From 64295db47162c014eadd26ae3568387075cba1be Mon Sep 17 00:00:00 2001 From: "zhenshan.cao" Date: Thu, 15 Oct 2020 21:31:50 +0800 Subject: [PATCH] Refact master and proxy and add etcdutil Signed-off-by: zhenshan.cao --- .github/workflows-bk/main.yaml | 58 + .gitignore | 4 +- Makefile | 4 +- ci/jenkins/Jenkinsfile | 196 + ci/jenkins/pod/docker-pod.yaml | 35 + ...cpu-version-ubuntu18.04-build-env-pod.yaml | 35 + ci/jenkins/pod/testEnvironment.yaml | 33 + ci/scripts/before-install.sh | 15 + ci/scripts/check_cache.sh | 114 + ci/scripts/core_build.sh | 169 + ci/scripts/install_deps.sh | 6 + ci/scripts/proto_gen_go.sh | 4 + proxy/build.sh => ci/scripts/proxy_build.sh | 33 +- ci/scripts/run_unittest.sh | 44 + sdk/build.sh => ci/scripts/sdk_build.sh | 7 +- ci/scripts/update_cache.sh | 104 + cmd/{ => master}/master.go | 14 +- proxy-go/main.go => cmd/proxy/proxy.go | 2 +- cmd/reader.go | 0 cmd/reader/reader.go | 28 + .../benchmark => cmd/storage}/benchmark.go | 30 +- cmd/storage/tikv_benchmark.go | 208 - cmd/storage/tikv_example.go | 69 - cmd/writer.go | 0 writer/main.go => cmd/writer/writer.go | 52 +- {conf => configs}/config.yaml | 7 +- core/src/dog_segment/EasyAssert.h | 19 - docker-compose.yml | 60 + docker/build_env/cpu/ubuntu18.04/Dockerfile | 57 + docker/build_env/entrypoint.sh | 24 + docker/deploy/cpu/centos7/Dockerfile | 33 + docker/deploy/cpu/ubuntu18.04/Dockerfile | 35 + docker/deploy/docker-compose.yaml | 17 + docker/docker-compose-monitor.yml | 21 + docker/test_env/Dockerfile | 30 + docker/test_env/docker-entrypoint.sh | 9 + go.sum | 5 + {conf => internal/conf}/conf.go | 34 +- {conf => internal/conf}/conf_test.go | 0 {core => internal/core}/CMakeLists.txt | 0 .../core/build.sh | 0 .../core}/cmake/BuildUtils.cmake | 0 .../core}/cmake/DefineOptions.cmake | 0 .../core}/cmake/FindClangTools.cmake | 0 {core => internal/core}/cmake/FindGTest.cmake | 0 .../core}/cmake/ThirdPartyPackages.cmake | 0 {core => internal/core}/cmake/Utils.cmake | 0 .../core}/include/collection_c.h | 0 {core => internal/core}/include/partition_c.h | 0 {core => internal/core}/include/segment_c.h | 0 .../core/release-build.sh | 4 +- {core => internal/core}/src/CMakeLists.txt | 0 .../core}/src/cache/CMakeLists.txt | 0 {core => internal/core}/src/cache/Cache.h | 0 {core => internal/core}/src/cache/Cache.inl | 0 {core => internal/core}/src/cache/CacheMgr.h | 0 .../core}/src/cache/CacheMgr.inl | 0 .../core}/src/cache/CpuCacheMgr.cpp | 0 .../core}/src/cache/CpuCacheMgr.h | 0 {core => internal/core}/src/cache/DataObj.h | 0 .../core}/src/cache/GpuCacheMgr.cpp | 0 .../core}/src/cache/GpuCacheMgr.h | 0 {core => internal/core}/src/cache/LRU.h | 0 .../core}/src/config/CMakeLists.txt | 0 .../core}/src/config/ConfigMgr.cpp | 0 .../core}/src/config/ConfigMgr.h | 0 .../core}/src/config/ConfigType.cpp | 0 .../core}/src/config/ConfigType.h | 0 .../core}/src/config/ConfigTypeTest1.cpp | 0 .../core}/src/config/ConfigTypeTest2.cpp | 0 .../core}/src/config/ServerConfig.cpp | 0 .../core}/src/config/ServerConfig.h | 0 .../core}/src/config/ServerConfigTest.cpp | 0 .../core}/src/dog_segment/AckResponder.h | 0 .../core}/src/dog_segment/CMakeLists.txt | 5 +- .../core}/src/dog_segment/Collection.cpp | 0 .../core}/src/dog_segment/Collection.h | 0 .../src/dog_segment/ConcurrentVector.cpp | 0 .../core}/src/dog_segment/ConcurrentVector.h | 0 .../core}/src/dog_segment/DeletedRecord.h | 0 internal/core/src/dog_segment/EasyAssert.cpp | 26 + internal/core/src/dog_segment/EasyAssert.h | 14 + .../core}/src/dog_segment/IndexMeta.cpp | 0 .../core}/src/dog_segment/IndexMeta.h | 0 .../core}/src/dog_segment/Partition.cpp | 0 .../core}/src/dog_segment/Partition.h | 0 .../core}/src/dog_segment/SegmentBase.h | 0 .../core}/src/dog_segment/SegmentDefs.h | 4 +- .../core}/src/dog_segment/SegmentNaive.cpp | 3 - .../core}/src/dog_segment/SegmentNaive.h | 0 .../core}/src/dog_segment/SmartBruteForce.h | 0 .../core}/src/dog_segment/collection_c.cpp | 0 .../core}/src/dog_segment/collection_c.h | 0 .../core}/src/dog_segment/partition_c.cpp | 0 .../core}/src/dog_segment/partition_c.h | 0 .../core}/src/dog_segment/segment_c.cpp | 0 .../core}/src/dog_segment/segment_c.h | 0 {core => internal/core}/src/index/.gitignore | 0 .../core}/src/index/CMakeLists.txt | 0 .../src/index/archive/KnowhereResource.cpp | 0 .../src/index/archive/KnowhereResource.h | 0 {core => internal/core}/src/index/build.sh | 0 .../src/index/cmake/BuildUtilsCore.cmake | 0 .../src/index/cmake/DefineOptionsCore.cmake | 0 .../core}/src/index/cmake/FindArrow.cmake | 0 .../core}/src/index/cmake/FindOpenBLAS.cmake | 0 .../index/cmake/ThirdPartyPackagesCore.cmake | 0 .../core}/src/index/knowhere/CMakeLists.txt | 0 .../knowhere/knowhere/common/BinarySet.h | 0 .../index/knowhere/knowhere/common/Config.h | 0 .../index/knowhere/knowhere/common/Dataset.h | 0 .../knowhere/knowhere/common/Exception.cpp | 0 .../knowhere/knowhere/common/Exception.h | 0 .../index/knowhere/knowhere/common/Log.cpp | 0 .../src/index/knowhere/knowhere/common/Log.h | 0 .../index/knowhere/knowhere/common/Timer.cpp | 0 .../index/knowhere/knowhere/common/Timer.h | 0 .../index/knowhere/knowhere/common/Typedef.h | 0 .../src/index/knowhere/knowhere/index/Index.h | 0 .../knowhere/knowhere/index/IndexType.cpp | 0 .../index/knowhere/knowhere/index/IndexType.h | 0 .../index/preprocessor/Preprocessor.h | 0 .../index/structured_index/StructuredIndex.h | 0 .../StructuredIndexFlat-inl.h | 0 .../structured_index/StructuredIndexFlat.h | 0 .../StructuredIndexSort-inl.h | 0 .../structured_index/StructuredIndexSort.h | 0 .../index/vector_index/ConfAdapter.cpp | 0 .../knowhere/index/vector_index/ConfAdapter.h | 0 .../index/vector_index/ConfAdapterMgr.cpp | 0 .../index/vector_index/ConfAdapterMgr.h | 0 .../vector_index/FaissBaseBinaryIndex.cpp | 0 .../index/vector_index/FaissBaseBinaryIndex.h | 0 .../index/vector_index/FaissBaseIndex.cpp | 0 .../index/vector_index/FaissBaseIndex.h | 0 .../index/vector_index/IndexAnnoy.cpp | 0 .../knowhere/index/vector_index/IndexAnnoy.h | 0 .../index/vector_index/IndexBinaryIDMAP.cpp | 0 .../index/vector_index/IndexBinaryIDMAP.h | 0 .../index/vector_index/IndexBinaryIVF.cpp | 0 .../index/vector_index/IndexBinaryIVF.h | 0 .../knowhere/index/vector_index/IndexHNSW.cpp | 0 .../knowhere/index/vector_index/IndexHNSW.h | 0 .../index/vector_index/IndexIDMAP.cpp | 0 .../knowhere/index/vector_index/IndexIDMAP.h | 0 .../knowhere/index/vector_index/IndexIVF.cpp | 0 .../knowhere/index/vector_index/IndexIVF.h | 0 .../index/vector_index/IndexIVFPQ.cpp | 0 .../knowhere/index/vector_index/IndexIVFPQ.h | 0 .../index/vector_index/IndexIVFSQ.cpp | 0 .../knowhere/index/vector_index/IndexIVFSQ.h | 0 .../knowhere/index/vector_index/IndexNSG.cpp | 0 .../knowhere/index/vector_index/IndexNSG.h | 0 .../index/vector_index/IndexRHNSW.cpp | 0 .../knowhere/index/vector_index/IndexRHNSW.h | 0 .../index/vector_index/IndexRHNSWFlat.cpp | 0 .../index/vector_index/IndexRHNSWFlat.h | 0 .../index/vector_index/IndexRHNSWPQ.cpp | 0 .../index/vector_index/IndexRHNSWPQ.h | 0 .../index/vector_index/IndexRHNSWSQ.cpp | 0 .../index/vector_index/IndexRHNSWSQ.h | 0 .../index/vector_index/IndexSPTAG.cpp | 0 .../knowhere/index/vector_index/IndexSPTAG.h | 0 .../knowhere/index/vector_index/VecIndex.h | 0 .../index/vector_index/VecIndexFactory.cpp | 0 .../index/vector_index/VecIndexFactory.h | 0 .../vector_index/adapter/SptagAdapter.cpp | 0 .../index/vector_index/adapter/SptagAdapter.h | 0 .../vector_index/adapter/VectorAdapter.cpp | 0 .../vector_index/adapter/VectorAdapter.h | 0 .../index/vector_index/gpu/GPUIndex.h | 0 .../index/vector_index/gpu/IndexGPUIDMAP.cpp | 0 .../index/vector_index/gpu/IndexGPUIDMAP.h | 0 .../index/vector_index/gpu/IndexGPUIVF.cpp | 0 .../index/vector_index/gpu/IndexGPUIVF.h | 0 .../index/vector_index/gpu/IndexGPUIVFPQ.cpp | 0 .../index/vector_index/gpu/IndexGPUIVFPQ.h | 0 .../index/vector_index/gpu/IndexGPUIVFSQ.cpp | 0 .../index/vector_index/gpu/IndexGPUIVFSQ.h | 0 .../vector_index/gpu/IndexIVFSQHybrid.cpp | 0 .../index/vector_index/gpu/IndexIVFSQHybrid.h | 0 .../index/vector_index/gpu/Quantizer.h | 0 .../vector_index/helpers/BuilderSuspend.h | 0 .../index/vector_index/helpers/Cloner.cpp | 0 .../index/vector_index/helpers/Cloner.h | 0 .../helpers/FaissGpuResourceMgr.cpp | 0 .../helpers/FaissGpuResourceMgr.h | 0 .../index/vector_index/helpers/FaissIO.cpp | 0 .../index/vector_index/helpers/FaissIO.h | 0 .../vector_index/helpers/IndexParameter.cpp | 0 .../vector_index/helpers/IndexParameter.h | 0 .../helpers/SPTAGParameterMgr.cpp | 0 .../vector_index/helpers/SPTAGParameterMgr.h | 0 .../index/vector_index/impl/nsg/Distance.cpp | 0 .../index/vector_index/impl/nsg/Distance.h | 0 .../index/vector_index/impl/nsg/NSG.cpp | 0 .../index/vector_index/impl/nsg/NSG.h | 0 .../index/vector_index/impl/nsg/NSGHelper.cpp | 0 .../index/vector_index/impl/nsg/NSGHelper.h | 0 .../index/vector_index/impl/nsg/NSGIO.cpp | 0 .../index/vector_index/impl/nsg/NSGIO.h | 0 .../index/vector_index/impl/nsg/Neighbor.h | 0 .../index/vector_offset_index/IndexIVF_NM.cpp | 0 .../index/vector_offset_index/IndexIVF_NM.h | 0 .../index/vector_offset_index/IndexNSG_NM.cpp | 0 .../index/vector_offset_index/IndexNSG_NM.h | 0 .../vector_offset_index/OffsetBaseIndex.cpp | 0 .../vector_offset_index/OffsetBaseIndex.h | 0 .../gpu/IndexGPUIVF_NM.cpp | 0 .../vector_offset_index/gpu/IndexGPUIVF_NM.h | 0 .../.github/ISSUE_TEMPLATE/bug_report.md | 0 .../.github/ISSUE_TEMPLATE/feature_request.md | 0 .../src/index/thirdparty/SPTAG/.gitignore | 0 .../thirdparty/SPTAG/AnnService.users.props | 0 .../SPTAG/AnnService/Aggregator.vcxproj | 0 .../AnnService/Aggregator.vcxproj.filters | 0 .../SPTAG/AnnService/CMakeLists.txt | 0 .../SPTAG/AnnService/Client.vcxproj | 0 .../SPTAG/AnnService/Client.vcxproj.filters | 0 .../SPTAG/AnnService/CoreLibrary.vcxproj | 0 .../AnnService/CoreLibrary.vcxproj.filters | 0 .../SPTAG/AnnService/IndexBuilder.vcxproj | 0 .../AnnService/IndexBuilder.vcxproj.filters | 0 .../SPTAG/AnnService/IndexSearcher.vcxproj | 0 .../AnnService/IndexSearcher.vcxproj.filters | 0 .../SPTAG/AnnService/Server.vcxproj | 0 .../SPTAG/AnnService/Server.vcxproj.filters | 0 .../SPTAG/AnnService/SocketLib.vcxproj | 0 .../AnnService/SocketLib.vcxproj.filters | 0 .../inc/Aggregator/AggregatorContext.h | 0 .../Aggregator/AggregatorExecutionContext.h | 0 .../inc/Aggregator/AggregatorService.h | 0 .../inc/Aggregator/AggregatorSettings.h | 0 .../AnnService/inc/Client/ClientWrapper.h | 0 .../SPTAG/AnnService/inc/Client/Options.h | 0 .../SPTAG/AnnService/inc/Core/BKT/Index.h | 0 .../inc/Core/BKT/ParameterDefinitionList.h | 0 .../SPTAG/AnnService/inc/Core/Common.h | 0 .../SPTAG/AnnService/inc/Core/Common/BKTree.h | 0 .../AnnService/inc/Core/Common/CommonUtils.h | 0 .../AnnService/inc/Core/Common/DataUtils.h | 0 .../AnnService/inc/Core/Common/Dataset.h | 0 .../inc/Core/Common/DistanceUtils.h | 0 .../inc/Core/Common/FineGrainedLock.h | 0 .../SPTAG/AnnService/inc/Core/Common/Heap.h | 0 .../SPTAG/AnnService/inc/Core/Common/KDTree.h | 0 .../inc/Core/Common/NeighborhoodGraph.h | 0 .../inc/Core/Common/QueryResultSet.h | 0 .../Core/Common/RelativeNeighborhoodGraph.h | 0 .../AnnService/inc/Core/Common/WorkSpace.h | 0 .../inc/Core/Common/WorkSpacePool.h | 0 .../AnnService/inc/Core/CommonDataStructure.h | 0 .../AnnService/inc/Core/DefinitionList.h | 0 .../SPTAG/AnnService/inc/Core/KDT/Index.h | 0 .../inc/Core/KDT/ParameterDefinitionList.h | 0 .../SPTAG/AnnService/inc/Core/MetadataSet.h | 0 .../SPTAG/AnnService/inc/Core/SearchQuery.h | 0 .../SPTAG/AnnService/inc/Core/SearchResult.h | 0 .../SPTAG/AnnService/inc/Core/VectorIndex.h | 0 .../SPTAG/AnnService/inc/Core/VectorSet.h | 0 .../AnnService/inc/Helper/ArgumentsParser.h | 0 .../AnnService/inc/Helper/Base64Encode.h | 0 .../AnnService/inc/Helper/BufferStream.h | 0 .../AnnService/inc/Helper/CommonHelper.h | 0 .../SPTAG/AnnService/inc/Helper/Concurrent.h | 0 .../AnnService/inc/Helper/ConcurrentSet.h | 0 .../AnnService/inc/Helper/SimpleIniReader.h | 0 .../AnnService/inc/Helper/StringConvert.h | 0 .../AnnService/inc/Helper/VectorSetReader.h | 0 .../Helper/VectorSetReaders/DefaultReader.h | 0 .../AnnService/inc/IndexBuilder/Options.h | 0 .../AnnService/inc/IndexBuilder/ThreadPool.h | 0 .../SPTAG/AnnService/inc/Server/QueryParser.h | 0 .../inc/Server/SearchExecutionContext.h | 0 .../AnnService/inc/Server/SearchExecutor.h | 0 .../AnnService/inc/Server/SearchService.h | 0 .../AnnService/inc/Server/ServiceContext.h | 0 .../AnnService/inc/Server/ServiceSettings.h | 0 .../SPTAG/AnnService/inc/Socket/Client.h | 0 .../SPTAG/AnnService/inc/Socket/Common.h | 0 .../SPTAG/AnnService/inc/Socket/Connection.h | 0 .../AnnService/inc/Socket/ConnectionManager.h | 0 .../SPTAG/AnnService/inc/Socket/Packet.h | 0 .../AnnService/inc/Socket/RemoteSearchQuery.h | 0 .../AnnService/inc/Socket/ResourceManager.h | 0 .../SPTAG/AnnService/inc/Socket/Server.h | 0 .../inc/Socket/SimpleSerialization.h | 0 .../SPTAG/AnnService/packages.config | 0 .../src/Aggregator/AggregatorContext.cpp | 0 .../Aggregator/AggregatorExecutionContext.cpp | 0 .../src/Aggregator/AggregatorService.cpp | 0 .../src/Aggregator/AggregatorSettings.cpp | 0 .../SPTAG/AnnService/src/Aggregator/main.cpp | 0 .../AnnService/src/Client/ClientWrapper.cpp | 0 .../SPTAG/AnnService/src/Client/Options.cpp | 0 .../SPTAG/AnnService/src/Client/main.cpp | 0 .../AnnService/src/Core/BKT/BKTIndex.cpp | 0 .../src/Core/Common/NeighborhoodGraph.cpp | 0 .../src/Core/Common/WorkSpacePool.cpp | 0 .../AnnService/src/Core/KDT/KDTIndex.cpp | 0 .../SPTAG/AnnService/src/Core/MetadataSet.cpp | 0 .../SPTAG/AnnService/src/Core/VectorIndex.cpp | 0 .../SPTAG/AnnService/src/Core/VectorSet.cpp | 0 .../AnnService/src/Helper/ArgumentsParser.cpp | 0 .../AnnService/src/Helper/Base64Encode.cpp | 0 .../AnnService/src/Helper/CommonHelper.cpp | 0 .../AnnService/src/Helper/Concurrent.cpp | 0 .../AnnService/src/Helper/SimpleIniReader.cpp | 0 .../AnnService/src/Helper/VectorSetReader.cpp | 0 .../Helper/VectorSetReaders/DefaultReader.cpp | 0 .../AnnService/src/IndexBuilder/Options.cpp | 0 .../src/IndexBuilder/ThreadPool.cpp | 0 .../AnnService/src/IndexBuilder/main.cpp | 0 .../AnnService/src/IndexSearcher/main.cpp | 0 .../AnnService/src/Server/QueryParser.cpp | 0 .../src/Server/SearchExecutionContext.cpp | 0 .../AnnService/src/Server/SearchExecutor.cpp | 0 .../AnnService/src/Server/SearchService.cpp | 0 .../AnnService/src/Server/ServiceContext.cpp | 0 .../AnnService/src/Server/ServiceSettings.cpp | 0 .../SPTAG/AnnService/src/Server/main.cpp | 0 .../SPTAG/AnnService/src/Socket/Client.cpp | 0 .../SPTAG/AnnService/src/Socket/Common.cpp | 0 .../AnnService/src/Socket/Connection.cpp | 0 .../src/Socket/ConnectionManager.cpp | 0 .../SPTAG/AnnService/src/Socket/Packet.cpp | 0 .../src/Socket/RemoteSearchQuery.cpp | 0 .../SPTAG/AnnService/src/Socket/Server.cpp | 0 .../src/index/thirdparty/SPTAG/CMakeLists.txt | 0 .../src/index/thirdparty/SPTAG/Dockerfile | 0 .../core}/src/index/thirdparty/SPTAG/LICENSE | 0 .../src/index/thirdparty/SPTAG/README.md | 0 .../src/index/thirdparty/SPTAG/SPTAG.sdf | Bin .../src/index/thirdparty/SPTAG/SPTAG.sln | 0 .../thirdparty/SPTAG/Test/CMakeLists.txt | 0 .../index/thirdparty/SPTAG/Test/Test.vcxproj | 0 .../SPTAG/Test/Test.vcxproj.filters | 0 .../thirdparty/SPTAG/Test/Test.vcxproj.user | 0 .../index/thirdparty/SPTAG/Test/inc/Test.h | 0 .../thirdparty/SPTAG/Test/packages.config | 0 .../thirdparty/SPTAG/Test/src/AlgoTest.cpp | 0 .../SPTAG/Test/src/Base64HelperTest.cpp | 0 .../SPTAG/Test/src/CommonHelperTest.cpp | 0 .../SPTAG/Test/src/DistanceTest.cpp | 0 .../SPTAG/Test/src/IniReaderTest.cpp | 0 .../SPTAG/Test/src/StringConvertTest.cpp | 0 .../index/thirdparty/SPTAG/Test/src/main.cpp | 0 .../thirdparty/SPTAG/Wrappers/CLRCore.vcxproj | 0 .../SPTAG/Wrappers/CLRCore.vcxproj.filters | 0 .../thirdparty/SPTAG/Wrappers/CMakeLists.txt | 0 .../SPTAG/Wrappers/CsharpClient.vcxproj | 0 .../Wrappers/CsharpClient.vcxproj.filters | 0 .../SPTAG/Wrappers/CsharpCore.vcxproj | 0 .../SPTAG/Wrappers/CsharpCore.vcxproj.filters | 0 .../SPTAG/Wrappers/JavaClient.vcxproj | 0 .../SPTAG/Wrappers/JavaClient.vcxproj.filters | 0 .../SPTAG/Wrappers/JavaCore.vcxproj | 0 .../SPTAG/Wrappers/JavaCore.vcxproj.filters | 0 .../SPTAG/Wrappers/PythonClient.vcxproj | 0 .../Wrappers/PythonClient.vcxproj.filters | 0 .../SPTAG/Wrappers/PythonCore.vcxproj | 0 .../SPTAG/Wrappers/PythonCore.vcxproj.filters | 0 .../SPTAG/Wrappers/PythonCore.vcxproj.user | 0 .../SPTAG/Wrappers/inc/CLRCoreInterface.h | 0 .../SPTAG/Wrappers/inc/ClientInterface.h | 0 .../SPTAG/Wrappers/inc/CoreInterface.h | 0 .../SPTAG/Wrappers/inc/CsharpClient.i | 0 .../SPTAG/Wrappers/inc/CsharpCommon.i | 0 .../SPTAG/Wrappers/inc/CsharpCore.i | 0 .../SPTAG/Wrappers/inc/JavaClient.i | 0 .../SPTAG/Wrappers/inc/JavaCommon.i | 0 .../thirdparty/SPTAG/Wrappers/inc/JavaCore.i | 0 .../SPTAG/Wrappers/inc/ManagedObject.h | 0 .../SPTAG/Wrappers/inc/PythonClient.i | 0 .../SPTAG/Wrappers/inc/PythonCommon.i | 0 .../SPTAG/Wrappers/inc/PythonCore.i | 0 .../SPTAG/Wrappers/inc/TransferDataType.h | 0 .../thirdparty/SPTAG/Wrappers/packages.config | 0 .../SPTAG/Wrappers/src/AssemblyInfo.cpp | 0 .../SPTAG/Wrappers/src/CLRCoreInterface.cpp | 0 .../SPTAG/Wrappers/src/ClientInterface.cpp | 0 .../SPTAG/Wrappers/src/CoreInterface.cpp | 0 .../thirdparty/SPTAG/azure-pipelines.yml | 0 .../thirdparty/SPTAG/docs/GettingStart.md | 0 .../index/thirdparty/SPTAG/docs/Parameters.md | 0 .../index/thirdparty/SPTAG/docs/img/sptag.png | Bin .../core}/src/index/thirdparty/annoy/LICENSE | 0 .../src/index/thirdparty/annoy/RELEASE.md | 0 .../thirdparty/annoy/examples/mmap_test.py | 0 .../annoy/examples/precision_test.cpp | 0 .../annoy/examples/precision_test.py | 0 .../annoy/examples/s_compile_cpp.sh | 0 .../thirdparty/annoy/examples/simple_test.py | 0 .../thirdparty/annoy/src/annoygomodule.h | 0 .../thirdparty/annoy/src/annoygomodule.i | 0 .../src/index/thirdparty/annoy/src/annoylib.h | 0 .../thirdparty/annoy/src/annoyluamodule.cc | 0 .../index/thirdparty/annoy/src/annoymodule.cc | 0 .../index/thirdparty/annoy/src/kissrandom.h | 0 .../src/index/thirdparty/annoy/src/mman.h | 0 .../core}/src/index/thirdparty/build.sh | 0 .../src/index/thirdparty/faiss/.dockerignore | 0 .../src/index/thirdparty/faiss/.gitignore | 0 .../src/index/thirdparty/faiss/AutoTune.cpp | 0 .../src/index/thirdparty/faiss/AutoTune.h | 0 .../index/thirdparty/faiss/BuilderSuspend.cpp | 0 .../index/thirdparty/faiss/BuilderSuspend.h | 0 .../index/thirdparty/faiss/CODE_OF_CONDUCT.md | 0 .../index/thirdparty/faiss/CONTRIBUTING.md | 0 .../src/index/thirdparty/faiss/Clustering.cpp | 0 .../src/index/thirdparty/faiss/Clustering.h | 0 .../src/index/thirdparty/faiss/DirectMap.cpp | 0 .../src/index/thirdparty/faiss/DirectMap.h | 0 .../src/index/thirdparty/faiss/Dockerfile | 0 .../src/index/thirdparty/faiss/FaissHook.cpp | 0 .../src/index/thirdparty/faiss/FaissHook.h | 0 .../src/index/thirdparty/faiss/INSTALL.md | 0 .../src/index/thirdparty/faiss/IVFlib.cpp | 0 .../core}/src/index/thirdparty/faiss/IVFlib.h | 0 .../src/index/thirdparty/faiss/Index.cpp | 0 .../core}/src/index/thirdparty/faiss/Index.h | 0 .../index/thirdparty/faiss/Index2Layer.cpp | 0 .../src/index/thirdparty/faiss/Index2Layer.h | 0 .../index/thirdparty/faiss/IndexBinary.cpp | 0 .../src/index/thirdparty/faiss/IndexBinary.h | 0 .../thirdparty/faiss/IndexBinaryFlat.cpp | 0 .../index/thirdparty/faiss/IndexBinaryFlat.h | 0 .../thirdparty/faiss/IndexBinaryFromFloat.cpp | 0 .../thirdparty/faiss/IndexBinaryFromFloat.h | 0 .../thirdparty/faiss/IndexBinaryHNSW.cpp | 0 .../index/thirdparty/faiss/IndexBinaryHNSW.h | 0 .../thirdparty/faiss/IndexBinaryHash.cpp | 0 .../index/thirdparty/faiss/IndexBinaryHash.h | 0 .../index/thirdparty/faiss/IndexBinaryIVF.cpp | 0 .../index/thirdparty/faiss/IndexBinaryIVF.h | 0 .../src/index/thirdparty/faiss/IndexFlat.cpp | 0 .../src/index/thirdparty/faiss/IndexFlat.h | 0 .../src/index/thirdparty/faiss/IndexHNSW.cpp | 0 .../src/index/thirdparty/faiss/IndexHNSW.h | 0 .../src/index/thirdparty/faiss/IndexIVF.cpp | 0 .../src/index/thirdparty/faiss/IndexIVF.h | 0 .../index/thirdparty/faiss/IndexIVFFlat.cpp | 0 .../src/index/thirdparty/faiss/IndexIVFFlat.h | 0 .../src/index/thirdparty/faiss/IndexIVFPQ.cpp | 0 .../src/index/thirdparty/faiss/IndexIVFPQ.h | 0 .../index/thirdparty/faiss/IndexIVFPQR.cpp | 0 .../src/index/thirdparty/faiss/IndexIVFPQR.h | 0 .../thirdparty/faiss/IndexIVFSpectralHash.cpp | 0 .../thirdparty/faiss/IndexIVFSpectralHash.h | 0 .../src/index/thirdparty/faiss/IndexLSH.cpp | 0 .../src/index/thirdparty/faiss/IndexLSH.h | 0 .../index/thirdparty/faiss/IndexLattice.cpp | 0 .../src/index/thirdparty/faiss/IndexLattice.h | 0 .../src/index/thirdparty/faiss/IndexPQ.cpp | 0 .../src/index/thirdparty/faiss/IndexPQ.h | 0 .../thirdparty/faiss/IndexPreTransform.cpp | 0 .../thirdparty/faiss/IndexPreTransform.h | 0 .../src/index/thirdparty/faiss/IndexRHNSW.cpp | 0 .../src/index/thirdparty/faiss/IndexRHNSW.h | 0 .../index/thirdparty/faiss/IndexReplicas.cpp | 0 .../index/thirdparty/faiss/IndexReplicas.h | 0 .../index/thirdparty/faiss/IndexSQHybrid.cpp | 0 .../index/thirdparty/faiss/IndexSQHybrid.h | 0 .../thirdparty/faiss/IndexScalarQuantizer.cpp | 0 .../thirdparty/faiss/IndexScalarQuantizer.h | 0 .../index/thirdparty/faiss/IndexShards.cpp | 0 .../src/index/thirdparty/faiss/IndexShards.h | 0 .../index/thirdparty/faiss/InvertedLists.cpp | 0 .../index/thirdparty/faiss/InvertedLists.h | 0 .../core}/src/index/thirdparty/faiss/LICENSE | 0 .../core}/src/index/thirdparty/faiss/Makefile | 0 .../index/thirdparty/faiss/MatrixStats.cpp | 0 .../src/index/thirdparty/faiss/MatrixStats.h | 0 .../index/thirdparty/faiss/MetaIndexes.cpp | 0 .../src/index/thirdparty/faiss/MetaIndexes.h | 0 .../src/index/thirdparty/faiss/MetricType.h | 0 .../thirdparty/faiss/OnDiskInvertedLists.cpp | 0 .../thirdparty/faiss/OnDiskInvertedLists.h | 0 .../src/index/thirdparty/faiss/README.md | 0 .../thirdparty/faiss/VectorTransform.cpp | 0 .../index/thirdparty/faiss/VectorTransform.h | 0 .../thirdparty/faiss/acinclude/ax_blas.m4 | 0 .../faiss/acinclude/ax_check_cpu.m4 | 0 .../faiss/acinclude/ax_cxx_compile_stdcxx.m4 | 0 .../thirdparty/faiss/acinclude/ax_lapack.m4 | 0 .../faiss/acinclude/fa_check_cuda.m4 | 0 .../thirdparty/faiss/acinclude/fa_numpy.m4 | 0 .../thirdparty/faiss/acinclude/fa_prog_nm.m4 | 0 .../faiss/acinclude/fa_prog_swig.m4 | 0 .../thirdparty/faiss/acinclude/fa_python.m4 | 0 .../index/thirdparty/faiss/benchs/README.md | 0 .../faiss/benchs/bench_all_ivf/README.md | 0 .../benchs/bench_all_ivf/bench_all_ivf.py | 0 .../benchs/bench_all_ivf/bench_kmeans.py | 0 .../faiss/benchs/bench_all_ivf/datasets.py | 0 .../bench_all_ivf/parse_bench_all_ivf.py | 0 .../bench_all_ivf/run_on_cluster_generic.bash | 0 .../faiss/benchs/bench_for_interrupt.py | 0 .../thirdparty/faiss/benchs/bench_gpu_1bn.py | 0 .../faiss/benchs/bench_gpu_sift1m.py | 0 .../thirdparty/faiss/benchs/bench_hnsw.py | 0 .../thirdparty/faiss/benchs/bench_index_pq.py | 0 .../faiss/benchs/bench_pairwise_distances.py | 0 .../faiss/benchs/bench_polysemous_1bn.py | 0 .../faiss/benchs/bench_polysemous_sift1m.py | 0 .../faiss/benchs/bench_scalar_quantizer.py | 0 .../faiss/benchs/bench_vector_ops.py | 0 .../index/thirdparty/faiss/benchs/datasets.py | 0 .../faiss/benchs/distributed_ondisk/README.md | 0 .../distributed_ondisk/combined_index.py | 0 .../distributed_ondisk/distributed_kmeans.py | 0 .../distributed_query_demo.py | 0 .../distributed_ondisk/make_index_vslice.py | 0 .../distributed_ondisk/make_trained_index.py | 0 .../distributed_ondisk/merge_to_ondisk.py | 0 .../faiss/benchs/distributed_ondisk/rpc.py | 0 .../distributed_ondisk/run_on_cluster.bash | 0 .../distributed_ondisk/search_server.py | 0 .../thirdparty/faiss/benchs/kmeans_mnist.py | 0 .../faiss/benchs/link_and_code/README.md | 0 .../link_and_code/bench_link_and_code.py | 0 .../faiss/benchs/link_and_code/datasets.py | 0 .../benchs/link_and_code/neighbor_codec.py | 0 .../thirdparty/faiss/build-aux/config.guess | 0 .../thirdparty/faiss/build-aux/config.sub | 0 .../thirdparty/faiss/build-aux/install-sh | 0 .../core}/src/index/thirdparty/faiss/build.sh | 0 .../thirdparty/faiss/c_api/AutoTune_c.cpp | 0 .../index/thirdparty/faiss/c_api/AutoTune_c.h | 0 .../thirdparty/faiss/c_api/Clustering_c.cpp | 0 .../thirdparty/faiss/c_api/Clustering_c.h | 0 .../index/thirdparty/faiss/c_api/INSTALL.md | 0 .../thirdparty/faiss/c_api/IndexFlat_c.cpp | 0 .../thirdparty/faiss/c_api/IndexFlat_c.h | 0 .../thirdparty/faiss/c_api/IndexIVFFlat_c.cpp | 0 .../thirdparty/faiss/c_api/IndexIVFFlat_c.h | 0 .../thirdparty/faiss/c_api/IndexIVF_c.cpp | 0 .../index/thirdparty/faiss/c_api/IndexIVF_c.h | 0 .../thirdparty/faiss/c_api/IndexLSH_c.cpp | 0 .../index/thirdparty/faiss/c_api/IndexLSH_c.h | 0 .../faiss/c_api/IndexPreTransform_c.cpp | 0 .../faiss/c_api/IndexPreTransform_c.h | 0 .../thirdparty/faiss/c_api/IndexShards_c.cpp | 0 .../thirdparty/faiss/c_api/IndexShards_c.h | 0 .../index/thirdparty/faiss/c_api/Index_c.cpp | 0 .../index/thirdparty/faiss/c_api/Index_c.h | 0 .../src/index/thirdparty/faiss/c_api/Makefile | 0 .../thirdparty/faiss/c_api/MetaIndexes_c.cpp | 0 .../thirdparty/faiss/c_api/MetaIndexes_c.h | 0 .../thirdparty/faiss/c_api/clone_index_c.cpp | 0 .../thirdparty/faiss/c_api/clone_index_c.h | 0 .../index/thirdparty/faiss/c_api/error_c.h | 0 .../thirdparty/faiss/c_api/error_impl.cpp | 0 .../index/thirdparty/faiss/c_api/error_impl.h | 0 .../index/thirdparty/faiss/c_api/example_c.c | 0 .../index/thirdparty/faiss/c_api/faiss_c.h | 0 .../faiss/c_api/gpu/GpuAutoTune_c.cpp | 0 .../faiss/c_api/gpu/GpuAutoTune_c.h | 0 .../faiss/c_api/gpu/GpuClonerOptions_c.cpp | 0 .../faiss/c_api/gpu/GpuClonerOptions_c.h | 0 .../thirdparty/faiss/c_api/gpu/GpuIndex_c.cpp | 0 .../thirdparty/faiss/c_api/gpu/GpuIndex_c.h | 0 .../faiss/c_api/gpu/GpuIndicesOptions_c.h | 0 .../faiss/c_api/gpu/GpuResources_c.cpp | 0 .../faiss/c_api/gpu/GpuResources_c.h | 0 .../index/thirdparty/faiss/c_api/gpu/Makefile | 0 .../c_api/gpu/StandardGpuResources_c.cpp | 0 .../faiss/c_api/gpu/StandardGpuResources_c.h | 0 .../faiss/c_api/gpu/example_gpu_c.c | 0 .../thirdparty/faiss/c_api/gpu/macros_impl.h | 0 .../faiss/c_api/impl/AuxIndexStructures_c.cpp | 0 .../faiss/c_api/impl/AuxIndexStructures_c.h | 0 .../faiss/c_api/index_factory_c.cpp | 0 .../thirdparty/faiss/c_api/index_factory_c.h | 0 .../thirdparty/faiss/c_api/index_io_c.cpp | 0 .../index/thirdparty/faiss/c_api/index_io_c.h | 0 .../thirdparty/faiss/c_api/macros_impl.h | 0 .../index/thirdparty/faiss/clone_index.cpp | 0 .../src/index/thirdparty/faiss/clone_index.h | 0 .../index/thirdparty/faiss/conda/Dockerfile | 0 .../faiss/conda/conda_build_config.yaml | 0 .../thirdparty/faiss/conda/faiss-gpu/build.sh | 0 .../conda/faiss-gpu/conda_build_config.yaml | 0 .../faiss/conda/faiss-gpu/meta.yaml | 0 .../faiss/conda/faiss-gpu/run_test.py | 0 .../thirdparty/faiss/conda/faiss/build.sh | 0 .../thirdparty/faiss/conda/faiss/meta.yaml | 0 .../thirdparty/faiss/conda/faiss/run_test.py | 0 .../src/index/thirdparty/faiss/configure | 0 .../src/index/thirdparty/faiss/configure.ac | 0 .../src/index/thirdparty/faiss/demos/Makefile | 0 .../index/thirdparty/faiss/demos/README.md | 0 .../thirdparty/faiss/demos/demo_auto_tune.py | 0 .../thirdparty/faiss/demos/demo_imi_flat.cpp | 0 .../thirdparty/faiss/demos/demo_imi_pq.cpp | 0 .../faiss/demos/demo_ivfpq_indexing.cpp | 0 .../thirdparty/faiss/demos/demo_ondisk_ivf.py | 0 .../thirdparty/faiss/demos/demo_sift1M.cpp | 0 .../faiss/demos/demo_weighted_kmeans.cpp | 0 .../example_makefiles/makefile.inc.Linux | 0 .../example_makefiles/makefile.inc.Mac.brew | 0 .../example_makefiles/makefile.inc.Mac.port | 0 .../core}/src/index/thirdparty/faiss/faiss | 0 .../thirdparty/faiss/gpu/GpuAutoTune.cpp | 0 .../index/thirdparty/faiss/gpu/GpuAutoTune.h | 0 .../index/thirdparty/faiss/gpu/GpuCloner.cpp | 0 .../index/thirdparty/faiss/gpu/GpuCloner.h | 0 .../thirdparty/faiss/gpu/GpuClonerOptions.cpp | 0 .../thirdparty/faiss/gpu/GpuClonerOptions.h | 0 .../index/thirdparty/faiss/gpu/GpuDistance.cu | 0 .../index/thirdparty/faiss/gpu/GpuDistance.h | 0 .../thirdparty/faiss/gpu/GpuFaissAssert.h | 0 .../index/thirdparty/faiss/gpu/GpuIndex.cu | 0 .../src/index/thirdparty/faiss/gpu/GpuIndex.h | 0 .../faiss/gpu/GpuIndexBinaryFlat.cu | 0 .../thirdparty/faiss/gpu/GpuIndexBinaryFlat.h | 0 .../thirdparty/faiss/gpu/GpuIndexFlat.cu | 0 .../index/thirdparty/faiss/gpu/GpuIndexFlat.h | 0 .../index/thirdparty/faiss/gpu/GpuIndexIVF.cu | 0 .../index/thirdparty/faiss/gpu/GpuIndexIVF.h | 0 .../thirdparty/faiss/gpu/GpuIndexIVFFlat.cu | 0 .../thirdparty/faiss/gpu/GpuIndexIVFFlat.h | 0 .../thirdparty/faiss/gpu/GpuIndexIVFPQ.cu | 0 .../thirdparty/faiss/gpu/GpuIndexIVFPQ.h | 0 .../faiss/gpu/GpuIndexIVFSQHybrid.cu | 0 .../faiss/gpu/GpuIndexIVFSQHybrid.h | 0 .../faiss/gpu/GpuIndexIVFScalarQuantizer.cu | 0 .../faiss/gpu/GpuIndexIVFScalarQuantizer.h | 0 .../thirdparty/faiss/gpu/GpuIndicesOptions.h | 0 .../thirdparty/faiss/gpu/GpuResources.cpp | 0 .../index/thirdparty/faiss/gpu/GpuResources.h | 0 .../faiss/gpu/StandardGpuResources.cpp | 0 .../faiss/gpu/StandardGpuResources.h | 0 .../faiss/gpu/impl/BinaryDistance.cu | 0 .../faiss/gpu/impl/BinaryDistance.cuh | 0 .../faiss/gpu/impl/BinaryFlatIndex.cu | 0 .../faiss/gpu/impl/BinaryFlatIndex.cuh | 0 .../thirdparty/faiss/gpu/impl/BroadcastSum.cu | 0 .../faiss/gpu/impl/BroadcastSum.cuh | 0 .../thirdparty/faiss/gpu/impl/Distance.cu | 0 .../thirdparty/faiss/gpu/impl/Distance.cuh | 0 .../faiss/gpu/impl/DistanceUtils.cuh | 0 .../thirdparty/faiss/gpu/impl/FlatIndex.cu | 0 .../thirdparty/faiss/gpu/impl/FlatIndex.cuh | 0 .../faiss/gpu/impl/GeneralDistance.cuh | 0 .../faiss/gpu/impl/GpuScalarQuantizer.cuh | 0 .../thirdparty/faiss/gpu/impl/IVFAppend.cu | 0 .../thirdparty/faiss/gpu/impl/IVFAppend.cuh | 0 .../thirdparty/faiss/gpu/impl/IVFBase.cu | 0 .../thirdparty/faiss/gpu/impl/IVFBase.cuh | 0 .../thirdparty/faiss/gpu/impl/IVFFlat.cu | 0 .../thirdparty/faiss/gpu/impl/IVFFlat.cuh | 0 .../thirdparty/faiss/gpu/impl/IVFFlatScan.cu | 0 .../thirdparty/faiss/gpu/impl/IVFFlatScan.cuh | 0 .../index/thirdparty/faiss/gpu/impl/IVFPQ.cu | 0 .../index/thirdparty/faiss/gpu/impl/IVFPQ.cuh | 0 .../thirdparty/faiss/gpu/impl/IVFUtils.cu | 0 .../thirdparty/faiss/gpu/impl/IVFUtils.cuh | 0 .../faiss/gpu/impl/IVFUtilsSelect1.cu | 0 .../faiss/gpu/impl/IVFUtilsSelect2.cu | 0 .../index/thirdparty/faiss/gpu/impl/L2Norm.cu | 0 .../thirdparty/faiss/gpu/impl/L2Norm.cuh | 0 .../thirdparty/faiss/gpu/impl/L2Select.cu | 0 .../thirdparty/faiss/gpu/impl/L2Select.cuh | 0 .../thirdparty/faiss/gpu/impl/Metrics.cuh | 0 .../faiss/gpu/impl/PQCodeDistances-inl.cuh | 0 .../faiss/gpu/impl/PQCodeDistances.cu | 0 .../faiss/gpu/impl/PQCodeDistances.cuh | 0 .../thirdparty/faiss/gpu/impl/PQCodeLoad.cuh | 0 .../impl/PQScanMultiPassNoPrecomputed-inl.cuh | 0 .../gpu/impl/PQScanMultiPassNoPrecomputed.cu | 0 .../gpu/impl/PQScanMultiPassNoPrecomputed.cuh | 0 .../gpu/impl/PQScanMultiPassPrecomputed.cu | 0 .../gpu/impl/PQScanMultiPassPrecomputed.cuh | 0 .../faiss/gpu/impl/RemapIndices.cpp | 0 .../thirdparty/faiss/gpu/impl/RemapIndices.h | 0 .../faiss/gpu/impl/VectorResidual.cu | 0 .../faiss/gpu/impl/VectorResidual.cuh | 0 .../faiss/gpu/perf/IndexWrapper-inl.h | 0 .../thirdparty/faiss/gpu/perf/IndexWrapper.h | 0 .../faiss/gpu/perf/PerfBinaryFlat.cu | 0 .../faiss/gpu/perf/PerfClustering.cpp | 0 .../thirdparty/faiss/gpu/perf/PerfFlat.cu | 0 .../thirdparty/faiss/gpu/perf/PerfIVFFlat.cu | 0 .../thirdparty/faiss/gpu/perf/PerfIVFPQ.cu | 0 .../faiss/gpu/perf/PerfIVFPQAdd.cpp | 0 .../thirdparty/faiss/gpu/perf/PerfSelect.cu | 0 .../thirdparty/faiss/gpu/perf/WriteIndex.cpp | 0 .../index/thirdparty/faiss/gpu/perf/slow.py | 0 .../index/thirdparty/faiss/gpu/test/Makefile | 0 .../faiss/gpu/test/TestGpuDistance.cu | 0 .../faiss/gpu/test/TestGpuIndexBinaryFlat.cpp | 0 .../faiss/gpu/test/TestGpuIndexFlat.cpp | 0 .../faiss/gpu/test/TestGpuIndexIVFFlat.cpp | 0 .../faiss/gpu/test/TestGpuIndexIVFPQ.cpp | 0 .../faiss/gpu/test/TestGpuMemoryException.cpp | 0 .../faiss/gpu/test/TestGpuSelect.cu | 0 .../thirdparty/faiss/gpu/test/TestUtils.cpp | 0 .../thirdparty/faiss/gpu/test/TestUtils.h | 0 .../gpu/test/demo_ivfpq_indexing_gpu.cpp | 0 .../faiss/gpu/test/test_gpu_index.py | 0 .../faiss/gpu/test/test_gpu_index_ivfsq.py | 0 .../faiss/gpu/test/test_pytorch_faiss.py | 0 .../faiss/gpu/utils/BlockSelectFloat.cu | 0 .../faiss/gpu/utils/BlockSelectHalf.cu | 0 .../faiss/gpu/utils/BlockSelectImpl.cuh | 0 .../faiss/gpu/utils/BlockSelectKernel.cuh | 0 .../faiss/gpu/utils/Comparators.cuh | 0 .../faiss/gpu/utils/ConversionOperators.cuh | 0 .../thirdparty/faiss/gpu/utils/CopyUtils.cuh | 0 .../thirdparty/faiss/gpu/utils/DeviceDefs.cuh | 0 .../faiss/gpu/utils/DeviceMemory.cpp | 0 .../thirdparty/faiss/gpu/utils/DeviceMemory.h | 0 .../faiss/gpu/utils/DeviceTensor-inl.cuh | 0 .../faiss/gpu/utils/DeviceTensor.cuh | 0 .../thirdparty/faiss/gpu/utils/DeviceUtils.cu | 0 .../thirdparty/faiss/gpu/utils/DeviceUtils.h | 0 .../faiss/gpu/utils/DeviceVector.cuh | 0 .../thirdparty/faiss/gpu/utils/Float16.cu | 0 .../thirdparty/faiss/gpu/utils/Float16.cuh | 0 .../faiss/gpu/utils/HostTensor-inl.cuh | 0 .../thirdparty/faiss/gpu/utils/HostTensor.cuh | 0 .../thirdparty/faiss/gpu/utils/Limits.cuh | 0 .../faiss/gpu/utils/LoadStoreOperators.cuh | 0 .../faiss/gpu/utils/MathOperators.cuh | 0 .../faiss/gpu/utils/MatrixMult-inl.cuh | 0 .../thirdparty/faiss/gpu/utils/MatrixMult.cu | 0 .../thirdparty/faiss/gpu/utils/MatrixMult.cuh | 0 .../faiss/gpu/utils/MemorySpace.cpp | 0 .../thirdparty/faiss/gpu/utils/MemorySpace.h | 0 .../faiss/gpu/utils/MergeNetworkBlock.cuh | 0 .../faiss/gpu/utils/MergeNetworkUtils.cuh | 0 .../faiss/gpu/utils/MergeNetworkWarp.cuh | 0 .../faiss/gpu/utils/NoTypeTensor.cuh | 0 .../index/thirdparty/faiss/gpu/utils/Pair.cuh | 0 .../thirdparty/faiss/gpu/utils/PtxUtils.cuh | 0 .../faiss/gpu/utils/ReductionOperators.cuh | 0 .../thirdparty/faiss/gpu/utils/Reductions.cuh | 0 .../thirdparty/faiss/gpu/utils/Select.cuh | 0 .../faiss/gpu/utils/StackDeviceMemory.cpp | 0 .../faiss/gpu/utils/StackDeviceMemory.h | 0 .../thirdparty/faiss/gpu/utils/StaticUtils.h | 0 .../thirdparty/faiss/gpu/utils/Tensor-inl.cuh | 0 .../thirdparty/faiss/gpu/utils/Tensor.cuh | 0 .../faiss/gpu/utils/ThrustAllocator.cuh | 0 .../thirdparty/faiss/gpu/utils/Timer.cpp | 0 .../index/thirdparty/faiss/gpu/utils/Timer.h | 0 .../thirdparty/faiss/gpu/utils/Transpose.cuh | 0 .../faiss/gpu/utils/WarpSelectFloat.cu | 0 .../faiss/gpu/utils/WarpSelectHalf.cu | 0 .../faiss/gpu/utils/WarpSelectKernel.cuh | 0 .../faiss/gpu/utils/WarpShuffles.cuh | 0 .../utils/blockselect/BlockSelectFloat1.cu | 0 .../utils/blockselect/BlockSelectFloat128.cu | 0 .../utils/blockselect/BlockSelectFloat256.cu | 0 .../utils/blockselect/BlockSelectFloat32.cu | 0 .../utils/blockselect/BlockSelectFloat64.cu | 0 .../blockselect/BlockSelectFloatF1024.cu | 0 .../blockselect/BlockSelectFloatF2048.cu | 0 .../utils/blockselect/BlockSelectFloatF512.cu | 0 .../blockselect/BlockSelectFloatT1024.cu | 0 .../blockselect/BlockSelectFloatT2048.cu | 0 .../utils/blockselect/BlockSelectFloatT512.cu | 0 .../gpu/utils/blockselect/BlockSelectHalf1.cu | 0 .../utils/blockselect/BlockSelectHalf128.cu | 0 .../utils/blockselect/BlockSelectHalf256.cu | 0 .../utils/blockselect/BlockSelectHalf32.cu | 0 .../utils/blockselect/BlockSelectHalf64.cu | 0 .../utils/blockselect/BlockSelectHalfF1024.cu | 0 .../utils/blockselect/BlockSelectHalfF2048.cu | 0 .../utils/blockselect/BlockSelectHalfF512.cu | 0 .../utils/blockselect/BlockSelectHalfT1024.cu | 0 .../utils/blockselect/BlockSelectHalfT2048.cu | 0 .../utils/blockselect/BlockSelectHalfT512.cu | 0 .../gpu/utils/blockselect/BlockSelectImpl.cuh | 0 .../gpu/utils/warpselect/WarpSelectFloat1.cu | 0 .../utils/warpselect/WarpSelectFloat128.cu | 0 .../utils/warpselect/WarpSelectFloat256.cu | 0 .../gpu/utils/warpselect/WarpSelectFloat32.cu | 0 .../gpu/utils/warpselect/WarpSelectFloat64.cu | 0 .../utils/warpselect/WarpSelectFloatF1024.cu | 0 .../utils/warpselect/WarpSelectFloatF2048.cu | 0 .../utils/warpselect/WarpSelectFloatF512.cu | 0 .../utils/warpselect/WarpSelectFloatT1024.cu | 0 .../utils/warpselect/WarpSelectFloatT2048.cu | 0 .../utils/warpselect/WarpSelectFloatT512.cu | 0 .../gpu/utils/warpselect/WarpSelectHalf1.cu | 0 .../gpu/utils/warpselect/WarpSelectHalf128.cu | 0 .../gpu/utils/warpselect/WarpSelectHalf256.cu | 0 .../gpu/utils/warpselect/WarpSelectHalf32.cu | 0 .../gpu/utils/warpselect/WarpSelectHalf64.cu | 0 .../utils/warpselect/WarpSelectHalfF1024.cu | 0 .../utils/warpselect/WarpSelectHalfF2048.cu | 0 .../utils/warpselect/WarpSelectHalfF512.cu | 0 .../utils/warpselect/WarpSelectHalfT1024.cu | 0 .../utils/warpselect/WarpSelectHalfT2048.cu | 0 .../utils/warpselect/WarpSelectHalfT512.cu | 0 .../gpu/utils/warpselect/WarpSelectImpl.cuh | 0 .../faiss/impl/AuxIndexStructures.cpp | 0 .../faiss/impl/AuxIndexStructures.h | 0 .../index/thirdparty/faiss/impl/FaissAssert.h | 0 .../thirdparty/faiss/impl/FaissException.cpp | 0 .../thirdparty/faiss/impl/FaissException.h | 0 .../src/index/thirdparty/faiss/impl/HNSW.cpp | 0 .../src/index/thirdparty/faiss/impl/HNSW.h | 0 .../faiss/impl/PolysemousTraining.cpp | 0 .../faiss/impl/PolysemousTraining.h | 0 .../faiss/impl/ProductQuantizer-inl.h | 0 .../faiss/impl/ProductQuantizer.cpp | 0 .../thirdparty/faiss/impl/ProductQuantizer.h | 0 .../src/index/thirdparty/faiss/impl/RHNSW.cpp | 0 .../src/index/thirdparty/faiss/impl/RHNSW.h | 0 .../thirdparty/faiss/impl/ScalarQuantizer.cpp | 0 .../thirdparty/faiss/impl/ScalarQuantizer.h | 0 .../faiss/impl/ScalarQuantizerCodec.h | 0 .../faiss/impl/ScalarQuantizerCodec_avx.h | 0 .../faiss/impl/ScalarQuantizerCodec_avx512.h | 0 .../faiss/impl/ScalarQuantizerDC.cpp | 0 .../thirdparty/faiss/impl/ScalarQuantizerDC.h | 0 .../faiss/impl/ScalarQuantizerDC_avx.cpp | 0 .../faiss/impl/ScalarQuantizerDC_avx.h | 0 .../faiss/impl/ScalarQuantizerDC_avx512.cpp | 0 .../faiss/impl/ScalarQuantizerDC_avx512.h | 0 .../faiss/impl/ScalarQuantizerOp.cpp | 0 .../thirdparty/faiss/impl/ScalarQuantizerOp.h | 0 .../thirdparty/faiss/impl/ThreadedIndex-inl.h | 0 .../thirdparty/faiss/impl/ThreadedIndex.h | 0 .../thirdparty/faiss/impl/index_read.cpp | 0 .../thirdparty/faiss/impl/index_write.cpp | 0 .../src/index/thirdparty/faiss/impl/io.cpp | 0 .../src/index/thirdparty/faiss/impl/io.h | 0 .../thirdparty/faiss/impl/lattice_Zn.cpp | 0 .../index/thirdparty/faiss/impl/lattice_Zn.h | 0 .../index/thirdparty/faiss/index_factory.cpp | 0 .../index/thirdparty/faiss/index_factory.h | 0 .../src/index/thirdparty/faiss/index_io.h | 0 .../index/thirdparty/faiss/makefile.inc.in | 0 .../index/thirdparty/faiss/misc/test_blas.cpp | 0 .../index/thirdparty/faiss/python/Makefile | 0 .../index/thirdparty/faiss/python/faiss.py | 0 .../index/thirdparty/faiss/python/setup.py | 0 .../thirdparty/faiss/python/swigfaiss.swig | 0 .../src/index/thirdparty/faiss/tests/Makefile | 0 .../index/thirdparty/faiss/tests/common.py | 0 .../faiss/tests/test_binary_factory.py | 0 .../faiss/tests/test_binary_flat.cpp | 0 .../faiss/tests/test_binary_hashindex.py | 0 .../thirdparty/faiss/tests/test_binary_io.py | 0 .../faiss/tests/test_build_blocks.py | 0 .../faiss/tests/test_dealloc_invlists.cpp | 0 .../faiss/tests/test_extra_distances.py | 0 .../thirdparty/faiss/tests/test_factory.py | 0 .../thirdparty/faiss/tests/test_index.py | 0 .../faiss/tests/test_index_accuracy.py | 0 .../faiss/tests/test_index_binary.py | 0 .../tests/test_index_binary_from_float.py | 0 .../faiss/tests/test_index_composite.py | 0 .../index/thirdparty/faiss/tests/test_io.py | 0 .../thirdparty/faiss/tests/test_ivflib.py | 0 .../faiss/tests/test_ivfpq_codec.cpp | 0 .../faiss/tests/test_ivfpq_indexing.cpp | 0 .../faiss/tests/test_lowlevel_ivf.cpp | 0 .../thirdparty/faiss/tests/test_merge.cpp | 0 .../thirdparty/faiss/tests/test_meta_index.py | 0 .../faiss/tests/test_omp_threads.cpp | 0 .../faiss/tests/test_omp_threads_py.py | 0 .../faiss/tests/test_ondisk_ivf.cpp | 0 .../faiss/tests/test_oom_exception.py | 0 .../faiss/tests/test_pairs_decoding.cpp | 0 .../faiss/tests/test_params_override.cpp | 0 .../faiss/tests/test_pq_encoding.cpp | 0 .../faiss/tests/test_referenced_objects.py | 0 .../faiss/tests/test_sliding_ivf.cpp | 0 .../faiss/tests/test_standalone_codec.py | 0 .../faiss/tests/test_threaded_index.cpp | 0 .../faiss/tests/test_transfer_invlists.cpp | 0 .../thirdparty/faiss/tutorial/cpp/1-Flat.cpp | 0 .../faiss/tutorial/cpp/2-IVFFlat.cpp | 0 .../thirdparty/faiss/tutorial/cpp/3-IVFPQ.cpp | 0 .../thirdparty/faiss/tutorial/cpp/4-GPU.cpp | 0 .../thirdparty/faiss/tutorial/cpp/5-GPU.cpp | 0 .../faiss/tutorial/cpp/5-Multiple-GPUs.cpp | 0 .../thirdparty/faiss/tutorial/cpp/6-GPU.cpp | 0 .../thirdparty/faiss/tutorial/cpp/6-RUN.cpp | 0 .../thirdparty/faiss/tutorial/cpp/7-GPU.cpp | 0 .../thirdparty/faiss/tutorial/cpp/8-GPU.cpp | 0 .../faiss/tutorial/cpp/9-BinaryFlat.cpp | 0 .../thirdparty/faiss/tutorial/cpp/Makefile | 0 .../faiss/tutorial/cpp/faiss_test.cpp | 0 .../faiss/tutorial/python/1-Flat.py | 0 .../faiss/tutorial/python/2-IVFFlat.py | 0 .../faiss/tutorial/python/3-IVFPQ.py | 0 .../thirdparty/faiss/tutorial/python/4-GPU.py | 0 .../faiss/tutorial/python/5-Multiple-GPUs.py | 0 .../thirdparty/faiss/utils/BinaryDistance.cpp | 0 .../thirdparty/faiss/utils/BinaryDistance.h | 0 .../faiss/utils/ConcurrentBitset.cpp | 0 .../thirdparty/faiss/utils/ConcurrentBitset.h | 0 .../src/index/thirdparty/faiss/utils/Heap.cpp | 0 .../src/index/thirdparty/faiss/utils/Heap.h | 0 .../thirdparty/faiss/utils/WorkerThread.cpp | 0 .../thirdparty/faiss/utils/WorkerThread.h | 0 .../thirdparty/faiss/utils/distances.cpp | 0 .../index/thirdparty/faiss/utils/distances.h | 0 .../thirdparty/faiss/utils/distances_avx.h | 0 .../thirdparty/faiss/utils/distances_avx512.h | 0 .../thirdparty/faiss/utils/distances_simd.cpp | 0 .../faiss/utils/distances_simd_avx.cpp | 0 .../faiss/utils/distances_simd_avx512.cpp | 0 .../faiss/utils/extra_distances.cpp | 0 .../thirdparty/faiss/utils/extra_distances.h | 0 .../thirdparty/faiss/utils/hamming-inl.h | 0 .../index/thirdparty/faiss/utils/hamming.cpp | 0 .../index/thirdparty/faiss/utils/hamming.h | 0 .../thirdparty/faiss/utils/instruction_set.h | 0 .../thirdparty/faiss/utils/jaccard-inl.h | 0 .../index/thirdparty/faiss/utils/random.cpp | 0 .../src/index/thirdparty/faiss/utils/random.h | 0 .../thirdparty/faiss/utils/substructure-inl.h | 0 .../faiss/utils/superstructure-inl.h | 0 .../index/thirdparty/faiss/utils/utils.cpp | 0 .../src/index/thirdparty/faiss/utils/utils.h | 0 .../src/index/thirdparty/hnswlib/bruteforce.h | 0 .../src/index/thirdparty/hnswlib/hnswalg.h | 0 .../src/index/thirdparty/hnswlib/hnswalg_nm.h | 0 .../src/index/thirdparty/hnswlib/hnswlib.h | 0 .../src/index/thirdparty/hnswlib/hnswlib_nm.h | 0 .../src/index/thirdparty/hnswlib/space_ip.h | 0 .../src/index/thirdparty/hnswlib/space_l2.h | 0 .../thirdparty/hnswlib/visited_list_pool.h | 0 .../core}/src/index/thirdparty/versions.txt | 0 .../core}/src/index/unittest/CMakeLists.txt | 0 .../core}/src/index/unittest/Helper.h | 0 .../core}/src/index/unittest/SPTAG.cpp | 0 .../unittest/faiss_benchmark/CMakeLists.txt | 0 .../index/unittest/faiss_benchmark/README.md | 0 .../faiss_benchmark/faiss_benchmark_test.cpp | 0 .../faiss_benchmark/faiss_bitset_test.cpp | 0 .../core}/src/index/unittest/kdtree.cpp | 0 .../metric_alg_benchmark/CMakeLists.txt | 0 .../metric_benchmark_test.cpp | 0 .../core}/src/index/unittest/sift.50NN.graph | Bin .../src/index/unittest/siftsmall_base.fvecs | Bin .../core}/src/index/unittest/test_annoy.cpp | 0 .../src/index/unittest/test_binaryidmap.cpp | 0 .../src/index/unittest/test_binaryivf.cpp | 0 .../core}/src/index/unittest/test_common.cpp | 0 .../index/unittest/test_customized_index.cpp | 0 .../src/index/unittest/test_gpuresource.cpp | 0 .../core}/src/index/unittest/test_hnsw.cpp | 0 .../core}/src/index/unittest/test_idmap.cpp | 0 .../index/unittest/test_instructionset.cpp | 0 .../core}/src/index/unittest/test_ivf.cpp | 0 .../src/index/unittest/test_ivf_cpu_nm.cpp | 0 .../src/index/unittest/test_ivf_gpu_nm.cpp | 0 .../src/index/unittest/test_knowhere.cpp | 0 .../core}/src/index/unittest/test_nsg.cpp | 0 .../src/index/unittest/test_rhnsw_flat.cpp | 0 .../src/index/unittest/test_rhnsw_pq.cpp | 0 .../src/index/unittest/test_rhnsw_sq8.cpp | 0 .../core}/src/index/unittest/test_sptag.cpp | 0 .../unittest/test_structured_index_sort.cpp | 0 .../src/index/unittest/test_vecindex.cpp | 0 .../core}/src/index/unittest/test_wrapper.cpp | 0 .../core}/src/index/unittest/utils.cpp | 0 .../core}/src/index/unittest/utils.h | 0 .../core}/src/log/CMakeLists.txt | 0 {core => internal/core}/src/log/Log.cpp | 0 {core => internal/core}/src/log/Log.h | 0 {core => internal/core}/src/log/LogMgr.cpp | 0 {core => internal/core}/src/log/LogMgr.h | 0 {core => internal/core}/src/main.cpp | 0 {core => internal/core}/src/pb/master.pb.cc | 0 {core => internal/core}/src/pb/master.pb.h | 0 {core => internal/core}/src/pb/message.pb.cc | 0 {core => internal/core}/src/pb/message.pb.h | 0 .../core}/src/query/BinaryQuery.cpp | 0 .../core}/src/query/BinaryQuery.h | 0 .../core}/src/query/BooleanQuery.h | 0 .../core}/src/query/CMakeLists.txt | 0 .../core}/src/query/GeneralQuery.h | 0 .../core}/src/utils/BlockingQueue.h | 0 .../core}/src/utils/CMakeLists.txt | 0 .../core}/src/utils/CommonUtil.cpp | 0 .../core}/src/utils/CommonUtil.h | 0 .../core}/src/utils/ConfigUtils.cpp | 0 .../core}/src/utils/ConfigUtils.h | 0 {core => internal/core}/src/utils/Error.h | 0 {core => internal/core}/src/utils/Exception.h | 0 {core => internal/core}/src/utils/Json.h | 0 {core => internal/core}/src/utils/Log.h | 0 .../core}/src/utils/SignalHandler.cpp | 0 .../core}/src/utils/SignalHandler.h | 0 {core => internal/core}/src/utils/Status.cpp | 0 {core => internal/core}/src/utils/Status.h | 0 .../core}/src/utils/StringHelpFunctions.cpp | 0 .../core}/src/utils/StringHelpFunctions.h | 0 .../core}/src/utils/ThreadPool.h | 0 .../core}/src/utils/TimeRecorder.cpp | 0 .../core}/src/utils/TimeRecorder.h | 0 {core => internal/core}/src/utils/Types.h | 0 .../core}/thirdparty/CMakeLists.txt | 0 .../thirdparty/easyloggingpp/easylogging++.cc | 0 .../thirdparty/easyloggingpp/easylogging++.h | 0 .../core}/thirdparty/gtest/CMakeLists.txt | 0 .../core}/thirdparty/nlohmann/json.hpp | 0 .../thirdparty/opentracing/CMakeLists.txt | 0 .../core}/thirdparty/protobuf/CMakeLists.txt | 0 .../core}/thirdparty/versions.txt | 0 .../core}/thirdparty/yaml-cpp/CMakeLists.txt | 0 {core => internal/core}/ubuntu_build_deps.sh | 0 .../core}/unittest/CMakeLists.txt | 3 +- .../core}/unittest/test_c_api.cpp | 0 .../core}/unittest/test_concurrent_vector.cpp | 0 .../core}/unittest/test_dog_segment.cpp | 42 + .../core}/unittest/test_indexing.cpp | 0 .../core}/unittest/test_naive.cpp | 0 {errors => internal/errors}/errors.go | 0 {errors => internal/errors}/group.go | 0 {errors => internal/errors}/stack.go | 0 {pkg => internal}/master/README.md | 0 .../master/collection}/collection.go | 10 +- internal/master/collection/collection_test.go | 39 + internal/master/controller/collection.go | 117 + internal/master/controller/segment.go | 114 + internal/master/controller/segment_test.go | 37 + internal/master/grpc/server.go | 69 + {pkg => internal}/master/id/id.go | 2 +- {pkg => internal}/master/informer/informer.go | 0 internal/master/informer/pulsar.go | 34 + {pkg => internal}/master/kv/etcd_kv.go | 17 +- {pkg => internal}/master/kv/kv.go | 0 .../master/segment}/segment.go | 46 +- internal/master/segment/stats.go | 69 + internal/master/server.go | 46 + internal/msgclient/msgclient.go | 562 + .../proto}/master/master.pb.go | 117 +- {proto => internal/proto/master}/master.proto | 7 +- .../proto}/message/message.pb.go | 533 +- .../proto}/message/message.proto | 4 +- .../proxy}/manipulation_req.go | 4 +- .../proxy}/proxy_node.go | 6 +- .../proxy}/proxy_node_test.go | 6 +- .../proxy}/query_req.go | 4 +- .../proxy}/readertimesync.go | 6 +- .../proxy}/readertimesync_test.go | 4 +- .../proxy}/request_scheduler.go | 2 +- .../proxy_node => internal/proxy}/server.go | 12 +- .../proxy}/server_test.go | 6 +- .../proxy}/timestamporacle.go | 4 +- .../proxy}/timestamporacle_test.go | 2 +- .../proxy_node => internal/proxy}/timetick.go | 4 +- .../proxy}/timetick_test.go | 4 +- .../proxy_node => internal/proxy}/util.go | 2 +- .../proxy}/util_test.go | 2 +- .../reader}/collection.go | 0 .../read_node => internal/reader}/index.go | 2 +- .../reader}/index_test.go | 7 +- {reader/read_node => internal/reader}/meta.go | 73 +- .../reader}/partition.go | 0 .../reader}/query_node.go | 269 +- .../reader}/query_node_time.go | 0 .../reader}/quety_node_test.go | 0 .../read_node => internal/reader}/reader.go | 13 +- internal/reader/reader_test.go | 25 + .../read_node => internal/reader}/result.go | 8 +- .../reader}/result_test.go | 63 +- .../read_node => internal/reader}/segment.go | 30 +- .../reader}/segment_service.go | 25 +- .../reader}/segment_service_test.go | 56 +- .../reader}/segment_test.go | 70 +- .../reader}/util_functions.go | 56 + .../reader}/util_functions_test.go | 37 +- .../storage}/internal/S3/S3_test.go | 2 +- .../storage}/internal/S3/s3_engine.go | 6 +- .../storage}/internal/S3/s3_store.go | 4 +- .../storage}/internal/minio/codec/codec.go | 0 .../storage}/internal/minio/minio_store.go | 6 +- .../internal/minio/minio_storeEngine.go | 5 +- .../storage}/internal/minio/minio_test.go | 2 +- .../storage}/internal/tikv/codec/codec.go | 0 .../storage}/internal/tikv/tikv_store.go | 7 +- .../storage}/internal/tikv/tikv_test.go | 17 +- {storage/pkg => internal/storage}/storage.go | 18 +- .../storage/type/storagetype.go | 2 +- .../timesync/timesync.go | 250 +- .../timesync/timesync_test.go | 48 +- {util => internal/util}/etcdutil/etcdutil.go | 2 +- .../util}/etcdutil/etcdutil_test.go | 0 internal/writer/writer.go | 226 + master/client/base_client.go | 201 - master/client/client.go | 403 - master/config/config.go | 533 - master/config/persist_options.go | 77 - master/config/util.go | 49 - master/election/leadership.go | 119 - master/election/lease.go | 149 - master/grpc/client/main.go | 42 - master/grpc/proto/hello.pb.go | 204 - master/grpc/proto/hello.proto | 17 - master/grpc/proto/master.pb.go | 281 - master/grpc/proto/master.proto | 31 - master/grpc/server/main.go | 87 - master/grpc_service.go | 193 - master/heartbeat_streams.go | 135 - master/id/id.go | 116 - master/kv/etcd_kv.go | 148 - master/kv/kv.go | 21 - master/kv/mem_kv.go | 81 - master/member/member.go | 102 - master/meta/storage.go | 112 - master/server.go | 456 - master/tso/global_allocator.go | 130 - master/tso/tso.go | 216 - master/util.go | 68 - pkg/master/common/config.go | 10 - pkg/master/grpc/master/master.proto | 50 - pkg/master/informer/pulsar.go | 66 - pkg/master/mock/collection_test.go | 30 - pkg/master/mock/grpc_client.go | 63 - pkg/master/mock/grpc_client_test.go | 15 - pkg/master/mock/mock.go | 5 - pkg/master/mock/pulsar.go | 50 - pkg/master/mock/segment_test.go | 49 - pkg/master/server.go | 343 - pkg/message/message.pb.go | 3292 --- pkg/metapb/metapb.pb.go | 182 - pkg/pdpb/pdpb.pb.go | 863 - proto/message.proto | 779 - proto/metapb.proto | 29 - proto/pdpb.proto | 82 - proxy/CMakeLists.txt | 203 - proxy/build-support/code_style_clion.xml | 38 - proxy/build-support/cpplint.py | 6476 ----- proxy/build-support/lint_exclusions.txt | 7 - proxy/build-support/lintutils.py | 110 - proxy/build-support/run_clang_format.py | 142 - proxy/build-support/run_clang_tidy.py | 125 - proxy/build-support/run_cpplint.py | 132 - proxy/cmake/BuildUtils.cmake | 231 - proxy/cmake/DefineOptions.cmake | 156 - proxy/cmake/FindClangTools.cmake | 111 - proxy/cmake/ThirdPartyPackages.cmake | 172 - proxy/cmake/Utils.cmake | 102 - proxy/generate_entity_ids/client/getIds.go | 45 - proxy/generate_entity_ids/collect_result.go | 45 - .../proto/generate_id.pb.go | 210 - .../proto/generate_id.proto | 24 - .../server/generate_entity_ids.go | 63 - proxy/src/CMakeLists.txt | 87 - proxy/src/config/CMakeLists.txt | 31 - proxy/src/config/ConfigMgr.cpp | 246 - proxy/src/config/ConfigMgr.h | 92 - proxy/src/config/ConfigType.cpp | 528 - proxy/src/config/ConfigType.h | 235 - proxy/src/config/ConfigTypeTest1.cpp | 493 - proxy/src/config/ConfigTypeTest2.cpp | 861 - proxy/src/config/ServerConfig.cpp | 62 - proxy/src/config/ServerConfig.h | 130 - proxy/src/config/ServerConfigTest.cpp | 19 - proxy/src/db/CMakeLists.txt | 21 - proxy/src/db/Constants.h | 33 - proxy/src/db/Types.cpp | 36 - proxy/src/db/Types.h | 200 - proxy/src/grpc/etcd.grpc.pb.cc | 131 - proxy/src/grpc/etcd.grpc.pb.h | 446 - proxy/src/grpc/etcd.pb.cc | 5058 ---- proxy/src/grpc/etcd.pb.h | 3370 --- proxy/src/grpc/master.grpc.pb.cc | 125 - proxy/src/grpc/master.grpc.pb.h | 413 - proxy/src/grpc/master.pb.cc | 1912 -- proxy/src/grpc/master.pb.h | 1250 - proxy/src/grpc/message.grpc.pb.cc | 1093 - proxy/src/grpc/message.grpc.pb.h | 4556 ---- proxy/src/grpc/message.pb.cc | 19734 --------------- proxy/src/grpc/message.pb.h | 13531 ---------- proxy/src/grpc/proto/etcd.proto | 248 - proxy/src/log/CMakeLists.txt | 21 - proxy/src/log/Log.cpp | 54 - proxy/src/log/Log.h | 135 - proxy/src/log/LogMgr.cpp | 245 - proxy/src/log/LogMgr.h | 29 - proxy/src/main.cpp | 161 - proxy/src/message_client/CMakeLists.txt | 18 - proxy/src/message_client/Client.cpp | 13 - proxy/src/message_client/Client.h | 26 - proxy/src/message_client/ClientV2.cpp | 326 - proxy/src/message_client/ClientV2.h | 58 - proxy/src/message_client/Consumer.cpp | 76 - proxy/src/message_client/Consumer.h | 46 - proxy/src/message_client/M3_hash.cpp | 94 - proxy/src/message_client/M3_hash.h | 15 - proxy/src/message_client/PartitionPolicy.cpp | 13 - proxy/src/message_client/PartitionPolicy.h | 16 - proxy/src/message_client/Producer.cpp | 80 - proxy/src/message_client/Producer.h | 41 - proxy/src/meta/CMakeLists.txt | 15 - proxy/src/meta/etcd_client/Etcd_client.cpp | 23 - proxy/src/meta/etcd_client/Etcd_client.h | 18 - proxy/src/meta/etcd_watcher/CMakeLists.txt | 14 - proxy/src/meta/etcd_watcher/Watcher.cpp | 93 - proxy/src/meta/etcd_watcher/Watcher.h | 40 - proxy/src/meta/etcd_watcher/test_watcher.cpp | 31 - proxy/src/meta/master/GrpcClient.cpp | 52 - proxy/src/meta/master/GrpcClient.h | 30 - proxy/src/query/BinaryQuery.cpp | 302 - proxy/src/query/BinaryQuery.h | 41 - proxy/src/query/BooleanQuery.h | 87 - proxy/src/query/CMakeLists.txt | 17 - proxy/src/query/GeneralQuery.h | 127 - proxy/src/server/CMakeLists.txt | 52 - proxy/src/server/MessageWrapper.cpp | 40 - proxy/src/server/MessageWrapper.h | 29 - proxy/src/server/MetaWrapper.cpp | 195 - proxy/src/server/MetaWrapper.h | 61 - proxy/src/server/Server.cpp | 310 - proxy/src/server/Server.h | 62 - proxy/src/server/ValidationUtil.cpp | 113 - proxy/src/server/ValidationUtil.h | 56 - proxy/src/server/context/ConnectionContext.h | 30 - proxy/src/server/context/Context.cpp | 108 - proxy/src/server/context/Context.h | 104 - proxy/src/server/delivery/ReqHandler.cpp | 217 - proxy/src/server/delivery/ReqHandler.h | 111 - proxy/src/server/delivery/ReqQueue.cpp | 71 - proxy/src/server/delivery/ReqQueue.h | 44 - proxy/src/server/delivery/ReqScheduler.cpp | 185 - proxy/src/server/delivery/ReqScheduler.h | 82 - proxy/src/server/delivery/request/BaseReq.cpp | 85 - proxy/src/server/delivery/request/BaseReq.h | 109 - proxy/src/server/delivery/request/CmdReq.cpp | 64 - proxy/src/server/delivery/request/CmdReq.h | 48 - .../server/delivery/request/CompactReq.cpp | 46 - .../src/server/delivery/request/CompactReq.h | 45 - .../delivery/request/CountEntitiesReq.cpp | 51 - .../delivery/request/CountEntitiesReq.h | 39 - .../delivery/request/CreateCollectionReq.cpp | 43 - .../delivery/request/CreateCollectionReq.h | 40 - .../delivery/request/CreateIndexReq.cpp | 62 - .../server/delivery/request/CreateIndexReq.h | 49 - .../delivery/request/CreatePartitionReq.cpp | 44 - .../delivery/request/CreatePartitionReq.h | 38 - .../delivery/request/DeleteEntityByIDReq.cpp | 62 - .../delivery/request/DeleteEntityByIDReq.h | 49 - .../delivery/request/DescribeIndexReq.cpp | 49 - .../delivery/request/DescribeIndexReq.h | 42 - .../delivery/request/DropCollectionReq.cpp | 36 - .../delivery/request/DropCollectionReq.h | 38 - .../server/delivery/request/DropIndexReq.cpp | 45 - .../server/delivery/request/DropIndexReq.h | 42 - .../delivery/request/DropPartitionReq.cpp | 40 - .../delivery/request/DropPartitionReq.h | 38 - .../src/server/delivery/request/FlushReq.cpp | 53 - proxy/src/server/delivery/request/FlushReq.h | 45 - .../delivery/request/GetCollectionInfoReq.cpp | 52 - .../delivery/request/GetCollectionInfoReq.h | 39 - .../request/GetCollectionStatsReq.cpp | 46 - .../delivery/request/GetCollectionStatsReq.h | 45 - .../delivery/request/GetEntityByIDReq.cpp | 60 - .../delivery/request/GetEntityByIDReq.h | 56 - .../delivery/request/HasCollectionReq.cpp | 37 - .../delivery/request/HasCollectionReq.h | 39 - .../delivery/request/HasPartitionReq.cpp | 44 - .../server/delivery/request/HasPartitionReq.h | 41 - .../src/server/delivery/request/InsertReq.cpp | 64 - proxy/src/server/delivery/request/InsertReq.h | 43 - .../delivery/request/ListCollectionsReq.cpp | 37 - .../delivery/request/ListCollectionsReq.h | 39 - .../delivery/request/ListIDInSegmentReq.cpp | 51 - .../delivery/request/ListIDInSegmentReq.h | 48 - .../delivery/request/ListPartitionsReq.cpp | 44 - .../delivery/request/ListPartitionsReq.h | 41 - .../delivery/request/LoadCollectionReq.cpp | 39 - .../delivery/request/LoadCollectionReq.h | 38 - .../src/server/delivery/request/SearchReq.cpp | 66 - proxy/src/server/delivery/request/SearchReq.h | 44 - proxy/src/server/delivery/request/Types.cpp | 73 - proxy/src/server/delivery/request/Types.h | 127 - .../server/delivery/strategy/ReqStrategy.h | 39 - .../delivery/strategy/SearchReqStrategy.cpp | 52 - .../delivery/strategy/SearchReqStrategy.h | 44 - .../server/grpc_impl/GrpcRequestHandler.cpp | 882 - .../src/server/grpc_impl/GrpcRequestHandler.h | 349 - proxy/src/server/grpc_impl/GrpcServer.cpp | 128 - proxy/src/server/grpc_impl/GrpcServer.h | 55 - .../GrpcInterceptorHookHandler.cpp | 31 - .../interceptor/GrpcInterceptorHookHandler.h | 34 - .../grpc_impl/interceptor/SpanInterceptor.cpp | 42 - .../grpc_impl/interceptor/SpanInterceptor.h | 53 - proxy/src/server/init/CpuChecker.cpp | 32 - proxy/src/server/init/CpuChecker.h | 26 - proxy/src/server/init/Directory.cpp | 74 - proxy/src/server/init/Directory.h | 42 - proxy/src/server/init/InstanceLockCheck.cpp | 66 - proxy/src/server/init/InstanceLockCheck.h | 27 - proxy/src/server/init/StorageChecker.cpp | 44 - proxy/src/server/init/StorageChecker.h | 26 - proxy/src/server/timesync/TimeSync.cpp | 69 - proxy/src/server/timesync/TimeSync.h | 45 - proxy/src/server/tso/TSO.cpp | 36 - proxy/src/server/tso/TSO.h | 29 - proxy/src/tracing/CMakeLists.txt | 25 - proxy/src/tracing/TextMapCarrier.cpp | 65 - proxy/src/tracing/TextMapCarrier.h | 43 - proxy/src/tracing/TraceContext.cpp | 40 - proxy/src/tracing/TraceContext.h | 41 - proxy/src/tracing/TracerUtil.cpp | 81 - proxy/src/tracing/TracerUtil.h | 39 - proxy/src/utils/BlockingQueue.h | 95 - proxy/src/utils/CMakeLists.txt | 20 - proxy/src/utils/CommonUtil.cpp | 216 - proxy/src/utils/CommonUtil.h | 57 - proxy/src/utils/ConfigUtils.cpp | 309 - proxy/src/utils/ConfigUtils.h | 63 - proxy/src/utils/Error.h | 141 - proxy/src/utils/Exception.h | 60 - proxy/src/utils/Json.h | 34 - proxy/src/utils/Log.h | 14 - proxy/src/utils/SignalHandler.cpp | 61 - proxy/src/utils/SignalHandler.h | 28 - proxy/src/utils/Status.cpp | 133 - proxy/src/utils/Status.h | 79 - proxy/src/utils/StringHelpFunctions.cpp | 160 - proxy/src/utils/StringHelpFunctions.h | 74 - proxy/src/utils/ThreadPool.h | 112 - proxy/src/utils/TimeRecorder.cpp | 99 - proxy/src/utils/TimeRecorder.h | 66 - proxy/src/version.h | 15 - proxy/src/version.h.in | 15 - proxy/thirdparty/CMakeLists.txt | 59 - proxy/thirdparty/avro/CMakeLists.txt | 56 - .../thirdparty/easyloggingpp/easylogging++.cc | 3299 --- .../thirdparty/easyloggingpp/easylogging++.h | 5193 ---- proxy/thirdparty/grpc/CMakeLists.txt | 76 - proxy/thirdparty/gtest/CMakeLists.txt | 65 - proxy/thirdparty/nlohmann/json.hpp | 21006 ---------------- proxy/thirdparty/opentracing/CMakeLists.txt | 68 - proxy/thirdparty/pulsar/CMakeLists | 314 - proxy/thirdparty/pulsar/CMakeLists.txt | 59 - proxy/thirdparty/versions.txt | 8 - proxy/thirdparty/yaml-cpp/CMakeLists.txt | 50 - proxy/unittest/CMakeLists.txt | 38 - proxy/unittest/config/CMakeLists.txt | 43 - proxy/unittest/config/ConfigTypeTest1.cpp | 493 - proxy/unittest/config/ConfigTypeTest2.cpp | 861 - proxy/unittest/config/ServerConfigTest.cpp | 19 - proxy/unittest/main.cpp | 25 - proxy/unittest/message_client/CMakeLists.txt | 40 - .../unittest/message_client/consumer_test.cpp | 15 - .../message_client/get_result_test.cpp | 93 - .../unittest/message_client/producer_test.cpp | 42 - proxy/unittest/message_client/test_pulsar.cpp | 36 - .../message_client/unittest_entry.cpp | 6 - reader/main.go | 16 - reader/message_client/message_client.go | 281 - reader/read_node/reader_test.go | 22 - sdk/CMakeLists.txt | 205 - sdk/build-support/code_style_clion.xml | 38 - sdk/build-support/cpplint.py | 6476 ----- sdk/build-support/ignore_checks.txt | 1 - sdk/build-support/lint_exclusions.txt | 5 - sdk/build-support/lintutils.py | 110 - sdk/build-support/run_clang_format.py | 142 - sdk/build-support/run_clang_tidy.py | 154 - sdk/build-support/run_cpplint.py | 132 - sdk/cmake/BuildUtils.cmake | 204 - sdk/cmake/DefineOptions.cmake | 133 - sdk/cmake/FindClangTools.cmake | 109 - sdk/cmake/FindGTest.cmake | 58 - sdk/cmake/ThirdPartyPackages.cmake | 322 - sdk/examples/CMakeLists.txt | 14 - sdk/examples/common/TestParameter.h | 45 - sdk/examples/simple/CMakeLists.txt | 23 - sdk/examples/simple/CountCollection.cpp | 29 - sdk/examples/simple/CreateCollection.cpp | 55 - sdk/examples/simple/CreateIndex.cpp | 26 - sdk/examples/simple/delete.cpp | 39 - sdk/examples/simple/insert.cpp | 82 - sdk/examples/simple/search.cpp | 74 - sdk/grpc-gen/message.grpc.pb.cc | 1093 - sdk/grpc-gen/message.grpc.pb.h | 4556 ---- sdk/grpc-gen/message.pb.cc | 19734 --------------- sdk/grpc-gen/message.pb.h | 13531 ---------- sdk/grpc/ClientProxy.cpp | 872 - sdk/grpc/ClientProxy.h | 116 - sdk/grpc/GrpcClient.cpp | 493 - sdk/grpc/GrpcClient.h | 118 - sdk/include/BooleanQuery.h | 68 - sdk/include/Field.h | 64 - sdk/include/GeneralQuery.h | 96 - sdk/include/MilvusApi.h | 517 - sdk/include/Status.h | 85 - sdk/interface/ConnectionImpl.cpp | 169 - sdk/interface/ConnectionImpl.h | 131 - sdk/interface/Status.cpp | 98 - sdk/thirdparty/nlohmann/json.hpp | 21006 ---------------- sdk/unittest/CMakeLists.txt | 13 - sdk/unittest/unittest_entry.cpp | 18 - sdk/utils/ThreadPool.h | 112 - sdk/utils/TimeRecorder.cpp | 29 - sdk/utils/TimeRecorder.h | 30 - sdk/utils/Utils.cpp | 608 - sdk/utils/Utils.h | 103 - storage/pkg/storage_test.go | 1 - {writer/test => test}/insert_test.go | 14 +- {writer/test => test}/key2seg_test.go | 7 +- util/grpcutil/grpcutil.go | 103 - util/logutil/log.go | 294 - util/logutil/log_test.go | 111 - util/tsoutil/tso.go | 41 - util/typeutil/comparison.go | 40 - util/typeutil/comparison_test.go | 47 - util/typeutil/convension.go | 36 - util/typeutil/duration.go | 63 - util/typeutil/duration_test.go | 49 - util/typeutil/size.go | 53 - util/typeutil/size_test.go | 45 - util/typeutil/string_slice.go | 43 - util/typeutil/string_slice_test.go | 48 - util/typeutil/time.go | 34 - util/typeutil/time_test.go | 49 - writer/message_client/message_client.go | 216 - writer/mock/mock.go | 68 - writer/write_node/writer_node.go | 135 - 1424 files changed, 3817 insertions(+), 191399 deletions(-) create mode 100644 .github/workflows-bk/main.yaml create mode 100644 ci/jenkins/Jenkinsfile create mode 100644 ci/jenkins/pod/docker-pod.yaml create mode 100644 ci/jenkins/pod/milvus-cpu-version-ubuntu18.04-build-env-pod.yaml create mode 100644 ci/jenkins/pod/testEnvironment.yaml create mode 100755 ci/scripts/before-install.sh create mode 100755 ci/scripts/check_cache.sh create mode 100755 ci/scripts/core_build.sh create mode 100755 ci/scripts/install_deps.sh create mode 100755 ci/scripts/proto_gen_go.sh rename proxy/build.sh => ci/scripts/proxy_build.sh (69%) create mode 100755 ci/scripts/run_unittest.sh rename sdk/build.sh => ci/scripts/sdk_build.sh (90%) create mode 100755 ci/scripts/update_cache.sh rename cmd/{ => master}/master.go (57%) rename proxy-go/main.go => cmd/proxy/proxy.go (84%) delete mode 100644 cmd/reader.go create mode 100644 cmd/reader/reader.go rename {storage/benchmark => cmd/storage}/benchmark.go (92%) delete mode 100644 cmd/storage/tikv_benchmark.go delete mode 100644 cmd/storage/tikv_example.go delete mode 100644 cmd/writer.go rename writer/main.go => cmd/writer/writer.go (57%) rename {conf => configs}/config.yaml (89%) delete mode 100644 core/src/dog_segment/EasyAssert.h create mode 100644 docker-compose.yml create mode 100644 docker/build_env/cpu/ubuntu18.04/Dockerfile create mode 100755 docker/build_env/entrypoint.sh create mode 100644 docker/deploy/cpu/centos7/Dockerfile create mode 100644 docker/deploy/cpu/ubuntu18.04/Dockerfile create mode 100644 docker/deploy/docker-compose.yaml create mode 100644 docker/docker-compose-monitor.yml create mode 100644 docker/test_env/Dockerfile create mode 100755 docker/test_env/docker-entrypoint.sh rename {conf => internal/conf}/conf.go (82%) rename {conf => internal/conf}/conf_test.go (100%) rename {core => internal/core}/CMakeLists.txt (100%) rename core/release-build.sh => internal/core/build.sh (100%) rename {core => internal/core}/cmake/BuildUtils.cmake (100%) rename {core => internal/core}/cmake/DefineOptions.cmake (100%) rename {core => internal/core}/cmake/FindClangTools.cmake (100%) rename {core => internal/core}/cmake/FindGTest.cmake (100%) rename {core => internal/core}/cmake/ThirdPartyPackages.cmake (100%) rename {core => internal/core}/cmake/Utils.cmake (100%) rename {core => internal/core}/include/collection_c.h (100%) rename {core => internal/core}/include/partition_c.h (100%) rename {core => internal/core}/include/segment_c.h (100%) rename core/build.sh => internal/core/release-build.sh (98%) rename {core => internal/core}/src/CMakeLists.txt (100%) rename {core => internal/core}/src/cache/CMakeLists.txt (100%) rename {core => internal/core}/src/cache/Cache.h (100%) rename {core => internal/core}/src/cache/Cache.inl (100%) rename {core => internal/core}/src/cache/CacheMgr.h (100%) rename {core => internal/core}/src/cache/CacheMgr.inl (100%) rename {core => internal/core}/src/cache/CpuCacheMgr.cpp (100%) rename {core => internal/core}/src/cache/CpuCacheMgr.h (100%) rename {core => internal/core}/src/cache/DataObj.h (100%) rename {core => internal/core}/src/cache/GpuCacheMgr.cpp (100%) rename {core => internal/core}/src/cache/GpuCacheMgr.h (100%) rename {core => internal/core}/src/cache/LRU.h (100%) rename {core => internal/core}/src/config/CMakeLists.txt (100%) rename {core => internal/core}/src/config/ConfigMgr.cpp (100%) rename {core => internal/core}/src/config/ConfigMgr.h (100%) rename {core => internal/core}/src/config/ConfigType.cpp (100%) rename {core => internal/core}/src/config/ConfigType.h (100%) rename {core => internal/core}/src/config/ConfigTypeTest1.cpp (100%) rename {core => internal/core}/src/config/ConfigTypeTest2.cpp (100%) rename {core => internal/core}/src/config/ServerConfig.cpp (100%) rename {core => internal/core}/src/config/ServerConfig.h (100%) rename {core => internal/core}/src/config/ServerConfigTest.cpp (100%) rename {core => internal/core}/src/dog_segment/AckResponder.h (100%) rename {core => internal/core}/src/dog_segment/CMakeLists.txt (81%) rename {core => internal/core}/src/dog_segment/Collection.cpp (100%) rename {core => internal/core}/src/dog_segment/Collection.h (100%) rename {core => internal/core}/src/dog_segment/ConcurrentVector.cpp (100%) rename {core => internal/core}/src/dog_segment/ConcurrentVector.h (100%) rename {core => internal/core}/src/dog_segment/DeletedRecord.h (100%) create mode 100644 internal/core/src/dog_segment/EasyAssert.cpp create mode 100644 internal/core/src/dog_segment/EasyAssert.h rename {core => internal/core}/src/dog_segment/IndexMeta.cpp (100%) rename {core => internal/core}/src/dog_segment/IndexMeta.h (100%) rename {core => internal/core}/src/dog_segment/Partition.cpp (100%) rename {core => internal/core}/src/dog_segment/Partition.h (100%) rename {core => internal/core}/src/dog_segment/SegmentBase.h (100%) rename {core => internal/core}/src/dog_segment/SegmentDefs.h (96%) rename {core => internal/core}/src/dog_segment/SegmentNaive.cpp (99%) rename {core => internal/core}/src/dog_segment/SegmentNaive.h (100%) rename {core => internal/core}/src/dog_segment/SmartBruteForce.h (100%) rename {core => internal/core}/src/dog_segment/collection_c.cpp (100%) rename {core => internal/core}/src/dog_segment/collection_c.h (100%) rename {core => internal/core}/src/dog_segment/partition_c.cpp (100%) rename {core => internal/core}/src/dog_segment/partition_c.h (100%) rename {core => internal/core}/src/dog_segment/segment_c.cpp (100%) rename {core => internal/core}/src/dog_segment/segment_c.h (100%) rename {core => internal/core}/src/index/.gitignore (100%) rename {core => internal/core}/src/index/CMakeLists.txt (100%) rename {core => internal/core}/src/index/archive/KnowhereResource.cpp (100%) rename {core => internal/core}/src/index/archive/KnowhereResource.h (100%) rename {core => internal/core}/src/index/build.sh (100%) rename {core => internal/core}/src/index/cmake/BuildUtilsCore.cmake (100%) rename {core => internal/core}/src/index/cmake/DefineOptionsCore.cmake (100%) rename {core => internal/core}/src/index/cmake/FindArrow.cmake (100%) rename {core => internal/core}/src/index/cmake/FindOpenBLAS.cmake (100%) rename {core => internal/core}/src/index/cmake/ThirdPartyPackagesCore.cmake (100%) rename {core => internal/core}/src/index/knowhere/CMakeLists.txt (100%) rename {core => internal/core}/src/index/knowhere/knowhere/common/BinarySet.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/common/Config.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/common/Dataset.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/common/Exception.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/common/Exception.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/common/Log.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/common/Log.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/common/Timer.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/common/Timer.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/common/Typedef.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/Index.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/IndexType.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/IndexType.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/preprocessor/Preprocessor.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/structured_index/StructuredIndex.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/structured_index/StructuredIndexFlat-inl.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/structured_index/StructuredIndexFlat.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/structured_index/StructuredIndexSort-inl.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/structured_index/StructuredIndexSort.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/ConfAdapter.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/ConfAdapter.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/ConfAdapterMgr.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/ConfAdapterMgr.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/FaissBaseBinaryIndex.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/FaissBaseBinaryIndex.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/FaissBaseIndex.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/FaissBaseIndex.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexAnnoy.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexAnnoy.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexHNSW.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexHNSW.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexIVF.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexIVF.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexIVFPQ.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexIVFPQ.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexNSG.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexNSG.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexRHNSW.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexRHNSW.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWFlat.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWFlat.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWPQ.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWPQ.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWSQ.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWSQ.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexSPTAG.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/IndexSPTAG.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/VecIndex.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/VecIndexFactory.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/VecIndexFactory.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/adapter/SptagAdapter.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/adapter/SptagAdapter.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/adapter/VectorAdapter.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/adapter/VectorAdapter.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/gpu/GPUIndex.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIDMAP.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIDMAP.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVF.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVF.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFPQ.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFPQ.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFSQ.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFSQ.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/gpu/IndexIVFSQHybrid.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/gpu/IndexIVFSQHybrid.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/gpu/Quantizer.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/helpers/BuilderSuspend.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/helpers/Cloner.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/helpers/Cloner.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/helpers/FaissGpuResourceMgr.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/helpers/FaissGpuResourceMgr.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/helpers/FaissIO.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/helpers/FaissIO.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/helpers/IndexParameter.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/helpers/IndexParameter.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/helpers/SPTAGParameterMgr.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/helpers/SPTAGParameterMgr.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/impl/nsg/Distance.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/impl/nsg/Distance.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSG.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSG.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGHelper.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGHelper.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGIO.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGIO.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_index/impl/nsg/Neighbor.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_offset_index/IndexIVF_NM.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_offset_index/IndexIVF_NM.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_offset_index/IndexNSG_NM.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_offset_index/IndexNSG_NM.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_offset_index/OffsetBaseIndex.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_offset_index/OffsetBaseIndex.h (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_offset_index/gpu/IndexGPUIVF_NM.cpp (100%) rename {core => internal/core}/src/index/knowhere/knowhere/index/vector_offset_index/gpu/IndexGPUIVF_NM.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/.github/ISSUE_TEMPLATE/bug_report.md (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/.github/ISSUE_TEMPLATE/feature_request.md (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/.gitignore (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService.users.props (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/Aggregator.vcxproj (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/Aggregator.vcxproj.filters (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/CMakeLists.txt (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/Client.vcxproj (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/Client.vcxproj.filters (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/CoreLibrary.vcxproj (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/CoreLibrary.vcxproj.filters (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/IndexBuilder.vcxproj (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/IndexBuilder.vcxproj.filters (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/IndexSearcher.vcxproj (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/IndexSearcher.vcxproj.filters (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/Server.vcxproj (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/Server.vcxproj.filters (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/SocketLib.vcxproj (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/SocketLib.vcxproj.filters (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorContext.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorExecutionContext.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorService.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorSettings.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Client/ClientWrapper.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Client/Options.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/BKT/Index.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/BKT/ParameterDefinitionList.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/BKTree.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/CommonUtils.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/DataUtils.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/Dataset.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/DistanceUtils.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/FineGrainedLock.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/Heap.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/KDTree.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/NeighborhoodGraph.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/QueryResultSet.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/WorkSpace.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/WorkSpacePool.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/CommonDataStructure.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/DefinitionList.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/KDT/Index.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/KDT/ParameterDefinitionList.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/MetadataSet.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/SearchQuery.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/SearchResult.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/VectorIndex.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Core/VectorSet.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Helper/ArgumentsParser.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Helper/Base64Encode.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Helper/BufferStream.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Helper/CommonHelper.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Helper/Concurrent.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Helper/ConcurrentSet.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Helper/SimpleIniReader.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Helper/StringConvert.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Helper/VectorSetReader.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Helper/VectorSetReaders/DefaultReader.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/IndexBuilder/Options.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/IndexBuilder/ThreadPool.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Server/QueryParser.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Server/SearchExecutionContext.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Server/SearchExecutor.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Server/SearchService.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Server/ServiceContext.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Server/ServiceSettings.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Client.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Common.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Connection.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Socket/ConnectionManager.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Packet.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Socket/RemoteSearchQuery.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Socket/ResourceManager.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Server.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/inc/Socket/SimpleSerialization.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/packages.config (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorContext.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorExecutionContext.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorService.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorSettings.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/main.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Client/ClientWrapper.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Client/Options.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Client/main.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Core/BKT/BKTIndex.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Core/Common/NeighborhoodGraph.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Core/Common/WorkSpacePool.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Core/KDT/KDTIndex.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Core/MetadataSet.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Core/VectorIndex.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Core/VectorSet.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Helper/ArgumentsParser.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Helper/Base64Encode.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Helper/CommonHelper.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Helper/Concurrent.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Helper/SimpleIniReader.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Helper/VectorSetReader.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Helper/VectorSetReaders/DefaultReader.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/IndexBuilder/Options.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/IndexBuilder/ThreadPool.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/IndexBuilder/main.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/IndexSearcher/main.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Server/QueryParser.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Server/SearchExecutionContext.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Server/SearchExecutor.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Server/SearchService.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Server/ServiceContext.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Server/ServiceSettings.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Server/main.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Socket/Client.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Socket/Common.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Socket/Connection.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Socket/ConnectionManager.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Socket/Packet.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Socket/RemoteSearchQuery.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/AnnService/src/Socket/Server.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/CMakeLists.txt (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Dockerfile (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/LICENSE (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/README.md (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/SPTAG.sdf (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/SPTAG.sln (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Test/CMakeLists.txt (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Test/Test.vcxproj (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Test/Test.vcxproj.filters (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Test/Test.vcxproj.user (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Test/inc/Test.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Test/packages.config (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Test/src/AlgoTest.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Test/src/Base64HelperTest.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Test/src/CommonHelperTest.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Test/src/DistanceTest.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Test/src/IniReaderTest.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Test/src/StringConvertTest.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Test/src/main.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/CLRCore.vcxproj (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/CLRCore.vcxproj.filters (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/CMakeLists.txt (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/CsharpClient.vcxproj (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/CsharpClient.vcxproj.filters (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/CsharpCore.vcxproj (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/CsharpCore.vcxproj.filters (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/JavaClient.vcxproj (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/JavaClient.vcxproj.filters (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/JavaCore.vcxproj (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/JavaCore.vcxproj.filters (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/PythonClient.vcxproj (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/PythonClient.vcxproj.filters (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/PythonCore.vcxproj (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/PythonCore.vcxproj.filters (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/PythonCore.vcxproj.user (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/inc/CLRCoreInterface.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/inc/ClientInterface.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/inc/CoreInterface.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/inc/CsharpClient.i (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/inc/CsharpCommon.i (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/inc/CsharpCore.i (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/inc/JavaClient.i (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/inc/JavaCommon.i (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/inc/JavaCore.i (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/inc/ManagedObject.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/inc/PythonClient.i (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/inc/PythonCommon.i (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/inc/PythonCore.i (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/inc/TransferDataType.h (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/packages.config (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/src/AssemblyInfo.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/src/CLRCoreInterface.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/src/ClientInterface.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/Wrappers/src/CoreInterface.cpp (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/azure-pipelines.yml (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/docs/GettingStart.md (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/docs/Parameters.md (100%) rename {core => internal/core}/src/index/thirdparty/SPTAG/docs/img/sptag.png (100%) rename {core => internal/core}/src/index/thirdparty/annoy/LICENSE (100%) rename {core => internal/core}/src/index/thirdparty/annoy/RELEASE.md (100%) rename {core => internal/core}/src/index/thirdparty/annoy/examples/mmap_test.py (100%) rename {core => internal/core}/src/index/thirdparty/annoy/examples/precision_test.cpp (100%) rename {core => internal/core}/src/index/thirdparty/annoy/examples/precision_test.py (100%) rename {core => internal/core}/src/index/thirdparty/annoy/examples/s_compile_cpp.sh (100%) rename {core => internal/core}/src/index/thirdparty/annoy/examples/simple_test.py (100%) rename {core => internal/core}/src/index/thirdparty/annoy/src/annoygomodule.h (100%) rename {core => internal/core}/src/index/thirdparty/annoy/src/annoygomodule.i (100%) rename {core => internal/core}/src/index/thirdparty/annoy/src/annoylib.h (100%) rename {core => internal/core}/src/index/thirdparty/annoy/src/annoyluamodule.cc (100%) rename {core => internal/core}/src/index/thirdparty/annoy/src/annoymodule.cc (100%) rename {core => internal/core}/src/index/thirdparty/annoy/src/kissrandom.h (100%) rename {core => internal/core}/src/index/thirdparty/annoy/src/mman.h (100%) rename {core => internal/core}/src/index/thirdparty/build.sh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/.dockerignore (100%) rename {core => internal/core}/src/index/thirdparty/faiss/.gitignore (100%) rename {core => internal/core}/src/index/thirdparty/faiss/AutoTune.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/AutoTune.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/BuilderSuspend.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/BuilderSuspend.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/CODE_OF_CONDUCT.md (100%) rename {core => internal/core}/src/index/thirdparty/faiss/CONTRIBUTING.md (100%) rename {core => internal/core}/src/index/thirdparty/faiss/Clustering.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/Clustering.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/DirectMap.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/DirectMap.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/Dockerfile (100%) rename {core => internal/core}/src/index/thirdparty/faiss/FaissHook.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/FaissHook.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/INSTALL.md (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IVFlib.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IVFlib.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/Index.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/Index.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/Index2Layer.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/Index2Layer.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexBinary.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexBinary.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexBinaryFlat.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexBinaryFlat.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexBinaryFromFloat.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexBinaryFromFloat.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexBinaryHNSW.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexBinaryHNSW.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexBinaryHash.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexBinaryHash.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexBinaryIVF.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexBinaryIVF.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexFlat.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexFlat.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexHNSW.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexHNSW.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexIVF.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexIVF.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexIVFFlat.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexIVFFlat.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexIVFPQ.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexIVFPQ.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexIVFPQR.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexIVFPQR.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexIVFSpectralHash.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexIVFSpectralHash.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexLSH.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexLSH.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexLattice.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexLattice.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexPQ.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexPQ.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexPreTransform.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexPreTransform.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexRHNSW.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexRHNSW.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexReplicas.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexReplicas.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexSQHybrid.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexSQHybrid.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexScalarQuantizer.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexScalarQuantizer.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexShards.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/IndexShards.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/InvertedLists.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/InvertedLists.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/LICENSE (100%) rename {core => internal/core}/src/index/thirdparty/faiss/Makefile (100%) rename {core => internal/core}/src/index/thirdparty/faiss/MatrixStats.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/MatrixStats.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/MetaIndexes.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/MetaIndexes.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/MetricType.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/OnDiskInvertedLists.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/OnDiskInvertedLists.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/README.md (100%) rename {core => internal/core}/src/index/thirdparty/faiss/VectorTransform.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/VectorTransform.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/acinclude/ax_blas.m4 (100%) rename {core => internal/core}/src/index/thirdparty/faiss/acinclude/ax_check_cpu.m4 (100%) rename {core => internal/core}/src/index/thirdparty/faiss/acinclude/ax_cxx_compile_stdcxx.m4 (100%) rename {core => internal/core}/src/index/thirdparty/faiss/acinclude/ax_lapack.m4 (100%) rename {core => internal/core}/src/index/thirdparty/faiss/acinclude/fa_check_cuda.m4 (100%) rename {core => internal/core}/src/index/thirdparty/faiss/acinclude/fa_numpy.m4 (100%) rename {core => internal/core}/src/index/thirdparty/faiss/acinclude/fa_prog_nm.m4 (100%) rename {core => internal/core}/src/index/thirdparty/faiss/acinclude/fa_prog_swig.m4 (100%) rename {core => internal/core}/src/index/thirdparty/faiss/acinclude/fa_python.m4 (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/README.md (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/bench_all_ivf/README.md (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/bench_all_ivf/bench_all_ivf.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/bench_all_ivf/bench_kmeans.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/bench_all_ivf/datasets.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/bench_all_ivf/parse_bench_all_ivf.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/bench_all_ivf/run_on_cluster_generic.bash (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/bench_for_interrupt.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/bench_gpu_1bn.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/bench_gpu_sift1m.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/bench_hnsw.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/bench_index_pq.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/bench_pairwise_distances.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/bench_polysemous_1bn.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/bench_polysemous_sift1m.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/bench_scalar_quantizer.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/bench_vector_ops.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/datasets.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/distributed_ondisk/README.md (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/distributed_ondisk/combined_index.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/distributed_ondisk/distributed_kmeans.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/distributed_ondisk/distributed_query_demo.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/distributed_ondisk/make_index_vslice.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/distributed_ondisk/make_trained_index.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/distributed_ondisk/merge_to_ondisk.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/distributed_ondisk/rpc.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/distributed_ondisk/run_on_cluster.bash (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/distributed_ondisk/search_server.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/kmeans_mnist.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/link_and_code/README.md (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/link_and_code/bench_link_and_code.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/link_and_code/datasets.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/benchs/link_and_code/neighbor_codec.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/build-aux/config.guess (100%) rename {core => internal/core}/src/index/thirdparty/faiss/build-aux/config.sub (100%) rename {core => internal/core}/src/index/thirdparty/faiss/build-aux/install-sh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/build.sh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/AutoTune_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/AutoTune_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/Clustering_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/Clustering_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/INSTALL.md (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/IndexFlat_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/IndexFlat_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/IndexIVFFlat_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/IndexIVFFlat_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/IndexIVF_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/IndexIVF_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/IndexLSH_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/IndexLSH_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/IndexPreTransform_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/IndexPreTransform_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/IndexShards_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/IndexShards_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/Index_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/Index_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/Makefile (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/MetaIndexes_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/MetaIndexes_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/clone_index_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/clone_index_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/error_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/error_impl.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/error_impl.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/example_c.c (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/faiss_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/gpu/GpuAutoTune_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/gpu/GpuAutoTune_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/gpu/GpuClonerOptions_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/gpu/GpuClonerOptions_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/gpu/GpuIndex_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/gpu/GpuIndex_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/gpu/GpuIndicesOptions_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/gpu/GpuResources_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/gpu/GpuResources_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/gpu/Makefile (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/gpu/StandardGpuResources_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/gpu/StandardGpuResources_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/gpu/example_gpu_c.c (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/gpu/macros_impl.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/impl/AuxIndexStructures_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/impl/AuxIndexStructures_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/index_factory_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/index_factory_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/index_io_c.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/index_io_c.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/c_api/macros_impl.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/clone_index.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/clone_index.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/conda/Dockerfile (100%) rename {core => internal/core}/src/index/thirdparty/faiss/conda/conda_build_config.yaml (100%) rename {core => internal/core}/src/index/thirdparty/faiss/conda/faiss-gpu/build.sh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/conda/faiss-gpu/conda_build_config.yaml (100%) rename {core => internal/core}/src/index/thirdparty/faiss/conda/faiss-gpu/meta.yaml (100%) rename {core => internal/core}/src/index/thirdparty/faiss/conda/faiss-gpu/run_test.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/conda/faiss/build.sh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/conda/faiss/meta.yaml (100%) rename {core => internal/core}/src/index/thirdparty/faiss/conda/faiss/run_test.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/configure (100%) rename {core => internal/core}/src/index/thirdparty/faiss/configure.ac (100%) rename {core => internal/core}/src/index/thirdparty/faiss/demos/Makefile (100%) rename {core => internal/core}/src/index/thirdparty/faiss/demos/README.md (100%) rename {core => internal/core}/src/index/thirdparty/faiss/demos/demo_auto_tune.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/demos/demo_imi_flat.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/demos/demo_imi_pq.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/demos/demo_ivfpq_indexing.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/demos/demo_ondisk_ivf.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/demos/demo_sift1M.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/demos/demo_weighted_kmeans.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/example_makefiles/makefile.inc.Linux (100%) rename {core => internal/core}/src/index/thirdparty/faiss/example_makefiles/makefile.inc.Mac.brew (100%) rename {core => internal/core}/src/index/thirdparty/faiss/example_makefiles/makefile.inc.Mac.port (100%) rename {core => internal/core}/src/index/thirdparty/faiss/faiss (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuAutoTune.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuAutoTune.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuCloner.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuCloner.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuClonerOptions.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuClonerOptions.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuDistance.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuDistance.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuFaissAssert.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndex.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndex.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndexBinaryFlat.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndexBinaryFlat.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndexFlat.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndexFlat.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndexIVF.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndexIVF.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndexIVFFlat.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndexIVFFlat.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndexIVFPQ.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndexIVFPQ.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndexIVFSQHybrid.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndexIVFSQHybrid.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndexIVFScalarQuantizer.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndexIVFScalarQuantizer.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuIndicesOptions.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuResources.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/GpuResources.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/StandardGpuResources.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/StandardGpuResources.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/BinaryDistance.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/BinaryDistance.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/BinaryFlatIndex.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/BinaryFlatIndex.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/BroadcastSum.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/BroadcastSum.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/Distance.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/Distance.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/DistanceUtils.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/FlatIndex.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/FlatIndex.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/GeneralDistance.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/GpuScalarQuantizer.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/IVFAppend.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/IVFAppend.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/IVFBase.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/IVFBase.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/IVFFlat.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/IVFFlat.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/IVFFlatScan.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/IVFFlatScan.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/IVFPQ.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/IVFPQ.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/IVFUtils.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/IVFUtils.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/IVFUtilsSelect1.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/IVFUtilsSelect2.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/L2Norm.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/L2Norm.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/L2Select.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/L2Select.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/Metrics.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/PQCodeDistances-inl.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/PQCodeDistances.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/PQCodeDistances.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/PQCodeLoad.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassNoPrecomputed-inl.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassNoPrecomputed.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassNoPrecomputed.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassPrecomputed.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassPrecomputed.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/RemapIndices.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/RemapIndices.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/VectorResidual.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/impl/VectorResidual.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/perf/IndexWrapper-inl.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/perf/IndexWrapper.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/perf/PerfBinaryFlat.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/perf/PerfClustering.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/perf/PerfFlat.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/perf/PerfIVFFlat.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/perf/PerfIVFPQ.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/perf/PerfIVFPQAdd.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/perf/PerfSelect.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/perf/WriteIndex.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/perf/slow.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/test/Makefile (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/test/TestGpuDistance.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/test/TestGpuIndexBinaryFlat.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/test/TestGpuIndexFlat.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/test/TestGpuIndexIVFFlat.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/test/TestGpuIndexIVFPQ.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/test/TestGpuMemoryException.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/test/TestGpuSelect.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/test/TestUtils.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/test/TestUtils.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/test/demo_ivfpq_indexing_gpu.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/test/test_gpu_index.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/test/test_gpu_index_ivfsq.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/test/test_pytorch_faiss.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/BlockSelectFloat.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/BlockSelectHalf.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/BlockSelectImpl.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/BlockSelectKernel.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/Comparators.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/ConversionOperators.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/CopyUtils.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/DeviceDefs.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/DeviceMemory.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/DeviceMemory.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/DeviceTensor-inl.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/DeviceTensor.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/DeviceUtils.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/DeviceUtils.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/DeviceVector.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/Float16.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/Float16.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/HostTensor-inl.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/HostTensor.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/Limits.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/LoadStoreOperators.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/MathOperators.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/MatrixMult-inl.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/MatrixMult.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/MatrixMult.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/MemorySpace.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/MemorySpace.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/MergeNetworkBlock.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/MergeNetworkUtils.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/MergeNetworkWarp.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/NoTypeTensor.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/Pair.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/PtxUtils.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/ReductionOperators.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/Reductions.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/Select.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/StackDeviceMemory.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/StackDeviceMemory.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/StaticUtils.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/Tensor-inl.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/Tensor.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/ThrustAllocator.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/Timer.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/Timer.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/Transpose.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/WarpSelectFloat.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/WarpSelectHalf.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/WarpSelectKernel.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/WarpShuffles.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat1.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat128.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat256.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat32.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat64.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatF1024.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatF2048.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatF512.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatT1024.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatT2048.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatT512.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf1.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf128.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf256.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf32.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf64.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfF1024.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfF2048.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfF512.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfT1024.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfT2048.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfT512.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectImpl.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat1.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat128.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat256.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat32.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat64.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatF1024.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatF2048.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatF512.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatT1024.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatT2048.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatT512.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf1.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf128.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf256.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf32.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf64.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfF1024.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfF2048.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfF512.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfT1024.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfT2048.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfT512.cu (100%) rename {core => internal/core}/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectImpl.cuh (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/AuxIndexStructures.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/AuxIndexStructures.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/FaissAssert.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/FaissException.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/FaissException.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/HNSW.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/HNSW.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/PolysemousTraining.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/PolysemousTraining.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ProductQuantizer-inl.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ProductQuantizer.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ProductQuantizer.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/RHNSW.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/RHNSW.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ScalarQuantizer.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ScalarQuantizer.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ScalarQuantizerCodec.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ScalarQuantizerCodec_avx.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ScalarQuantizerCodec_avx512.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ScalarQuantizerDC.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ScalarQuantizerDC.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx512.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx512.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ScalarQuantizerOp.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ScalarQuantizerOp.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ThreadedIndex-inl.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/ThreadedIndex.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/index_read.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/index_write.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/io.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/io.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/lattice_Zn.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/impl/lattice_Zn.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/index_factory.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/index_factory.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/index_io.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/makefile.inc.in (100%) rename {core => internal/core}/src/index/thirdparty/faiss/misc/test_blas.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/python/Makefile (100%) rename {core => internal/core}/src/index/thirdparty/faiss/python/faiss.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/python/setup.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/python/swigfaiss.swig (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/Makefile (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/common.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_binary_factory.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_binary_flat.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_binary_hashindex.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_binary_io.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_build_blocks.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_dealloc_invlists.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_extra_distances.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_factory.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_index.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_index_accuracy.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_index_binary.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_index_binary_from_float.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_index_composite.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_io.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_ivflib.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_ivfpq_codec.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_ivfpq_indexing.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_lowlevel_ivf.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_merge.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_meta_index.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_omp_threads.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_omp_threads_py.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_ondisk_ivf.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_oom_exception.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_pairs_decoding.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_params_override.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_pq_encoding.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_referenced_objects.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_sliding_ivf.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_standalone_codec.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_threaded_index.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tests/test_transfer_invlists.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/cpp/1-Flat.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/cpp/2-IVFFlat.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/cpp/3-IVFPQ.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/cpp/4-GPU.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/cpp/5-GPU.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/cpp/5-Multiple-GPUs.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/cpp/6-GPU.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/cpp/6-RUN.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/cpp/7-GPU.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/cpp/8-GPU.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/cpp/9-BinaryFlat.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/cpp/Makefile (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/cpp/faiss_test.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/python/1-Flat.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/python/2-IVFFlat.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/python/3-IVFPQ.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/python/4-GPU.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/tutorial/python/5-Multiple-GPUs.py (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/BinaryDistance.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/BinaryDistance.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/ConcurrentBitset.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/ConcurrentBitset.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/Heap.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/Heap.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/WorkerThread.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/WorkerThread.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/distances.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/distances.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/distances_avx.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/distances_avx512.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/distances_simd.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/distances_simd_avx.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/distances_simd_avx512.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/extra_distances.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/extra_distances.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/hamming-inl.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/hamming.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/hamming.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/instruction_set.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/jaccard-inl.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/random.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/random.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/substructure-inl.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/superstructure-inl.h (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/utils.cpp (100%) rename {core => internal/core}/src/index/thirdparty/faiss/utils/utils.h (100%) rename {core => internal/core}/src/index/thirdparty/hnswlib/bruteforce.h (100%) rename {core => internal/core}/src/index/thirdparty/hnswlib/hnswalg.h (100%) rename {core => internal/core}/src/index/thirdparty/hnswlib/hnswalg_nm.h (100%) rename {core => internal/core}/src/index/thirdparty/hnswlib/hnswlib.h (100%) rename {core => internal/core}/src/index/thirdparty/hnswlib/hnswlib_nm.h (100%) rename {core => internal/core}/src/index/thirdparty/hnswlib/space_ip.h (100%) rename {core => internal/core}/src/index/thirdparty/hnswlib/space_l2.h (100%) rename {core => internal/core}/src/index/thirdparty/hnswlib/visited_list_pool.h (100%) rename {core => internal/core}/src/index/thirdparty/versions.txt (100%) rename {core => internal/core}/src/index/unittest/CMakeLists.txt (100%) rename {core => internal/core}/src/index/unittest/Helper.h (100%) rename {core => internal/core}/src/index/unittest/SPTAG.cpp (100%) rename {core => internal/core}/src/index/unittest/faiss_benchmark/CMakeLists.txt (100%) rename {core => internal/core}/src/index/unittest/faiss_benchmark/README.md (100%) rename {core => internal/core}/src/index/unittest/faiss_benchmark/faiss_benchmark_test.cpp (100%) rename {core => internal/core}/src/index/unittest/faiss_benchmark/faiss_bitset_test.cpp (100%) rename {core => internal/core}/src/index/unittest/kdtree.cpp (100%) rename {core => internal/core}/src/index/unittest/metric_alg_benchmark/CMakeLists.txt (100%) rename {core => internal/core}/src/index/unittest/metric_alg_benchmark/metric_benchmark_test.cpp (100%) rename {core => internal/core}/src/index/unittest/sift.50NN.graph (100%) rename {core => internal/core}/src/index/unittest/siftsmall_base.fvecs (100%) rename {core => internal/core}/src/index/unittest/test_annoy.cpp (100%) rename {core => internal/core}/src/index/unittest/test_binaryidmap.cpp (100%) rename {core => internal/core}/src/index/unittest/test_binaryivf.cpp (100%) rename {core => internal/core}/src/index/unittest/test_common.cpp (100%) rename {core => internal/core}/src/index/unittest/test_customized_index.cpp (100%) rename {core => internal/core}/src/index/unittest/test_gpuresource.cpp (100%) rename {core => internal/core}/src/index/unittest/test_hnsw.cpp (100%) rename {core => internal/core}/src/index/unittest/test_idmap.cpp (100%) rename {core => internal/core}/src/index/unittest/test_instructionset.cpp (100%) rename {core => internal/core}/src/index/unittest/test_ivf.cpp (100%) rename {core => internal/core}/src/index/unittest/test_ivf_cpu_nm.cpp (100%) rename {core => internal/core}/src/index/unittest/test_ivf_gpu_nm.cpp (100%) rename {core => internal/core}/src/index/unittest/test_knowhere.cpp (100%) rename {core => internal/core}/src/index/unittest/test_nsg.cpp (100%) rename {core => internal/core}/src/index/unittest/test_rhnsw_flat.cpp (100%) rename {core => internal/core}/src/index/unittest/test_rhnsw_pq.cpp (100%) rename {core => internal/core}/src/index/unittest/test_rhnsw_sq8.cpp (100%) rename {core => internal/core}/src/index/unittest/test_sptag.cpp (100%) rename {core => internal/core}/src/index/unittest/test_structured_index_sort.cpp (100%) rename {core => internal/core}/src/index/unittest/test_vecindex.cpp (100%) rename {core => internal/core}/src/index/unittest/test_wrapper.cpp (100%) rename {core => internal/core}/src/index/unittest/utils.cpp (100%) rename {core => internal/core}/src/index/unittest/utils.h (100%) rename {core => internal/core}/src/log/CMakeLists.txt (100%) rename {core => internal/core}/src/log/Log.cpp (100%) rename {core => internal/core}/src/log/Log.h (100%) rename {core => internal/core}/src/log/LogMgr.cpp (100%) rename {core => internal/core}/src/log/LogMgr.h (100%) rename {core => internal/core}/src/main.cpp (100%) rename {core => internal/core}/src/pb/master.pb.cc (100%) rename {core => internal/core}/src/pb/master.pb.h (100%) rename {core => internal/core}/src/pb/message.pb.cc (100%) rename {core => internal/core}/src/pb/message.pb.h (100%) rename {core => internal/core}/src/query/BinaryQuery.cpp (100%) rename {core => internal/core}/src/query/BinaryQuery.h (100%) rename {core => internal/core}/src/query/BooleanQuery.h (100%) rename {core => internal/core}/src/query/CMakeLists.txt (100%) rename {core => internal/core}/src/query/GeneralQuery.h (100%) rename {core => internal/core}/src/utils/BlockingQueue.h (100%) rename {core => internal/core}/src/utils/CMakeLists.txt (100%) rename {core => internal/core}/src/utils/CommonUtil.cpp (100%) rename {core => internal/core}/src/utils/CommonUtil.h (100%) rename {core => internal/core}/src/utils/ConfigUtils.cpp (100%) rename {core => internal/core}/src/utils/ConfigUtils.h (100%) rename {core => internal/core}/src/utils/Error.h (100%) rename {core => internal/core}/src/utils/Exception.h (100%) rename {core => internal/core}/src/utils/Json.h (100%) rename {core => internal/core}/src/utils/Log.h (100%) rename {core => internal/core}/src/utils/SignalHandler.cpp (100%) rename {core => internal/core}/src/utils/SignalHandler.h (100%) rename {core => internal/core}/src/utils/Status.cpp (100%) rename {core => internal/core}/src/utils/Status.h (100%) rename {core => internal/core}/src/utils/StringHelpFunctions.cpp (100%) rename {core => internal/core}/src/utils/StringHelpFunctions.h (100%) rename {core => internal/core}/src/utils/ThreadPool.h (100%) rename {core => internal/core}/src/utils/TimeRecorder.cpp (100%) rename {core => internal/core}/src/utils/TimeRecorder.h (100%) rename {core => internal/core}/src/utils/Types.h (100%) rename {core => internal/core}/thirdparty/CMakeLists.txt (100%) rename {core => internal/core}/thirdparty/easyloggingpp/easylogging++.cc (100%) rename {core => internal/core}/thirdparty/easyloggingpp/easylogging++.h (100%) rename {core => internal/core}/thirdparty/gtest/CMakeLists.txt (100%) rename {core => internal/core}/thirdparty/nlohmann/json.hpp (100%) rename {core => internal/core}/thirdparty/opentracing/CMakeLists.txt (100%) rename {core => internal/core}/thirdparty/protobuf/CMakeLists.txt (100%) rename {core => internal/core}/thirdparty/versions.txt (100%) rename {core => internal/core}/thirdparty/yaml-cpp/CMakeLists.txt (100%) rename {core => internal/core}/ubuntu_build_deps.sh (100%) rename {core => internal/core}/unittest/CMakeLists.txt (90%) rename {core => internal/core}/unittest/test_c_api.cpp (100%) rename {core => internal/core}/unittest/test_concurrent_vector.cpp (100%) rename {core => internal/core}/unittest/test_dog_segment.cpp (66%) rename {core => internal/core}/unittest/test_indexing.cpp (100%) rename {core => internal/core}/unittest/test_naive.cpp (100%) rename {errors => internal/errors}/errors.go (100%) rename {errors => internal/errors}/group.go (100%) rename {errors => internal/errors}/stack.go (100%) rename {pkg => internal}/master/README.md (100%) rename {pkg/master/mock => internal/master/collection}/collection.go (91%) create mode 100644 internal/master/collection/collection_test.go create mode 100644 internal/master/controller/collection.go create mode 100644 internal/master/controller/segment.go create mode 100644 internal/master/controller/segment_test.go create mode 100644 internal/master/grpc/server.go rename {pkg => internal}/master/id/id.go (93%) rename {pkg => internal}/master/informer/informer.go (100%) create mode 100644 internal/master/informer/pulsar.go rename {pkg => internal}/master/kv/etcd_kv.go (91%) rename {pkg => internal}/master/kv/kv.go (100%) rename {pkg/master/mock => internal/master/segment}/segment.go (60%) create mode 100644 internal/master/segment/stats.go create mode 100644 internal/master/server.go create mode 100644 internal/msgclient/msgclient.go rename {pkg/master/grpc => internal/proto}/master/master.pb.go (72%) rename {proto => internal/proto/master}/master.proto (88%) rename {pkg/master/grpc => internal/proto}/message/message.pb.go (86%) rename {pkg/master/grpc => internal/proto}/message/message.proto (99%) rename {proxy-go/proxy_node => internal/proxy}/manipulation_req.go (97%) rename {proxy-go/proxy_node => internal/proxy}/proxy_node.go (97%) rename {proxy-go/proxy_node => internal/proxy}/proxy_node_test.go (99%) rename {proxy-go/proxy_node => internal/proxy}/query_req.go (98%) rename {proxy-go/proxy_node => internal/proxy}/readertimesync.go (98%) rename {proxy-go/proxy_node => internal/proxy}/readertimesync_test.go (99%) rename {proxy-go/proxy_node => internal/proxy}/request_scheduler.go (98%) rename {proxy-go/proxy_node => internal/proxy}/server.go (98%) rename {proxy-go/proxy_node => internal/proxy}/server_test.go (99%) rename {proxy-go/proxy_node => internal/proxy}/timestamporacle.go (97%) rename {proxy-go/proxy_node => internal/proxy}/timestamporacle_test.go (97%) rename {proxy-go/proxy_node => internal/proxy}/timetick.go (96%) rename {proxy-go/proxy_node => internal/proxy}/timetick_test.go (96%) rename {proxy-go/proxy_node => internal/proxy}/util.go (95%) rename {proxy-go/proxy_node => internal/proxy}/util_test.go (95%) rename {reader/read_node => internal/reader}/collection.go (100%) rename {reader/read_node => internal/reader}/index.go (92%) rename {reader/read_node => internal/reader}/index_test.go (93%) rename {reader/read_node => internal/reader}/meta.go (81%) rename {reader/read_node => internal/reader}/partition.go (100%) rename {reader/read_node => internal/reader}/query_node.go (73%) rename {reader/read_node => internal/reader}/query_node_time.go (100%) rename {reader/read_node => internal/reader}/quety_node_test.go (100%) rename {reader/read_node => internal/reader}/reader.go (60%) create mode 100644 internal/reader/reader_test.go rename {reader/read_node => internal/reader}/result.go (77%) rename {reader/read_node => internal/reader}/result_test.go (51%) rename {reader/read_node => internal/reader}/segment.go (87%) rename {reader/read_node => internal/reader}/segment_service.go (82%) rename {reader/read_node => internal/reader}/segment_service_test.go (51%) rename {reader/read_node => internal/reader}/segment_test.go (89%) rename {reader/read_node => internal/reader}/util_functions.go (59%) rename {reader/read_node => internal/reader}/util_functions_test.go (52%) rename {storage => internal/storage}/internal/S3/S3_test.go (98%) rename {storage => internal/storage}/internal/S3/s3_engine.go (96%) rename {storage => internal/storage}/internal/S3/s3_store.go (98%) rename {storage => internal/storage}/internal/minio/codec/codec.go (100%) rename {storage => internal/storage}/internal/minio/minio_store.go (97%) rename {storage => internal/storage}/internal/minio/minio_storeEngine.go (95%) rename {storage => internal/storage}/internal/minio/minio_test.go (98%) rename {storage => internal/storage}/internal/tikv/codec/codec.go (100%) rename {storage => internal/storage}/internal/tikv/tikv_store.go (98%) rename {storage => internal/storage}/internal/tikv/tikv_test.go (94%) rename {storage/pkg => internal/storage}/storage.go (51%) rename storage/pkg/types/types.go => internal/storage/type/storagetype.go (99%) rename timesync/readertimesync.go => internal/timesync/timesync.go (59%) rename timesync/readertimesync_test.go => internal/timesync/timesync_test.go (95%) rename {util => internal/util}/etcdutil/etcdutil.go (99%) rename {util => internal/util}/etcdutil/etcdutil_test.go (100%) create mode 100644 internal/writer/writer.go delete mode 100644 master/client/base_client.go delete mode 100644 master/client/client.go delete mode 100644 master/config/config.go delete mode 100644 master/config/persist_options.go delete mode 100644 master/config/util.go delete mode 100644 master/election/leadership.go delete mode 100644 master/election/lease.go delete mode 100644 master/grpc/client/main.go delete mode 100644 master/grpc/proto/hello.pb.go delete mode 100644 master/grpc/proto/hello.proto delete mode 100644 master/grpc/proto/master.pb.go delete mode 100644 master/grpc/proto/master.proto delete mode 100644 master/grpc/server/main.go delete mode 100644 master/grpc_service.go delete mode 100644 master/heartbeat_streams.go delete mode 100644 master/id/id.go delete mode 100644 master/kv/etcd_kv.go delete mode 100644 master/kv/kv.go delete mode 100644 master/kv/mem_kv.go delete mode 100644 master/member/member.go delete mode 100644 master/meta/storage.go delete mode 100644 master/server.go delete mode 100644 master/tso/global_allocator.go delete mode 100644 master/tso/tso.go delete mode 100644 master/util.go delete mode 100644 pkg/master/common/config.go delete mode 100644 pkg/master/grpc/master/master.proto delete mode 100644 pkg/master/informer/pulsar.go delete mode 100644 pkg/master/mock/collection_test.go delete mode 100644 pkg/master/mock/grpc_client.go delete mode 100644 pkg/master/mock/grpc_client_test.go delete mode 100644 pkg/master/mock/mock.go delete mode 100644 pkg/master/mock/pulsar.go delete mode 100644 pkg/master/mock/segment_test.go delete mode 100644 pkg/master/server.go delete mode 100644 pkg/message/message.pb.go delete mode 100644 pkg/metapb/metapb.pb.go delete mode 100644 pkg/pdpb/pdpb.pb.go delete mode 100644 proto/message.proto delete mode 100644 proto/metapb.proto delete mode 100644 proto/pdpb.proto delete mode 100644 proxy/CMakeLists.txt delete mode 100644 proxy/build-support/code_style_clion.xml delete mode 100755 proxy/build-support/cpplint.py delete mode 100644 proxy/build-support/lint_exclusions.txt delete mode 100755 proxy/build-support/lintutils.py delete mode 100755 proxy/build-support/run_clang_format.py delete mode 100755 proxy/build-support/run_clang_tidy.py delete mode 100755 proxy/build-support/run_cpplint.py delete mode 100644 proxy/cmake/BuildUtils.cmake delete mode 100644 proxy/cmake/DefineOptions.cmake delete mode 100644 proxy/cmake/FindClangTools.cmake delete mode 100644 proxy/cmake/ThirdPartyPackages.cmake delete mode 100644 proxy/cmake/Utils.cmake delete mode 100644 proxy/generate_entity_ids/client/getIds.go delete mode 100644 proxy/generate_entity_ids/collect_result.go delete mode 100644 proxy/generate_entity_ids/proto/generate_id.pb.go delete mode 100644 proxy/generate_entity_ids/proto/generate_id.proto delete mode 100644 proxy/generate_entity_ids/server/generate_entity_ids.go delete mode 100644 proxy/src/CMakeLists.txt delete mode 100644 proxy/src/config/CMakeLists.txt delete mode 100644 proxy/src/config/ConfigMgr.cpp delete mode 100644 proxy/src/config/ConfigMgr.h delete mode 100644 proxy/src/config/ConfigType.cpp delete mode 100644 proxy/src/config/ConfigType.h delete mode 100644 proxy/src/config/ConfigTypeTest1.cpp delete mode 100644 proxy/src/config/ConfigTypeTest2.cpp delete mode 100644 proxy/src/config/ServerConfig.cpp delete mode 100644 proxy/src/config/ServerConfig.h delete mode 100644 proxy/src/config/ServerConfigTest.cpp delete mode 100644 proxy/src/db/CMakeLists.txt delete mode 100644 proxy/src/db/Constants.h delete mode 100644 proxy/src/db/Types.cpp delete mode 100644 proxy/src/db/Types.h delete mode 100644 proxy/src/grpc/etcd.grpc.pb.cc delete mode 100644 proxy/src/grpc/etcd.grpc.pb.h delete mode 100644 proxy/src/grpc/etcd.pb.cc delete mode 100644 proxy/src/grpc/etcd.pb.h delete mode 100644 proxy/src/grpc/master.grpc.pb.cc delete mode 100644 proxy/src/grpc/master.grpc.pb.h delete mode 100644 proxy/src/grpc/master.pb.cc delete mode 100644 proxy/src/grpc/master.pb.h delete mode 100644 proxy/src/grpc/message.grpc.pb.cc delete mode 100644 proxy/src/grpc/message.grpc.pb.h delete mode 100644 proxy/src/grpc/message.pb.cc delete mode 100644 proxy/src/grpc/message.pb.h delete mode 100644 proxy/src/grpc/proto/etcd.proto delete mode 100644 proxy/src/log/CMakeLists.txt delete mode 100644 proxy/src/log/Log.cpp delete mode 100644 proxy/src/log/Log.h delete mode 100644 proxy/src/log/LogMgr.cpp delete mode 100644 proxy/src/log/LogMgr.h delete mode 100644 proxy/src/main.cpp delete mode 100644 proxy/src/message_client/CMakeLists.txt delete mode 100644 proxy/src/message_client/Client.cpp delete mode 100644 proxy/src/message_client/Client.h delete mode 100644 proxy/src/message_client/ClientV2.cpp delete mode 100644 proxy/src/message_client/ClientV2.h delete mode 100644 proxy/src/message_client/Consumer.cpp delete mode 100644 proxy/src/message_client/Consumer.h delete mode 100644 proxy/src/message_client/M3_hash.cpp delete mode 100644 proxy/src/message_client/M3_hash.h delete mode 100644 proxy/src/message_client/PartitionPolicy.cpp delete mode 100644 proxy/src/message_client/PartitionPolicy.h delete mode 100644 proxy/src/message_client/Producer.cpp delete mode 100644 proxy/src/message_client/Producer.h delete mode 100644 proxy/src/meta/CMakeLists.txt delete mode 100644 proxy/src/meta/etcd_client/Etcd_client.cpp delete mode 100644 proxy/src/meta/etcd_client/Etcd_client.h delete mode 100644 proxy/src/meta/etcd_watcher/CMakeLists.txt delete mode 100644 proxy/src/meta/etcd_watcher/Watcher.cpp delete mode 100644 proxy/src/meta/etcd_watcher/Watcher.h delete mode 100644 proxy/src/meta/etcd_watcher/test_watcher.cpp delete mode 100644 proxy/src/meta/master/GrpcClient.cpp delete mode 100644 proxy/src/meta/master/GrpcClient.h delete mode 100644 proxy/src/query/BinaryQuery.cpp delete mode 100644 proxy/src/query/BinaryQuery.h delete mode 100644 proxy/src/query/BooleanQuery.h delete mode 100644 proxy/src/query/CMakeLists.txt delete mode 100644 proxy/src/query/GeneralQuery.h delete mode 100644 proxy/src/server/CMakeLists.txt delete mode 100644 proxy/src/server/MessageWrapper.cpp delete mode 100644 proxy/src/server/MessageWrapper.h delete mode 100644 proxy/src/server/MetaWrapper.cpp delete mode 100644 proxy/src/server/MetaWrapper.h delete mode 100644 proxy/src/server/Server.cpp delete mode 100644 proxy/src/server/Server.h delete mode 100644 proxy/src/server/ValidationUtil.cpp delete mode 100644 proxy/src/server/ValidationUtil.h delete mode 100644 proxy/src/server/context/ConnectionContext.h delete mode 100644 proxy/src/server/context/Context.cpp delete mode 100644 proxy/src/server/context/Context.h delete mode 100644 proxy/src/server/delivery/ReqHandler.cpp delete mode 100644 proxy/src/server/delivery/ReqHandler.h delete mode 100644 proxy/src/server/delivery/ReqQueue.cpp delete mode 100644 proxy/src/server/delivery/ReqQueue.h delete mode 100644 proxy/src/server/delivery/ReqScheduler.cpp delete mode 100644 proxy/src/server/delivery/ReqScheduler.h delete mode 100644 proxy/src/server/delivery/request/BaseReq.cpp delete mode 100644 proxy/src/server/delivery/request/BaseReq.h delete mode 100644 proxy/src/server/delivery/request/CmdReq.cpp delete mode 100644 proxy/src/server/delivery/request/CmdReq.h delete mode 100644 proxy/src/server/delivery/request/CompactReq.cpp delete mode 100644 proxy/src/server/delivery/request/CompactReq.h delete mode 100644 proxy/src/server/delivery/request/CountEntitiesReq.cpp delete mode 100644 proxy/src/server/delivery/request/CountEntitiesReq.h delete mode 100644 proxy/src/server/delivery/request/CreateCollectionReq.cpp delete mode 100644 proxy/src/server/delivery/request/CreateCollectionReq.h delete mode 100644 proxy/src/server/delivery/request/CreateIndexReq.cpp delete mode 100644 proxy/src/server/delivery/request/CreateIndexReq.h delete mode 100644 proxy/src/server/delivery/request/CreatePartitionReq.cpp delete mode 100644 proxy/src/server/delivery/request/CreatePartitionReq.h delete mode 100644 proxy/src/server/delivery/request/DeleteEntityByIDReq.cpp delete mode 100644 proxy/src/server/delivery/request/DeleteEntityByIDReq.h delete mode 100644 proxy/src/server/delivery/request/DescribeIndexReq.cpp delete mode 100644 proxy/src/server/delivery/request/DescribeIndexReq.h delete mode 100644 proxy/src/server/delivery/request/DropCollectionReq.cpp delete mode 100644 proxy/src/server/delivery/request/DropCollectionReq.h delete mode 100644 proxy/src/server/delivery/request/DropIndexReq.cpp delete mode 100644 proxy/src/server/delivery/request/DropIndexReq.h delete mode 100644 proxy/src/server/delivery/request/DropPartitionReq.cpp delete mode 100644 proxy/src/server/delivery/request/DropPartitionReq.h delete mode 100644 proxy/src/server/delivery/request/FlushReq.cpp delete mode 100644 proxy/src/server/delivery/request/FlushReq.h delete mode 100644 proxy/src/server/delivery/request/GetCollectionInfoReq.cpp delete mode 100644 proxy/src/server/delivery/request/GetCollectionInfoReq.h delete mode 100644 proxy/src/server/delivery/request/GetCollectionStatsReq.cpp delete mode 100644 proxy/src/server/delivery/request/GetCollectionStatsReq.h delete mode 100644 proxy/src/server/delivery/request/GetEntityByIDReq.cpp delete mode 100644 proxy/src/server/delivery/request/GetEntityByIDReq.h delete mode 100644 proxy/src/server/delivery/request/HasCollectionReq.cpp delete mode 100644 proxy/src/server/delivery/request/HasCollectionReq.h delete mode 100644 proxy/src/server/delivery/request/HasPartitionReq.cpp delete mode 100644 proxy/src/server/delivery/request/HasPartitionReq.h delete mode 100644 proxy/src/server/delivery/request/InsertReq.cpp delete mode 100644 proxy/src/server/delivery/request/InsertReq.h delete mode 100644 proxy/src/server/delivery/request/ListCollectionsReq.cpp delete mode 100644 proxy/src/server/delivery/request/ListCollectionsReq.h delete mode 100644 proxy/src/server/delivery/request/ListIDInSegmentReq.cpp delete mode 100644 proxy/src/server/delivery/request/ListIDInSegmentReq.h delete mode 100644 proxy/src/server/delivery/request/ListPartitionsReq.cpp delete mode 100644 proxy/src/server/delivery/request/ListPartitionsReq.h delete mode 100644 proxy/src/server/delivery/request/LoadCollectionReq.cpp delete mode 100644 proxy/src/server/delivery/request/LoadCollectionReq.h delete mode 100644 proxy/src/server/delivery/request/SearchReq.cpp delete mode 100644 proxy/src/server/delivery/request/SearchReq.h delete mode 100644 proxy/src/server/delivery/request/Types.cpp delete mode 100644 proxy/src/server/delivery/request/Types.h delete mode 100644 proxy/src/server/delivery/strategy/ReqStrategy.h delete mode 100644 proxy/src/server/delivery/strategy/SearchReqStrategy.cpp delete mode 100644 proxy/src/server/delivery/strategy/SearchReqStrategy.h delete mode 100644 proxy/src/server/grpc_impl/GrpcRequestHandler.cpp delete mode 100644 proxy/src/server/grpc_impl/GrpcRequestHandler.h delete mode 100644 proxy/src/server/grpc_impl/GrpcServer.cpp delete mode 100644 proxy/src/server/grpc_impl/GrpcServer.h delete mode 100644 proxy/src/server/grpc_impl/interceptor/GrpcInterceptorHookHandler.cpp delete mode 100644 proxy/src/server/grpc_impl/interceptor/GrpcInterceptorHookHandler.h delete mode 100644 proxy/src/server/grpc_impl/interceptor/SpanInterceptor.cpp delete mode 100644 proxy/src/server/grpc_impl/interceptor/SpanInterceptor.h delete mode 100644 proxy/src/server/init/CpuChecker.cpp delete mode 100644 proxy/src/server/init/CpuChecker.h delete mode 100644 proxy/src/server/init/Directory.cpp delete mode 100644 proxy/src/server/init/Directory.h delete mode 100644 proxy/src/server/init/InstanceLockCheck.cpp delete mode 100644 proxy/src/server/init/InstanceLockCheck.h delete mode 100644 proxy/src/server/init/StorageChecker.cpp delete mode 100644 proxy/src/server/init/StorageChecker.h delete mode 100644 proxy/src/server/timesync/TimeSync.cpp delete mode 100644 proxy/src/server/timesync/TimeSync.h delete mode 100644 proxy/src/server/tso/TSO.cpp delete mode 100644 proxy/src/server/tso/TSO.h delete mode 100644 proxy/src/tracing/CMakeLists.txt delete mode 100644 proxy/src/tracing/TextMapCarrier.cpp delete mode 100644 proxy/src/tracing/TextMapCarrier.h delete mode 100644 proxy/src/tracing/TraceContext.cpp delete mode 100644 proxy/src/tracing/TraceContext.h delete mode 100644 proxy/src/tracing/TracerUtil.cpp delete mode 100644 proxy/src/tracing/TracerUtil.h delete mode 100644 proxy/src/utils/BlockingQueue.h delete mode 100644 proxy/src/utils/CMakeLists.txt delete mode 100644 proxy/src/utils/CommonUtil.cpp delete mode 100644 proxy/src/utils/CommonUtil.h delete mode 100644 proxy/src/utils/ConfigUtils.cpp delete mode 100644 proxy/src/utils/ConfigUtils.h delete mode 100644 proxy/src/utils/Error.h delete mode 100644 proxy/src/utils/Exception.h delete mode 100644 proxy/src/utils/Json.h delete mode 100644 proxy/src/utils/Log.h delete mode 100644 proxy/src/utils/SignalHandler.cpp delete mode 100644 proxy/src/utils/SignalHandler.h delete mode 100644 proxy/src/utils/Status.cpp delete mode 100644 proxy/src/utils/Status.h delete mode 100644 proxy/src/utils/StringHelpFunctions.cpp delete mode 100644 proxy/src/utils/StringHelpFunctions.h delete mode 100644 proxy/src/utils/ThreadPool.h delete mode 100644 proxy/src/utils/TimeRecorder.cpp delete mode 100644 proxy/src/utils/TimeRecorder.h delete mode 100644 proxy/src/version.h delete mode 100644 proxy/src/version.h.in delete mode 100644 proxy/thirdparty/CMakeLists.txt delete mode 100644 proxy/thirdparty/avro/CMakeLists.txt delete mode 100644 proxy/thirdparty/easyloggingpp/easylogging++.cc delete mode 100644 proxy/thirdparty/easyloggingpp/easylogging++.h delete mode 100644 proxy/thirdparty/grpc/CMakeLists.txt delete mode 100644 proxy/thirdparty/gtest/CMakeLists.txt delete mode 100644 proxy/thirdparty/nlohmann/json.hpp delete mode 100644 proxy/thirdparty/opentracing/CMakeLists.txt delete mode 100644 proxy/thirdparty/pulsar/CMakeLists delete mode 100644 proxy/thirdparty/pulsar/CMakeLists.txt delete mode 100644 proxy/thirdparty/versions.txt delete mode 100644 proxy/thirdparty/yaml-cpp/CMakeLists.txt delete mode 100644 proxy/unittest/CMakeLists.txt delete mode 100644 proxy/unittest/config/CMakeLists.txt delete mode 100644 proxy/unittest/config/ConfigTypeTest1.cpp delete mode 100644 proxy/unittest/config/ConfigTypeTest2.cpp delete mode 100644 proxy/unittest/config/ServerConfigTest.cpp delete mode 100644 proxy/unittest/main.cpp delete mode 100644 proxy/unittest/message_client/CMakeLists.txt delete mode 100644 proxy/unittest/message_client/consumer_test.cpp delete mode 100644 proxy/unittest/message_client/get_result_test.cpp delete mode 100644 proxy/unittest/message_client/producer_test.cpp delete mode 100644 proxy/unittest/message_client/test_pulsar.cpp delete mode 100644 proxy/unittest/message_client/unittest_entry.cpp delete mode 100644 reader/main.go delete mode 100644 reader/message_client/message_client.go delete mode 100644 reader/read_node/reader_test.go delete mode 100644 sdk/CMakeLists.txt delete mode 100644 sdk/build-support/code_style_clion.xml delete mode 100755 sdk/build-support/cpplint.py delete mode 100644 sdk/build-support/ignore_checks.txt delete mode 100644 sdk/build-support/lint_exclusions.txt delete mode 100755 sdk/build-support/lintutils.py delete mode 100755 sdk/build-support/run_clang_format.py delete mode 100755 sdk/build-support/run_clang_tidy.py delete mode 100755 sdk/build-support/run_cpplint.py delete mode 100644 sdk/cmake/BuildUtils.cmake delete mode 100644 sdk/cmake/DefineOptions.cmake delete mode 100644 sdk/cmake/FindClangTools.cmake delete mode 100644 sdk/cmake/FindGTest.cmake delete mode 100644 sdk/cmake/ThirdPartyPackages.cmake delete mode 100644 sdk/examples/CMakeLists.txt delete mode 100644 sdk/examples/common/TestParameter.h delete mode 100644 sdk/examples/simple/CMakeLists.txt delete mode 100644 sdk/examples/simple/CountCollection.cpp delete mode 100644 sdk/examples/simple/CreateCollection.cpp delete mode 100644 sdk/examples/simple/CreateIndex.cpp delete mode 100644 sdk/examples/simple/delete.cpp delete mode 100644 sdk/examples/simple/insert.cpp delete mode 100644 sdk/examples/simple/search.cpp delete mode 100644 sdk/grpc-gen/message.grpc.pb.cc delete mode 100644 sdk/grpc-gen/message.grpc.pb.h delete mode 100644 sdk/grpc-gen/message.pb.cc delete mode 100644 sdk/grpc-gen/message.pb.h delete mode 100644 sdk/grpc/ClientProxy.cpp delete mode 100644 sdk/grpc/ClientProxy.h delete mode 100644 sdk/grpc/GrpcClient.cpp delete mode 100644 sdk/grpc/GrpcClient.h delete mode 100644 sdk/include/BooleanQuery.h delete mode 100644 sdk/include/Field.h delete mode 100644 sdk/include/GeneralQuery.h delete mode 100644 sdk/include/MilvusApi.h delete mode 100644 sdk/include/Status.h delete mode 100644 sdk/interface/ConnectionImpl.cpp delete mode 100644 sdk/interface/ConnectionImpl.h delete mode 100644 sdk/interface/Status.cpp delete mode 100644 sdk/thirdparty/nlohmann/json.hpp delete mode 100644 sdk/unittest/CMakeLists.txt delete mode 100644 sdk/unittest/unittest_entry.cpp delete mode 100644 sdk/utils/ThreadPool.h delete mode 100644 sdk/utils/TimeRecorder.cpp delete mode 100644 sdk/utils/TimeRecorder.h delete mode 100644 sdk/utils/Utils.cpp delete mode 100644 sdk/utils/Utils.h delete mode 100644 storage/pkg/storage_test.go rename {writer/test => test}/insert_test.go (81%) rename {writer/test => test}/key2seg_test.go (85%) delete mode 100644 util/grpcutil/grpcutil.go delete mode 100644 util/logutil/log.go delete mode 100644 util/logutil/log_test.go delete mode 100644 util/tsoutil/tso.go delete mode 100644 util/typeutil/comparison.go delete mode 100644 util/typeutil/comparison_test.go delete mode 100644 util/typeutil/convension.go delete mode 100644 util/typeutil/duration.go delete mode 100644 util/typeutil/duration_test.go delete mode 100644 util/typeutil/size.go delete mode 100644 util/typeutil/size_test.go delete mode 100644 util/typeutil/string_slice.go delete mode 100644 util/typeutil/string_slice_test.go delete mode 100644 util/typeutil/time.go delete mode 100644 util/typeutil/time_test.go delete mode 100644 writer/message_client/message_client.go delete mode 100644 writer/mock/mock.go delete mode 100644 writer/write_node/writer_node.go diff --git a/.github/workflows-bk/main.yaml b/.github/workflows-bk/main.yaml new file mode 100644 index 0000000000..e60f3e2624 --- /dev/null +++ b/.github/workflows-bk/main.yaml @@ -0,0 +1,58 @@ +name: Build and test +# TODO: do not trigger action for some document file update +on: [push, pull_request] + +jobs: + ubuntu: + name: AMD64 ubuntu-18.04 + runs-on: ubuntu-18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install Dependency + run: | + ./ci/scripts/install_deps.sh + go get github.com/golang/protobuf/protoc-gen-go@v1.3.2 + - name: Cache Proxy Thirdparty + id: cache-proxy + uses: actions/cache@v2 + with: + path: | + ./proxy/cmake_build + key: ${{ runner.os }}-proxy-thirdparty + - name: Cache Core Thirdparty + id: cache-core + uses: actions/cache@v2 + with: + path: | + ./core/cmake_build + key: ${{ runner.os }}-core-thirdparty + - name: Cache SDK Thirdparty + id: cache-sdk + uses: actions/cache@v2 + with: + path: | + ./sdk/cmake_build + key: ${{ runner.os }}-sdk-thirdparty + - name: Build Cpp + run: | + ./ci/scripts/proxy_build.sh -u + ./ci/scripts/core_build.sh -u + ./ci/scripts/sdk_build.sh -u + - name: Generat Proto GO File + run: | + echo `pwd` + export PATH=$PATH:$(go env GOPATH)/bin + export protoc=./proxy/cmake_build/thirdparty/grpc/grpc-build/third_party/protobuf/protoc-3.9.0.0 + ./ci/scripts/proto_gen_go.sh + - name: Build GO + run: | + go build -o ./cmd/writer ./writer/main.go + go build -o ./cmd/reader ./reader/main.go + go build -o ./cmd/master ./cmd/master.go + - name: Docker Pull And Run + run: | + docker-compose up -d + - name: Run Unittest + run: | + ./ci/scripts/run_unittest.sh \ No newline at end of file diff --git a/.gitignore b/.gitignore index 12ed3e51e4..639d405c6b 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,8 @@ cmake_build proxy/milvus proxy/cmake_build proxy/cmake-build-debug +proxy/cmake-build-release +proxy/cmake_build_release proxy/thirdparty/grpc-src proxy/thirdparty/grpc-build proxy/milvus/* @@ -38,7 +40,7 @@ proxy-go/proxy-go sdk/cmake_build sdk/cmake-build-debug sdk/cmake-build-release - +sdk/cmake_build_release # Compiled source *.a diff --git a/Makefile b/Makefile index e8f9e3a8ae..673887c513 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,3 @@ master-proto-gen: - protoc --go_out=plugins=grpc,paths=source_relative:. pkg/master/grpc/master/master.proto - protoc --go_out=plugins=grpc,paths=source_relative:. pkg/master/grpc/message/message.proto + ${protoc} --go_out=plugins=grpc,paths=source_relative:. internal/proto/master/master.proto + ${protoc} --go_out=plugins=grpc,paths=source_relative:. internal/proto/message/message.proto diff --git a/ci/jenkins/Jenkinsfile b/ci/jenkins/Jenkinsfile new file mode 100644 index 0000000000..7bb18a5b15 --- /dev/null +++ b/ci/jenkins/Jenkinsfile @@ -0,0 +1,196 @@ +#!/usr/bin/env groovy +@Library('mpl') _ + +String cron_timezone = "TZ=Asia/Shanghai" +String cron_string = BRANCH_NAME == "master" ? "50 3 * * * " : "" + +pipeline { + agent none + triggers { + cron """${cron_timezone} + ${cron_string}""" + } + options { + timestamps() + } + parameters{ + choice choices: ['Release', 'Debug'], description: 'Build Type', name: 'BUILD_TYPE' + choice choices: ['False', 'True'], description: 'Is Manual Trigger Or Not', name: 'IS_MANUAL_TRIGGER_TYPE' + string defaultValue: 'registry.zilliz.com', description: 'DOCKER REGISTRY URL', name: 'DOKCER_REGISTRY_URL', trim: true + string defaultValue: 'ba070c98-c8cc-4f7c-b657-897715f359fc', description: 'DOCKER CREDENTIALS ID', name: 'DOCKER_CREDENTIALS_ID', trim: true + string defaultValue: 'http://192.168.1.201/artifactory/milvus', description: 'JFROG ARTFACTORY URL', name: 'JFROG_ARTFACTORY_URL', trim: true + string defaultValue: '1a527823-d2b7-44fd-834b-9844350baf14', description: 'JFROG CREDENTIALS ID', name: 'JFROG_CREDENTIALS_ID', trim: true + } + environment { + PROJECT_NAME = "milvus" + MILVUS_ROOT_PATH="/var/lib" + MILVUS_INSTALL_PREFIX="${env.MILVUS_ROOT_PATH}/${env.PROJECT_NAME}" + LOWER_BUILD_TYPE = params.BUILD_TYPE.toLowerCase() + SEMVER = "${BRANCH_NAME.contains('/') ? BRANCH_NAME.substring(BRANCH_NAME.lastIndexOf('/') + 1) : BRANCH_NAME}" + PIPELINE_NAME = "milvus-ci" + HELM_BRANCH = "0.11.0" + } + stages { + stage ('Milvus Build and Unittest') { + matrix { + axes { + axis { + name 'OS_NAME' + values 'centos7' + } + axis { + name 'CPU_ARCH' + values 'amd64' + } + axis { + name 'BINARY_VERSION' + values 'cpu' + } + } + environment { + PACKAGE_VERSION = VersionNumber([ + versionNumberString : '${SEMVER}-${BINARY_VERSION}-${OS_NAME}-${CPU_ARCH}-${LOWER_BUILD_TYPE}' + ]); + } + agent { + kubernetes { + label "${OS_NAME}-${BINARY_VERSION}-build-${SEMVER}-${env.PIPELINE_NAME}-${env.BUILD_NUMBER}" + defaultContainer 'jnlp' + customWorkspace '/home/jenkins/agent/workspace' + yamlFile "ci/jenkins/pod/milvus-${BINARY_VERSION}-version-${OS_NAME}-build-env-pod.yaml" + } + } + stages { + stage('Build and Unittest') { + steps { + container("milvus-${BINARY_VERSION}-build-env") { + MPLModule('Milvus Build') + MPLModule('Unittest') + MPLModule('Package Build') + } + } + } + } + } + } + stage ('Publish Docker Images') { + matrix { + axes { + axis { + name 'OS_NAME' + values 'centos7' + } + axis { + name 'CPU_ARCH' + values 'amd64' + } + axis { + name 'BINARY_VERSION' + values 'cpu' + } + } + environment { + PACKAGE_VERSION = VersionNumber([ + versionNumberString : '${SEMVER}-${BINARY_VERSION}-${OS_NAME}-${CPU_ARCH}-${LOWER_BUILD_TYPE}' + ]); + SOURCE_REPO = "${params.DOKCER_REGISTRY_URL}/milvus/engine" + TARGET_REPO = "${params.DOKCER_REGISTRY_URL}/milvus/engine" + SOURCE_TAG = "${CHANGE_TARGET ? CHANGE_TARGET : SEMVER}-${BINARY_VERSION}-${OS_NAME}-${LOWER_BUILD_TYPE}" + TARGET_TAG = "${SEMVER}-${BINARY_VERSION}-${OS_NAME}-${LOWER_BUILD_TYPE}" + DOCKER_BUILDKIT = 1 + } + agent { + kubernetes { + label "${OS_NAME}-${BINARY_VERSION}-publish-${SEMVER}-${env.PIPELINE_NAME}-${env.BUILD_NUMBER}" + defaultContainer 'jnlp' + yamlFile 'ci/jenkins/pod/docker-pod.yaml' + } + } + stages { + stage('Publish') { + steps { + container('publish-images') { + MPLModule('Publish') + } + } + } + } + } + } + stage ('Dev Test') { + matrix { + axes { + axis { + name 'OS_NAME' + values 'centos7' + } + + axis { + name 'CPU_ARCH' + values 'amd64' + } + + axis { + name 'BINARY_VERSION' + values 'cpu' + } + } + environment { + DOCKER_VERSION = "${SEMVER}-${BINARY_VERSION}-${OS_NAME}-${LOWER_BUILD_TYPE}" + FROMAT_SEMVER = "${env.SEMVER}".replaceAll("\\.", "-").replaceAll("_", "-") + FORMAT_OS_NAME = "${OS_NAME}".replaceAll("\\.", "-").replaceAll("_", "-") + HELM_RELEASE_NAME = "${env.PIPELINE_NAME}-${env.FROMAT_SEMVER}-${env.BUILD_NUMBER}-single-${FORMAT_OS_NAME}-${BINARY_VERSION}".toLowerCase() + SHARDS_HELM_RELEASE_NAME = "${env.PIPELINE_NAME}-${env.FROMAT_SEMVER}-${env.BUILD_NUMBER}-shards-${FORMAT_OS_NAME}-${BINARY_VERSION}".toLowerCase() + DEV_TEST_ARTIFACTS = "_artifacts/${FORMAT_OS_NAME}/${BINARY_VERSION}" + } + agent { + kubernetes { + label "${OS_NAME}-${BINARY_VERSION}-dev-test-${SEMVER}-${env.PIPELINE_NAME}-${env.BUILD_NUMBER}" + defaultContainer 'jnlp' + yamlFile 'ci/jenkins/pod/testEnvironment.yaml' + } + } + stages { + stage('Test') { + steps { + container('milvus-test-env') { + MPLModule('Single Node DevTest') + MPLModule('Mishards DevTest') + } + } + } + } + post { + cleanup { + container('milvus-test-env') { + archiveArtifacts artifacts: "${env.DEV_TEST_ARTIFACTS}/**", allowEmptyArchive: true + MPLModule('Cleanup Single Node DevTest') + MPLModule('Cleanup Mishards DevTest') + } + } + } + } + } + } + post { + unsuccessful { + script { + if (isTimeTriggeredBuild()) { + // Send an email only if the build status has changed from green/unstable to red + emailext subject: '$DEFAULT_SUBJECT', + body: '$DEFAULT_CONTENT', + recipientProviders: [ + [$class: 'DevelopersRecipientProvider'], + [$class: 'RequesterRecipientProvider'] + ], + replyTo: '$DEFAULT_REPLYTO', + to: 'dev.milvus@zilliz.com' + } + } + } + } +} + +boolean isTimeTriggeredBuild() { + return (currentBuild.getBuildCauses('hudson.triggers.TimerTrigger$TimerTriggerCause').size() != 0) ? true : false; +} diff --git a/ci/jenkins/pod/docker-pod.yaml b/ci/jenkins/pod/docker-pod.yaml new file mode 100644 index 0000000000..1f88a14f38 --- /dev/null +++ b/ci/jenkins/pod/docker-pod.yaml @@ -0,0 +1,35 @@ +apiVersion: v1 +kind: Pod +metadata: + labels: + app: publish + componet: docker +spec: + containers: + - name: publish-images + image: registry.zilliz.com/library/docker:v1.1.0 + imagePullPolicy: Always + securityContext: + privileged: true + command: + - cat + tty: true + resources: + limits: + memory: "8Gi" + cpu: "2" + requests: + memory: "2Gi" + cpu: "1" + volumeMounts: + - name: docker-sock + mountPath: /var/run/docker.sock + volumes: + - name: docker-sock + hostPath: + path: /var/run/docker.sock + tolerations: + - key: dedicated + operator: Equal + value: milvus + effect: NoSchedule diff --git a/ci/jenkins/pod/milvus-cpu-version-ubuntu18.04-build-env-pod.yaml b/ci/jenkins/pod/milvus-cpu-version-ubuntu18.04-build-env-pod.yaml new file mode 100644 index 0000000000..20a5c01a64 --- /dev/null +++ b/ci/jenkins/pod/milvus-cpu-version-ubuntu18.04-build-env-pod.yaml @@ -0,0 +1,35 @@ +apiVersion: v1 +kind: Pod +metadata: + name: milvus-cpu-build-env + labels: + app: milvus + componet: cpu-build-env +spec: + containers: + - name: milvus-cpu-build-env + image: registry.zilliz.com/milvus/milvus-cpu-build-env:v0.10.2-ubuntu18.04 + env: + - name: POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: OS_NAME + value: "ubuntu18.04" + - name: BUILD_ENV_IMAGE_ID + value: "4e30ebe398d1a10150c625e52f44d5426c71a557afbb3f16ee9cea20e52e1b9d" + command: + - cat + tty: true + resources: + limits: + memory: "14Gi" + cpu: "6.0" + requests: + memory: "8Gi" + cpu: "4.0" + tolerations: + - key: dedicated + operator: Equal + value: milvus + effect: NoSchedule diff --git a/ci/jenkins/pod/testEnvironment.yaml b/ci/jenkins/pod/testEnvironment.yaml new file mode 100644 index 0000000000..ff79299cbb --- /dev/null +++ b/ci/jenkins/pod/testEnvironment.yaml @@ -0,0 +1,33 @@ +apiVersion: v1 +kind: Pod +metadata: + labels: + app: milvus + componet: test-env +spec: + containers: + - name: milvus-test-env + image: registry.zilliz.com/milvus/milvus-test-env:v0.2 + command: + - cat + tty: true + resources: + limits: + memory: "8Gi" + cpu: "4.0" + requests: + memory: "4Gi" + cpu: "2.0" + volumeMounts: + - name: kubeconf + mountPath: /root/.kube/ + readOnly: true + volumes: + - name: kubeconf + secret: + secretName: test-cluster-config + tolerations: + - key: dedicated + operator: Equal + value: milvus + effect: NoSchedule diff --git a/ci/scripts/before-install.sh b/ci/scripts/before-install.sh new file mode 100755 index 0000000000..e767de26c9 --- /dev/null +++ b/ci/scripts/before-install.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -ex + +export CCACHE_COMPRESS=1 +export CCACHE_COMPRESSLEVEL=5 +export CCACHE_COMPILERCHECK=content +export PATH=/usr/lib/ccache/:$PATH +export CCACHE_BASEDIR=${WORKSPACE:=""} +export CCACHE_DIR=${CCACHE_DIR:="${HOME}/.ccache"} +export CCACHE_COMPRESS_PACKAGE_FILE=${CCACHE_COMPRESS_PACKAGE_FILE:="ccache-${OS_NAME}-${BUILD_ENV_IMAGE_ID}.tar.gz"} +export CUSTOM_THIRDPARTY_DOWNLOAD_PATH=${CUSTOM_THIRDPARTY_DOWNLOAD_PATH:="${HOME}/3rdparty_download"} +export THIRDPARTY_COMPRESS_PACKAGE_FILE=${THIRDPARTY_COMPRESS_PACKAGE_FILE:="thirdparty-download.tar.gz"} + +set +ex diff --git a/ci/scripts/check_cache.sh b/ci/scripts/check_cache.sh new file mode 100755 index 0000000000..d675181745 --- /dev/null +++ b/ci/scripts/check_cache.sh @@ -0,0 +1,114 @@ +#!/bin/bash + +HELP=" +Usage: + $0 [flags] [Arguments] + + -l [ARTIFACTORY_URL] Artifactory URL + --cache_dir=[CACHE_DIR] Cache directory + -f [FILE] or --file=[FILE] Cache compress package file + -h or --help Print help information + + +Use \"$0 --help\" for more information about a given command. +" + +ARGS=$(getopt -o "l:f:h" -l "cache_dir::,file::,help" -n "$0" -- "$@") + +eval set -- "${ARGS}" + +while true ; do + case "$1" in + -l) + # o has an optional argument. As we are in quoted mode, + # an empty parameter will be generated if its optional + # argument is not found. + case "$2" in + "") echo "Option Artifactory URL, no argument"; exit 1 ;; + *) ARTIFACTORY_URL=$2 ; shift 2 ;; + esac ;; + --cache_dir) + case "$2" in + "") echo "Option cache_dir, no argument"; exit 1 ;; + *) CACHE_DIR=$2 ; shift 2 ;; + esac ;; + -f|--file) + case "$2" in + "") echo "Option file, no argument"; exit 1 ;; + *) PACKAGE_FILE=$2 ; shift 2 ;; + esac ;; + -h|--help) echo -e "${HELP}" ; exit 0 ;; + --) shift ; break ;; + *) echo "Internal error!" ; exit 1 ;; + esac +done + +# Set defaults for vars modified by flags to this script +BRANCH_NAMES=$(git log --decorate | head -n 1 | sed 's/.*(\(.*\))/\1/' | sed 's=[a-zA-Z]*\/==g' | awk -F", " '{$1=""; print $0}') + +if [[ -z "${ARTIFACTORY_URL}" || "${ARTIFACTORY_URL}" == "" ]];then + echo "You have not input ARTIFACTORY_URL !" + exit 1 +fi + +if [[ -z "${CACHE_DIR}" ]]; then + echo "You have not input CACHE_DIR !" + exit 1 +fi + +if [[ -z "${PACKAGE_FILE}" ]]; then + echo "You have not input PACKAGE_FILE !" + exit 1 +fi + +function check_cache() { + BRANCH=$1 + echo "fetching ${BRANCH}/${PACKAGE_FILE}" + wget -q --spider "${ARTIFACTORY_URL}/${BRANCH}/${PACKAGE_FILE}" + return $? +} + +function download_file() { + BRANCH=$1 + wget -q "${ARTIFACTORY_URL}/${BRANCH}/${PACKAGE_FILE}" && \ + mkdir -p "${CACHE_DIR}" && \ + tar zxf "${PACKAGE_FILE}" -C "${CACHE_DIR}" && \ + rm ${PACKAGE_FILE} + return $? +} + +if [[ -n "${CHANGE_TARGET}" && "${BRANCH_NAME}" =~ "PR-" ]];then + check_cache ${CHANGE_TARGET} + if [[ $? == 0 ]];then + download_file ${CHANGE_TARGET} + if [[ $? == 0 ]];then + echo "found cache" + exit 0 + fi + fi + + check_cache ${BRANCH_NAME} + if [[ $? == 0 ]];then + download_file ${BRANCH_NAME} + if [[ $? == 0 ]];then + echo "found cache" + exit 0 + fi + fi +fi + +for CURRENT_BRANCH in ${BRANCH_NAMES} +do + if [[ "${CURRENT_BRANCH}" != "HEAD" ]];then + check_cache ${CURRENT_BRANCH} + if [[ $? == 0 ]];then + download_file ${CURRENT_BRANCH} + if [[ $? == 0 ]];then + echo "found cache" + exit 0 + fi + fi + fi +done + +echo "could not download cache" && exit 1 diff --git a/ci/scripts/core_build.sh b/ci/scripts/core_build.sh new file mode 100755 index 0000000000..3cf7979a05 --- /dev/null +++ b/ci/scripts/core_build.sh @@ -0,0 +1,169 @@ +#!/usr/bin/env bash + +# Compile jobs variable; Usage: $ jobs=12 ./core_build.sh ... +if [[ ! ${jobs+1} ]]; then + jobs=$(nproc) +fi + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +SCRIPTS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +CPP_SRC_DIR="${SCRIPTS_DIR}/../../core" +CPP_BUILD_DIR="${CPP_SRC_DIR}/cmake_build" + +BUILD_OUTPUT_DIR=${CPP_BUILD_DIR} +BUILD_TYPE="Release" +BUILD_UNITTEST="OFF" +INSTALL_PREFIX="${CPP_SRC_DIR}/milvus" +MAKE_CLEAN="OFF" +BUILD_COVERAGE="OFF" +DB_PATH="/tmp/milvus" +PROFILING="OFF" +RUN_CPPLINT="OFF" +CUDA_COMPILER=/usr/local/cuda/bin/nvcc +GPU_VERSION="OFF" #defaults to CPU version +WITH_PROMETHEUS="ON" +CUDA_ARCH="DEFAULT" +CUSTOM_THIRDPARTY_PATH="" + +while getopts "p:d:t:s:f:ulrcghzme" arg; do + case $arg in + f) + CUSTOM_THIRDPARTY_PATH=$OPTARG + ;; + p) + INSTALL_PREFIX=$OPTARG + ;; + d) + DB_PATH=$OPTARG + ;; + t) + BUILD_TYPE=$OPTARG # BUILD_TYPE + ;; + u) + echo "Build and run unittest cases" + BUILD_UNITTEST="ON" + ;; + l) + RUN_CPPLINT="ON" + ;; + r) + if [[ -d ${BUILD_OUTPUT_DIR} ]]; then + MAKE_CLEAN="ON" + fi + ;; + c) + BUILD_COVERAGE="ON" + ;; + z) + PROFILING="ON" + ;; + g) + GPU_VERSION="ON" + ;; + e) + WITH_PROMETHEUS="OFF" + ;; + s) + CUDA_ARCH=$OPTARG + ;; + h) # help + echo " + +parameter: +-f: custom paths of thirdparty downloaded files(default: NULL) +-p: install prefix(default: $(pwd)/milvus) +-d: db data path(default: /tmp/milvus) +-t: build type(default: Debug) +-u: building unit test options(default: OFF) +-l: run cpplint, clang-format and clang-tidy(default: OFF) +-r: remove previous build directory(default: OFF) +-c: code coverage(default: OFF) +-z: profiling(default: OFF) +-g: build GPU version(default: OFF) +-e: build without prometheus(default: OFF) +-s: build with CUDA arch(default:DEFAULT), for example '-gencode=compute_61,code=sm_61;-gencode=compute_75,code=sm_75' +-h: help + +usage: +./core_build.sh -p \${INSTALL_PREFIX} -t \${BUILD_TYPE} -s \${CUDA_ARCH} -f\${CUSTOM_THIRDPARTY_PATH} [-u] [-l] [-r] [-c] [-z] [-g] [-m] [-e] [-h] + " + exit 0 + ;; + ?) + echo "ERROR! unknown argument" + exit 1 + ;; + esac +done + +if [[ ! -d ${BUILD_OUTPUT_DIR} ]]; then + mkdir ${BUILD_OUTPUT_DIR} +fi + +pushd ${BUILD_OUTPUT_DIR} + +# remove make cache since build.sh -l use default variables +# force update the variables each time +make rebuild_cache >/dev/null 2>&1 + + +if [[ ${MAKE_CLEAN} == "ON" ]]; then + echo "Runing make clean in ${BUILD_OUTPUT_DIR} ..." + make clean + exit 0 +fi + +CMAKE_CMD="cmake \ +-DBUILD_UNIT_TEST=${BUILD_UNITTEST} \ +-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} +-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ +-DOpenBLAS_SOURCE=AUTO \ +-DCMAKE_CUDA_COMPILER=${CUDA_COMPILER} \ +-DBUILD_COVERAGE=${BUILD_COVERAGE} \ +-DMILVUS_DB_PATH=${DB_PATH} \ +-DENABLE_CPU_PROFILING=${PROFILING} \ +-DMILVUS_GPU_VERSION=${GPU_VERSION} \ +-DMILVUS_WITH_PROMETHEUS=${WITH_PROMETHEUS} \ +-DMILVUS_CUDA_ARCH=${CUDA_ARCH} \ +-DCUSTOM_THIRDPARTY_DOWNLOAD_PATH=${CUSTOM_THIRDPARTY_PATH} \ +${CPP_SRC_DIR}" +echo ${CMAKE_CMD} +${CMAKE_CMD} + + +if [[ ${RUN_CPPLINT} == "ON" ]]; then + # cpplint check + make lint + if [ $? -ne 0 ]; then + echo "ERROR! cpplint check failed" + exit 1 + fi + echo "cpplint check passed!" + + # clang-format check + make check-clang-format + if [ $? -ne 0 ]; then + echo "ERROR! clang-format check failed" + exit 1 + fi + echo "clang-format check passed!" + + # clang-tidy check + make check-clang-tidy + if [ $? -ne 0 ]; then + echo "ERROR! clang-tidy check failed" + exit 1 + fi + echo "clang-tidy check passed!" +else + # compile and build + make -j ${jobs} install || exit 1 +fi + +popd diff --git a/ci/scripts/install_deps.sh b/ci/scripts/install_deps.sh new file mode 100755 index 0000000000..27f8658668 --- /dev/null +++ b/ci/scripts/install_deps.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +sudo apt install -y g++ gcc make libssl-dev zlib1g-dev libboost-regex-dev \ +libboost-program-options-dev libboost-system-dev libboost-filesystem-dev \ +libboost-serialization-dev python3-dev libboost-python-dev libcurl4-openssl-dev gfortran libtbb-dev + diff --git a/ci/scripts/proto_gen_go.sh b/ci/scripts/proto_gen_go.sh new file mode 100755 index 0000000000..a3950cef1a --- /dev/null +++ b/ci/scripts/proto_gen_go.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +${protoc} --go_out=plugins=grpc,paths=source_relative:. pkg/master/grpc/master/master.proto +${protoc} --go_out=plugins=grpc,paths=source_relative:. pkg/master/grpc/message/message.proto \ No newline at end of file diff --git a/proxy/build.sh b/ci/scripts/proxy_build.sh similarity index 69% rename from proxy/build.sh rename to ci/scripts/proxy_build.sh index be71461c10..13626ccef6 100755 --- a/proxy/build.sh +++ b/ci/scripts/proxy_build.sh @@ -1,14 +1,26 @@ -#!/bin/bash +#!/usr/bin/env bash -# Compile jobs variable; Usage: $ jobs=12 ./build.sh ... +# Compile jobs variable; Usage: $ jobs=12 ./proxy_build.sh ... if [[ ! ${jobs+1} ]]; then jobs=$(nproc) fi -BUILD_OUTPUT_DIR="cmake_build" +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +SCRIPTS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +CPP_SRC_DIR="${SCRIPTS_DIR}/../../proxy" +CPP_BUILD_DIR="${CPP_SRC_DIR}/cmake_build" + + +BUILD_OUTPUT_DIR="${CPP_BUILD_DIR}" BUILD_TYPE="Release" BUILD_UNITTEST="OFF" -INSTALL_PREFIX=$(pwd)/milvus +INSTALL_PREFIX="${CPP_SRC_DIR}/milvus" MAKE_CLEAN="OFF" DB_PATH="/tmp/milvus" RUN_CPPLINT="OFF" @@ -40,7 +52,7 @@ while getopts "p:d:t:s:ulrcghzme" arg; do echo " parameter: --p: install prefix(default: $(pwd)/milvus) +-p: install prefix(default: ${CPP_SRC_DIR}/milvus) -d: db data path(default: /tmp/milvus) -t: build type(default: Debug) -u: building unit test options(default: OFF) @@ -49,7 +61,7 @@ parameter: -h: help usage: -./build.sh -p \${INSTALL_PREFIX} -t \${BUILD_TYPE} [-u] [-l] [-r] [-h] +./proxy_build.sh -p \${INSTALL_PREFIX} -t \${BUILD_TYPE} [-u] [-l] [-r] [-h] " exit 0 ;; @@ -64,7 +76,7 @@ if [[ ! -d ${BUILD_OUTPUT_DIR} ]]; then mkdir ${BUILD_OUTPUT_DIR} fi -cd ${BUILD_OUTPUT_DIR} +pushd ${CPP_BUILD_DIR} # remove make cache since build.sh -l use default variables # force update the variables each time @@ -77,13 +89,14 @@ if [[ ${MAKE_CLEAN} == "ON" ]]; then exit 0 fi + CMAKE_CMD="cmake \ -DBUILD_UNIT_TEST=${BUILD_UNITTEST} \ --DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} +-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ -DOpenBLAS_SOURCE=AUTO \ -DMILVUS_DB_PATH=${DB_PATH} \ -../" +${CPP_SRC_DIR}" echo ${CMAKE_CMD} ${CMAKE_CMD} @@ -116,3 +129,5 @@ else # compile and build make -j ${jobs} install || exit 1 fi + +popd diff --git a/ci/scripts/run_unittest.sh b/ci/scripts/run_unittest.sh new file mode 100755 index 0000000000..f4e73eb614 --- /dev/null +++ b/ci/scripts/run_unittest.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +SCRIPTS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +MILVUS_CORE_DIR="${SCRIPTS_DIR}/../../core" +MILVUS_PROXY_DIR="${SCRIPTS_DIR}/../../proxy" +CORE_INSTALL_PREFIX="${MILVUS_CORE_DIR}/milvus" +PROXY_INSTALL_PREFIX="${MILVUS_PROXY_DIR}/milvus" +UNITTEST_DIRS=("${CORE_INSTALL_PREFIX}/unittest" "${PROXY_INSTALL_PREFIX}/unittest") + +# Currently core will install target lib to "core/lib" +if [ -d "${MILVUS_CORE_DIR}/lib" ]; then + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${MILVUS_CORE_DIR}/lib +fi + +# run unittest +for UNITTEST_DIR in "${UNITTEST_DIRS[@]}"; do + if [ ! -d "${UNITTEST_DIR}" ]; then + echo "The unittest folder does not exist!" + exit 1 + fi + for test in `ls ${UNITTEST_DIR}`; do + echo $test " running..." + # run unittest +# ${UNITTEST_DIR}/${test} + if [ $? -ne 0 ]; then + echo ${UNITTEST_DIR}/${test} "run failed" + exit 1 + fi + done +done + +# ignore Minio,S3 unittes +MILVUS_DIR="${SCRIPTS_DIR}/../../" +echo $MILVUS_DIR +go test "${MILVUS_DIR}/storage/internal/tikv/..." "${MILVUS_DIR}/reader/..." "${MILVUS_DIR}/writer/..." "${MILVUS_DIR}/pkg/master/..." -failfast diff --git a/sdk/build.sh b/ci/scripts/sdk_build.sh similarity index 90% rename from sdk/build.sh rename to ci/scripts/sdk_build.sh index c83a53923c..243cbd180a 100755 --- a/sdk/build.sh +++ b/ci/scripts/sdk_build.sh @@ -1,9 +1,12 @@ #!/bin/bash -BUILD_OUTPUT_DIR="cmake_build" -BUILD_TYPE="Debug" +SOURCE="${BASH_SOURCE[0]}" +SCRIPTS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" +BUILD_OUTPUT_DIR=${SCRIPTS_DIR}"/../../sdk/cmake_build" +BUILD_TYPE="Release" MAKE_CLEAN="OFF" RUN_CPPLINT="OFF" +BUILD_UNITTEST="OFF" while getopts "p:d:t:f:ulrcgjhxzme" arg; do case $arg in diff --git a/ci/scripts/update_cache.sh b/ci/scripts/update_cache.sh new file mode 100755 index 0000000000..85985b741d --- /dev/null +++ b/ci/scripts/update_cache.sh @@ -0,0 +1,104 @@ +#!/bin/bash + +HELP=" +Usage: + $0 [flags] [Arguments] + + -l [ARTIFACTORY_URL] Artifactory URL + --cache_dir=[CACHE_DIR] Cache directory + -f [FILE] or --file=[FILE] Cache compress package file + -u [USERNAME] Artifactory Username + -p [PASSWORD] Artifactory Password + -h or --help Print help information + + +Use \"$0 --help\" for more information about a given command. +" + +ARGS=$(getopt -o "l:f:u:p:h" -l "cache_dir::,file::,help" -n "$0" -- "$@") + +eval set -- "${ARGS}" + +while true ; do + case "$1" in + -l) + # o has an optional argument. As we are in quoted mode, + # an empty parameter will be generated if its optional + # argument is not found. + case "$2" in + "") echo "Option Artifactory URL, no argument"; exit 1 ;; + *) ARTIFACTORY_URL=$2 ; shift 2 ;; + esac ;; + --cache_dir) + case "$2" in + "") echo "Option cache_dir, no argument"; exit 1 ;; + *) CACHE_DIR=$2 ; shift 2 ;; + esac ;; + -u) + case "$2" in + "") echo "Option Username, no argument"; exit 1 ;; + *) USERNAME=$2 ; shift 2 ;; + esac ;; + -p) + case "$2" in + "") echo "Option Password, no argument"; exit 1 ;; + *) PASSWORD=$2 ; shift 2 ;; + esac ;; + -f|--file) + case "$2" in + "") echo "Option file, no argument"; exit 1 ;; + *) PACKAGE_FILE=$2 ; shift 2 ;; + esac ;; + -h|--help) echo -e "${HELP}" ; exit 0 ;; + --) shift ; break ;; + *) echo "Internal error!" ; exit 1 ;; + esac +done + +# Set defaults for vars modified by flags to this script +BRANCH_NAME=$(git log --decorate | head -n 1 | sed 's/.*(\(.*\))/\1/' | sed 's/.*, //' | sed 's=[a-zA-Z]*\/==g') + +if [[ -z "${ARTIFACTORY_URL}" || "${ARTIFACTORY_URL}" == "" ]];then + echo "You have not input ARTIFACTORY_URL !" + exit 1 +fi + +if [[ ! -d "${CACHE_DIR}" ]]; then + echo "\"${CACHE_DIR}\" directory does not exist !" + exit 1 +fi + +if [[ -z "${PACKAGE_FILE}" ]]; then + echo "You have not input PACKAGE_FILE !" + exit 1 +fi + +function check_cache() { + BRANCH=$1 + wget -q --spider "${ARTIFACTORY_URL}/${BRANCH}/${PACKAGE_FILE}" + return $? +} + +if [[ -n "${CHANGE_TARGET}" && "${BRANCH_NAME}" =~ "PR-" ]]; then + check_cache ${CHANGE_TARGET} + if [[ $? == 0 ]];then + echo "Skip Update cache package ..." && exit 0 + fi +fi + +if [[ "${BRANCH_NAME}" != "HEAD" ]];then + REMOTE_PACKAGE_PATH="${ARTIFACTORY_URL}/${BRANCH_NAME}" + echo "Updating cache package file: ${PACKAGE_FILE}" + tar zcf ./"${PACKAGE_FILE}" -C "${CACHE_DIR}" . + echo "Uploading cache package file ${PACKAGE_FILE} to ${REMOTE_PACKAGE_PATH}" + curl -u"${USERNAME}":"${PASSWORD}" -T "${PACKAGE_FILE}" "${REMOTE_PACKAGE_PATH}"/"${PACKAGE_FILE}" + if [[ $? == 0 ]];then + echo "Uploading cache package file success !" + exit 0 + else + echo "Uploading cache package file fault !" + exit 1 + fi +fi + +echo "Skip Update cache package ..." diff --git a/cmd/master.go b/cmd/master/master.go similarity index 57% rename from cmd/master.go rename to cmd/master/master.go index ebfaee66ac..8dac1e8839 100644 --- a/cmd/master.go +++ b/cmd/master/master.go @@ -1,6 +1,11 @@ package main -import "github.com/czs007/suvlim/pkg/master" +import ( + "flag" + "fmt" + "github.com/czs007/suvlim/internal/conf" + "github.com/czs007/suvlim/internal/master" +) // func main() { // ctx, cancel := context.WithCancel(context.Background()) @@ -20,6 +25,13 @@ func init() { // go mock.FakePulsarProducer() } func main() { + var yamlFile string + flag.StringVar(&yamlFile, "yaml", "", "yaml file") + flag.Parse() + // flag.Usage() + fmt.Println("yaml file: ", yamlFile) + conf.LoadConfig(yamlFile) + master.Run() //master.SegmentStatsController() //master.CollectionController() diff --git a/proxy-go/main.go b/cmd/proxy/proxy.go similarity index 84% rename from proxy-go/main.go rename to cmd/proxy/proxy.go index 13714c7068..beb20259d9 100644 --- a/proxy-go/main.go +++ b/cmd/proxy/proxy.go @@ -1,7 +1,7 @@ package main import ( - proxy "github.com/czs007/suvlim/proxy-go/proxy_node" + "github.com/czs007/suvlim/internal/proxy" "log" ) diff --git a/cmd/reader.go b/cmd/reader.go deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cmd/reader/reader.go b/cmd/reader/reader.go new file mode 100644 index 0000000000..c0c779a93d --- /dev/null +++ b/cmd/reader/reader.go @@ -0,0 +1,28 @@ +package main + +import ( + "context" + "flag" + "fmt" + "github.com/czs007/suvlim/internal/conf" + "github.com/czs007/suvlim/internal/reader" + "strconv" +) + +func main() { + ctx, _ := context.WithCancel(context.Background()) + + var yamlFile string + flag.StringVar(&yamlFile, "yaml", "", "yaml file") + flag.Parse() + // flag.Usage() + fmt.Println("yaml file: ", yamlFile) + conf.LoadConfig(yamlFile) + + pulsarAddr := "pulsar://" + pulsarAddr += conf.Config.Pulsar.Address + pulsarAddr += ":" + pulsarAddr += strconv.FormatInt(int64(conf.Config.Pulsar.Port), 10) + reader.StartQueryNode(ctx, pulsarAddr) +} + diff --git a/storage/benchmark/benchmark.go b/cmd/storage/benchmark.go similarity index 92% rename from storage/benchmark/benchmark.go rename to cmd/storage/benchmark.go index bddb0dda53..2e509e5973 100644 --- a/storage/benchmark/benchmark.go +++ b/cmd/storage/benchmark.go @@ -5,10 +5,8 @@ import ( "crypto/md5" "flag" "fmt" - s3 "github.com/czs007/suvlim/storage/internal/S3" - minio "github.com/czs007/suvlim/storage/internal/minio" - tikv "github.com/czs007/suvlim/storage/internal/tikv" - "github.com/czs007/suvlim/storage/pkg/types" + "github.com/czs007/suvlim/internal/storage" + "github.com/czs007/suvlim/internal/storage/type" "github.com/pivotal-golang/bytefmt" "log" "math/rand" @@ -30,7 +28,7 @@ var totalKeys [][]byte var logFileName = "benchmark.log" var logFile *os.File -var store types.Store +var store storagetype.Store var wg sync.WaitGroup @@ -191,25 +189,9 @@ func main() { if valueSize, err = bytefmt.ToBytes(sizeArg); err != nil { log.Fatalf("Invalid -z argument for object size: %v", err) } - switch storeType { - case "minio": - store, err = minio.NewMinioDriver(context.Background()) - if err != nil { - log.Fatalf("Error when creating storage " + err.Error()) - } - case "tikv": - store, err = tikv.NewTikvStore(context.Background()) - if err != nil { - log.Fatalf("Error when creating storage " + err.Error()) - } - case "s3": - store, err = s3.NewS3Driver(context.Background()) - if err != nil { - log.Fatalf("Error when creating storage " + err.Error()) - } - - default: - log.Fatalf("Not supported storage type") + store, err = storage.NewStore(context.Background(), storeType) + if err != nil { + log.Fatalf("Error when creating storage " + err.Error()) } logFile, err = os.OpenFile(logFileName, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0777) if err != nil { diff --git a/cmd/storage/tikv_benchmark.go b/cmd/storage/tikv_benchmark.go deleted file mode 100644 index 7199ce1d4c..0000000000 --- a/cmd/storage/tikv_benchmark.go +++ /dev/null @@ -1,208 +0,0 @@ -// s3-benchmark.go -// Copyright (c) 2017 Wasabi Technology, Inc. - -package main - -import ( - "github.com/czs007/suvlim/storage/pkg" - . "github.com/czs007/suvlim/storage/pkg/types" - "crypto/md5" - "flag" - "fmt" - "code.cloudfoundry.org/bytefmt" - "github.com/tikv/client-go/config" - "github.com/tikv/client-go/rawkv" - "log" - "math/rand" - "net/http" - "os" - "sync" - "sync/atomic" - "time" - "context" -) - -// Global variables -var duration_secs, threads, batchOpSize int -var object_size uint64 -var object_data []byte -var running_threads, upload_count, upload_slowdown_count int32 -var endtime, upload_finish time.Time -var store Store -var err error -var keys [][]byte -var objects_data [][]byte -var segments []string -var timestamps []uint64 -var wg sync.WaitGroup -var client *rawkv.Client - -func logit(msg string) { - fmt.Println(msg) - logfile, _ := os.OpenFile("benchmark.log", os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666) - if logfile != nil { - logfile.WriteString(time.Now().Format(http.TimeFormat) + ": " + msg + "\n") - logfile.Close() - } -} - -func _putFile(ctx context.Context, store Store){ - atomic.AddInt32(&upload_count, 1) - key := "collection_abc" - err := store.PutRow(ctx, []byte(key), object_data, "abc", uint64(time.Now().Unix())) - if err != nil { - atomic.AddInt32(&upload_slowdown_count, 1) - } - -} - -func _putFiles(ctx context.Context, store Store){ - atomic.AddInt32(&upload_count, 1) - - err = client.BatchPut(ctx, keys, objects_data) - //err := store.PutRows(ctx, keys, objects_data, segments, timestamps) - if err != nil { - atomic.AddInt32(&upload_slowdown_count, 1) - } - //wg.Done() -} - -func runPutFiles(thread_num int) { - //var store Store - //var err error - ctx := context.Background() - //store, err = storage.NewStore(ctx, TIKVDriver) - //if err != nil { - // panic(err.Error()) - //} - - for time.Now().Before(endtime) { - _putFiles(ctx, store) - } - - // Remember last done time - upload_finish = time.Now() - // One less thread - atomic.AddInt32(&running_threads, -1) - wg.Done() -} - -func runPutFile(thread_num int) { - var store Store - var err error - ctx := context.Background() - store, err = storage.NewStore(ctx, TIKVDriver) - if err != nil { - panic(err.Error()) - } - - for time.Now().Before(endtime) { - _putFile(ctx, store) - } - - // Remember last done time - upload_finish = time.Now() - // One less thread - atomic.AddInt32(&running_threads, -1) -} - -func main() { - // Hello - - // Parse command line - myflag := flag.NewFlagSet("myflag", flag.ExitOnError) - myflag.IntVar(&duration_secs, "d", 10, "Duration of each test in seconds") - myflag.IntVar(&threads, "t", 50, "Number of threads to run") - myflag.IntVar(&batchOpSize, "b", 1000, "Batch operation kv pair number") - - var sizeArg string - myflag.StringVar(&sizeArg, "z", "1M", "Size of objects in bytes with postfix K, M, and G") - if err := myflag.Parse(os.Args[1:]); err != nil { - os.Exit(1) - } - - // Check the arguments - var err error - if object_size, err = bytefmt.ToBytes(sizeArg); err != nil { - log.Fatalf("Invalid -z argument for object size: %v", err) - } - - logit(fmt.Sprintf("Parameters: duration=%d, threads=%d, size=%s", - duration_secs, threads, sizeArg)) - - pdAddrs := []string{"127.0.0.1:2379"} - conf := config.Default() - ctx := context.Background() - - client, err = rawkv.NewClient(ctx, pdAddrs, conf) - - - - // Initialize data for the bucket - object_data = make([]byte, object_size) - rand.Read(object_data) - hasher := md5.New() - hasher.Write(object_data) - - // reset counters - upload_count = 0 - upload_slowdown_count = 0 - - running_threads = int32(threads) - - // Run the upload case - //starttime := time.Now() - //endtime = starttime.Add(time.Second * time.Duration(duration_secs)) - // - //for n := 1; n <= threads; n++ { - // go runPutFile(n) - //} - // - //// Wait for it to finish - //for atomic.LoadInt32(&running_threads) > 0 { - // time.Sleep(time.Millisecond) - //} - //upload_time := upload_finish.Sub(starttime).Seconds() - // - //bps := float64(uint64(upload_count)*object_size) / upload_time - //logit(fmt.Sprintf("PUT time %.1f secs, objects = %d, speed = %sB/sec, %.1f operations/sec. Slowdowns = %d", - // upload_time, upload_count, bytefmt.ByteSize(uint64(bps)), float64(upload_count)/upload_time, upload_slowdown_count)) - // - //fmt.Println(" upload_count :", upload_count) - - // Run the batchput case - - keys = make([][]byte, batchOpSize) - objects_data = make([][]byte, batchOpSize) - segments = make([]string, batchOpSize) - timestamps = make([]uint64, batchOpSize) - - for n := batchOpSize; n > 0; n-- { - keys[n-1] = []byte("collection_abc") - objects_data[n-1] = object_data - segments[n-1] = "abc" - timestamps[n-1] = uint64(time.Now().Unix()) - } - - starttime := time.Now() - endtime = starttime.Add(time.Second * time.Duration(duration_secs)) - - for n := 1; n <= threads; n++ { - wg.Add(1) - go runPutFiles(n) - } - - wg.Wait() - // Wait for it to finish - for atomic.LoadInt32(&running_threads) > 0 { - time.Sleep(time.Millisecond) - } - upload_time := upload_finish.Sub(starttime).Seconds() - - bps := float64(uint64(upload_count)*object_size*uint64(batchOpSize)) / upload_time - logit(fmt.Sprintf("PUT time %.1f secs, objects = %d, speed = %sB/sec, %.1f operations/sec. Slowdowns = %d", - upload_time, upload_count*int32(batchOpSize), bytefmt.ByteSize(uint64(bps)), float64(upload_count)/upload_time, upload_slowdown_count)) - - fmt.Println(" upload_count :", upload_count) - -} diff --git a/cmd/storage/tikv_example.go b/cmd/storage/tikv_example.go deleted file mode 100644 index a574380578..0000000000 --- a/cmd/storage/tikv_example.go +++ /dev/null @@ -1,69 +0,0 @@ -package main - -import ( - "context" - "fmt" - "math" - "storage/pkg" - . "storage/pkg/types" -) - -func main() { - // Create a tikv based storage - var store Store - var err error - ctx := context.Background() - store, err = storage.NewStore(ctx, TIKVDriver) - if err != nil { - panic(err.Error()) - } - - // Set some key-value pair with different timestamp - key := Key("key") - store.Set(ctx, key, Value("value_1"), 1) - store.Set(ctx, key, Value("value_2"), 2) - store.Set(ctx, key, Value("value_3"), 3) - store.Set(ctx, key, Value("value_4"), 4) - - search := func(key Key, timestamp uint64) { - v, err := store.Get(ctx, key, timestamp) - if err != nil { - panic(err.Error()) - } - fmt.Printf("Get result for key: %s, version:%d, value:%s \n", key, timestamp, v) - } - - search(key, 0) - search(key, 3) - search(key, 10) - - // Batch set key-value pairs with same timestamp - keys := []Key{Key("key"), Key("key1")} - values := []Value{Value("value_5"), Value("value1_5")} - store.BatchSet(ctx, keys, values, 5) - - batchSearch := func(keys []Key, timestamp uint64) { - vs, err := store.BatchGet(ctx, keys, timestamp) - if err != nil { - panic(err.Error()) - } - for i, v := range vs { - fmt.Printf("Get result for key: %s, version:%d, value:%s \n", keys[i], timestamp, v) - } - } - - // Batch get keys - keys = []Key{Key("key"), Key("key1")} - batchSearch(keys, 5) - - //Delete outdated key-value pairs for a key - store.Set(ctx, key, Value("value_6"), 6) - store.Set(ctx, key, Value("value_7"), 7) - err = store.Delete(ctx, key, 5) - search(key, 5) - - // use BatchDelete all keys - keys = []Key{Key("key"), Key("key1")} - store.BatchDelete(ctx, keys , math.MaxUint64) - batchSearch(keys, math.MaxUint64) -} diff --git a/cmd/writer.go b/cmd/writer.go deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/writer/main.go b/cmd/writer/writer.go similarity index 57% rename from writer/main.go rename to cmd/writer/writer.go index f862775c8d..55908309d4 100644 --- a/writer/main.go +++ b/cmd/writer/writer.go @@ -2,29 +2,34 @@ package main import ( "context" + "flag" "fmt" - "github.com/czs007/suvlim/conf" - storage "github.com/czs007/suvlim/storage/pkg" - "github.com/czs007/suvlim/writer/message_client" - "github.com/czs007/suvlim/writer/write_node" + "github.com/czs007/suvlim/internal/conf" + "github.com/czs007/suvlim/internal/storage" + "github.com/czs007/suvlim/internal/msgclient" + "github.com/czs007/suvlim/internal/writer" "log" "strconv" - "sync" - "time" ) func main() { + var yamlFile string + flag.StringVar(&yamlFile, "yaml", "", "yaml file") + flag.Parse() + // flag.Usage() + fmt.Println("yaml file: ", yamlFile) + conf.LoadConfig(yamlFile) + pulsarAddr := "pulsar://" pulsarAddr += conf.Config.Pulsar.Address pulsarAddr += ":" pulsarAddr += strconv.FormatInt(int64(conf.Config.Pulsar.Port), 10) - mc := message_client.MessageClient{} + mc := msgclient.WriterMessageClient{} mc.InitClient(pulsarAddr) //TODO::close client / consumer/ producer mc.ReceiveMessage() - wg := sync.WaitGroup{} ctx := context.Background() kv, err := storage.NewStore(ctx, conf.Config.Storage.Driver) // TODO:: if err != nil, should retry link @@ -32,12 +37,12 @@ func main() { log.Fatal(err) } - msgCounter := write_node.MsgCounter{ + msgCounter := writer.MsgCounter{ InsertCounter: 0, DeleteCounter: 0, } - wn := write_node.WriteNode{ + wn := writer.WriteNode{ KvStore: &kv, MessageClient: &mc, TimeSync: 100, @@ -45,34 +50,25 @@ func main() { } const Debug = true - const CountMsgNum = 1000 * 1000 if Debug { - var printFlag = true - var startTime = true - var start time.Time + const CountInsertMsgBaseline = 1000 * 1000 + var BaselineCounter int64 = 0 for { if ctx.Err() != nil { break } msgLength := wn.MessageClient.PrepareBatchMsg() - if msgLength > 0 { - if startTime { - fmt.Println("============> Start Test <============") - startTime = false - start = time.Now() - } - wn.DoWriteNode(ctx, &wg) - fmt.Println("write node do a batch message, storage len: ", msgLength) + if wn.MsgCounter.InsertCounter/CountInsertMsgBaseline != BaselineCounter { + wn.WriteWriterLog() + BaselineCounter = wn.MsgCounter.InsertCounter/CountInsertMsgBaseline } - // Test insert time - if printFlag && wn.MsgCounter.InsertCounter >= CountMsgNum { - printFlag = false - timeSince := time.Since(start) - fmt.Println("============> Do", wn.MsgCounter.InsertCounter, "Insert in", timeSince, "<============") + if msgLength > 0 { + wn.DoWriteNode(ctx) + fmt.Println("write node do a batch message, storage len: ", msgLength) } } } @@ -84,7 +80,7 @@ func main() { } msgLength := wn.MessageClient.PrepareBatchMsg() if msgLength > 0 { - wn.DoWriteNode(ctx, &wg) + wn.DoWriteNode(ctx) fmt.Println("write node do a batch message, storage len: ", msgLength) } } diff --git a/conf/config.yaml b/configs/config.yaml similarity index 89% rename from conf/config.yaml rename to configs/config.yaml index 97d9418080..14acd58a61 100644 --- a/conf/config.yaml +++ b/configs/config.yaml @@ -14,7 +14,7 @@ master: port: 53100 pulsarmoniterinterval: 1 pulsartopic: "monitor-topic" - segmentthreshole: 104857600 + segmentthreshole: 1073741824 proxyidlist: [0] querynodenum: 1 writenodenum: 1 @@ -36,6 +36,9 @@ storage: secretkey: pulsar: + authentication: false + user: user-default + token: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJKb2UifQ.ipevRNuRP6HflG8cFKnmUPtypruRC4fb1DWtoLL62SY address: localhost port: 6650 topicnum: 128 @@ -54,8 +57,10 @@ writer: stopflag: -2 readerqueuesize: 10000 searchbyidchansize: 10000 + parallelism: 100 topicstart: 0 topicend: 128 + bucket: "zilliz-hz" proxy: timezone: UTC+8 diff --git a/core/src/dog_segment/EasyAssert.h b/core/src/dog_segment/EasyAssert.h deleted file mode 100644 index b60fd7e82c..0000000000 --- a/core/src/dog_segment/EasyAssert.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include - -namespace milvus::impl { -inline -void EasyAssertInfo(bool value, std::string_view expr_str, std::string_view filename, int lineno, - std::string_view extra_info) { - if (!value) { - std::string info; - info += "Assert \"" + std::string(expr_str) + "\""; - info += " at " + std::string(filename) + ":" + std::to_string(lineno); - info += " => " + std::string(extra_info); - throw std::runtime_error(info); - } -} -} - -#define AssertInfo(expr, info) impl::EasyAssertInfo(bool(expr), #expr, __FILE__, __LINE__, (info)) -#define Assert(expr) AssertInfo((expr), "") diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000..1e399d1758 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,60 @@ +version: '3.5' + +services: + etcd: + image: quay.io/coreos/etcd:latest + command: etcd -listen-peer-urls=http://127.0.0.1:12380 -advertise-client-urls=http://127.0.0.1:12379 -listen-client-urls http://0.0.0.0:12379,http://0.0.0.0:14001 -initial-advertise-peer-urls=http://127.0.0.1:12380 --initial-cluster default=http://127.0.0.1:12380 + ports: + - "12379:12379" + - "12380:12380" + - "14001:14001" + + pulsar: + image: apachepulsar/pulsar:latest + command: bin/pulsar standalone + ports: + - "6650:6650" + - "18080:8080" + + pd0: + image: pingcap/pd:latest + network_mode: "host" + ports: + - "2379:2379" + - "2380:2380" + volumes: + - /tmp/config/pd.toml:/pd.toml:ro + - /tmp/data:/data + - /tmp/logs:/logs + - /etc/localtime:/etc/localtime:ro + command: + - --name=pd0 + - --client-urls=http://0.0.0.0:2379 + - --peer-urls=http://0.0.0.0:2380 + - --advertise-client-urls=http://127.0.0.1:2379 + - --advertise-peer-urls=http://127.0.0.1:2380 + - --initial-cluster=pd0=http://127.0.0.1:2380 + - --data-dir=/data/pd0 + - --log-file=/logs/pd0.log + restart: on-failure + + tikv0: + network_mode: "host" + image: pingcap/tikv:latest + ports: + - "20160:20160" + volumes: + - /tmp/config/tikv.toml:/tikv.toml:ro + - /tmp/data:/data + - /tmp/logs:/logs + - /etc/localtime:/etc/localtime:ro + command: + - --addr=0.0.0.0:20160 + - --advertise-addr=127.0.0.1:20160 + - --data-dir=/data/tikv0 + - --pd=127.0.0.1:2379 + - --log-file=/logs/tikv0.log + depends_on: + - "pd0" + restart: on-failure + diff --git a/docker/build_env/cpu/ubuntu18.04/Dockerfile b/docker/build_env/cpu/ubuntu18.04/Dockerfile new file mode 100644 index 0000000000..87dbb37ade --- /dev/null +++ b/docker/build_env/cpu/ubuntu18.04/Dockerfile @@ -0,0 +1,57 @@ +# Copyright (C) 2019-2020 Zilliz. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under the License. + +FROM ubuntu:18.04 + +# pipefail is enabled for proper error detection in the `wget | apt-key add` +# step +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates gnupg2 && \ + wget -P /tmp https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \ + apt-key add /tmp/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \ + sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list' && \ + wget -qO- "https://cmake.org/files/v3.14/cmake-3.14.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local && \ + apt-get update && apt-get install -y --no-install-recommends \ + g++ git gfortran lsb-core \ + libboost-serialization-dev libboost-filesystem-dev libboost-system-dev libboost-regex-dev \ + curl libtool automake libssl-dev pkg-config libcurl4-openssl-dev python3-pip \ + clang-format-7 clang-tidy-7 \ + lcov mysql-client libmysqlclient-dev intel-mkl-gnu-2019.5-281 intel-mkl-core-2019.5-281 && \ + apt-get remove --purge -y && \ + rm -rf /var/lib/apt/lists/* + +RUN ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so \ + /usr/lib/x86_64-linux-gnu/libmysqlclient_r.so + +RUN sh -c 'echo export LD_LIBRARY_PATH=/opt/intel/compilers_and_libraries_2019.5.281/linux/mkl/lib/intel64:\$LD_LIBRARY_PATH > /etc/profile.d/mkl.sh' + +RUN wget https://github.com/xianyi/OpenBLAS/archive/v0.3.9.tar.gz && \ + tar zxvf v0.3.9.tar.gz && cd OpenBLAS-0.3.9 && \ + make TARGET=CORE2 DYNAMIC_ARCH=1 DYNAMIC_OLDER=1 USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="-O3 -g -fPIC" FCOMMON_OPT="-O3 -g -fPIC -frecursive" NMAX="NUM_THREADS=128" LIBPREFIX="libopenblas" LAPACKE="NO_LAPACKE=1" INTERFACE64=0 NO_STATIC=1 && \ + make PREFIX=/usr install && \ + cd .. && rm -rf OpenBLAS-0.3.9 && rm v0.3.9.tar.gz + +RUN apt-get update && apt-get install -y --no-install-recommends ccache && \ + apt-get remove --purge -y && \ + rm -rf /var/lib/apt/lists/* + +ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib" + +# Set permissions on /etc/passwd and /home to allow arbitrary users to write +COPY --chown=0:0 docker/build_env/entrypoint.sh / +RUN mkdir -p /home/user && chgrp -R 0 /home && chmod -R g=u /etc/passwd /etc/group /home && chmod +x /entrypoint.sh + +ENV HOME=/home/user +ENTRYPOINT [ "/entrypoint.sh" ] +CMD ["tail", "-f", "/dev/null"] diff --git a/docker/build_env/entrypoint.sh b/docker/build_env/entrypoint.sh new file mode 100755 index 0000000000..c42fafedee --- /dev/null +++ b/docker/build_env/entrypoint.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +# Ensure $HOME exists when starting +if [ ! -d "${HOME}" ]; then + mkdir -p "${HOME}" +fi + +# Setup $PS1 for a consistent and reasonable prompt +if [ -w "${HOME}" ] && [ ! -f "${HOME}"/.bashrc ]; then + echo "PS1='\s-\v \w \$ '" > "${HOME}"/.bashrc + echo -e 'if [ -f /etc/bashrc ]; then\n . /etc/bashrc\nfi' >> "${HOME}"/.bashrc +fi + +# Add current (arbitrary) user to /etc/passwd and /etc/group +if ! whoami &> /dev/null; then + if [ -w /etc/passwd ]; then + echo "${USER_NAME:-user}:x:$(id -u):0:${USER_NAME:-user} user:${HOME}:/bin/bash" >> /etc/passwd + echo "${USER_NAME:-user}:x:$(id -u):" >> /etc/group + fi +fi + +exec "$@" diff --git a/docker/deploy/cpu/centos7/Dockerfile b/docker/deploy/cpu/centos7/Dockerfile new file mode 100644 index 0000000000..fe3f255128 --- /dev/null +++ b/docker/deploy/cpu/centos7/Dockerfile @@ -0,0 +1,33 @@ +# Copyright (C) 2019-2020 Zilliz. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under the License. + +FROM milvusdb/milvus-dev:amd64-centos-7-core AS openblas + +FROM centos:centos7 + +RUN yum install -y wget && \ + wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo && \ + yum clean all && yum makecache && \ + yum install -y libgomp libgfortran4 mysql-devel && \ + rm -rf /var/cache/yum/* + +COPY ./milvus /var/lib/milvus +ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/var/lib/milvus/lib" + +COPY --from=openblas /usr/lib/libopenblas-r0.3.9.so /var/lib/milvus/lib/ +RUN ln -s /var/lib/milvus/lib/libopenblas-r0.3.9.so /var/lib/milvus/lib/libopenblas.so.0 && \ + ln -s /var/lib/milvus/lib/libopenblas.so.0 /var/lib/milvus/lib/libopenblas.so + +WORKDIR /var/lib/milvus + +CMD [ "/var/lib/milvus/bin/milvus_server", "-c", "/var/lib/milvus/conf/milvus.yaml" ] + +EXPOSE 19530 diff --git a/docker/deploy/cpu/ubuntu18.04/Dockerfile b/docker/deploy/cpu/ubuntu18.04/Dockerfile new file mode 100644 index 0000000000..15a6fb97ad --- /dev/null +++ b/docker/deploy/cpu/ubuntu18.04/Dockerfile @@ -0,0 +1,35 @@ +# Copyright (C) 2019-2020 Zilliz. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under the License. + +FROM milvusdb/milvus-dev:amd64-ubuntu-18.04-core AS openblas + +FROM ubuntu:18.04 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + gfortran libsqlite3-dev libmysqlclient-dev libcurl4-openssl-dev python3 && \ + apt-get remove --purge -y && \ + rm -rf /var/lib/apt/lists/* + +RUN ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so /usr/lib/x86_64-linux-gnu/libmysqlclient_r.so + +COPY ./milvus /var/lib/milvus +ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/var/lib/milvus/lib" + +COPY --from=openblas /usr/lib/libopenblas-r0.3.9.so /var/lib/milvus/lib/ +RUN ln -s /var/lib/milvus/lib/libopenblas-r0.3.9.so /var/lib/milvus/lib/libopenblas.so.0 && \ + ln -s /var/lib/milvus/lib/libopenblas.so.0 /var/lib/milvus/lib/libopenblas.so + +WORKDIR /var/lib/milvus + +CMD [ "/var/lib/milvus/bin/milvus_server", "-c", "/var/lib/milvus/conf/milvus.yaml" ] + +EXPOSE 19530 + diff --git a/docker/deploy/docker-compose.yaml b/docker/deploy/docker-compose.yaml new file mode 100644 index 0000000000..1c8b232ac8 --- /dev/null +++ b/docker/deploy/docker-compose.yaml @@ -0,0 +1,17 @@ +version: '2.3' + +services: + cpu_centos7: + image: ${TARGET_REPO}:${TARGET_TAG} + build: + context: ./ + dockerfile: cpu/centos7/Dockerfile + cache_from: + - ${SOURCE_REPO}:${SOURCE_TAG} + cpu_ubuntu18.04: + image: ${TARGET_REPO}:${TARGET_TAG} + build: + context: ./ + dockerfile: cpu/ubuntu18.04/Dockerfile + cache_from: + - ${SOURCE_REPO}:${SOURCE_TAG} diff --git a/docker/docker-compose-monitor.yml b/docker/docker-compose-monitor.yml new file mode 100644 index 0000000000..d6b0490090 --- /dev/null +++ b/docker/docker-compose-monitor.yml @@ -0,0 +1,21 @@ +version: '2.3' + +networks: + monitor: + driver: bridge + +services: + milvus_server: + runtime: nvidia + image: milvusdb/milvus:latest + restart: always + environment: + WEB_APP: host.docker.internal + volumes: + - ../core/conf/milvus.yaml:/var/lib/milvus/conf/milvus.yaml + - ../core/conf/log_config.conf:/var/lib/milvus/conf/log_config.conf + ports: + - "8080:8080" + - "19530:19530" + networks: + - monitor diff --git a/docker/test_env/Dockerfile b/docker/test_env/Dockerfile new file mode 100644 index 0000000000..9a785fc1ef --- /dev/null +++ b/docker/test_env/Dockerfile @@ -0,0 +1,30 @@ +# Copyright (C) 2019-2020 Zilliz. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under the License. + +FROM python:3.6.8-jessie + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN apt-get update && apt-get install -y --no-install-recommends wget apt-transport-https && \ + wget -qO- "https://get.helm.sh/helm-v3.0.2-linux-amd64.tar.gz" | tar --strip-components=1 -xz -C /usr/local/bin linux-amd64/helm && \ + wget -P /tmp https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg && \ + apt-key add /tmp/apt-key.gpg && \ + sh -c 'echo deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main > /etc/apt/sources.list.d/kubernetes.list' && \ + apt-get update && apt-get install -y --no-install-recommends \ + build-essential kubectl && \ + apt-get remove --purge -y && \ + rm -rf /var/lib/apt/lists/* + +COPY docker-entrypoint.sh /app/docker-entrypoint.sh +WORKDIR /root + +ENTRYPOINT [ "/app/docker-entrypoint.sh" ] +CMD [ "start" ] diff --git a/docker/test_env/docker-entrypoint.sh b/docker/test_env/docker-entrypoint.sh new file mode 100755 index 0000000000..af9ba0ba66 --- /dev/null +++ b/docker/test_env/docker-entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +if [ "$1" = 'start' ]; then + tail -f /dev/null +fi + +exec "$@" \ No newline at end of file diff --git a/go.sum b/go.sum index 1e38198600..8f4f473af2 100644 --- a/go.sum +++ b/go.sum @@ -87,6 +87,8 @@ github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQ github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.30.8 h1:4BHbh8K3qKmcnAgToZ2LShldRF9inoqIBccpCLNCy3I= github.com/aws/aws-sdk-go v1.30.8/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.35.7 h1:FHMhVhyc/9jljgFAcGkQDYjpC9btM0B8VfkLBfctdNE= +github.com/aws/aws-sdk-go v1.35.7/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/beefsack/go-rate v0.0.0-20180408011153-efa7637bb9b6/go.mod h1:6YNgTHLutezwnBvyneBbwvB8C82y3dcoOj5EQJIdGXA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= @@ -318,6 +320,9 @@ github.com/jawher/mow.cli v1.2.0/go.mod h1:y+pcA3jBAdo/GIZx/0rFjw/K2bVEODP9rfZOf github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= diff --git a/conf/conf.go b/internal/conf/conf.go similarity index 82% rename from conf/conf.go rename to internal/conf/conf.go index 368885e123..c301bcaf22 100644 --- a/conf/conf.go +++ b/internal/conf/conf.go @@ -5,7 +5,7 @@ import ( "path" "runtime" - "github.com/czs007/suvlim/storage/pkg/types" + storagetype "github.com/czs007/suvlim/internal/storage/type" yaml "gopkg.in/yaml.v2" ) @@ -34,7 +34,7 @@ type TimeSyncConfig struct { } type StorageConfig struct { - Driver types.DriverType + Driver storagetype.DriverType Address string Port int32 Accesskey string @@ -42,9 +42,12 @@ type StorageConfig struct { } type PulsarConfig struct { - Address string - Port int32 - TopicNum int + Authentication bool + User string + Token string + Address string + Port int32 + TopicNum int } type ProxyConfig struct { @@ -94,8 +97,10 @@ type Writer struct { StopFlag int64 ReaderQueueSize int SearchByIdChanSize int + Parallelism int TopicStart int TopicEnd int + Bucket string } type ServerConfig struct { @@ -111,9 +116,9 @@ type ServerConfig struct { var Config ServerConfig -func init() { - load_config() -} +// func init() { +// load_config() +// } func getCurrentFileDir() string { _, fpath, _, _ := runtime.Caller(0) @@ -132,3 +137,16 @@ func load_config() { } //fmt.Printf("Result: %v\n", Config) } + +func LoadConfig(yamlFile string) { + filePath := path.Join(getCurrentFileDir(), yamlFile) + source, err := ioutil.ReadFile(filePath) + if err != nil { + panic(err) + } + err = yaml.Unmarshal(source, &Config) + if err != nil { + panic(err) + } + //fmt.Printf("Result: %v\n", Config) +} diff --git a/conf/conf_test.go b/internal/conf/conf_test.go similarity index 100% rename from conf/conf_test.go rename to internal/conf/conf_test.go diff --git a/core/CMakeLists.txt b/internal/core/CMakeLists.txt similarity index 100% rename from core/CMakeLists.txt rename to internal/core/CMakeLists.txt diff --git a/core/release-build.sh b/internal/core/build.sh similarity index 100% rename from core/release-build.sh rename to internal/core/build.sh diff --git a/core/cmake/BuildUtils.cmake b/internal/core/cmake/BuildUtils.cmake similarity index 100% rename from core/cmake/BuildUtils.cmake rename to internal/core/cmake/BuildUtils.cmake diff --git a/core/cmake/DefineOptions.cmake b/internal/core/cmake/DefineOptions.cmake similarity index 100% rename from core/cmake/DefineOptions.cmake rename to internal/core/cmake/DefineOptions.cmake diff --git a/core/cmake/FindClangTools.cmake b/internal/core/cmake/FindClangTools.cmake similarity index 100% rename from core/cmake/FindClangTools.cmake rename to internal/core/cmake/FindClangTools.cmake diff --git a/core/cmake/FindGTest.cmake b/internal/core/cmake/FindGTest.cmake similarity index 100% rename from core/cmake/FindGTest.cmake rename to internal/core/cmake/FindGTest.cmake diff --git a/core/cmake/ThirdPartyPackages.cmake b/internal/core/cmake/ThirdPartyPackages.cmake similarity index 100% rename from core/cmake/ThirdPartyPackages.cmake rename to internal/core/cmake/ThirdPartyPackages.cmake diff --git a/core/cmake/Utils.cmake b/internal/core/cmake/Utils.cmake similarity index 100% rename from core/cmake/Utils.cmake rename to internal/core/cmake/Utils.cmake diff --git a/core/include/collection_c.h b/internal/core/include/collection_c.h similarity index 100% rename from core/include/collection_c.h rename to internal/core/include/collection_c.h diff --git a/core/include/partition_c.h b/internal/core/include/partition_c.h similarity index 100% rename from core/include/partition_c.h rename to internal/core/include/partition_c.h diff --git a/core/include/segment_c.h b/internal/core/include/segment_c.h similarity index 100% rename from core/include/segment_c.h rename to internal/core/include/segment_c.h diff --git a/core/build.sh b/internal/core/release-build.sh similarity index 98% rename from core/build.sh rename to internal/core/release-build.sh index aa4777b93a..f7fd8861ac 100755 --- a/core/build.sh +++ b/internal/core/release-build.sh @@ -5,8 +5,8 @@ if [[ ! ${jobs+1} ]]; then jobs=$(nproc) fi -BUILD_OUTPUT_DIR="cmake-build-debug" -BUILD_TYPE="Debug" +BUILD_OUTPUT_DIR="cmake-build-release" +BUILD_TYPE="Release" BUILD_UNITTEST="OFF" INSTALL_PREFIX=$(pwd)/milvus MAKE_CLEAN="OFF" diff --git a/core/src/CMakeLists.txt b/internal/core/src/CMakeLists.txt similarity index 100% rename from core/src/CMakeLists.txt rename to internal/core/src/CMakeLists.txt diff --git a/core/src/cache/CMakeLists.txt b/internal/core/src/cache/CMakeLists.txt similarity index 100% rename from core/src/cache/CMakeLists.txt rename to internal/core/src/cache/CMakeLists.txt diff --git a/core/src/cache/Cache.h b/internal/core/src/cache/Cache.h similarity index 100% rename from core/src/cache/Cache.h rename to internal/core/src/cache/Cache.h diff --git a/core/src/cache/Cache.inl b/internal/core/src/cache/Cache.inl similarity index 100% rename from core/src/cache/Cache.inl rename to internal/core/src/cache/Cache.inl diff --git a/core/src/cache/CacheMgr.h b/internal/core/src/cache/CacheMgr.h similarity index 100% rename from core/src/cache/CacheMgr.h rename to internal/core/src/cache/CacheMgr.h diff --git a/core/src/cache/CacheMgr.inl b/internal/core/src/cache/CacheMgr.inl similarity index 100% rename from core/src/cache/CacheMgr.inl rename to internal/core/src/cache/CacheMgr.inl diff --git a/core/src/cache/CpuCacheMgr.cpp b/internal/core/src/cache/CpuCacheMgr.cpp similarity index 100% rename from core/src/cache/CpuCacheMgr.cpp rename to internal/core/src/cache/CpuCacheMgr.cpp diff --git a/core/src/cache/CpuCacheMgr.h b/internal/core/src/cache/CpuCacheMgr.h similarity index 100% rename from core/src/cache/CpuCacheMgr.h rename to internal/core/src/cache/CpuCacheMgr.h diff --git a/core/src/cache/DataObj.h b/internal/core/src/cache/DataObj.h similarity index 100% rename from core/src/cache/DataObj.h rename to internal/core/src/cache/DataObj.h diff --git a/core/src/cache/GpuCacheMgr.cpp b/internal/core/src/cache/GpuCacheMgr.cpp similarity index 100% rename from core/src/cache/GpuCacheMgr.cpp rename to internal/core/src/cache/GpuCacheMgr.cpp diff --git a/core/src/cache/GpuCacheMgr.h b/internal/core/src/cache/GpuCacheMgr.h similarity index 100% rename from core/src/cache/GpuCacheMgr.h rename to internal/core/src/cache/GpuCacheMgr.h diff --git a/core/src/cache/LRU.h b/internal/core/src/cache/LRU.h similarity index 100% rename from core/src/cache/LRU.h rename to internal/core/src/cache/LRU.h diff --git a/core/src/config/CMakeLists.txt b/internal/core/src/config/CMakeLists.txt similarity index 100% rename from core/src/config/CMakeLists.txt rename to internal/core/src/config/CMakeLists.txt diff --git a/core/src/config/ConfigMgr.cpp b/internal/core/src/config/ConfigMgr.cpp similarity index 100% rename from core/src/config/ConfigMgr.cpp rename to internal/core/src/config/ConfigMgr.cpp diff --git a/core/src/config/ConfigMgr.h b/internal/core/src/config/ConfigMgr.h similarity index 100% rename from core/src/config/ConfigMgr.h rename to internal/core/src/config/ConfigMgr.h diff --git a/core/src/config/ConfigType.cpp b/internal/core/src/config/ConfigType.cpp similarity index 100% rename from core/src/config/ConfigType.cpp rename to internal/core/src/config/ConfigType.cpp diff --git a/core/src/config/ConfigType.h b/internal/core/src/config/ConfigType.h similarity index 100% rename from core/src/config/ConfigType.h rename to internal/core/src/config/ConfigType.h diff --git a/core/src/config/ConfigTypeTest1.cpp b/internal/core/src/config/ConfigTypeTest1.cpp similarity index 100% rename from core/src/config/ConfigTypeTest1.cpp rename to internal/core/src/config/ConfigTypeTest1.cpp diff --git a/core/src/config/ConfigTypeTest2.cpp b/internal/core/src/config/ConfigTypeTest2.cpp similarity index 100% rename from core/src/config/ConfigTypeTest2.cpp rename to internal/core/src/config/ConfigTypeTest2.cpp diff --git a/core/src/config/ServerConfig.cpp b/internal/core/src/config/ServerConfig.cpp similarity index 100% rename from core/src/config/ServerConfig.cpp rename to internal/core/src/config/ServerConfig.cpp diff --git a/core/src/config/ServerConfig.h b/internal/core/src/config/ServerConfig.h similarity index 100% rename from core/src/config/ServerConfig.h rename to internal/core/src/config/ServerConfig.h diff --git a/core/src/config/ServerConfigTest.cpp b/internal/core/src/config/ServerConfigTest.cpp similarity index 100% rename from core/src/config/ServerConfigTest.cpp rename to internal/core/src/config/ServerConfigTest.cpp diff --git a/core/src/dog_segment/AckResponder.h b/internal/core/src/dog_segment/AckResponder.h similarity index 100% rename from core/src/dog_segment/AckResponder.h rename to internal/core/src/dog_segment/AckResponder.h diff --git a/core/src/dog_segment/CMakeLists.txt b/internal/core/src/dog_segment/CMakeLists.txt similarity index 81% rename from core/src/dog_segment/CMakeLists.txt rename to internal/core/src/dog_segment/CMakeLists.txt index 43890955c6..58f79fde8f 100644 --- a/core/src/dog_segment/CMakeLists.txt +++ b/internal/core/src/dog_segment/CMakeLists.txt @@ -1,5 +1,6 @@ aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/../pb PB_SRC_FILES) +# add_definitions(-DBOOST_STACKTRACE_USE_ADDR2LINE) set(DOG_SEGMENT_FILES SegmentNaive.cpp IndexMeta.cpp @@ -9,6 +10,7 @@ set(DOG_SEGMENT_FILES collection_c.cpp partition_c.cpp segment_c.cpp + EasyAssert.cpp ${PB_SRC_FILES} ) add_library(milvus_dog_segment SHARED @@ -18,4 +20,5 @@ add_library(milvus_dog_segment SHARED #add_dependencies( segment sqlite mysqlpp ) -target_link_libraries(milvus_dog_segment tbb utils pthread knowhere log libprotobuf) +target_link_libraries(milvus_dog_segment tbb utils pthread knowhere log libprotobuf dl backtrace +) diff --git a/core/src/dog_segment/Collection.cpp b/internal/core/src/dog_segment/Collection.cpp similarity index 100% rename from core/src/dog_segment/Collection.cpp rename to internal/core/src/dog_segment/Collection.cpp diff --git a/core/src/dog_segment/Collection.h b/internal/core/src/dog_segment/Collection.h similarity index 100% rename from core/src/dog_segment/Collection.h rename to internal/core/src/dog_segment/Collection.h diff --git a/core/src/dog_segment/ConcurrentVector.cpp b/internal/core/src/dog_segment/ConcurrentVector.cpp similarity index 100% rename from core/src/dog_segment/ConcurrentVector.cpp rename to internal/core/src/dog_segment/ConcurrentVector.cpp diff --git a/core/src/dog_segment/ConcurrentVector.h b/internal/core/src/dog_segment/ConcurrentVector.h similarity index 100% rename from core/src/dog_segment/ConcurrentVector.h rename to internal/core/src/dog_segment/ConcurrentVector.h diff --git a/core/src/dog_segment/DeletedRecord.h b/internal/core/src/dog_segment/DeletedRecord.h similarity index 100% rename from core/src/dog_segment/DeletedRecord.h rename to internal/core/src/dog_segment/DeletedRecord.h diff --git a/internal/core/src/dog_segment/EasyAssert.cpp b/internal/core/src/dog_segment/EasyAssert.cpp new file mode 100644 index 0000000000..794ad89631 --- /dev/null +++ b/internal/core/src/dog_segment/EasyAssert.cpp @@ -0,0 +1,26 @@ + +#include +#include "EasyAssert.h" +// #define BOOST_STACKTRACE_USE_ADDR2LINE +#define BOOST_STACKTRACE_USE_BACKTRACE +#include + + +namespace milvus::impl { +void EasyAssertInfo(bool value, std::string_view expr_str, std::string_view filename, int lineno, + std::string_view extra_info) { + if (!value) { + std::string info; + info += "Assert \"" + std::string(expr_str) + "\""; + info += " at " + std::string(filename) + ":" + std::to_string(lineno) + "\n"; + if(!extra_info.empty()) { + info += " => " + std::string(extra_info); + } + auto fuck = boost::stacktrace::stacktrace(); + std::cout << fuck; + // std::string s = fuck; + // info += ; + throw std::runtime_error(info); + } +} +} \ No newline at end of file diff --git a/internal/core/src/dog_segment/EasyAssert.h b/internal/core/src/dog_segment/EasyAssert.h new file mode 100644 index 0000000000..b9c0274423 --- /dev/null +++ b/internal/core/src/dog_segment/EasyAssert.h @@ -0,0 +1,14 @@ +#pragma once +#include +#include +#include + +/* Paste this on the file you want to debug. */ + +namespace milvus::impl { +void EasyAssertInfo(bool value, std::string_view expr_str, std::string_view filename, int lineno, + std::string_view extra_info); +} + +#define AssertInfo(expr, info) impl::EasyAssertInfo(bool(expr), #expr, __FILE__, __LINE__, (info)) +#define Assert(expr) AssertInfo((expr), "") diff --git a/core/src/dog_segment/IndexMeta.cpp b/internal/core/src/dog_segment/IndexMeta.cpp similarity index 100% rename from core/src/dog_segment/IndexMeta.cpp rename to internal/core/src/dog_segment/IndexMeta.cpp diff --git a/core/src/dog_segment/IndexMeta.h b/internal/core/src/dog_segment/IndexMeta.h similarity index 100% rename from core/src/dog_segment/IndexMeta.h rename to internal/core/src/dog_segment/IndexMeta.h diff --git a/core/src/dog_segment/Partition.cpp b/internal/core/src/dog_segment/Partition.cpp similarity index 100% rename from core/src/dog_segment/Partition.cpp rename to internal/core/src/dog_segment/Partition.cpp diff --git a/core/src/dog_segment/Partition.h b/internal/core/src/dog_segment/Partition.h similarity index 100% rename from core/src/dog_segment/Partition.h rename to internal/core/src/dog_segment/Partition.h diff --git a/core/src/dog_segment/SegmentBase.h b/internal/core/src/dog_segment/SegmentBase.h similarity index 100% rename from core/src/dog_segment/SegmentBase.h rename to internal/core/src/dog_segment/SegmentBase.h diff --git a/core/src/dog_segment/SegmentDefs.h b/internal/core/src/dog_segment/SegmentDefs.h similarity index 96% rename from core/src/dog_segment/SegmentDefs.h rename to internal/core/src/dog_segment/SegmentDefs.h index 2156a56bb0..cb0c187a77 100644 --- a/core/src/dog_segment/SegmentDefs.h +++ b/internal/core/src/dog_segment/SegmentDefs.h @@ -171,9 +171,7 @@ class Schema { const FieldMeta& operator[](const std::string& field_name) const { auto offset_iter = offsets_.find(field_name); - if (offset_iter == offsets_.end()) { - throw std::runtime_error("Cannot found field_name: " + field_name); - } + AssertInfo(offset_iter != offsets_.end(), "Cannot found field_name: " + field_name); auto offset = offset_iter->second; return (*this)[offset]; } diff --git a/core/src/dog_segment/SegmentNaive.cpp b/internal/core/src/dog_segment/SegmentNaive.cpp similarity index 99% rename from core/src/dog_segment/SegmentNaive.cpp rename to internal/core/src/dog_segment/SegmentNaive.cpp index 10120caf31..46b2e1ad9c 100644 --- a/core/src/dog_segment/SegmentNaive.cpp +++ b/internal/core/src/dog_segment/SegmentNaive.cpp @@ -96,9 +96,6 @@ auto SegmentNaive::get_deleted_bitmap(int64_t del_barrier, Timestamp query_times if (offset >= insert_barrier) { continue; } - if (offset >= insert_barrier) { - continue; - } if (record_.timestamps_[offset] < query_timestamp) { Assert(offset < insert_barrier); the_offset = std::max(the_offset, offset); diff --git a/core/src/dog_segment/SegmentNaive.h b/internal/core/src/dog_segment/SegmentNaive.h similarity index 100% rename from core/src/dog_segment/SegmentNaive.h rename to internal/core/src/dog_segment/SegmentNaive.h diff --git a/core/src/dog_segment/SmartBruteForce.h b/internal/core/src/dog_segment/SmartBruteForce.h similarity index 100% rename from core/src/dog_segment/SmartBruteForce.h rename to internal/core/src/dog_segment/SmartBruteForce.h diff --git a/core/src/dog_segment/collection_c.cpp b/internal/core/src/dog_segment/collection_c.cpp similarity index 100% rename from core/src/dog_segment/collection_c.cpp rename to internal/core/src/dog_segment/collection_c.cpp diff --git a/core/src/dog_segment/collection_c.h b/internal/core/src/dog_segment/collection_c.h similarity index 100% rename from core/src/dog_segment/collection_c.h rename to internal/core/src/dog_segment/collection_c.h diff --git a/core/src/dog_segment/partition_c.cpp b/internal/core/src/dog_segment/partition_c.cpp similarity index 100% rename from core/src/dog_segment/partition_c.cpp rename to internal/core/src/dog_segment/partition_c.cpp diff --git a/core/src/dog_segment/partition_c.h b/internal/core/src/dog_segment/partition_c.h similarity index 100% rename from core/src/dog_segment/partition_c.h rename to internal/core/src/dog_segment/partition_c.h diff --git a/core/src/dog_segment/segment_c.cpp b/internal/core/src/dog_segment/segment_c.cpp similarity index 100% rename from core/src/dog_segment/segment_c.cpp rename to internal/core/src/dog_segment/segment_c.cpp diff --git a/core/src/dog_segment/segment_c.h b/internal/core/src/dog_segment/segment_c.h similarity index 100% rename from core/src/dog_segment/segment_c.h rename to internal/core/src/dog_segment/segment_c.h diff --git a/core/src/index/.gitignore b/internal/core/src/index/.gitignore similarity index 100% rename from core/src/index/.gitignore rename to internal/core/src/index/.gitignore diff --git a/core/src/index/CMakeLists.txt b/internal/core/src/index/CMakeLists.txt similarity index 100% rename from core/src/index/CMakeLists.txt rename to internal/core/src/index/CMakeLists.txt diff --git a/core/src/index/archive/KnowhereResource.cpp b/internal/core/src/index/archive/KnowhereResource.cpp similarity index 100% rename from core/src/index/archive/KnowhereResource.cpp rename to internal/core/src/index/archive/KnowhereResource.cpp diff --git a/core/src/index/archive/KnowhereResource.h b/internal/core/src/index/archive/KnowhereResource.h similarity index 100% rename from core/src/index/archive/KnowhereResource.h rename to internal/core/src/index/archive/KnowhereResource.h diff --git a/core/src/index/build.sh b/internal/core/src/index/build.sh similarity index 100% rename from core/src/index/build.sh rename to internal/core/src/index/build.sh diff --git a/core/src/index/cmake/BuildUtilsCore.cmake b/internal/core/src/index/cmake/BuildUtilsCore.cmake similarity index 100% rename from core/src/index/cmake/BuildUtilsCore.cmake rename to internal/core/src/index/cmake/BuildUtilsCore.cmake diff --git a/core/src/index/cmake/DefineOptionsCore.cmake b/internal/core/src/index/cmake/DefineOptionsCore.cmake similarity index 100% rename from core/src/index/cmake/DefineOptionsCore.cmake rename to internal/core/src/index/cmake/DefineOptionsCore.cmake diff --git a/core/src/index/cmake/FindArrow.cmake b/internal/core/src/index/cmake/FindArrow.cmake similarity index 100% rename from core/src/index/cmake/FindArrow.cmake rename to internal/core/src/index/cmake/FindArrow.cmake diff --git a/core/src/index/cmake/FindOpenBLAS.cmake b/internal/core/src/index/cmake/FindOpenBLAS.cmake similarity index 100% rename from core/src/index/cmake/FindOpenBLAS.cmake rename to internal/core/src/index/cmake/FindOpenBLAS.cmake diff --git a/core/src/index/cmake/ThirdPartyPackagesCore.cmake b/internal/core/src/index/cmake/ThirdPartyPackagesCore.cmake similarity index 100% rename from core/src/index/cmake/ThirdPartyPackagesCore.cmake rename to internal/core/src/index/cmake/ThirdPartyPackagesCore.cmake diff --git a/core/src/index/knowhere/CMakeLists.txt b/internal/core/src/index/knowhere/CMakeLists.txt similarity index 100% rename from core/src/index/knowhere/CMakeLists.txt rename to internal/core/src/index/knowhere/CMakeLists.txt diff --git a/core/src/index/knowhere/knowhere/common/BinarySet.h b/internal/core/src/index/knowhere/knowhere/common/BinarySet.h similarity index 100% rename from core/src/index/knowhere/knowhere/common/BinarySet.h rename to internal/core/src/index/knowhere/knowhere/common/BinarySet.h diff --git a/core/src/index/knowhere/knowhere/common/Config.h b/internal/core/src/index/knowhere/knowhere/common/Config.h similarity index 100% rename from core/src/index/knowhere/knowhere/common/Config.h rename to internal/core/src/index/knowhere/knowhere/common/Config.h diff --git a/core/src/index/knowhere/knowhere/common/Dataset.h b/internal/core/src/index/knowhere/knowhere/common/Dataset.h similarity index 100% rename from core/src/index/knowhere/knowhere/common/Dataset.h rename to internal/core/src/index/knowhere/knowhere/common/Dataset.h diff --git a/core/src/index/knowhere/knowhere/common/Exception.cpp b/internal/core/src/index/knowhere/knowhere/common/Exception.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/common/Exception.cpp rename to internal/core/src/index/knowhere/knowhere/common/Exception.cpp diff --git a/core/src/index/knowhere/knowhere/common/Exception.h b/internal/core/src/index/knowhere/knowhere/common/Exception.h similarity index 100% rename from core/src/index/knowhere/knowhere/common/Exception.h rename to internal/core/src/index/knowhere/knowhere/common/Exception.h diff --git a/core/src/index/knowhere/knowhere/common/Log.cpp b/internal/core/src/index/knowhere/knowhere/common/Log.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/common/Log.cpp rename to internal/core/src/index/knowhere/knowhere/common/Log.cpp diff --git a/core/src/index/knowhere/knowhere/common/Log.h b/internal/core/src/index/knowhere/knowhere/common/Log.h similarity index 100% rename from core/src/index/knowhere/knowhere/common/Log.h rename to internal/core/src/index/knowhere/knowhere/common/Log.h diff --git a/core/src/index/knowhere/knowhere/common/Timer.cpp b/internal/core/src/index/knowhere/knowhere/common/Timer.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/common/Timer.cpp rename to internal/core/src/index/knowhere/knowhere/common/Timer.cpp diff --git a/core/src/index/knowhere/knowhere/common/Timer.h b/internal/core/src/index/knowhere/knowhere/common/Timer.h similarity index 100% rename from core/src/index/knowhere/knowhere/common/Timer.h rename to internal/core/src/index/knowhere/knowhere/common/Timer.h diff --git a/core/src/index/knowhere/knowhere/common/Typedef.h b/internal/core/src/index/knowhere/knowhere/common/Typedef.h similarity index 100% rename from core/src/index/knowhere/knowhere/common/Typedef.h rename to internal/core/src/index/knowhere/knowhere/common/Typedef.h diff --git a/core/src/index/knowhere/knowhere/index/Index.h b/internal/core/src/index/knowhere/knowhere/index/Index.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/Index.h rename to internal/core/src/index/knowhere/knowhere/index/Index.h diff --git a/core/src/index/knowhere/knowhere/index/IndexType.cpp b/internal/core/src/index/knowhere/knowhere/index/IndexType.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/IndexType.cpp rename to internal/core/src/index/knowhere/knowhere/index/IndexType.cpp diff --git a/core/src/index/knowhere/knowhere/index/IndexType.h b/internal/core/src/index/knowhere/knowhere/index/IndexType.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/IndexType.h rename to internal/core/src/index/knowhere/knowhere/index/IndexType.h diff --git a/core/src/index/knowhere/knowhere/index/preprocessor/Preprocessor.h b/internal/core/src/index/knowhere/knowhere/index/preprocessor/Preprocessor.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/preprocessor/Preprocessor.h rename to internal/core/src/index/knowhere/knowhere/index/preprocessor/Preprocessor.h diff --git a/core/src/index/knowhere/knowhere/index/structured_index/StructuredIndex.h b/internal/core/src/index/knowhere/knowhere/index/structured_index/StructuredIndex.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/structured_index/StructuredIndex.h rename to internal/core/src/index/knowhere/knowhere/index/structured_index/StructuredIndex.h diff --git a/core/src/index/knowhere/knowhere/index/structured_index/StructuredIndexFlat-inl.h b/internal/core/src/index/knowhere/knowhere/index/structured_index/StructuredIndexFlat-inl.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/structured_index/StructuredIndexFlat-inl.h rename to internal/core/src/index/knowhere/knowhere/index/structured_index/StructuredIndexFlat-inl.h diff --git a/core/src/index/knowhere/knowhere/index/structured_index/StructuredIndexFlat.h b/internal/core/src/index/knowhere/knowhere/index/structured_index/StructuredIndexFlat.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/structured_index/StructuredIndexFlat.h rename to internal/core/src/index/knowhere/knowhere/index/structured_index/StructuredIndexFlat.h diff --git a/core/src/index/knowhere/knowhere/index/structured_index/StructuredIndexSort-inl.h b/internal/core/src/index/knowhere/knowhere/index/structured_index/StructuredIndexSort-inl.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/structured_index/StructuredIndexSort-inl.h rename to internal/core/src/index/knowhere/knowhere/index/structured_index/StructuredIndexSort-inl.h diff --git a/core/src/index/knowhere/knowhere/index/structured_index/StructuredIndexSort.h b/internal/core/src/index/knowhere/knowhere/index/structured_index/StructuredIndexSort.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/structured_index/StructuredIndexSort.h rename to internal/core/src/index/knowhere/knowhere/index/structured_index/StructuredIndexSort.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/ConfAdapter.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/ConfAdapter.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/ConfAdapter.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/ConfAdapter.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/ConfAdapter.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/ConfAdapter.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/ConfAdapter.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/ConfAdapter.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/ConfAdapterMgr.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/ConfAdapterMgr.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/ConfAdapterMgr.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/ConfAdapterMgr.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/ConfAdapterMgr.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/ConfAdapterMgr.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/ConfAdapterMgr.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/ConfAdapterMgr.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/FaissBaseBinaryIndex.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/FaissBaseBinaryIndex.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/FaissBaseBinaryIndex.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/FaissBaseBinaryIndex.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/FaissBaseBinaryIndex.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/FaissBaseBinaryIndex.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/FaissBaseBinaryIndex.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/FaissBaseBinaryIndex.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/FaissBaseIndex.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/FaissBaseIndex.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/FaissBaseIndex.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/FaissBaseIndex.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/FaissBaseIndex.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/FaissBaseIndex.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/FaissBaseIndex.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/FaissBaseIndex.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexAnnoy.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexAnnoy.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexAnnoy.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexAnnoy.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexAnnoy.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexAnnoy.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexAnnoy.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexAnnoy.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexHNSW.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexHNSW.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexHNSW.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexHNSW.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexHNSW.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexHNSW.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexHNSW.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexHNSW.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFPQ.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFPQ.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexIVFPQ.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFPQ.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFPQ.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFPQ.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexIVFPQ.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFPQ.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexNSG.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexNSG.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexNSG.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexNSG.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexNSG.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexNSG.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexNSG.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexNSG.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSW.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSW.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSW.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSW.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSW.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSW.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSW.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSW.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWFlat.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWFlat.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWFlat.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWFlat.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWFlat.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWFlat.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWFlat.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWFlat.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWPQ.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWPQ.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWPQ.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWPQ.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWPQ.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWPQ.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWPQ.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWPQ.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWSQ.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWSQ.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWSQ.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWSQ.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWSQ.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWSQ.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWSQ.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexRHNSWSQ.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexSPTAG.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexSPTAG.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexSPTAG.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexSPTAG.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexSPTAG.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/IndexSPTAG.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/IndexSPTAG.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/IndexSPTAG.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/VecIndex.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/VecIndex.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/VecIndex.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/VecIndex.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/VecIndexFactory.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/VecIndexFactory.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/VecIndexFactory.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/VecIndexFactory.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/VecIndexFactory.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/VecIndexFactory.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/VecIndexFactory.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/VecIndexFactory.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/adapter/SptagAdapter.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/adapter/SptagAdapter.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/adapter/SptagAdapter.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/adapter/SptagAdapter.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/adapter/SptagAdapter.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/adapter/SptagAdapter.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/adapter/SptagAdapter.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/adapter/SptagAdapter.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/adapter/VectorAdapter.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/adapter/VectorAdapter.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/adapter/VectorAdapter.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/adapter/VectorAdapter.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/adapter/VectorAdapter.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/adapter/VectorAdapter.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/adapter/VectorAdapter.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/adapter/VectorAdapter.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/gpu/GPUIndex.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/GPUIndex.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/gpu/GPUIndex.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/GPUIndex.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIDMAP.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIDMAP.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIDMAP.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIDMAP.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIDMAP.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIDMAP.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIDMAP.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIDMAP.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVF.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVF.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVF.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVF.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVF.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVF.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVF.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVF.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFPQ.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFPQ.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFPQ.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFPQ.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFPQ.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFPQ.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFPQ.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFPQ.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFSQ.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFSQ.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFSQ.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFSQ.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFSQ.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFSQ.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFSQ.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexGPUIVFSQ.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexIVFSQHybrid.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexIVFSQHybrid.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexIVFSQHybrid.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexIVFSQHybrid.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexIVFSQHybrid.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexIVFSQHybrid.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexIVFSQHybrid.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/IndexIVFSQHybrid.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/gpu/Quantizer.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/Quantizer.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/gpu/Quantizer.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/gpu/Quantizer.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/helpers/BuilderSuspend.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/BuilderSuspend.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/helpers/BuilderSuspend.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/BuilderSuspend.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/helpers/Cloner.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/Cloner.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/helpers/Cloner.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/Cloner.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/helpers/Cloner.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/Cloner.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/helpers/Cloner.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/Cloner.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/helpers/FaissGpuResourceMgr.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/FaissGpuResourceMgr.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/helpers/FaissGpuResourceMgr.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/FaissGpuResourceMgr.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/helpers/FaissGpuResourceMgr.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/FaissGpuResourceMgr.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/helpers/FaissGpuResourceMgr.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/FaissGpuResourceMgr.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/helpers/FaissIO.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/FaissIO.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/helpers/FaissIO.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/FaissIO.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/helpers/FaissIO.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/FaissIO.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/helpers/FaissIO.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/FaissIO.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/helpers/IndexParameter.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/IndexParameter.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/helpers/IndexParameter.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/IndexParameter.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/helpers/IndexParameter.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/IndexParameter.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/helpers/IndexParameter.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/IndexParameter.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/helpers/SPTAGParameterMgr.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/SPTAGParameterMgr.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/helpers/SPTAGParameterMgr.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/SPTAGParameterMgr.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/helpers/SPTAGParameterMgr.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/SPTAGParameterMgr.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/helpers/SPTAGParameterMgr.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/helpers/SPTAGParameterMgr.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/Distance.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/Distance.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/Distance.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/Distance.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/Distance.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/Distance.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/Distance.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/Distance.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSG.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSG.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSG.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSG.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSG.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSG.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSG.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSG.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGHelper.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGHelper.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGHelper.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGHelper.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGHelper.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGHelper.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGHelper.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGHelper.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGIO.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGIO.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGIO.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGIO.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGIO.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGIO.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGIO.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/NSGIO.h diff --git a/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/Neighbor.h b/internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/Neighbor.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/Neighbor.h rename to internal/core/src/index/knowhere/knowhere/index/vector_index/impl/nsg/Neighbor.h diff --git a/core/src/index/knowhere/knowhere/index/vector_offset_index/IndexIVF_NM.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_offset_index/IndexIVF_NM.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_offset_index/IndexIVF_NM.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_offset_index/IndexIVF_NM.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_offset_index/IndexIVF_NM.h b/internal/core/src/index/knowhere/knowhere/index/vector_offset_index/IndexIVF_NM.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_offset_index/IndexIVF_NM.h rename to internal/core/src/index/knowhere/knowhere/index/vector_offset_index/IndexIVF_NM.h diff --git a/core/src/index/knowhere/knowhere/index/vector_offset_index/IndexNSG_NM.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_offset_index/IndexNSG_NM.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_offset_index/IndexNSG_NM.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_offset_index/IndexNSG_NM.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_offset_index/IndexNSG_NM.h b/internal/core/src/index/knowhere/knowhere/index/vector_offset_index/IndexNSG_NM.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_offset_index/IndexNSG_NM.h rename to internal/core/src/index/knowhere/knowhere/index/vector_offset_index/IndexNSG_NM.h diff --git a/core/src/index/knowhere/knowhere/index/vector_offset_index/OffsetBaseIndex.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_offset_index/OffsetBaseIndex.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_offset_index/OffsetBaseIndex.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_offset_index/OffsetBaseIndex.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_offset_index/OffsetBaseIndex.h b/internal/core/src/index/knowhere/knowhere/index/vector_offset_index/OffsetBaseIndex.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_offset_index/OffsetBaseIndex.h rename to internal/core/src/index/knowhere/knowhere/index/vector_offset_index/OffsetBaseIndex.h diff --git a/core/src/index/knowhere/knowhere/index/vector_offset_index/gpu/IndexGPUIVF_NM.cpp b/internal/core/src/index/knowhere/knowhere/index/vector_offset_index/gpu/IndexGPUIVF_NM.cpp similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_offset_index/gpu/IndexGPUIVF_NM.cpp rename to internal/core/src/index/knowhere/knowhere/index/vector_offset_index/gpu/IndexGPUIVF_NM.cpp diff --git a/core/src/index/knowhere/knowhere/index/vector_offset_index/gpu/IndexGPUIVF_NM.h b/internal/core/src/index/knowhere/knowhere/index/vector_offset_index/gpu/IndexGPUIVF_NM.h similarity index 100% rename from core/src/index/knowhere/knowhere/index/vector_offset_index/gpu/IndexGPUIVF_NM.h rename to internal/core/src/index/knowhere/knowhere/index/vector_offset_index/gpu/IndexGPUIVF_NM.h diff --git a/core/src/index/thirdparty/SPTAG/.github/ISSUE_TEMPLATE/bug_report.md b/internal/core/src/index/thirdparty/SPTAG/.github/ISSUE_TEMPLATE/bug_report.md similarity index 100% rename from core/src/index/thirdparty/SPTAG/.github/ISSUE_TEMPLATE/bug_report.md rename to internal/core/src/index/thirdparty/SPTAG/.github/ISSUE_TEMPLATE/bug_report.md diff --git a/core/src/index/thirdparty/SPTAG/.github/ISSUE_TEMPLATE/feature_request.md b/internal/core/src/index/thirdparty/SPTAG/.github/ISSUE_TEMPLATE/feature_request.md similarity index 100% rename from core/src/index/thirdparty/SPTAG/.github/ISSUE_TEMPLATE/feature_request.md rename to internal/core/src/index/thirdparty/SPTAG/.github/ISSUE_TEMPLATE/feature_request.md diff --git a/core/src/index/thirdparty/SPTAG/.gitignore b/internal/core/src/index/thirdparty/SPTAG/.gitignore similarity index 100% rename from core/src/index/thirdparty/SPTAG/.gitignore rename to internal/core/src/index/thirdparty/SPTAG/.gitignore diff --git a/core/src/index/thirdparty/SPTAG/AnnService.users.props b/internal/core/src/index/thirdparty/SPTAG/AnnService.users.props similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService.users.props rename to internal/core/src/index/thirdparty/SPTAG/AnnService.users.props diff --git a/core/src/index/thirdparty/SPTAG/AnnService/Aggregator.vcxproj b/internal/core/src/index/thirdparty/SPTAG/AnnService/Aggregator.vcxproj similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/Aggregator.vcxproj rename to internal/core/src/index/thirdparty/SPTAG/AnnService/Aggregator.vcxproj diff --git a/core/src/index/thirdparty/SPTAG/AnnService/Aggregator.vcxproj.filters b/internal/core/src/index/thirdparty/SPTAG/AnnService/Aggregator.vcxproj.filters similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/Aggregator.vcxproj.filters rename to internal/core/src/index/thirdparty/SPTAG/AnnService/Aggregator.vcxproj.filters diff --git a/core/src/index/thirdparty/SPTAG/AnnService/CMakeLists.txt b/internal/core/src/index/thirdparty/SPTAG/AnnService/CMakeLists.txt similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/CMakeLists.txt rename to internal/core/src/index/thirdparty/SPTAG/AnnService/CMakeLists.txt diff --git a/core/src/index/thirdparty/SPTAG/AnnService/Client.vcxproj b/internal/core/src/index/thirdparty/SPTAG/AnnService/Client.vcxproj similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/Client.vcxproj rename to internal/core/src/index/thirdparty/SPTAG/AnnService/Client.vcxproj diff --git a/core/src/index/thirdparty/SPTAG/AnnService/Client.vcxproj.filters b/internal/core/src/index/thirdparty/SPTAG/AnnService/Client.vcxproj.filters similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/Client.vcxproj.filters rename to internal/core/src/index/thirdparty/SPTAG/AnnService/Client.vcxproj.filters diff --git a/core/src/index/thirdparty/SPTAG/AnnService/CoreLibrary.vcxproj b/internal/core/src/index/thirdparty/SPTAG/AnnService/CoreLibrary.vcxproj similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/CoreLibrary.vcxproj rename to internal/core/src/index/thirdparty/SPTAG/AnnService/CoreLibrary.vcxproj diff --git a/core/src/index/thirdparty/SPTAG/AnnService/CoreLibrary.vcxproj.filters b/internal/core/src/index/thirdparty/SPTAG/AnnService/CoreLibrary.vcxproj.filters similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/CoreLibrary.vcxproj.filters rename to internal/core/src/index/thirdparty/SPTAG/AnnService/CoreLibrary.vcxproj.filters diff --git a/core/src/index/thirdparty/SPTAG/AnnService/IndexBuilder.vcxproj b/internal/core/src/index/thirdparty/SPTAG/AnnService/IndexBuilder.vcxproj similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/IndexBuilder.vcxproj rename to internal/core/src/index/thirdparty/SPTAG/AnnService/IndexBuilder.vcxproj diff --git a/core/src/index/thirdparty/SPTAG/AnnService/IndexBuilder.vcxproj.filters b/internal/core/src/index/thirdparty/SPTAG/AnnService/IndexBuilder.vcxproj.filters similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/IndexBuilder.vcxproj.filters rename to internal/core/src/index/thirdparty/SPTAG/AnnService/IndexBuilder.vcxproj.filters diff --git a/core/src/index/thirdparty/SPTAG/AnnService/IndexSearcher.vcxproj b/internal/core/src/index/thirdparty/SPTAG/AnnService/IndexSearcher.vcxproj similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/IndexSearcher.vcxproj rename to internal/core/src/index/thirdparty/SPTAG/AnnService/IndexSearcher.vcxproj diff --git a/core/src/index/thirdparty/SPTAG/AnnService/IndexSearcher.vcxproj.filters b/internal/core/src/index/thirdparty/SPTAG/AnnService/IndexSearcher.vcxproj.filters similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/IndexSearcher.vcxproj.filters rename to internal/core/src/index/thirdparty/SPTAG/AnnService/IndexSearcher.vcxproj.filters diff --git a/core/src/index/thirdparty/SPTAG/AnnService/Server.vcxproj b/internal/core/src/index/thirdparty/SPTAG/AnnService/Server.vcxproj similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/Server.vcxproj rename to internal/core/src/index/thirdparty/SPTAG/AnnService/Server.vcxproj diff --git a/core/src/index/thirdparty/SPTAG/AnnService/Server.vcxproj.filters b/internal/core/src/index/thirdparty/SPTAG/AnnService/Server.vcxproj.filters similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/Server.vcxproj.filters rename to internal/core/src/index/thirdparty/SPTAG/AnnService/Server.vcxproj.filters diff --git a/core/src/index/thirdparty/SPTAG/AnnService/SocketLib.vcxproj b/internal/core/src/index/thirdparty/SPTAG/AnnService/SocketLib.vcxproj similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/SocketLib.vcxproj rename to internal/core/src/index/thirdparty/SPTAG/AnnService/SocketLib.vcxproj diff --git a/core/src/index/thirdparty/SPTAG/AnnService/SocketLib.vcxproj.filters b/internal/core/src/index/thirdparty/SPTAG/AnnService/SocketLib.vcxproj.filters similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/SocketLib.vcxproj.filters rename to internal/core/src/index/thirdparty/SPTAG/AnnService/SocketLib.vcxproj.filters diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorContext.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorContext.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorContext.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorContext.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorExecutionContext.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorExecutionContext.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorExecutionContext.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorExecutionContext.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorService.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorService.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorService.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorService.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorSettings.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorSettings.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorSettings.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Aggregator/AggregatorSettings.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Client/ClientWrapper.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Client/ClientWrapper.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Client/ClientWrapper.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Client/ClientWrapper.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Client/Options.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Client/Options.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Client/Options.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Client/Options.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/BKT/Index.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/BKT/Index.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/BKT/Index.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/BKT/Index.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/BKT/ParameterDefinitionList.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/BKT/ParameterDefinitionList.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/BKT/ParameterDefinitionList.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/BKT/ParameterDefinitionList.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/BKTree.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/BKTree.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/BKTree.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/BKTree.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/CommonUtils.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/CommonUtils.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/CommonUtils.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/CommonUtils.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/DataUtils.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/DataUtils.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/DataUtils.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/DataUtils.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/Dataset.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/Dataset.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/Dataset.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/Dataset.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/DistanceUtils.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/DistanceUtils.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/DistanceUtils.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/DistanceUtils.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/FineGrainedLock.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/FineGrainedLock.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/FineGrainedLock.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/FineGrainedLock.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/Heap.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/Heap.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/Heap.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/Heap.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/KDTree.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/KDTree.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/KDTree.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/KDTree.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/NeighborhoodGraph.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/NeighborhoodGraph.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/NeighborhoodGraph.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/NeighborhoodGraph.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/QueryResultSet.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/QueryResultSet.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/QueryResultSet.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/QueryResultSet.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/WorkSpace.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/WorkSpace.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/WorkSpace.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/WorkSpace.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/WorkSpacePool.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/WorkSpacePool.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/WorkSpacePool.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/Common/WorkSpacePool.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/CommonDataStructure.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/CommonDataStructure.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/CommonDataStructure.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/CommonDataStructure.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/DefinitionList.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/DefinitionList.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/DefinitionList.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/DefinitionList.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/KDT/Index.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/KDT/Index.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/KDT/Index.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/KDT/Index.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/KDT/ParameterDefinitionList.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/KDT/ParameterDefinitionList.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/KDT/ParameterDefinitionList.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/KDT/ParameterDefinitionList.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/MetadataSet.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/MetadataSet.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/MetadataSet.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/MetadataSet.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/SearchQuery.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/SearchQuery.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/SearchQuery.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/SearchQuery.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/SearchResult.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/SearchResult.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/SearchResult.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/SearchResult.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/VectorIndex.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/VectorIndex.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/VectorIndex.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/VectorIndex.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/VectorSet.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/VectorSet.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Core/VectorSet.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Core/VectorSet.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/ArgumentsParser.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/ArgumentsParser.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/ArgumentsParser.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/ArgumentsParser.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/Base64Encode.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/Base64Encode.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/Base64Encode.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/Base64Encode.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/BufferStream.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/BufferStream.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/BufferStream.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/BufferStream.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/CommonHelper.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/CommonHelper.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/CommonHelper.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/CommonHelper.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/Concurrent.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/Concurrent.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/Concurrent.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/Concurrent.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/ConcurrentSet.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/ConcurrentSet.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/ConcurrentSet.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/ConcurrentSet.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/SimpleIniReader.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/SimpleIniReader.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/SimpleIniReader.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/SimpleIniReader.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/StringConvert.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/StringConvert.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/StringConvert.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/StringConvert.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/VectorSetReader.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/VectorSetReader.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/VectorSetReader.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/VectorSetReader.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/VectorSetReaders/DefaultReader.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/VectorSetReaders/DefaultReader.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/VectorSetReaders/DefaultReader.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Helper/VectorSetReaders/DefaultReader.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/IndexBuilder/Options.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/IndexBuilder/Options.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/IndexBuilder/Options.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/IndexBuilder/Options.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/IndexBuilder/ThreadPool.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/IndexBuilder/ThreadPool.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/IndexBuilder/ThreadPool.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/IndexBuilder/ThreadPool.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/QueryParser.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/QueryParser.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Server/QueryParser.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/QueryParser.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/SearchExecutionContext.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/SearchExecutionContext.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Server/SearchExecutionContext.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/SearchExecutionContext.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/SearchExecutor.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/SearchExecutor.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Server/SearchExecutor.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/SearchExecutor.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/SearchService.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/SearchService.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Server/SearchService.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/SearchService.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/ServiceContext.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/ServiceContext.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Server/ServiceContext.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/ServiceContext.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/ServiceSettings.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/ServiceSettings.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Server/ServiceSettings.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Server/ServiceSettings.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Client.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Client.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Client.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Client.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Common.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Common.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Common.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Common.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Connection.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Connection.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Connection.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Connection.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/ConnectionManager.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/ConnectionManager.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/ConnectionManager.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/ConnectionManager.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Packet.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Packet.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Packet.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Packet.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/RemoteSearchQuery.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/RemoteSearchQuery.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/RemoteSearchQuery.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/RemoteSearchQuery.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/ResourceManager.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/ResourceManager.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/ResourceManager.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/ResourceManager.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Server.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Server.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Server.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/Server.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/SimpleSerialization.h b/internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/SimpleSerialization.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/SimpleSerialization.h rename to internal/core/src/index/thirdparty/SPTAG/AnnService/inc/Socket/SimpleSerialization.h diff --git a/core/src/index/thirdparty/SPTAG/AnnService/packages.config b/internal/core/src/index/thirdparty/SPTAG/AnnService/packages.config similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/packages.config rename to internal/core/src/index/thirdparty/SPTAG/AnnService/packages.config diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorContext.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorContext.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorContext.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorContext.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorExecutionContext.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorExecutionContext.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorExecutionContext.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorExecutionContext.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorService.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorService.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorService.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorService.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorSettings.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorSettings.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorSettings.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/AggregatorSettings.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/main.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/main.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/main.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Aggregator/main.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Client/ClientWrapper.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Client/ClientWrapper.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Client/ClientWrapper.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Client/ClientWrapper.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Client/Options.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Client/Options.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Client/Options.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Client/Options.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Client/main.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Client/main.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Client/main.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Client/main.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Core/BKT/BKTIndex.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Core/BKT/BKTIndex.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Core/BKT/BKTIndex.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Core/BKT/BKTIndex.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Core/Common/NeighborhoodGraph.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Core/Common/NeighborhoodGraph.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Core/Common/NeighborhoodGraph.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Core/Common/NeighborhoodGraph.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Core/Common/WorkSpacePool.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Core/Common/WorkSpacePool.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Core/Common/WorkSpacePool.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Core/Common/WorkSpacePool.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Core/KDT/KDTIndex.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Core/KDT/KDTIndex.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Core/KDT/KDTIndex.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Core/KDT/KDTIndex.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Core/MetadataSet.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Core/MetadataSet.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Core/MetadataSet.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Core/MetadataSet.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Core/VectorIndex.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Core/VectorIndex.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Core/VectorIndex.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Core/VectorIndex.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Core/VectorSet.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Core/VectorSet.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Core/VectorSet.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Core/VectorSet.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/ArgumentsParser.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/ArgumentsParser.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Helper/ArgumentsParser.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/ArgumentsParser.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/Base64Encode.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/Base64Encode.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Helper/Base64Encode.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/Base64Encode.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/CommonHelper.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/CommonHelper.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Helper/CommonHelper.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/CommonHelper.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/Concurrent.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/Concurrent.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Helper/Concurrent.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/Concurrent.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/SimpleIniReader.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/SimpleIniReader.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Helper/SimpleIniReader.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/SimpleIniReader.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/VectorSetReader.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/VectorSetReader.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Helper/VectorSetReader.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/VectorSetReader.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/VectorSetReaders/DefaultReader.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/VectorSetReaders/DefaultReader.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Helper/VectorSetReaders/DefaultReader.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Helper/VectorSetReaders/DefaultReader.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/IndexBuilder/Options.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/IndexBuilder/Options.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/IndexBuilder/Options.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/IndexBuilder/Options.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/IndexBuilder/ThreadPool.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/IndexBuilder/ThreadPool.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/IndexBuilder/ThreadPool.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/IndexBuilder/ThreadPool.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/IndexBuilder/main.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/IndexBuilder/main.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/IndexBuilder/main.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/IndexBuilder/main.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/IndexSearcher/main.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/IndexSearcher/main.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/IndexSearcher/main.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/IndexSearcher/main.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Server/QueryParser.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Server/QueryParser.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Server/QueryParser.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Server/QueryParser.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Server/SearchExecutionContext.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Server/SearchExecutionContext.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Server/SearchExecutionContext.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Server/SearchExecutionContext.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Server/SearchExecutor.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Server/SearchExecutor.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Server/SearchExecutor.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Server/SearchExecutor.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Server/SearchService.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Server/SearchService.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Server/SearchService.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Server/SearchService.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Server/ServiceContext.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Server/ServiceContext.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Server/ServiceContext.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Server/ServiceContext.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Server/ServiceSettings.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Server/ServiceSettings.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Server/ServiceSettings.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Server/ServiceSettings.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Server/main.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Server/main.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Server/main.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Server/main.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Client.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Client.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Client.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Client.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Common.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Common.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Common.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Common.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Connection.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Connection.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Connection.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Connection.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/ConnectionManager.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/ConnectionManager.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Socket/ConnectionManager.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/ConnectionManager.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Packet.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Packet.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Packet.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Packet.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/RemoteSearchQuery.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/RemoteSearchQuery.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Socket/RemoteSearchQuery.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/RemoteSearchQuery.cpp diff --git a/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Server.cpp b/internal/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Server.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Server.cpp rename to internal/core/src/index/thirdparty/SPTAG/AnnService/src/Socket/Server.cpp diff --git a/core/src/index/thirdparty/SPTAG/CMakeLists.txt b/internal/core/src/index/thirdparty/SPTAG/CMakeLists.txt similarity index 100% rename from core/src/index/thirdparty/SPTAG/CMakeLists.txt rename to internal/core/src/index/thirdparty/SPTAG/CMakeLists.txt diff --git a/core/src/index/thirdparty/SPTAG/Dockerfile b/internal/core/src/index/thirdparty/SPTAG/Dockerfile similarity index 100% rename from core/src/index/thirdparty/SPTAG/Dockerfile rename to internal/core/src/index/thirdparty/SPTAG/Dockerfile diff --git a/core/src/index/thirdparty/SPTAG/LICENSE b/internal/core/src/index/thirdparty/SPTAG/LICENSE similarity index 100% rename from core/src/index/thirdparty/SPTAG/LICENSE rename to internal/core/src/index/thirdparty/SPTAG/LICENSE diff --git a/core/src/index/thirdparty/SPTAG/README.md b/internal/core/src/index/thirdparty/SPTAG/README.md similarity index 100% rename from core/src/index/thirdparty/SPTAG/README.md rename to internal/core/src/index/thirdparty/SPTAG/README.md diff --git a/core/src/index/thirdparty/SPTAG/SPTAG.sdf b/internal/core/src/index/thirdparty/SPTAG/SPTAG.sdf similarity index 100% rename from core/src/index/thirdparty/SPTAG/SPTAG.sdf rename to internal/core/src/index/thirdparty/SPTAG/SPTAG.sdf diff --git a/core/src/index/thirdparty/SPTAG/SPTAG.sln b/internal/core/src/index/thirdparty/SPTAG/SPTAG.sln similarity index 100% rename from core/src/index/thirdparty/SPTAG/SPTAG.sln rename to internal/core/src/index/thirdparty/SPTAG/SPTAG.sln diff --git a/core/src/index/thirdparty/SPTAG/Test/CMakeLists.txt b/internal/core/src/index/thirdparty/SPTAG/Test/CMakeLists.txt similarity index 100% rename from core/src/index/thirdparty/SPTAG/Test/CMakeLists.txt rename to internal/core/src/index/thirdparty/SPTAG/Test/CMakeLists.txt diff --git a/core/src/index/thirdparty/SPTAG/Test/Test.vcxproj b/internal/core/src/index/thirdparty/SPTAG/Test/Test.vcxproj similarity index 100% rename from core/src/index/thirdparty/SPTAG/Test/Test.vcxproj rename to internal/core/src/index/thirdparty/SPTAG/Test/Test.vcxproj diff --git a/core/src/index/thirdparty/SPTAG/Test/Test.vcxproj.filters b/internal/core/src/index/thirdparty/SPTAG/Test/Test.vcxproj.filters similarity index 100% rename from core/src/index/thirdparty/SPTAG/Test/Test.vcxproj.filters rename to internal/core/src/index/thirdparty/SPTAG/Test/Test.vcxproj.filters diff --git a/core/src/index/thirdparty/SPTAG/Test/Test.vcxproj.user b/internal/core/src/index/thirdparty/SPTAG/Test/Test.vcxproj.user similarity index 100% rename from core/src/index/thirdparty/SPTAG/Test/Test.vcxproj.user rename to internal/core/src/index/thirdparty/SPTAG/Test/Test.vcxproj.user diff --git a/core/src/index/thirdparty/SPTAG/Test/inc/Test.h b/internal/core/src/index/thirdparty/SPTAG/Test/inc/Test.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/Test/inc/Test.h rename to internal/core/src/index/thirdparty/SPTAG/Test/inc/Test.h diff --git a/core/src/index/thirdparty/SPTAG/Test/packages.config b/internal/core/src/index/thirdparty/SPTAG/Test/packages.config similarity index 100% rename from core/src/index/thirdparty/SPTAG/Test/packages.config rename to internal/core/src/index/thirdparty/SPTAG/Test/packages.config diff --git a/core/src/index/thirdparty/SPTAG/Test/src/AlgoTest.cpp b/internal/core/src/index/thirdparty/SPTAG/Test/src/AlgoTest.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/Test/src/AlgoTest.cpp rename to internal/core/src/index/thirdparty/SPTAG/Test/src/AlgoTest.cpp diff --git a/core/src/index/thirdparty/SPTAG/Test/src/Base64HelperTest.cpp b/internal/core/src/index/thirdparty/SPTAG/Test/src/Base64HelperTest.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/Test/src/Base64HelperTest.cpp rename to internal/core/src/index/thirdparty/SPTAG/Test/src/Base64HelperTest.cpp diff --git a/core/src/index/thirdparty/SPTAG/Test/src/CommonHelperTest.cpp b/internal/core/src/index/thirdparty/SPTAG/Test/src/CommonHelperTest.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/Test/src/CommonHelperTest.cpp rename to internal/core/src/index/thirdparty/SPTAG/Test/src/CommonHelperTest.cpp diff --git a/core/src/index/thirdparty/SPTAG/Test/src/DistanceTest.cpp b/internal/core/src/index/thirdparty/SPTAG/Test/src/DistanceTest.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/Test/src/DistanceTest.cpp rename to internal/core/src/index/thirdparty/SPTAG/Test/src/DistanceTest.cpp diff --git a/core/src/index/thirdparty/SPTAG/Test/src/IniReaderTest.cpp b/internal/core/src/index/thirdparty/SPTAG/Test/src/IniReaderTest.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/Test/src/IniReaderTest.cpp rename to internal/core/src/index/thirdparty/SPTAG/Test/src/IniReaderTest.cpp diff --git a/core/src/index/thirdparty/SPTAG/Test/src/StringConvertTest.cpp b/internal/core/src/index/thirdparty/SPTAG/Test/src/StringConvertTest.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/Test/src/StringConvertTest.cpp rename to internal/core/src/index/thirdparty/SPTAG/Test/src/StringConvertTest.cpp diff --git a/core/src/index/thirdparty/SPTAG/Test/src/main.cpp b/internal/core/src/index/thirdparty/SPTAG/Test/src/main.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/Test/src/main.cpp rename to internal/core/src/index/thirdparty/SPTAG/Test/src/main.cpp diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/CLRCore.vcxproj b/internal/core/src/index/thirdparty/SPTAG/Wrappers/CLRCore.vcxproj similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/CLRCore.vcxproj rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/CLRCore.vcxproj diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/CLRCore.vcxproj.filters b/internal/core/src/index/thirdparty/SPTAG/Wrappers/CLRCore.vcxproj.filters similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/CLRCore.vcxproj.filters rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/CLRCore.vcxproj.filters diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/CMakeLists.txt b/internal/core/src/index/thirdparty/SPTAG/Wrappers/CMakeLists.txt similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/CMakeLists.txt rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/CMakeLists.txt diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/CsharpClient.vcxproj b/internal/core/src/index/thirdparty/SPTAG/Wrappers/CsharpClient.vcxproj similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/CsharpClient.vcxproj rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/CsharpClient.vcxproj diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/CsharpClient.vcxproj.filters b/internal/core/src/index/thirdparty/SPTAG/Wrappers/CsharpClient.vcxproj.filters similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/CsharpClient.vcxproj.filters rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/CsharpClient.vcxproj.filters diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/CsharpCore.vcxproj b/internal/core/src/index/thirdparty/SPTAG/Wrappers/CsharpCore.vcxproj similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/CsharpCore.vcxproj rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/CsharpCore.vcxproj diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/CsharpCore.vcxproj.filters b/internal/core/src/index/thirdparty/SPTAG/Wrappers/CsharpCore.vcxproj.filters similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/CsharpCore.vcxproj.filters rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/CsharpCore.vcxproj.filters diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/JavaClient.vcxproj b/internal/core/src/index/thirdparty/SPTAG/Wrappers/JavaClient.vcxproj similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/JavaClient.vcxproj rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/JavaClient.vcxproj diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/JavaClient.vcxproj.filters b/internal/core/src/index/thirdparty/SPTAG/Wrappers/JavaClient.vcxproj.filters similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/JavaClient.vcxproj.filters rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/JavaClient.vcxproj.filters diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/JavaCore.vcxproj b/internal/core/src/index/thirdparty/SPTAG/Wrappers/JavaCore.vcxproj similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/JavaCore.vcxproj rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/JavaCore.vcxproj diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/JavaCore.vcxproj.filters b/internal/core/src/index/thirdparty/SPTAG/Wrappers/JavaCore.vcxproj.filters similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/JavaCore.vcxproj.filters rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/JavaCore.vcxproj.filters diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/PythonClient.vcxproj b/internal/core/src/index/thirdparty/SPTAG/Wrappers/PythonClient.vcxproj similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/PythonClient.vcxproj rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/PythonClient.vcxproj diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/PythonClient.vcxproj.filters b/internal/core/src/index/thirdparty/SPTAG/Wrappers/PythonClient.vcxproj.filters similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/PythonClient.vcxproj.filters rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/PythonClient.vcxproj.filters diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/PythonCore.vcxproj b/internal/core/src/index/thirdparty/SPTAG/Wrappers/PythonCore.vcxproj similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/PythonCore.vcxproj rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/PythonCore.vcxproj diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/PythonCore.vcxproj.filters b/internal/core/src/index/thirdparty/SPTAG/Wrappers/PythonCore.vcxproj.filters similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/PythonCore.vcxproj.filters rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/PythonCore.vcxproj.filters diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/PythonCore.vcxproj.user b/internal/core/src/index/thirdparty/SPTAG/Wrappers/PythonCore.vcxproj.user similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/PythonCore.vcxproj.user rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/PythonCore.vcxproj.user diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/inc/CLRCoreInterface.h b/internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/CLRCoreInterface.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/inc/CLRCoreInterface.h rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/CLRCoreInterface.h diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/inc/ClientInterface.h b/internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/ClientInterface.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/inc/ClientInterface.h rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/ClientInterface.h diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/inc/CoreInterface.h b/internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/CoreInterface.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/inc/CoreInterface.h rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/CoreInterface.h diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/inc/CsharpClient.i b/internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/CsharpClient.i similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/inc/CsharpClient.i rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/CsharpClient.i diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/inc/CsharpCommon.i b/internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/CsharpCommon.i similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/inc/CsharpCommon.i rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/CsharpCommon.i diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/inc/CsharpCore.i b/internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/CsharpCore.i similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/inc/CsharpCore.i rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/CsharpCore.i diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/inc/JavaClient.i b/internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/JavaClient.i similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/inc/JavaClient.i rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/JavaClient.i diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/inc/JavaCommon.i b/internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/JavaCommon.i similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/inc/JavaCommon.i rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/JavaCommon.i diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/inc/JavaCore.i b/internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/JavaCore.i similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/inc/JavaCore.i rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/JavaCore.i diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/inc/ManagedObject.h b/internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/ManagedObject.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/inc/ManagedObject.h rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/ManagedObject.h diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/inc/PythonClient.i b/internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/PythonClient.i similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/inc/PythonClient.i rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/PythonClient.i diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/inc/PythonCommon.i b/internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/PythonCommon.i similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/inc/PythonCommon.i rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/PythonCommon.i diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/inc/PythonCore.i b/internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/PythonCore.i similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/inc/PythonCore.i rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/PythonCore.i diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/inc/TransferDataType.h b/internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/TransferDataType.h similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/inc/TransferDataType.h rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/inc/TransferDataType.h diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/packages.config b/internal/core/src/index/thirdparty/SPTAG/Wrappers/packages.config similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/packages.config rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/packages.config diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/src/AssemblyInfo.cpp b/internal/core/src/index/thirdparty/SPTAG/Wrappers/src/AssemblyInfo.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/src/AssemblyInfo.cpp rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/src/AssemblyInfo.cpp diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/src/CLRCoreInterface.cpp b/internal/core/src/index/thirdparty/SPTAG/Wrappers/src/CLRCoreInterface.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/src/CLRCoreInterface.cpp rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/src/CLRCoreInterface.cpp diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/src/ClientInterface.cpp b/internal/core/src/index/thirdparty/SPTAG/Wrappers/src/ClientInterface.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/src/ClientInterface.cpp rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/src/ClientInterface.cpp diff --git a/core/src/index/thirdparty/SPTAG/Wrappers/src/CoreInterface.cpp b/internal/core/src/index/thirdparty/SPTAG/Wrappers/src/CoreInterface.cpp similarity index 100% rename from core/src/index/thirdparty/SPTAG/Wrappers/src/CoreInterface.cpp rename to internal/core/src/index/thirdparty/SPTAG/Wrappers/src/CoreInterface.cpp diff --git a/core/src/index/thirdparty/SPTAG/azure-pipelines.yml b/internal/core/src/index/thirdparty/SPTAG/azure-pipelines.yml similarity index 100% rename from core/src/index/thirdparty/SPTAG/azure-pipelines.yml rename to internal/core/src/index/thirdparty/SPTAG/azure-pipelines.yml diff --git a/core/src/index/thirdparty/SPTAG/docs/GettingStart.md b/internal/core/src/index/thirdparty/SPTAG/docs/GettingStart.md similarity index 100% rename from core/src/index/thirdparty/SPTAG/docs/GettingStart.md rename to internal/core/src/index/thirdparty/SPTAG/docs/GettingStart.md diff --git a/core/src/index/thirdparty/SPTAG/docs/Parameters.md b/internal/core/src/index/thirdparty/SPTAG/docs/Parameters.md similarity index 100% rename from core/src/index/thirdparty/SPTAG/docs/Parameters.md rename to internal/core/src/index/thirdparty/SPTAG/docs/Parameters.md diff --git a/core/src/index/thirdparty/SPTAG/docs/img/sptag.png b/internal/core/src/index/thirdparty/SPTAG/docs/img/sptag.png similarity index 100% rename from core/src/index/thirdparty/SPTAG/docs/img/sptag.png rename to internal/core/src/index/thirdparty/SPTAG/docs/img/sptag.png diff --git a/core/src/index/thirdparty/annoy/LICENSE b/internal/core/src/index/thirdparty/annoy/LICENSE similarity index 100% rename from core/src/index/thirdparty/annoy/LICENSE rename to internal/core/src/index/thirdparty/annoy/LICENSE diff --git a/core/src/index/thirdparty/annoy/RELEASE.md b/internal/core/src/index/thirdparty/annoy/RELEASE.md similarity index 100% rename from core/src/index/thirdparty/annoy/RELEASE.md rename to internal/core/src/index/thirdparty/annoy/RELEASE.md diff --git a/core/src/index/thirdparty/annoy/examples/mmap_test.py b/internal/core/src/index/thirdparty/annoy/examples/mmap_test.py similarity index 100% rename from core/src/index/thirdparty/annoy/examples/mmap_test.py rename to internal/core/src/index/thirdparty/annoy/examples/mmap_test.py diff --git a/core/src/index/thirdparty/annoy/examples/precision_test.cpp b/internal/core/src/index/thirdparty/annoy/examples/precision_test.cpp similarity index 100% rename from core/src/index/thirdparty/annoy/examples/precision_test.cpp rename to internal/core/src/index/thirdparty/annoy/examples/precision_test.cpp diff --git a/core/src/index/thirdparty/annoy/examples/precision_test.py b/internal/core/src/index/thirdparty/annoy/examples/precision_test.py similarity index 100% rename from core/src/index/thirdparty/annoy/examples/precision_test.py rename to internal/core/src/index/thirdparty/annoy/examples/precision_test.py diff --git a/core/src/index/thirdparty/annoy/examples/s_compile_cpp.sh b/internal/core/src/index/thirdparty/annoy/examples/s_compile_cpp.sh similarity index 100% rename from core/src/index/thirdparty/annoy/examples/s_compile_cpp.sh rename to internal/core/src/index/thirdparty/annoy/examples/s_compile_cpp.sh diff --git a/core/src/index/thirdparty/annoy/examples/simple_test.py b/internal/core/src/index/thirdparty/annoy/examples/simple_test.py similarity index 100% rename from core/src/index/thirdparty/annoy/examples/simple_test.py rename to internal/core/src/index/thirdparty/annoy/examples/simple_test.py diff --git a/core/src/index/thirdparty/annoy/src/annoygomodule.h b/internal/core/src/index/thirdparty/annoy/src/annoygomodule.h similarity index 100% rename from core/src/index/thirdparty/annoy/src/annoygomodule.h rename to internal/core/src/index/thirdparty/annoy/src/annoygomodule.h diff --git a/core/src/index/thirdparty/annoy/src/annoygomodule.i b/internal/core/src/index/thirdparty/annoy/src/annoygomodule.i similarity index 100% rename from core/src/index/thirdparty/annoy/src/annoygomodule.i rename to internal/core/src/index/thirdparty/annoy/src/annoygomodule.i diff --git a/core/src/index/thirdparty/annoy/src/annoylib.h b/internal/core/src/index/thirdparty/annoy/src/annoylib.h similarity index 100% rename from core/src/index/thirdparty/annoy/src/annoylib.h rename to internal/core/src/index/thirdparty/annoy/src/annoylib.h diff --git a/core/src/index/thirdparty/annoy/src/annoyluamodule.cc b/internal/core/src/index/thirdparty/annoy/src/annoyluamodule.cc similarity index 100% rename from core/src/index/thirdparty/annoy/src/annoyluamodule.cc rename to internal/core/src/index/thirdparty/annoy/src/annoyluamodule.cc diff --git a/core/src/index/thirdparty/annoy/src/annoymodule.cc b/internal/core/src/index/thirdparty/annoy/src/annoymodule.cc similarity index 100% rename from core/src/index/thirdparty/annoy/src/annoymodule.cc rename to internal/core/src/index/thirdparty/annoy/src/annoymodule.cc diff --git a/core/src/index/thirdparty/annoy/src/kissrandom.h b/internal/core/src/index/thirdparty/annoy/src/kissrandom.h similarity index 100% rename from core/src/index/thirdparty/annoy/src/kissrandom.h rename to internal/core/src/index/thirdparty/annoy/src/kissrandom.h diff --git a/core/src/index/thirdparty/annoy/src/mman.h b/internal/core/src/index/thirdparty/annoy/src/mman.h similarity index 100% rename from core/src/index/thirdparty/annoy/src/mman.h rename to internal/core/src/index/thirdparty/annoy/src/mman.h diff --git a/core/src/index/thirdparty/build.sh b/internal/core/src/index/thirdparty/build.sh similarity index 100% rename from core/src/index/thirdparty/build.sh rename to internal/core/src/index/thirdparty/build.sh diff --git a/core/src/index/thirdparty/faiss/.dockerignore b/internal/core/src/index/thirdparty/faiss/.dockerignore similarity index 100% rename from core/src/index/thirdparty/faiss/.dockerignore rename to internal/core/src/index/thirdparty/faiss/.dockerignore diff --git a/core/src/index/thirdparty/faiss/.gitignore b/internal/core/src/index/thirdparty/faiss/.gitignore similarity index 100% rename from core/src/index/thirdparty/faiss/.gitignore rename to internal/core/src/index/thirdparty/faiss/.gitignore diff --git a/core/src/index/thirdparty/faiss/AutoTune.cpp b/internal/core/src/index/thirdparty/faiss/AutoTune.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/AutoTune.cpp rename to internal/core/src/index/thirdparty/faiss/AutoTune.cpp diff --git a/core/src/index/thirdparty/faiss/AutoTune.h b/internal/core/src/index/thirdparty/faiss/AutoTune.h similarity index 100% rename from core/src/index/thirdparty/faiss/AutoTune.h rename to internal/core/src/index/thirdparty/faiss/AutoTune.h diff --git a/core/src/index/thirdparty/faiss/BuilderSuspend.cpp b/internal/core/src/index/thirdparty/faiss/BuilderSuspend.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/BuilderSuspend.cpp rename to internal/core/src/index/thirdparty/faiss/BuilderSuspend.cpp diff --git a/core/src/index/thirdparty/faiss/BuilderSuspend.h b/internal/core/src/index/thirdparty/faiss/BuilderSuspend.h similarity index 100% rename from core/src/index/thirdparty/faiss/BuilderSuspend.h rename to internal/core/src/index/thirdparty/faiss/BuilderSuspend.h diff --git a/core/src/index/thirdparty/faiss/CODE_OF_CONDUCT.md b/internal/core/src/index/thirdparty/faiss/CODE_OF_CONDUCT.md similarity index 100% rename from core/src/index/thirdparty/faiss/CODE_OF_CONDUCT.md rename to internal/core/src/index/thirdparty/faiss/CODE_OF_CONDUCT.md diff --git a/core/src/index/thirdparty/faiss/CONTRIBUTING.md b/internal/core/src/index/thirdparty/faiss/CONTRIBUTING.md similarity index 100% rename from core/src/index/thirdparty/faiss/CONTRIBUTING.md rename to internal/core/src/index/thirdparty/faiss/CONTRIBUTING.md diff --git a/core/src/index/thirdparty/faiss/Clustering.cpp b/internal/core/src/index/thirdparty/faiss/Clustering.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/Clustering.cpp rename to internal/core/src/index/thirdparty/faiss/Clustering.cpp diff --git a/core/src/index/thirdparty/faiss/Clustering.h b/internal/core/src/index/thirdparty/faiss/Clustering.h similarity index 100% rename from core/src/index/thirdparty/faiss/Clustering.h rename to internal/core/src/index/thirdparty/faiss/Clustering.h diff --git a/core/src/index/thirdparty/faiss/DirectMap.cpp b/internal/core/src/index/thirdparty/faiss/DirectMap.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/DirectMap.cpp rename to internal/core/src/index/thirdparty/faiss/DirectMap.cpp diff --git a/core/src/index/thirdparty/faiss/DirectMap.h b/internal/core/src/index/thirdparty/faiss/DirectMap.h similarity index 100% rename from core/src/index/thirdparty/faiss/DirectMap.h rename to internal/core/src/index/thirdparty/faiss/DirectMap.h diff --git a/core/src/index/thirdparty/faiss/Dockerfile b/internal/core/src/index/thirdparty/faiss/Dockerfile similarity index 100% rename from core/src/index/thirdparty/faiss/Dockerfile rename to internal/core/src/index/thirdparty/faiss/Dockerfile diff --git a/core/src/index/thirdparty/faiss/FaissHook.cpp b/internal/core/src/index/thirdparty/faiss/FaissHook.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/FaissHook.cpp rename to internal/core/src/index/thirdparty/faiss/FaissHook.cpp diff --git a/core/src/index/thirdparty/faiss/FaissHook.h b/internal/core/src/index/thirdparty/faiss/FaissHook.h similarity index 100% rename from core/src/index/thirdparty/faiss/FaissHook.h rename to internal/core/src/index/thirdparty/faiss/FaissHook.h diff --git a/core/src/index/thirdparty/faiss/INSTALL.md b/internal/core/src/index/thirdparty/faiss/INSTALL.md similarity index 100% rename from core/src/index/thirdparty/faiss/INSTALL.md rename to internal/core/src/index/thirdparty/faiss/INSTALL.md diff --git a/core/src/index/thirdparty/faiss/IVFlib.cpp b/internal/core/src/index/thirdparty/faiss/IVFlib.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IVFlib.cpp rename to internal/core/src/index/thirdparty/faiss/IVFlib.cpp diff --git a/core/src/index/thirdparty/faiss/IVFlib.h b/internal/core/src/index/thirdparty/faiss/IVFlib.h similarity index 100% rename from core/src/index/thirdparty/faiss/IVFlib.h rename to internal/core/src/index/thirdparty/faiss/IVFlib.h diff --git a/core/src/index/thirdparty/faiss/Index.cpp b/internal/core/src/index/thirdparty/faiss/Index.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/Index.cpp rename to internal/core/src/index/thirdparty/faiss/Index.cpp diff --git a/core/src/index/thirdparty/faiss/Index.h b/internal/core/src/index/thirdparty/faiss/Index.h similarity index 100% rename from core/src/index/thirdparty/faiss/Index.h rename to internal/core/src/index/thirdparty/faiss/Index.h diff --git a/core/src/index/thirdparty/faiss/Index2Layer.cpp b/internal/core/src/index/thirdparty/faiss/Index2Layer.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/Index2Layer.cpp rename to internal/core/src/index/thirdparty/faiss/Index2Layer.cpp diff --git a/core/src/index/thirdparty/faiss/Index2Layer.h b/internal/core/src/index/thirdparty/faiss/Index2Layer.h similarity index 100% rename from core/src/index/thirdparty/faiss/Index2Layer.h rename to internal/core/src/index/thirdparty/faiss/Index2Layer.h diff --git a/core/src/index/thirdparty/faiss/IndexBinary.cpp b/internal/core/src/index/thirdparty/faiss/IndexBinary.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexBinary.cpp rename to internal/core/src/index/thirdparty/faiss/IndexBinary.cpp diff --git a/core/src/index/thirdparty/faiss/IndexBinary.h b/internal/core/src/index/thirdparty/faiss/IndexBinary.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexBinary.h rename to internal/core/src/index/thirdparty/faiss/IndexBinary.h diff --git a/core/src/index/thirdparty/faiss/IndexBinaryFlat.cpp b/internal/core/src/index/thirdparty/faiss/IndexBinaryFlat.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexBinaryFlat.cpp rename to internal/core/src/index/thirdparty/faiss/IndexBinaryFlat.cpp diff --git a/core/src/index/thirdparty/faiss/IndexBinaryFlat.h b/internal/core/src/index/thirdparty/faiss/IndexBinaryFlat.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexBinaryFlat.h rename to internal/core/src/index/thirdparty/faiss/IndexBinaryFlat.h diff --git a/core/src/index/thirdparty/faiss/IndexBinaryFromFloat.cpp b/internal/core/src/index/thirdparty/faiss/IndexBinaryFromFloat.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexBinaryFromFloat.cpp rename to internal/core/src/index/thirdparty/faiss/IndexBinaryFromFloat.cpp diff --git a/core/src/index/thirdparty/faiss/IndexBinaryFromFloat.h b/internal/core/src/index/thirdparty/faiss/IndexBinaryFromFloat.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexBinaryFromFloat.h rename to internal/core/src/index/thirdparty/faiss/IndexBinaryFromFloat.h diff --git a/core/src/index/thirdparty/faiss/IndexBinaryHNSW.cpp b/internal/core/src/index/thirdparty/faiss/IndexBinaryHNSW.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexBinaryHNSW.cpp rename to internal/core/src/index/thirdparty/faiss/IndexBinaryHNSW.cpp diff --git a/core/src/index/thirdparty/faiss/IndexBinaryHNSW.h b/internal/core/src/index/thirdparty/faiss/IndexBinaryHNSW.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexBinaryHNSW.h rename to internal/core/src/index/thirdparty/faiss/IndexBinaryHNSW.h diff --git a/core/src/index/thirdparty/faiss/IndexBinaryHash.cpp b/internal/core/src/index/thirdparty/faiss/IndexBinaryHash.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexBinaryHash.cpp rename to internal/core/src/index/thirdparty/faiss/IndexBinaryHash.cpp diff --git a/core/src/index/thirdparty/faiss/IndexBinaryHash.h b/internal/core/src/index/thirdparty/faiss/IndexBinaryHash.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexBinaryHash.h rename to internal/core/src/index/thirdparty/faiss/IndexBinaryHash.h diff --git a/core/src/index/thirdparty/faiss/IndexBinaryIVF.cpp b/internal/core/src/index/thirdparty/faiss/IndexBinaryIVF.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexBinaryIVF.cpp rename to internal/core/src/index/thirdparty/faiss/IndexBinaryIVF.cpp diff --git a/core/src/index/thirdparty/faiss/IndexBinaryIVF.h b/internal/core/src/index/thirdparty/faiss/IndexBinaryIVF.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexBinaryIVF.h rename to internal/core/src/index/thirdparty/faiss/IndexBinaryIVF.h diff --git a/core/src/index/thirdparty/faiss/IndexFlat.cpp b/internal/core/src/index/thirdparty/faiss/IndexFlat.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexFlat.cpp rename to internal/core/src/index/thirdparty/faiss/IndexFlat.cpp diff --git a/core/src/index/thirdparty/faiss/IndexFlat.h b/internal/core/src/index/thirdparty/faiss/IndexFlat.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexFlat.h rename to internal/core/src/index/thirdparty/faiss/IndexFlat.h diff --git a/core/src/index/thirdparty/faiss/IndexHNSW.cpp b/internal/core/src/index/thirdparty/faiss/IndexHNSW.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexHNSW.cpp rename to internal/core/src/index/thirdparty/faiss/IndexHNSW.cpp diff --git a/core/src/index/thirdparty/faiss/IndexHNSW.h b/internal/core/src/index/thirdparty/faiss/IndexHNSW.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexHNSW.h rename to internal/core/src/index/thirdparty/faiss/IndexHNSW.h diff --git a/core/src/index/thirdparty/faiss/IndexIVF.cpp b/internal/core/src/index/thirdparty/faiss/IndexIVF.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexIVF.cpp rename to internal/core/src/index/thirdparty/faiss/IndexIVF.cpp diff --git a/core/src/index/thirdparty/faiss/IndexIVF.h b/internal/core/src/index/thirdparty/faiss/IndexIVF.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexIVF.h rename to internal/core/src/index/thirdparty/faiss/IndexIVF.h diff --git a/core/src/index/thirdparty/faiss/IndexIVFFlat.cpp b/internal/core/src/index/thirdparty/faiss/IndexIVFFlat.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexIVFFlat.cpp rename to internal/core/src/index/thirdparty/faiss/IndexIVFFlat.cpp diff --git a/core/src/index/thirdparty/faiss/IndexIVFFlat.h b/internal/core/src/index/thirdparty/faiss/IndexIVFFlat.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexIVFFlat.h rename to internal/core/src/index/thirdparty/faiss/IndexIVFFlat.h diff --git a/core/src/index/thirdparty/faiss/IndexIVFPQ.cpp b/internal/core/src/index/thirdparty/faiss/IndexIVFPQ.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexIVFPQ.cpp rename to internal/core/src/index/thirdparty/faiss/IndexIVFPQ.cpp diff --git a/core/src/index/thirdparty/faiss/IndexIVFPQ.h b/internal/core/src/index/thirdparty/faiss/IndexIVFPQ.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexIVFPQ.h rename to internal/core/src/index/thirdparty/faiss/IndexIVFPQ.h diff --git a/core/src/index/thirdparty/faiss/IndexIVFPQR.cpp b/internal/core/src/index/thirdparty/faiss/IndexIVFPQR.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexIVFPQR.cpp rename to internal/core/src/index/thirdparty/faiss/IndexIVFPQR.cpp diff --git a/core/src/index/thirdparty/faiss/IndexIVFPQR.h b/internal/core/src/index/thirdparty/faiss/IndexIVFPQR.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexIVFPQR.h rename to internal/core/src/index/thirdparty/faiss/IndexIVFPQR.h diff --git a/core/src/index/thirdparty/faiss/IndexIVFSpectralHash.cpp b/internal/core/src/index/thirdparty/faiss/IndexIVFSpectralHash.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexIVFSpectralHash.cpp rename to internal/core/src/index/thirdparty/faiss/IndexIVFSpectralHash.cpp diff --git a/core/src/index/thirdparty/faiss/IndexIVFSpectralHash.h b/internal/core/src/index/thirdparty/faiss/IndexIVFSpectralHash.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexIVFSpectralHash.h rename to internal/core/src/index/thirdparty/faiss/IndexIVFSpectralHash.h diff --git a/core/src/index/thirdparty/faiss/IndexLSH.cpp b/internal/core/src/index/thirdparty/faiss/IndexLSH.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexLSH.cpp rename to internal/core/src/index/thirdparty/faiss/IndexLSH.cpp diff --git a/core/src/index/thirdparty/faiss/IndexLSH.h b/internal/core/src/index/thirdparty/faiss/IndexLSH.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexLSH.h rename to internal/core/src/index/thirdparty/faiss/IndexLSH.h diff --git a/core/src/index/thirdparty/faiss/IndexLattice.cpp b/internal/core/src/index/thirdparty/faiss/IndexLattice.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexLattice.cpp rename to internal/core/src/index/thirdparty/faiss/IndexLattice.cpp diff --git a/core/src/index/thirdparty/faiss/IndexLattice.h b/internal/core/src/index/thirdparty/faiss/IndexLattice.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexLattice.h rename to internal/core/src/index/thirdparty/faiss/IndexLattice.h diff --git a/core/src/index/thirdparty/faiss/IndexPQ.cpp b/internal/core/src/index/thirdparty/faiss/IndexPQ.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexPQ.cpp rename to internal/core/src/index/thirdparty/faiss/IndexPQ.cpp diff --git a/core/src/index/thirdparty/faiss/IndexPQ.h b/internal/core/src/index/thirdparty/faiss/IndexPQ.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexPQ.h rename to internal/core/src/index/thirdparty/faiss/IndexPQ.h diff --git a/core/src/index/thirdparty/faiss/IndexPreTransform.cpp b/internal/core/src/index/thirdparty/faiss/IndexPreTransform.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexPreTransform.cpp rename to internal/core/src/index/thirdparty/faiss/IndexPreTransform.cpp diff --git a/core/src/index/thirdparty/faiss/IndexPreTransform.h b/internal/core/src/index/thirdparty/faiss/IndexPreTransform.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexPreTransform.h rename to internal/core/src/index/thirdparty/faiss/IndexPreTransform.h diff --git a/core/src/index/thirdparty/faiss/IndexRHNSW.cpp b/internal/core/src/index/thirdparty/faiss/IndexRHNSW.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexRHNSW.cpp rename to internal/core/src/index/thirdparty/faiss/IndexRHNSW.cpp diff --git a/core/src/index/thirdparty/faiss/IndexRHNSW.h b/internal/core/src/index/thirdparty/faiss/IndexRHNSW.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexRHNSW.h rename to internal/core/src/index/thirdparty/faiss/IndexRHNSW.h diff --git a/core/src/index/thirdparty/faiss/IndexReplicas.cpp b/internal/core/src/index/thirdparty/faiss/IndexReplicas.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexReplicas.cpp rename to internal/core/src/index/thirdparty/faiss/IndexReplicas.cpp diff --git a/core/src/index/thirdparty/faiss/IndexReplicas.h b/internal/core/src/index/thirdparty/faiss/IndexReplicas.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexReplicas.h rename to internal/core/src/index/thirdparty/faiss/IndexReplicas.h diff --git a/core/src/index/thirdparty/faiss/IndexSQHybrid.cpp b/internal/core/src/index/thirdparty/faiss/IndexSQHybrid.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexSQHybrid.cpp rename to internal/core/src/index/thirdparty/faiss/IndexSQHybrid.cpp diff --git a/core/src/index/thirdparty/faiss/IndexSQHybrid.h b/internal/core/src/index/thirdparty/faiss/IndexSQHybrid.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexSQHybrid.h rename to internal/core/src/index/thirdparty/faiss/IndexSQHybrid.h diff --git a/core/src/index/thirdparty/faiss/IndexScalarQuantizer.cpp b/internal/core/src/index/thirdparty/faiss/IndexScalarQuantizer.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexScalarQuantizer.cpp rename to internal/core/src/index/thirdparty/faiss/IndexScalarQuantizer.cpp diff --git a/core/src/index/thirdparty/faiss/IndexScalarQuantizer.h b/internal/core/src/index/thirdparty/faiss/IndexScalarQuantizer.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexScalarQuantizer.h rename to internal/core/src/index/thirdparty/faiss/IndexScalarQuantizer.h diff --git a/core/src/index/thirdparty/faiss/IndexShards.cpp b/internal/core/src/index/thirdparty/faiss/IndexShards.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/IndexShards.cpp rename to internal/core/src/index/thirdparty/faiss/IndexShards.cpp diff --git a/core/src/index/thirdparty/faiss/IndexShards.h b/internal/core/src/index/thirdparty/faiss/IndexShards.h similarity index 100% rename from core/src/index/thirdparty/faiss/IndexShards.h rename to internal/core/src/index/thirdparty/faiss/IndexShards.h diff --git a/core/src/index/thirdparty/faiss/InvertedLists.cpp b/internal/core/src/index/thirdparty/faiss/InvertedLists.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/InvertedLists.cpp rename to internal/core/src/index/thirdparty/faiss/InvertedLists.cpp diff --git a/core/src/index/thirdparty/faiss/InvertedLists.h b/internal/core/src/index/thirdparty/faiss/InvertedLists.h similarity index 100% rename from core/src/index/thirdparty/faiss/InvertedLists.h rename to internal/core/src/index/thirdparty/faiss/InvertedLists.h diff --git a/core/src/index/thirdparty/faiss/LICENSE b/internal/core/src/index/thirdparty/faiss/LICENSE similarity index 100% rename from core/src/index/thirdparty/faiss/LICENSE rename to internal/core/src/index/thirdparty/faiss/LICENSE diff --git a/core/src/index/thirdparty/faiss/Makefile b/internal/core/src/index/thirdparty/faiss/Makefile similarity index 100% rename from core/src/index/thirdparty/faiss/Makefile rename to internal/core/src/index/thirdparty/faiss/Makefile diff --git a/core/src/index/thirdparty/faiss/MatrixStats.cpp b/internal/core/src/index/thirdparty/faiss/MatrixStats.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/MatrixStats.cpp rename to internal/core/src/index/thirdparty/faiss/MatrixStats.cpp diff --git a/core/src/index/thirdparty/faiss/MatrixStats.h b/internal/core/src/index/thirdparty/faiss/MatrixStats.h similarity index 100% rename from core/src/index/thirdparty/faiss/MatrixStats.h rename to internal/core/src/index/thirdparty/faiss/MatrixStats.h diff --git a/core/src/index/thirdparty/faiss/MetaIndexes.cpp b/internal/core/src/index/thirdparty/faiss/MetaIndexes.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/MetaIndexes.cpp rename to internal/core/src/index/thirdparty/faiss/MetaIndexes.cpp diff --git a/core/src/index/thirdparty/faiss/MetaIndexes.h b/internal/core/src/index/thirdparty/faiss/MetaIndexes.h similarity index 100% rename from core/src/index/thirdparty/faiss/MetaIndexes.h rename to internal/core/src/index/thirdparty/faiss/MetaIndexes.h diff --git a/core/src/index/thirdparty/faiss/MetricType.h b/internal/core/src/index/thirdparty/faiss/MetricType.h similarity index 100% rename from core/src/index/thirdparty/faiss/MetricType.h rename to internal/core/src/index/thirdparty/faiss/MetricType.h diff --git a/core/src/index/thirdparty/faiss/OnDiskInvertedLists.cpp b/internal/core/src/index/thirdparty/faiss/OnDiskInvertedLists.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/OnDiskInvertedLists.cpp rename to internal/core/src/index/thirdparty/faiss/OnDiskInvertedLists.cpp diff --git a/core/src/index/thirdparty/faiss/OnDiskInvertedLists.h b/internal/core/src/index/thirdparty/faiss/OnDiskInvertedLists.h similarity index 100% rename from core/src/index/thirdparty/faiss/OnDiskInvertedLists.h rename to internal/core/src/index/thirdparty/faiss/OnDiskInvertedLists.h diff --git a/core/src/index/thirdparty/faiss/README.md b/internal/core/src/index/thirdparty/faiss/README.md similarity index 100% rename from core/src/index/thirdparty/faiss/README.md rename to internal/core/src/index/thirdparty/faiss/README.md diff --git a/core/src/index/thirdparty/faiss/VectorTransform.cpp b/internal/core/src/index/thirdparty/faiss/VectorTransform.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/VectorTransform.cpp rename to internal/core/src/index/thirdparty/faiss/VectorTransform.cpp diff --git a/core/src/index/thirdparty/faiss/VectorTransform.h b/internal/core/src/index/thirdparty/faiss/VectorTransform.h similarity index 100% rename from core/src/index/thirdparty/faiss/VectorTransform.h rename to internal/core/src/index/thirdparty/faiss/VectorTransform.h diff --git a/core/src/index/thirdparty/faiss/acinclude/ax_blas.m4 b/internal/core/src/index/thirdparty/faiss/acinclude/ax_blas.m4 similarity index 100% rename from core/src/index/thirdparty/faiss/acinclude/ax_blas.m4 rename to internal/core/src/index/thirdparty/faiss/acinclude/ax_blas.m4 diff --git a/core/src/index/thirdparty/faiss/acinclude/ax_check_cpu.m4 b/internal/core/src/index/thirdparty/faiss/acinclude/ax_check_cpu.m4 similarity index 100% rename from core/src/index/thirdparty/faiss/acinclude/ax_check_cpu.m4 rename to internal/core/src/index/thirdparty/faiss/acinclude/ax_check_cpu.m4 diff --git a/core/src/index/thirdparty/faiss/acinclude/ax_cxx_compile_stdcxx.m4 b/internal/core/src/index/thirdparty/faiss/acinclude/ax_cxx_compile_stdcxx.m4 similarity index 100% rename from core/src/index/thirdparty/faiss/acinclude/ax_cxx_compile_stdcxx.m4 rename to internal/core/src/index/thirdparty/faiss/acinclude/ax_cxx_compile_stdcxx.m4 diff --git a/core/src/index/thirdparty/faiss/acinclude/ax_lapack.m4 b/internal/core/src/index/thirdparty/faiss/acinclude/ax_lapack.m4 similarity index 100% rename from core/src/index/thirdparty/faiss/acinclude/ax_lapack.m4 rename to internal/core/src/index/thirdparty/faiss/acinclude/ax_lapack.m4 diff --git a/core/src/index/thirdparty/faiss/acinclude/fa_check_cuda.m4 b/internal/core/src/index/thirdparty/faiss/acinclude/fa_check_cuda.m4 similarity index 100% rename from core/src/index/thirdparty/faiss/acinclude/fa_check_cuda.m4 rename to internal/core/src/index/thirdparty/faiss/acinclude/fa_check_cuda.m4 diff --git a/core/src/index/thirdparty/faiss/acinclude/fa_numpy.m4 b/internal/core/src/index/thirdparty/faiss/acinclude/fa_numpy.m4 similarity index 100% rename from core/src/index/thirdparty/faiss/acinclude/fa_numpy.m4 rename to internal/core/src/index/thirdparty/faiss/acinclude/fa_numpy.m4 diff --git a/core/src/index/thirdparty/faiss/acinclude/fa_prog_nm.m4 b/internal/core/src/index/thirdparty/faiss/acinclude/fa_prog_nm.m4 similarity index 100% rename from core/src/index/thirdparty/faiss/acinclude/fa_prog_nm.m4 rename to internal/core/src/index/thirdparty/faiss/acinclude/fa_prog_nm.m4 diff --git a/core/src/index/thirdparty/faiss/acinclude/fa_prog_swig.m4 b/internal/core/src/index/thirdparty/faiss/acinclude/fa_prog_swig.m4 similarity index 100% rename from core/src/index/thirdparty/faiss/acinclude/fa_prog_swig.m4 rename to internal/core/src/index/thirdparty/faiss/acinclude/fa_prog_swig.m4 diff --git a/core/src/index/thirdparty/faiss/acinclude/fa_python.m4 b/internal/core/src/index/thirdparty/faiss/acinclude/fa_python.m4 similarity index 100% rename from core/src/index/thirdparty/faiss/acinclude/fa_python.m4 rename to internal/core/src/index/thirdparty/faiss/acinclude/fa_python.m4 diff --git a/core/src/index/thirdparty/faiss/benchs/README.md b/internal/core/src/index/thirdparty/faiss/benchs/README.md similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/README.md rename to internal/core/src/index/thirdparty/faiss/benchs/README.md diff --git a/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/README.md b/internal/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/README.md similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/bench_all_ivf/README.md rename to internal/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/README.md diff --git a/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/bench_all_ivf.py b/internal/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/bench_all_ivf.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/bench_all_ivf/bench_all_ivf.py rename to internal/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/bench_all_ivf.py diff --git a/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/bench_kmeans.py b/internal/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/bench_kmeans.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/bench_all_ivf/bench_kmeans.py rename to internal/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/bench_kmeans.py diff --git a/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/datasets.py b/internal/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/datasets.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/bench_all_ivf/datasets.py rename to internal/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/datasets.py diff --git a/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/parse_bench_all_ivf.py b/internal/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/parse_bench_all_ivf.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/bench_all_ivf/parse_bench_all_ivf.py rename to internal/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/parse_bench_all_ivf.py diff --git a/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/run_on_cluster_generic.bash b/internal/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/run_on_cluster_generic.bash similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/bench_all_ivf/run_on_cluster_generic.bash rename to internal/core/src/index/thirdparty/faiss/benchs/bench_all_ivf/run_on_cluster_generic.bash diff --git a/core/src/index/thirdparty/faiss/benchs/bench_for_interrupt.py b/internal/core/src/index/thirdparty/faiss/benchs/bench_for_interrupt.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/bench_for_interrupt.py rename to internal/core/src/index/thirdparty/faiss/benchs/bench_for_interrupt.py diff --git a/core/src/index/thirdparty/faiss/benchs/bench_gpu_1bn.py b/internal/core/src/index/thirdparty/faiss/benchs/bench_gpu_1bn.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/bench_gpu_1bn.py rename to internal/core/src/index/thirdparty/faiss/benchs/bench_gpu_1bn.py diff --git a/core/src/index/thirdparty/faiss/benchs/bench_gpu_sift1m.py b/internal/core/src/index/thirdparty/faiss/benchs/bench_gpu_sift1m.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/bench_gpu_sift1m.py rename to internal/core/src/index/thirdparty/faiss/benchs/bench_gpu_sift1m.py diff --git a/core/src/index/thirdparty/faiss/benchs/bench_hnsw.py b/internal/core/src/index/thirdparty/faiss/benchs/bench_hnsw.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/bench_hnsw.py rename to internal/core/src/index/thirdparty/faiss/benchs/bench_hnsw.py diff --git a/core/src/index/thirdparty/faiss/benchs/bench_index_pq.py b/internal/core/src/index/thirdparty/faiss/benchs/bench_index_pq.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/bench_index_pq.py rename to internal/core/src/index/thirdparty/faiss/benchs/bench_index_pq.py diff --git a/core/src/index/thirdparty/faiss/benchs/bench_pairwise_distances.py b/internal/core/src/index/thirdparty/faiss/benchs/bench_pairwise_distances.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/bench_pairwise_distances.py rename to internal/core/src/index/thirdparty/faiss/benchs/bench_pairwise_distances.py diff --git a/core/src/index/thirdparty/faiss/benchs/bench_polysemous_1bn.py b/internal/core/src/index/thirdparty/faiss/benchs/bench_polysemous_1bn.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/bench_polysemous_1bn.py rename to internal/core/src/index/thirdparty/faiss/benchs/bench_polysemous_1bn.py diff --git a/core/src/index/thirdparty/faiss/benchs/bench_polysemous_sift1m.py b/internal/core/src/index/thirdparty/faiss/benchs/bench_polysemous_sift1m.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/bench_polysemous_sift1m.py rename to internal/core/src/index/thirdparty/faiss/benchs/bench_polysemous_sift1m.py diff --git a/core/src/index/thirdparty/faiss/benchs/bench_scalar_quantizer.py b/internal/core/src/index/thirdparty/faiss/benchs/bench_scalar_quantizer.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/bench_scalar_quantizer.py rename to internal/core/src/index/thirdparty/faiss/benchs/bench_scalar_quantizer.py diff --git a/core/src/index/thirdparty/faiss/benchs/bench_vector_ops.py b/internal/core/src/index/thirdparty/faiss/benchs/bench_vector_ops.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/bench_vector_ops.py rename to internal/core/src/index/thirdparty/faiss/benchs/bench_vector_ops.py diff --git a/core/src/index/thirdparty/faiss/benchs/datasets.py b/internal/core/src/index/thirdparty/faiss/benchs/datasets.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/datasets.py rename to internal/core/src/index/thirdparty/faiss/benchs/datasets.py diff --git a/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/README.md b/internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/README.md similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/distributed_ondisk/README.md rename to internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/README.md diff --git a/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/combined_index.py b/internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/combined_index.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/distributed_ondisk/combined_index.py rename to internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/combined_index.py diff --git a/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/distributed_kmeans.py b/internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/distributed_kmeans.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/distributed_ondisk/distributed_kmeans.py rename to internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/distributed_kmeans.py diff --git a/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/distributed_query_demo.py b/internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/distributed_query_demo.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/distributed_ondisk/distributed_query_demo.py rename to internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/distributed_query_demo.py diff --git a/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/make_index_vslice.py b/internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/make_index_vslice.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/distributed_ondisk/make_index_vslice.py rename to internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/make_index_vslice.py diff --git a/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/make_trained_index.py b/internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/make_trained_index.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/distributed_ondisk/make_trained_index.py rename to internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/make_trained_index.py diff --git a/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/merge_to_ondisk.py b/internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/merge_to_ondisk.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/distributed_ondisk/merge_to_ondisk.py rename to internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/merge_to_ondisk.py diff --git a/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/rpc.py b/internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/rpc.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/distributed_ondisk/rpc.py rename to internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/rpc.py diff --git a/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/run_on_cluster.bash b/internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/run_on_cluster.bash similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/distributed_ondisk/run_on_cluster.bash rename to internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/run_on_cluster.bash diff --git a/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/search_server.py b/internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/search_server.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/distributed_ondisk/search_server.py rename to internal/core/src/index/thirdparty/faiss/benchs/distributed_ondisk/search_server.py diff --git a/core/src/index/thirdparty/faiss/benchs/kmeans_mnist.py b/internal/core/src/index/thirdparty/faiss/benchs/kmeans_mnist.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/kmeans_mnist.py rename to internal/core/src/index/thirdparty/faiss/benchs/kmeans_mnist.py diff --git a/core/src/index/thirdparty/faiss/benchs/link_and_code/README.md b/internal/core/src/index/thirdparty/faiss/benchs/link_and_code/README.md similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/link_and_code/README.md rename to internal/core/src/index/thirdparty/faiss/benchs/link_and_code/README.md diff --git a/core/src/index/thirdparty/faiss/benchs/link_and_code/bench_link_and_code.py b/internal/core/src/index/thirdparty/faiss/benchs/link_and_code/bench_link_and_code.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/link_and_code/bench_link_and_code.py rename to internal/core/src/index/thirdparty/faiss/benchs/link_and_code/bench_link_and_code.py diff --git a/core/src/index/thirdparty/faiss/benchs/link_and_code/datasets.py b/internal/core/src/index/thirdparty/faiss/benchs/link_and_code/datasets.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/link_and_code/datasets.py rename to internal/core/src/index/thirdparty/faiss/benchs/link_and_code/datasets.py diff --git a/core/src/index/thirdparty/faiss/benchs/link_and_code/neighbor_codec.py b/internal/core/src/index/thirdparty/faiss/benchs/link_and_code/neighbor_codec.py similarity index 100% rename from core/src/index/thirdparty/faiss/benchs/link_and_code/neighbor_codec.py rename to internal/core/src/index/thirdparty/faiss/benchs/link_and_code/neighbor_codec.py diff --git a/core/src/index/thirdparty/faiss/build-aux/config.guess b/internal/core/src/index/thirdparty/faiss/build-aux/config.guess similarity index 100% rename from core/src/index/thirdparty/faiss/build-aux/config.guess rename to internal/core/src/index/thirdparty/faiss/build-aux/config.guess diff --git a/core/src/index/thirdparty/faiss/build-aux/config.sub b/internal/core/src/index/thirdparty/faiss/build-aux/config.sub similarity index 100% rename from core/src/index/thirdparty/faiss/build-aux/config.sub rename to internal/core/src/index/thirdparty/faiss/build-aux/config.sub diff --git a/core/src/index/thirdparty/faiss/build-aux/install-sh b/internal/core/src/index/thirdparty/faiss/build-aux/install-sh similarity index 100% rename from core/src/index/thirdparty/faiss/build-aux/install-sh rename to internal/core/src/index/thirdparty/faiss/build-aux/install-sh diff --git a/core/src/index/thirdparty/faiss/build.sh b/internal/core/src/index/thirdparty/faiss/build.sh similarity index 100% rename from core/src/index/thirdparty/faiss/build.sh rename to internal/core/src/index/thirdparty/faiss/build.sh diff --git a/core/src/index/thirdparty/faiss/c_api/AutoTune_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/AutoTune_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/AutoTune_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/AutoTune_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/AutoTune_c.h b/internal/core/src/index/thirdparty/faiss/c_api/AutoTune_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/AutoTune_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/AutoTune_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/Clustering_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/Clustering_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/Clustering_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/Clustering_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/Clustering_c.h b/internal/core/src/index/thirdparty/faiss/c_api/Clustering_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/Clustering_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/Clustering_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/INSTALL.md b/internal/core/src/index/thirdparty/faiss/c_api/INSTALL.md similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/INSTALL.md rename to internal/core/src/index/thirdparty/faiss/c_api/INSTALL.md diff --git a/core/src/index/thirdparty/faiss/c_api/IndexFlat_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/IndexFlat_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/IndexFlat_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/IndexFlat_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/IndexFlat_c.h b/internal/core/src/index/thirdparty/faiss/c_api/IndexFlat_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/IndexFlat_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/IndexFlat_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/IndexIVFFlat_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/IndexIVFFlat_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/IndexIVFFlat_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/IndexIVFFlat_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/IndexIVFFlat_c.h b/internal/core/src/index/thirdparty/faiss/c_api/IndexIVFFlat_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/IndexIVFFlat_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/IndexIVFFlat_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/IndexIVF_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/IndexIVF_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/IndexIVF_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/IndexIVF_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/IndexIVF_c.h b/internal/core/src/index/thirdparty/faiss/c_api/IndexIVF_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/IndexIVF_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/IndexIVF_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/IndexLSH_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/IndexLSH_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/IndexLSH_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/IndexLSH_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/IndexLSH_c.h b/internal/core/src/index/thirdparty/faiss/c_api/IndexLSH_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/IndexLSH_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/IndexLSH_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/IndexPreTransform_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/IndexPreTransform_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/IndexPreTransform_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/IndexPreTransform_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/IndexPreTransform_c.h b/internal/core/src/index/thirdparty/faiss/c_api/IndexPreTransform_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/IndexPreTransform_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/IndexPreTransform_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/IndexShards_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/IndexShards_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/IndexShards_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/IndexShards_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/IndexShards_c.h b/internal/core/src/index/thirdparty/faiss/c_api/IndexShards_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/IndexShards_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/IndexShards_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/Index_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/Index_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/Index_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/Index_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/Index_c.h b/internal/core/src/index/thirdparty/faiss/c_api/Index_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/Index_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/Index_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/Makefile b/internal/core/src/index/thirdparty/faiss/c_api/Makefile similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/Makefile rename to internal/core/src/index/thirdparty/faiss/c_api/Makefile diff --git a/core/src/index/thirdparty/faiss/c_api/MetaIndexes_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/MetaIndexes_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/MetaIndexes_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/MetaIndexes_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/MetaIndexes_c.h b/internal/core/src/index/thirdparty/faiss/c_api/MetaIndexes_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/MetaIndexes_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/MetaIndexes_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/clone_index_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/clone_index_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/clone_index_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/clone_index_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/clone_index_c.h b/internal/core/src/index/thirdparty/faiss/c_api/clone_index_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/clone_index_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/clone_index_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/error_c.h b/internal/core/src/index/thirdparty/faiss/c_api/error_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/error_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/error_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/error_impl.cpp b/internal/core/src/index/thirdparty/faiss/c_api/error_impl.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/error_impl.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/error_impl.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/error_impl.h b/internal/core/src/index/thirdparty/faiss/c_api/error_impl.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/error_impl.h rename to internal/core/src/index/thirdparty/faiss/c_api/error_impl.h diff --git a/core/src/index/thirdparty/faiss/c_api/example_c.c b/internal/core/src/index/thirdparty/faiss/c_api/example_c.c similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/example_c.c rename to internal/core/src/index/thirdparty/faiss/c_api/example_c.c diff --git a/core/src/index/thirdparty/faiss/c_api/faiss_c.h b/internal/core/src/index/thirdparty/faiss/c_api/faiss_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/faiss_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/faiss_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/gpu/GpuAutoTune_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuAutoTune_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/gpu/GpuAutoTune_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuAutoTune_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/gpu/GpuAutoTune_c.h b/internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuAutoTune_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/gpu/GpuAutoTune_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuAutoTune_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/gpu/GpuClonerOptions_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuClonerOptions_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/gpu/GpuClonerOptions_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuClonerOptions_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/gpu/GpuClonerOptions_c.h b/internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuClonerOptions_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/gpu/GpuClonerOptions_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuClonerOptions_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/gpu/GpuIndex_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuIndex_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/gpu/GpuIndex_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuIndex_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/gpu/GpuIndex_c.h b/internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuIndex_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/gpu/GpuIndex_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuIndex_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/gpu/GpuIndicesOptions_c.h b/internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuIndicesOptions_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/gpu/GpuIndicesOptions_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuIndicesOptions_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/gpu/GpuResources_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuResources_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/gpu/GpuResources_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuResources_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/gpu/GpuResources_c.h b/internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuResources_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/gpu/GpuResources_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/gpu/GpuResources_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/gpu/Makefile b/internal/core/src/index/thirdparty/faiss/c_api/gpu/Makefile similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/gpu/Makefile rename to internal/core/src/index/thirdparty/faiss/c_api/gpu/Makefile diff --git a/core/src/index/thirdparty/faiss/c_api/gpu/StandardGpuResources_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/gpu/StandardGpuResources_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/gpu/StandardGpuResources_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/gpu/StandardGpuResources_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/gpu/StandardGpuResources_c.h b/internal/core/src/index/thirdparty/faiss/c_api/gpu/StandardGpuResources_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/gpu/StandardGpuResources_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/gpu/StandardGpuResources_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/gpu/example_gpu_c.c b/internal/core/src/index/thirdparty/faiss/c_api/gpu/example_gpu_c.c similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/gpu/example_gpu_c.c rename to internal/core/src/index/thirdparty/faiss/c_api/gpu/example_gpu_c.c diff --git a/core/src/index/thirdparty/faiss/c_api/gpu/macros_impl.h b/internal/core/src/index/thirdparty/faiss/c_api/gpu/macros_impl.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/gpu/macros_impl.h rename to internal/core/src/index/thirdparty/faiss/c_api/gpu/macros_impl.h diff --git a/core/src/index/thirdparty/faiss/c_api/impl/AuxIndexStructures_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/impl/AuxIndexStructures_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/impl/AuxIndexStructures_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/impl/AuxIndexStructures_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/impl/AuxIndexStructures_c.h b/internal/core/src/index/thirdparty/faiss/c_api/impl/AuxIndexStructures_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/impl/AuxIndexStructures_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/impl/AuxIndexStructures_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/index_factory_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/index_factory_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/index_factory_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/index_factory_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/index_factory_c.h b/internal/core/src/index/thirdparty/faiss/c_api/index_factory_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/index_factory_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/index_factory_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/index_io_c.cpp b/internal/core/src/index/thirdparty/faiss/c_api/index_io_c.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/index_io_c.cpp rename to internal/core/src/index/thirdparty/faiss/c_api/index_io_c.cpp diff --git a/core/src/index/thirdparty/faiss/c_api/index_io_c.h b/internal/core/src/index/thirdparty/faiss/c_api/index_io_c.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/index_io_c.h rename to internal/core/src/index/thirdparty/faiss/c_api/index_io_c.h diff --git a/core/src/index/thirdparty/faiss/c_api/macros_impl.h b/internal/core/src/index/thirdparty/faiss/c_api/macros_impl.h similarity index 100% rename from core/src/index/thirdparty/faiss/c_api/macros_impl.h rename to internal/core/src/index/thirdparty/faiss/c_api/macros_impl.h diff --git a/core/src/index/thirdparty/faiss/clone_index.cpp b/internal/core/src/index/thirdparty/faiss/clone_index.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/clone_index.cpp rename to internal/core/src/index/thirdparty/faiss/clone_index.cpp diff --git a/core/src/index/thirdparty/faiss/clone_index.h b/internal/core/src/index/thirdparty/faiss/clone_index.h similarity index 100% rename from core/src/index/thirdparty/faiss/clone_index.h rename to internal/core/src/index/thirdparty/faiss/clone_index.h diff --git a/core/src/index/thirdparty/faiss/conda/Dockerfile b/internal/core/src/index/thirdparty/faiss/conda/Dockerfile similarity index 100% rename from core/src/index/thirdparty/faiss/conda/Dockerfile rename to internal/core/src/index/thirdparty/faiss/conda/Dockerfile diff --git a/core/src/index/thirdparty/faiss/conda/conda_build_config.yaml b/internal/core/src/index/thirdparty/faiss/conda/conda_build_config.yaml similarity index 100% rename from core/src/index/thirdparty/faiss/conda/conda_build_config.yaml rename to internal/core/src/index/thirdparty/faiss/conda/conda_build_config.yaml diff --git a/core/src/index/thirdparty/faiss/conda/faiss-gpu/build.sh b/internal/core/src/index/thirdparty/faiss/conda/faiss-gpu/build.sh similarity index 100% rename from core/src/index/thirdparty/faiss/conda/faiss-gpu/build.sh rename to internal/core/src/index/thirdparty/faiss/conda/faiss-gpu/build.sh diff --git a/core/src/index/thirdparty/faiss/conda/faiss-gpu/conda_build_config.yaml b/internal/core/src/index/thirdparty/faiss/conda/faiss-gpu/conda_build_config.yaml similarity index 100% rename from core/src/index/thirdparty/faiss/conda/faiss-gpu/conda_build_config.yaml rename to internal/core/src/index/thirdparty/faiss/conda/faiss-gpu/conda_build_config.yaml diff --git a/core/src/index/thirdparty/faiss/conda/faiss-gpu/meta.yaml b/internal/core/src/index/thirdparty/faiss/conda/faiss-gpu/meta.yaml similarity index 100% rename from core/src/index/thirdparty/faiss/conda/faiss-gpu/meta.yaml rename to internal/core/src/index/thirdparty/faiss/conda/faiss-gpu/meta.yaml diff --git a/core/src/index/thirdparty/faiss/conda/faiss-gpu/run_test.py b/internal/core/src/index/thirdparty/faiss/conda/faiss-gpu/run_test.py similarity index 100% rename from core/src/index/thirdparty/faiss/conda/faiss-gpu/run_test.py rename to internal/core/src/index/thirdparty/faiss/conda/faiss-gpu/run_test.py diff --git a/core/src/index/thirdparty/faiss/conda/faiss/build.sh b/internal/core/src/index/thirdparty/faiss/conda/faiss/build.sh similarity index 100% rename from core/src/index/thirdparty/faiss/conda/faiss/build.sh rename to internal/core/src/index/thirdparty/faiss/conda/faiss/build.sh diff --git a/core/src/index/thirdparty/faiss/conda/faiss/meta.yaml b/internal/core/src/index/thirdparty/faiss/conda/faiss/meta.yaml similarity index 100% rename from core/src/index/thirdparty/faiss/conda/faiss/meta.yaml rename to internal/core/src/index/thirdparty/faiss/conda/faiss/meta.yaml diff --git a/core/src/index/thirdparty/faiss/conda/faiss/run_test.py b/internal/core/src/index/thirdparty/faiss/conda/faiss/run_test.py similarity index 100% rename from core/src/index/thirdparty/faiss/conda/faiss/run_test.py rename to internal/core/src/index/thirdparty/faiss/conda/faiss/run_test.py diff --git a/core/src/index/thirdparty/faiss/configure b/internal/core/src/index/thirdparty/faiss/configure similarity index 100% rename from core/src/index/thirdparty/faiss/configure rename to internal/core/src/index/thirdparty/faiss/configure diff --git a/core/src/index/thirdparty/faiss/configure.ac b/internal/core/src/index/thirdparty/faiss/configure.ac similarity index 100% rename from core/src/index/thirdparty/faiss/configure.ac rename to internal/core/src/index/thirdparty/faiss/configure.ac diff --git a/core/src/index/thirdparty/faiss/demos/Makefile b/internal/core/src/index/thirdparty/faiss/demos/Makefile similarity index 100% rename from core/src/index/thirdparty/faiss/demos/Makefile rename to internal/core/src/index/thirdparty/faiss/demos/Makefile diff --git a/core/src/index/thirdparty/faiss/demos/README.md b/internal/core/src/index/thirdparty/faiss/demos/README.md similarity index 100% rename from core/src/index/thirdparty/faiss/demos/README.md rename to internal/core/src/index/thirdparty/faiss/demos/README.md diff --git a/core/src/index/thirdparty/faiss/demos/demo_auto_tune.py b/internal/core/src/index/thirdparty/faiss/demos/demo_auto_tune.py similarity index 100% rename from core/src/index/thirdparty/faiss/demos/demo_auto_tune.py rename to internal/core/src/index/thirdparty/faiss/demos/demo_auto_tune.py diff --git a/core/src/index/thirdparty/faiss/demos/demo_imi_flat.cpp b/internal/core/src/index/thirdparty/faiss/demos/demo_imi_flat.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/demos/demo_imi_flat.cpp rename to internal/core/src/index/thirdparty/faiss/demos/demo_imi_flat.cpp diff --git a/core/src/index/thirdparty/faiss/demos/demo_imi_pq.cpp b/internal/core/src/index/thirdparty/faiss/demos/demo_imi_pq.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/demos/demo_imi_pq.cpp rename to internal/core/src/index/thirdparty/faiss/demos/demo_imi_pq.cpp diff --git a/core/src/index/thirdparty/faiss/demos/demo_ivfpq_indexing.cpp b/internal/core/src/index/thirdparty/faiss/demos/demo_ivfpq_indexing.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/demos/demo_ivfpq_indexing.cpp rename to internal/core/src/index/thirdparty/faiss/demos/demo_ivfpq_indexing.cpp diff --git a/core/src/index/thirdparty/faiss/demos/demo_ondisk_ivf.py b/internal/core/src/index/thirdparty/faiss/demos/demo_ondisk_ivf.py similarity index 100% rename from core/src/index/thirdparty/faiss/demos/demo_ondisk_ivf.py rename to internal/core/src/index/thirdparty/faiss/demos/demo_ondisk_ivf.py diff --git a/core/src/index/thirdparty/faiss/demos/demo_sift1M.cpp b/internal/core/src/index/thirdparty/faiss/demos/demo_sift1M.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/demos/demo_sift1M.cpp rename to internal/core/src/index/thirdparty/faiss/demos/demo_sift1M.cpp diff --git a/core/src/index/thirdparty/faiss/demos/demo_weighted_kmeans.cpp b/internal/core/src/index/thirdparty/faiss/demos/demo_weighted_kmeans.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/demos/demo_weighted_kmeans.cpp rename to internal/core/src/index/thirdparty/faiss/demos/demo_weighted_kmeans.cpp diff --git a/core/src/index/thirdparty/faiss/example_makefiles/makefile.inc.Linux b/internal/core/src/index/thirdparty/faiss/example_makefiles/makefile.inc.Linux similarity index 100% rename from core/src/index/thirdparty/faiss/example_makefiles/makefile.inc.Linux rename to internal/core/src/index/thirdparty/faiss/example_makefiles/makefile.inc.Linux diff --git a/core/src/index/thirdparty/faiss/example_makefiles/makefile.inc.Mac.brew b/internal/core/src/index/thirdparty/faiss/example_makefiles/makefile.inc.Mac.brew similarity index 100% rename from core/src/index/thirdparty/faiss/example_makefiles/makefile.inc.Mac.brew rename to internal/core/src/index/thirdparty/faiss/example_makefiles/makefile.inc.Mac.brew diff --git a/core/src/index/thirdparty/faiss/example_makefiles/makefile.inc.Mac.port b/internal/core/src/index/thirdparty/faiss/example_makefiles/makefile.inc.Mac.port similarity index 100% rename from core/src/index/thirdparty/faiss/example_makefiles/makefile.inc.Mac.port rename to internal/core/src/index/thirdparty/faiss/example_makefiles/makefile.inc.Mac.port diff --git a/core/src/index/thirdparty/faiss/faiss b/internal/core/src/index/thirdparty/faiss/faiss similarity index 100% rename from core/src/index/thirdparty/faiss/faiss rename to internal/core/src/index/thirdparty/faiss/faiss diff --git a/core/src/index/thirdparty/faiss/gpu/GpuAutoTune.cpp b/internal/core/src/index/thirdparty/faiss/gpu/GpuAutoTune.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuAutoTune.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/GpuAutoTune.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/GpuAutoTune.h b/internal/core/src/index/thirdparty/faiss/gpu/GpuAutoTune.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuAutoTune.h rename to internal/core/src/index/thirdparty/faiss/gpu/GpuAutoTune.h diff --git a/core/src/index/thirdparty/faiss/gpu/GpuCloner.cpp b/internal/core/src/index/thirdparty/faiss/gpu/GpuCloner.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuCloner.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/GpuCloner.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/GpuCloner.h b/internal/core/src/index/thirdparty/faiss/gpu/GpuCloner.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuCloner.h rename to internal/core/src/index/thirdparty/faiss/gpu/GpuCloner.h diff --git a/core/src/index/thirdparty/faiss/gpu/GpuClonerOptions.cpp b/internal/core/src/index/thirdparty/faiss/gpu/GpuClonerOptions.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuClonerOptions.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/GpuClonerOptions.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/GpuClonerOptions.h b/internal/core/src/index/thirdparty/faiss/gpu/GpuClonerOptions.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuClonerOptions.h rename to internal/core/src/index/thirdparty/faiss/gpu/GpuClonerOptions.h diff --git a/core/src/index/thirdparty/faiss/gpu/GpuDistance.cu b/internal/core/src/index/thirdparty/faiss/gpu/GpuDistance.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuDistance.cu rename to internal/core/src/index/thirdparty/faiss/gpu/GpuDistance.cu diff --git a/core/src/index/thirdparty/faiss/gpu/GpuDistance.h b/internal/core/src/index/thirdparty/faiss/gpu/GpuDistance.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuDistance.h rename to internal/core/src/index/thirdparty/faiss/gpu/GpuDistance.h diff --git a/core/src/index/thirdparty/faiss/gpu/GpuFaissAssert.h b/internal/core/src/index/thirdparty/faiss/gpu/GpuFaissAssert.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuFaissAssert.h rename to internal/core/src/index/thirdparty/faiss/gpu/GpuFaissAssert.h diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndex.cu b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndex.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndex.cu rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndex.cu diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndex.h b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndex.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndex.h rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndex.h diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndexBinaryFlat.cu b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndexBinaryFlat.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndexBinaryFlat.cu rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndexBinaryFlat.cu diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndexBinaryFlat.h b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndexBinaryFlat.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndexBinaryFlat.h rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndexBinaryFlat.h diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndexFlat.cu b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndexFlat.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndexFlat.cu rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndexFlat.cu diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndexFlat.h b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndexFlat.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndexFlat.h rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndexFlat.h diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndexIVF.cu b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVF.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndexIVF.cu rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVF.cu diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndexIVF.h b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVF.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndexIVF.h rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVF.h diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFFlat.cu b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFFlat.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndexIVFFlat.cu rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFFlat.cu diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFFlat.h b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFFlat.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndexIVFFlat.h rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFFlat.h diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFPQ.cu b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFPQ.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndexIVFPQ.cu rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFPQ.cu diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFPQ.h b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFPQ.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndexIVFPQ.h rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFPQ.h diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFSQHybrid.cu b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFSQHybrid.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndexIVFSQHybrid.cu rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFSQHybrid.cu diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFSQHybrid.h b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFSQHybrid.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndexIVFSQHybrid.h rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFSQHybrid.h diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFScalarQuantizer.cu b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFScalarQuantizer.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndexIVFScalarQuantizer.cu rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFScalarQuantizer.cu diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFScalarQuantizer.h b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFScalarQuantizer.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndexIVFScalarQuantizer.h rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndexIVFScalarQuantizer.h diff --git a/core/src/index/thirdparty/faiss/gpu/GpuIndicesOptions.h b/internal/core/src/index/thirdparty/faiss/gpu/GpuIndicesOptions.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuIndicesOptions.h rename to internal/core/src/index/thirdparty/faiss/gpu/GpuIndicesOptions.h diff --git a/core/src/index/thirdparty/faiss/gpu/GpuResources.cpp b/internal/core/src/index/thirdparty/faiss/gpu/GpuResources.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuResources.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/GpuResources.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/GpuResources.h b/internal/core/src/index/thirdparty/faiss/gpu/GpuResources.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/GpuResources.h rename to internal/core/src/index/thirdparty/faiss/gpu/GpuResources.h diff --git a/core/src/index/thirdparty/faiss/gpu/StandardGpuResources.cpp b/internal/core/src/index/thirdparty/faiss/gpu/StandardGpuResources.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/StandardGpuResources.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/StandardGpuResources.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/StandardGpuResources.h b/internal/core/src/index/thirdparty/faiss/gpu/StandardGpuResources.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/StandardGpuResources.h rename to internal/core/src/index/thirdparty/faiss/gpu/StandardGpuResources.h diff --git a/core/src/index/thirdparty/faiss/gpu/impl/BinaryDistance.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/BinaryDistance.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/BinaryDistance.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/BinaryDistance.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/BinaryDistance.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/BinaryDistance.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/BinaryDistance.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/BinaryDistance.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/BinaryFlatIndex.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/BinaryFlatIndex.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/BinaryFlatIndex.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/BinaryFlatIndex.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/BinaryFlatIndex.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/BinaryFlatIndex.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/BinaryFlatIndex.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/BinaryFlatIndex.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/BroadcastSum.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/BroadcastSum.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/BroadcastSum.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/BroadcastSum.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/BroadcastSum.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/BroadcastSum.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/BroadcastSum.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/BroadcastSum.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/Distance.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/Distance.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/Distance.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/Distance.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/Distance.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/Distance.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/Distance.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/Distance.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/DistanceUtils.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/DistanceUtils.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/DistanceUtils.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/DistanceUtils.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/FlatIndex.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/FlatIndex.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/FlatIndex.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/FlatIndex.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/FlatIndex.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/FlatIndex.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/FlatIndex.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/FlatIndex.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/GeneralDistance.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/GeneralDistance.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/GeneralDistance.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/GeneralDistance.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/GpuScalarQuantizer.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/GpuScalarQuantizer.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/GpuScalarQuantizer.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/GpuScalarQuantizer.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/IVFAppend.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/IVFAppend.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/IVFAppend.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/IVFAppend.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/IVFAppend.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/IVFAppend.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/IVFAppend.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/IVFAppend.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/IVFBase.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/IVFBase.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/IVFBase.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/IVFBase.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/IVFBase.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/IVFBase.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/IVFBase.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/IVFBase.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/IVFFlat.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/IVFFlat.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/IVFFlat.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/IVFFlat.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/IVFFlat.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/IVFFlat.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/IVFFlat.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/IVFFlat.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/IVFFlatScan.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/IVFFlatScan.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/IVFFlatScan.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/IVFFlatScan.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/IVFFlatScan.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/IVFFlatScan.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/IVFFlatScan.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/IVFFlatScan.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/IVFPQ.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/IVFPQ.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/IVFPQ.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/IVFPQ.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/IVFPQ.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/IVFPQ.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/IVFPQ.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/IVFPQ.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/IVFUtils.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/IVFUtils.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/IVFUtils.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/IVFUtils.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/IVFUtils.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/IVFUtils.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/IVFUtils.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/IVFUtils.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/IVFUtilsSelect1.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/IVFUtilsSelect1.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/IVFUtilsSelect1.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/IVFUtilsSelect1.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/IVFUtilsSelect2.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/IVFUtilsSelect2.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/IVFUtilsSelect2.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/IVFUtilsSelect2.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/L2Norm.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/L2Norm.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/L2Norm.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/L2Norm.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/L2Norm.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/L2Norm.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/L2Norm.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/L2Norm.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/L2Select.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/L2Select.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/L2Select.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/L2Select.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/L2Select.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/L2Select.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/L2Select.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/L2Select.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/Metrics.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/Metrics.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/Metrics.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/Metrics.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/PQCodeDistances-inl.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/PQCodeDistances-inl.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/PQCodeDistances-inl.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/PQCodeDistances-inl.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/PQCodeDistances.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/PQCodeDistances.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/PQCodeDistances.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/PQCodeDistances.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/PQCodeDistances.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/PQCodeDistances.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/PQCodeDistances.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/PQCodeDistances.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/PQCodeLoad.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/PQCodeLoad.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/PQCodeLoad.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/PQCodeLoad.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassNoPrecomputed-inl.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassNoPrecomputed-inl.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassNoPrecomputed-inl.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassNoPrecomputed-inl.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassNoPrecomputed.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassNoPrecomputed.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassNoPrecomputed.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassNoPrecomputed.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassNoPrecomputed.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassNoPrecomputed.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassNoPrecomputed.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassNoPrecomputed.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassPrecomputed.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassPrecomputed.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassPrecomputed.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassPrecomputed.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassPrecomputed.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassPrecomputed.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassPrecomputed.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/PQScanMultiPassPrecomputed.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/impl/RemapIndices.cpp b/internal/core/src/index/thirdparty/faiss/gpu/impl/RemapIndices.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/RemapIndices.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/impl/RemapIndices.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/impl/RemapIndices.h b/internal/core/src/index/thirdparty/faiss/gpu/impl/RemapIndices.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/RemapIndices.h rename to internal/core/src/index/thirdparty/faiss/gpu/impl/RemapIndices.h diff --git a/core/src/index/thirdparty/faiss/gpu/impl/VectorResidual.cu b/internal/core/src/index/thirdparty/faiss/gpu/impl/VectorResidual.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/VectorResidual.cu rename to internal/core/src/index/thirdparty/faiss/gpu/impl/VectorResidual.cu diff --git a/core/src/index/thirdparty/faiss/gpu/impl/VectorResidual.cuh b/internal/core/src/index/thirdparty/faiss/gpu/impl/VectorResidual.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/impl/VectorResidual.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/impl/VectorResidual.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/perf/IndexWrapper-inl.h b/internal/core/src/index/thirdparty/faiss/gpu/perf/IndexWrapper-inl.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/perf/IndexWrapper-inl.h rename to internal/core/src/index/thirdparty/faiss/gpu/perf/IndexWrapper-inl.h diff --git a/core/src/index/thirdparty/faiss/gpu/perf/IndexWrapper.h b/internal/core/src/index/thirdparty/faiss/gpu/perf/IndexWrapper.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/perf/IndexWrapper.h rename to internal/core/src/index/thirdparty/faiss/gpu/perf/IndexWrapper.h diff --git a/core/src/index/thirdparty/faiss/gpu/perf/PerfBinaryFlat.cu b/internal/core/src/index/thirdparty/faiss/gpu/perf/PerfBinaryFlat.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/perf/PerfBinaryFlat.cu rename to internal/core/src/index/thirdparty/faiss/gpu/perf/PerfBinaryFlat.cu diff --git a/core/src/index/thirdparty/faiss/gpu/perf/PerfClustering.cpp b/internal/core/src/index/thirdparty/faiss/gpu/perf/PerfClustering.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/perf/PerfClustering.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/perf/PerfClustering.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/perf/PerfFlat.cu b/internal/core/src/index/thirdparty/faiss/gpu/perf/PerfFlat.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/perf/PerfFlat.cu rename to internal/core/src/index/thirdparty/faiss/gpu/perf/PerfFlat.cu diff --git a/core/src/index/thirdparty/faiss/gpu/perf/PerfIVFFlat.cu b/internal/core/src/index/thirdparty/faiss/gpu/perf/PerfIVFFlat.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/perf/PerfIVFFlat.cu rename to internal/core/src/index/thirdparty/faiss/gpu/perf/PerfIVFFlat.cu diff --git a/core/src/index/thirdparty/faiss/gpu/perf/PerfIVFPQ.cu b/internal/core/src/index/thirdparty/faiss/gpu/perf/PerfIVFPQ.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/perf/PerfIVFPQ.cu rename to internal/core/src/index/thirdparty/faiss/gpu/perf/PerfIVFPQ.cu diff --git a/core/src/index/thirdparty/faiss/gpu/perf/PerfIVFPQAdd.cpp b/internal/core/src/index/thirdparty/faiss/gpu/perf/PerfIVFPQAdd.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/perf/PerfIVFPQAdd.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/perf/PerfIVFPQAdd.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/perf/PerfSelect.cu b/internal/core/src/index/thirdparty/faiss/gpu/perf/PerfSelect.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/perf/PerfSelect.cu rename to internal/core/src/index/thirdparty/faiss/gpu/perf/PerfSelect.cu diff --git a/core/src/index/thirdparty/faiss/gpu/perf/WriteIndex.cpp b/internal/core/src/index/thirdparty/faiss/gpu/perf/WriteIndex.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/perf/WriteIndex.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/perf/WriteIndex.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/perf/slow.py b/internal/core/src/index/thirdparty/faiss/gpu/perf/slow.py similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/perf/slow.py rename to internal/core/src/index/thirdparty/faiss/gpu/perf/slow.py diff --git a/core/src/index/thirdparty/faiss/gpu/test/Makefile b/internal/core/src/index/thirdparty/faiss/gpu/test/Makefile similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/test/Makefile rename to internal/core/src/index/thirdparty/faiss/gpu/test/Makefile diff --git a/core/src/index/thirdparty/faiss/gpu/test/TestGpuDistance.cu b/internal/core/src/index/thirdparty/faiss/gpu/test/TestGpuDistance.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/test/TestGpuDistance.cu rename to internal/core/src/index/thirdparty/faiss/gpu/test/TestGpuDistance.cu diff --git a/core/src/index/thirdparty/faiss/gpu/test/TestGpuIndexBinaryFlat.cpp b/internal/core/src/index/thirdparty/faiss/gpu/test/TestGpuIndexBinaryFlat.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/test/TestGpuIndexBinaryFlat.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/test/TestGpuIndexBinaryFlat.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/test/TestGpuIndexFlat.cpp b/internal/core/src/index/thirdparty/faiss/gpu/test/TestGpuIndexFlat.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/test/TestGpuIndexFlat.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/test/TestGpuIndexFlat.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/test/TestGpuIndexIVFFlat.cpp b/internal/core/src/index/thirdparty/faiss/gpu/test/TestGpuIndexIVFFlat.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/test/TestGpuIndexIVFFlat.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/test/TestGpuIndexIVFFlat.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/test/TestGpuIndexIVFPQ.cpp b/internal/core/src/index/thirdparty/faiss/gpu/test/TestGpuIndexIVFPQ.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/test/TestGpuIndexIVFPQ.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/test/TestGpuIndexIVFPQ.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/test/TestGpuMemoryException.cpp b/internal/core/src/index/thirdparty/faiss/gpu/test/TestGpuMemoryException.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/test/TestGpuMemoryException.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/test/TestGpuMemoryException.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/test/TestGpuSelect.cu b/internal/core/src/index/thirdparty/faiss/gpu/test/TestGpuSelect.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/test/TestGpuSelect.cu rename to internal/core/src/index/thirdparty/faiss/gpu/test/TestGpuSelect.cu diff --git a/core/src/index/thirdparty/faiss/gpu/test/TestUtils.cpp b/internal/core/src/index/thirdparty/faiss/gpu/test/TestUtils.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/test/TestUtils.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/test/TestUtils.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/test/TestUtils.h b/internal/core/src/index/thirdparty/faiss/gpu/test/TestUtils.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/test/TestUtils.h rename to internal/core/src/index/thirdparty/faiss/gpu/test/TestUtils.h diff --git a/core/src/index/thirdparty/faiss/gpu/test/demo_ivfpq_indexing_gpu.cpp b/internal/core/src/index/thirdparty/faiss/gpu/test/demo_ivfpq_indexing_gpu.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/test/demo_ivfpq_indexing_gpu.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/test/demo_ivfpq_indexing_gpu.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/test/test_gpu_index.py b/internal/core/src/index/thirdparty/faiss/gpu/test/test_gpu_index.py similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/test/test_gpu_index.py rename to internal/core/src/index/thirdparty/faiss/gpu/test/test_gpu_index.py diff --git a/core/src/index/thirdparty/faiss/gpu/test/test_gpu_index_ivfsq.py b/internal/core/src/index/thirdparty/faiss/gpu/test/test_gpu_index_ivfsq.py similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/test/test_gpu_index_ivfsq.py rename to internal/core/src/index/thirdparty/faiss/gpu/test/test_gpu_index_ivfsq.py diff --git a/core/src/index/thirdparty/faiss/gpu/test/test_pytorch_faiss.py b/internal/core/src/index/thirdparty/faiss/gpu/test/test_pytorch_faiss.py similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/test/test_pytorch_faiss.py rename to internal/core/src/index/thirdparty/faiss/gpu/test/test_pytorch_faiss.py diff --git a/core/src/index/thirdparty/faiss/gpu/utils/BlockSelectFloat.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/BlockSelectFloat.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/BlockSelectFloat.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/BlockSelectFloat.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/BlockSelectHalf.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/BlockSelectHalf.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/BlockSelectHalf.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/BlockSelectHalf.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/BlockSelectImpl.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/BlockSelectImpl.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/BlockSelectImpl.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/BlockSelectImpl.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/BlockSelectKernel.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/BlockSelectKernel.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/BlockSelectKernel.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/BlockSelectKernel.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/Comparators.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/Comparators.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/Comparators.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/Comparators.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/ConversionOperators.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/ConversionOperators.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/ConversionOperators.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/ConversionOperators.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/CopyUtils.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/CopyUtils.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/CopyUtils.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/CopyUtils.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/DeviceDefs.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/DeviceDefs.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/DeviceDefs.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/DeviceDefs.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/DeviceMemory.cpp b/internal/core/src/index/thirdparty/faiss/gpu/utils/DeviceMemory.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/DeviceMemory.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/utils/DeviceMemory.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/utils/DeviceMemory.h b/internal/core/src/index/thirdparty/faiss/gpu/utils/DeviceMemory.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/DeviceMemory.h rename to internal/core/src/index/thirdparty/faiss/gpu/utils/DeviceMemory.h diff --git a/core/src/index/thirdparty/faiss/gpu/utils/DeviceTensor-inl.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/DeviceTensor-inl.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/DeviceTensor-inl.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/DeviceTensor-inl.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/DeviceTensor.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/DeviceTensor.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/DeviceTensor.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/DeviceTensor.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/DeviceUtils.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/DeviceUtils.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/DeviceUtils.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/DeviceUtils.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/DeviceUtils.h b/internal/core/src/index/thirdparty/faiss/gpu/utils/DeviceUtils.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/DeviceUtils.h rename to internal/core/src/index/thirdparty/faiss/gpu/utils/DeviceUtils.h diff --git a/core/src/index/thirdparty/faiss/gpu/utils/DeviceVector.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/DeviceVector.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/DeviceVector.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/DeviceVector.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/Float16.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/Float16.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/Float16.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/Float16.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/Float16.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/Float16.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/Float16.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/Float16.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/HostTensor-inl.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/HostTensor-inl.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/HostTensor-inl.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/HostTensor-inl.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/HostTensor.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/HostTensor.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/HostTensor.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/HostTensor.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/Limits.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/Limits.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/Limits.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/Limits.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/LoadStoreOperators.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/LoadStoreOperators.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/LoadStoreOperators.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/LoadStoreOperators.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/MathOperators.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/MathOperators.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/MathOperators.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/MathOperators.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/MatrixMult-inl.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/MatrixMult-inl.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/MatrixMult-inl.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/MatrixMult-inl.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/MatrixMult.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/MatrixMult.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/MatrixMult.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/MatrixMult.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/MatrixMult.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/MatrixMult.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/MatrixMult.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/MatrixMult.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/MemorySpace.cpp b/internal/core/src/index/thirdparty/faiss/gpu/utils/MemorySpace.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/MemorySpace.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/utils/MemorySpace.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/utils/MemorySpace.h b/internal/core/src/index/thirdparty/faiss/gpu/utils/MemorySpace.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/MemorySpace.h rename to internal/core/src/index/thirdparty/faiss/gpu/utils/MemorySpace.h diff --git a/core/src/index/thirdparty/faiss/gpu/utils/MergeNetworkBlock.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/MergeNetworkBlock.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/MergeNetworkBlock.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/MergeNetworkBlock.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/MergeNetworkUtils.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/MergeNetworkUtils.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/MergeNetworkUtils.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/MergeNetworkUtils.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/MergeNetworkWarp.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/MergeNetworkWarp.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/MergeNetworkWarp.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/MergeNetworkWarp.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/NoTypeTensor.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/NoTypeTensor.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/NoTypeTensor.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/NoTypeTensor.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/Pair.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/Pair.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/Pair.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/Pair.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/PtxUtils.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/PtxUtils.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/PtxUtils.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/PtxUtils.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/ReductionOperators.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/ReductionOperators.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/ReductionOperators.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/ReductionOperators.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/Reductions.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/Reductions.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/Reductions.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/Reductions.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/Select.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/Select.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/Select.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/Select.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/StackDeviceMemory.cpp b/internal/core/src/index/thirdparty/faiss/gpu/utils/StackDeviceMemory.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/StackDeviceMemory.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/utils/StackDeviceMemory.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/utils/StackDeviceMemory.h b/internal/core/src/index/thirdparty/faiss/gpu/utils/StackDeviceMemory.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/StackDeviceMemory.h rename to internal/core/src/index/thirdparty/faiss/gpu/utils/StackDeviceMemory.h diff --git a/core/src/index/thirdparty/faiss/gpu/utils/StaticUtils.h b/internal/core/src/index/thirdparty/faiss/gpu/utils/StaticUtils.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/StaticUtils.h rename to internal/core/src/index/thirdparty/faiss/gpu/utils/StaticUtils.h diff --git a/core/src/index/thirdparty/faiss/gpu/utils/Tensor-inl.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/Tensor-inl.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/Tensor-inl.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/Tensor-inl.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/Tensor.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/Tensor.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/Tensor.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/Tensor.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/ThrustAllocator.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/ThrustAllocator.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/ThrustAllocator.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/ThrustAllocator.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/Timer.cpp b/internal/core/src/index/thirdparty/faiss/gpu/utils/Timer.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/Timer.cpp rename to internal/core/src/index/thirdparty/faiss/gpu/utils/Timer.cpp diff --git a/core/src/index/thirdparty/faiss/gpu/utils/Timer.h b/internal/core/src/index/thirdparty/faiss/gpu/utils/Timer.h similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/Timer.h rename to internal/core/src/index/thirdparty/faiss/gpu/utils/Timer.h diff --git a/core/src/index/thirdparty/faiss/gpu/utils/Transpose.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/Transpose.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/Transpose.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/Transpose.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/WarpSelectFloat.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/WarpSelectFloat.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/WarpSelectFloat.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/WarpSelectFloat.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/WarpSelectHalf.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/WarpSelectHalf.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/WarpSelectHalf.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/WarpSelectHalf.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/WarpSelectKernel.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/WarpSelectKernel.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/WarpSelectKernel.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/WarpSelectKernel.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/WarpShuffles.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/WarpShuffles.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/WarpShuffles.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/WarpShuffles.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat1.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat1.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat1.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat1.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat128.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat128.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat128.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat128.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat256.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat256.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat256.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat256.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat32.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat32.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat32.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat32.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat64.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat64.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat64.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloat64.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatF1024.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatF1024.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatF1024.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatF1024.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatF2048.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatF2048.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatF2048.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatF2048.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatF512.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatF512.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatF512.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatF512.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatT1024.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatT1024.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatT1024.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatT1024.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatT2048.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatT2048.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatT2048.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatT2048.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatT512.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatT512.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatT512.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectFloatT512.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf1.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf1.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf1.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf1.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf128.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf128.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf128.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf128.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf256.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf256.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf256.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf256.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf32.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf32.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf32.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf32.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf64.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf64.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf64.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalf64.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfF1024.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfF1024.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfF1024.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfF1024.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfF2048.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfF2048.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfF2048.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfF2048.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfF512.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfF512.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfF512.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfF512.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfT1024.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfT1024.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfT1024.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfT1024.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfT2048.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfT2048.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfT2048.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfT2048.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfT512.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfT512.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfT512.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectHalfT512.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectImpl.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectImpl.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectImpl.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/blockselect/BlockSelectImpl.cuh diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat1.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat1.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat1.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat1.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat128.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat128.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat128.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat128.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat256.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat256.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat256.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat256.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat32.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat32.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat32.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat32.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat64.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat64.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat64.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloat64.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatF1024.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatF1024.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatF1024.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatF1024.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatF2048.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatF2048.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatF2048.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatF2048.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatF512.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatF512.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatF512.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatF512.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatT1024.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatT1024.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatT1024.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatT1024.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatT2048.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatT2048.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatT2048.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatT2048.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatT512.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatT512.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatT512.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectFloatT512.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf1.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf1.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf1.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf1.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf128.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf128.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf128.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf128.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf256.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf256.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf256.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf256.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf32.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf32.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf32.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf32.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf64.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf64.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf64.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalf64.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfF1024.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfF1024.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfF1024.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfF1024.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfF2048.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfF2048.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfF2048.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfF2048.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfF512.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfF512.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfF512.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfF512.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfT1024.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfT1024.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfT1024.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfT1024.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfT2048.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfT2048.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfT2048.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfT2048.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfT512.cu b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfT512.cu similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfT512.cu rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectHalfT512.cu diff --git a/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectImpl.cuh b/internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectImpl.cuh similarity index 100% rename from core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectImpl.cuh rename to internal/core/src/index/thirdparty/faiss/gpu/utils/warpselect/WarpSelectImpl.cuh diff --git a/core/src/index/thirdparty/faiss/impl/AuxIndexStructures.cpp b/internal/core/src/index/thirdparty/faiss/impl/AuxIndexStructures.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/impl/AuxIndexStructures.cpp rename to internal/core/src/index/thirdparty/faiss/impl/AuxIndexStructures.cpp diff --git a/core/src/index/thirdparty/faiss/impl/AuxIndexStructures.h b/internal/core/src/index/thirdparty/faiss/impl/AuxIndexStructures.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/AuxIndexStructures.h rename to internal/core/src/index/thirdparty/faiss/impl/AuxIndexStructures.h diff --git a/core/src/index/thirdparty/faiss/impl/FaissAssert.h b/internal/core/src/index/thirdparty/faiss/impl/FaissAssert.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/FaissAssert.h rename to internal/core/src/index/thirdparty/faiss/impl/FaissAssert.h diff --git a/core/src/index/thirdparty/faiss/impl/FaissException.cpp b/internal/core/src/index/thirdparty/faiss/impl/FaissException.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/impl/FaissException.cpp rename to internal/core/src/index/thirdparty/faiss/impl/FaissException.cpp diff --git a/core/src/index/thirdparty/faiss/impl/FaissException.h b/internal/core/src/index/thirdparty/faiss/impl/FaissException.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/FaissException.h rename to internal/core/src/index/thirdparty/faiss/impl/FaissException.h diff --git a/core/src/index/thirdparty/faiss/impl/HNSW.cpp b/internal/core/src/index/thirdparty/faiss/impl/HNSW.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/impl/HNSW.cpp rename to internal/core/src/index/thirdparty/faiss/impl/HNSW.cpp diff --git a/core/src/index/thirdparty/faiss/impl/HNSW.h b/internal/core/src/index/thirdparty/faiss/impl/HNSW.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/HNSW.h rename to internal/core/src/index/thirdparty/faiss/impl/HNSW.h diff --git a/core/src/index/thirdparty/faiss/impl/PolysemousTraining.cpp b/internal/core/src/index/thirdparty/faiss/impl/PolysemousTraining.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/impl/PolysemousTraining.cpp rename to internal/core/src/index/thirdparty/faiss/impl/PolysemousTraining.cpp diff --git a/core/src/index/thirdparty/faiss/impl/PolysemousTraining.h b/internal/core/src/index/thirdparty/faiss/impl/PolysemousTraining.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/PolysemousTraining.h rename to internal/core/src/index/thirdparty/faiss/impl/PolysemousTraining.h diff --git a/core/src/index/thirdparty/faiss/impl/ProductQuantizer-inl.h b/internal/core/src/index/thirdparty/faiss/impl/ProductQuantizer-inl.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ProductQuantizer-inl.h rename to internal/core/src/index/thirdparty/faiss/impl/ProductQuantizer-inl.h diff --git a/core/src/index/thirdparty/faiss/impl/ProductQuantizer.cpp b/internal/core/src/index/thirdparty/faiss/impl/ProductQuantizer.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ProductQuantizer.cpp rename to internal/core/src/index/thirdparty/faiss/impl/ProductQuantizer.cpp diff --git a/core/src/index/thirdparty/faiss/impl/ProductQuantizer.h b/internal/core/src/index/thirdparty/faiss/impl/ProductQuantizer.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ProductQuantizer.h rename to internal/core/src/index/thirdparty/faiss/impl/ProductQuantizer.h diff --git a/core/src/index/thirdparty/faiss/impl/RHNSW.cpp b/internal/core/src/index/thirdparty/faiss/impl/RHNSW.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/impl/RHNSW.cpp rename to internal/core/src/index/thirdparty/faiss/impl/RHNSW.cpp diff --git a/core/src/index/thirdparty/faiss/impl/RHNSW.h b/internal/core/src/index/thirdparty/faiss/impl/RHNSW.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/RHNSW.h rename to internal/core/src/index/thirdparty/faiss/impl/RHNSW.h diff --git a/core/src/index/thirdparty/faiss/impl/ScalarQuantizer.cpp b/internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizer.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ScalarQuantizer.cpp rename to internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizer.cpp diff --git a/core/src/index/thirdparty/faiss/impl/ScalarQuantizer.h b/internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizer.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ScalarQuantizer.h rename to internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizer.h diff --git a/core/src/index/thirdparty/faiss/impl/ScalarQuantizerCodec.h b/internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerCodec.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ScalarQuantizerCodec.h rename to internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerCodec.h diff --git a/core/src/index/thirdparty/faiss/impl/ScalarQuantizerCodec_avx.h b/internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerCodec_avx.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ScalarQuantizerCodec_avx.h rename to internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerCodec_avx.h diff --git a/core/src/index/thirdparty/faiss/impl/ScalarQuantizerCodec_avx512.h b/internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerCodec_avx512.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ScalarQuantizerCodec_avx512.h rename to internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerCodec_avx512.h diff --git a/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC.cpp b/internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC.cpp rename to internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC.cpp diff --git a/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC.h b/internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC.h rename to internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC.h diff --git a/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx.cpp b/internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx.cpp rename to internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx.cpp diff --git a/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx.h b/internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx.h rename to internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx.h diff --git a/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx512.cpp b/internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx512.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx512.cpp rename to internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx512.cpp diff --git a/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx512.h b/internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx512.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx512.h rename to internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerDC_avx512.h diff --git a/core/src/index/thirdparty/faiss/impl/ScalarQuantizerOp.cpp b/internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerOp.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ScalarQuantizerOp.cpp rename to internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerOp.cpp diff --git a/core/src/index/thirdparty/faiss/impl/ScalarQuantizerOp.h b/internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerOp.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ScalarQuantizerOp.h rename to internal/core/src/index/thirdparty/faiss/impl/ScalarQuantizerOp.h diff --git a/core/src/index/thirdparty/faiss/impl/ThreadedIndex-inl.h b/internal/core/src/index/thirdparty/faiss/impl/ThreadedIndex-inl.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ThreadedIndex-inl.h rename to internal/core/src/index/thirdparty/faiss/impl/ThreadedIndex-inl.h diff --git a/core/src/index/thirdparty/faiss/impl/ThreadedIndex.h b/internal/core/src/index/thirdparty/faiss/impl/ThreadedIndex.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/ThreadedIndex.h rename to internal/core/src/index/thirdparty/faiss/impl/ThreadedIndex.h diff --git a/core/src/index/thirdparty/faiss/impl/index_read.cpp b/internal/core/src/index/thirdparty/faiss/impl/index_read.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/impl/index_read.cpp rename to internal/core/src/index/thirdparty/faiss/impl/index_read.cpp diff --git a/core/src/index/thirdparty/faiss/impl/index_write.cpp b/internal/core/src/index/thirdparty/faiss/impl/index_write.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/impl/index_write.cpp rename to internal/core/src/index/thirdparty/faiss/impl/index_write.cpp diff --git a/core/src/index/thirdparty/faiss/impl/io.cpp b/internal/core/src/index/thirdparty/faiss/impl/io.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/impl/io.cpp rename to internal/core/src/index/thirdparty/faiss/impl/io.cpp diff --git a/core/src/index/thirdparty/faiss/impl/io.h b/internal/core/src/index/thirdparty/faiss/impl/io.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/io.h rename to internal/core/src/index/thirdparty/faiss/impl/io.h diff --git a/core/src/index/thirdparty/faiss/impl/lattice_Zn.cpp b/internal/core/src/index/thirdparty/faiss/impl/lattice_Zn.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/impl/lattice_Zn.cpp rename to internal/core/src/index/thirdparty/faiss/impl/lattice_Zn.cpp diff --git a/core/src/index/thirdparty/faiss/impl/lattice_Zn.h b/internal/core/src/index/thirdparty/faiss/impl/lattice_Zn.h similarity index 100% rename from core/src/index/thirdparty/faiss/impl/lattice_Zn.h rename to internal/core/src/index/thirdparty/faiss/impl/lattice_Zn.h diff --git a/core/src/index/thirdparty/faiss/index_factory.cpp b/internal/core/src/index/thirdparty/faiss/index_factory.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/index_factory.cpp rename to internal/core/src/index/thirdparty/faiss/index_factory.cpp diff --git a/core/src/index/thirdparty/faiss/index_factory.h b/internal/core/src/index/thirdparty/faiss/index_factory.h similarity index 100% rename from core/src/index/thirdparty/faiss/index_factory.h rename to internal/core/src/index/thirdparty/faiss/index_factory.h diff --git a/core/src/index/thirdparty/faiss/index_io.h b/internal/core/src/index/thirdparty/faiss/index_io.h similarity index 100% rename from core/src/index/thirdparty/faiss/index_io.h rename to internal/core/src/index/thirdparty/faiss/index_io.h diff --git a/core/src/index/thirdparty/faiss/makefile.inc.in b/internal/core/src/index/thirdparty/faiss/makefile.inc.in similarity index 100% rename from core/src/index/thirdparty/faiss/makefile.inc.in rename to internal/core/src/index/thirdparty/faiss/makefile.inc.in diff --git a/core/src/index/thirdparty/faiss/misc/test_blas.cpp b/internal/core/src/index/thirdparty/faiss/misc/test_blas.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/misc/test_blas.cpp rename to internal/core/src/index/thirdparty/faiss/misc/test_blas.cpp diff --git a/core/src/index/thirdparty/faiss/python/Makefile b/internal/core/src/index/thirdparty/faiss/python/Makefile similarity index 100% rename from core/src/index/thirdparty/faiss/python/Makefile rename to internal/core/src/index/thirdparty/faiss/python/Makefile diff --git a/core/src/index/thirdparty/faiss/python/faiss.py b/internal/core/src/index/thirdparty/faiss/python/faiss.py similarity index 100% rename from core/src/index/thirdparty/faiss/python/faiss.py rename to internal/core/src/index/thirdparty/faiss/python/faiss.py diff --git a/core/src/index/thirdparty/faiss/python/setup.py b/internal/core/src/index/thirdparty/faiss/python/setup.py similarity index 100% rename from core/src/index/thirdparty/faiss/python/setup.py rename to internal/core/src/index/thirdparty/faiss/python/setup.py diff --git a/core/src/index/thirdparty/faiss/python/swigfaiss.swig b/internal/core/src/index/thirdparty/faiss/python/swigfaiss.swig similarity index 100% rename from core/src/index/thirdparty/faiss/python/swigfaiss.swig rename to internal/core/src/index/thirdparty/faiss/python/swigfaiss.swig diff --git a/core/src/index/thirdparty/faiss/tests/Makefile b/internal/core/src/index/thirdparty/faiss/tests/Makefile similarity index 100% rename from core/src/index/thirdparty/faiss/tests/Makefile rename to internal/core/src/index/thirdparty/faiss/tests/Makefile diff --git a/core/src/index/thirdparty/faiss/tests/common.py b/internal/core/src/index/thirdparty/faiss/tests/common.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/common.py rename to internal/core/src/index/thirdparty/faiss/tests/common.py diff --git a/core/src/index/thirdparty/faiss/tests/test_binary_factory.py b/internal/core/src/index/thirdparty/faiss/tests/test_binary_factory.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_binary_factory.py rename to internal/core/src/index/thirdparty/faiss/tests/test_binary_factory.py diff --git a/core/src/index/thirdparty/faiss/tests/test_binary_flat.cpp b/internal/core/src/index/thirdparty/faiss/tests/test_binary_flat.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_binary_flat.cpp rename to internal/core/src/index/thirdparty/faiss/tests/test_binary_flat.cpp diff --git a/core/src/index/thirdparty/faiss/tests/test_binary_hashindex.py b/internal/core/src/index/thirdparty/faiss/tests/test_binary_hashindex.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_binary_hashindex.py rename to internal/core/src/index/thirdparty/faiss/tests/test_binary_hashindex.py diff --git a/core/src/index/thirdparty/faiss/tests/test_binary_io.py b/internal/core/src/index/thirdparty/faiss/tests/test_binary_io.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_binary_io.py rename to internal/core/src/index/thirdparty/faiss/tests/test_binary_io.py diff --git a/core/src/index/thirdparty/faiss/tests/test_build_blocks.py b/internal/core/src/index/thirdparty/faiss/tests/test_build_blocks.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_build_blocks.py rename to internal/core/src/index/thirdparty/faiss/tests/test_build_blocks.py diff --git a/core/src/index/thirdparty/faiss/tests/test_dealloc_invlists.cpp b/internal/core/src/index/thirdparty/faiss/tests/test_dealloc_invlists.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_dealloc_invlists.cpp rename to internal/core/src/index/thirdparty/faiss/tests/test_dealloc_invlists.cpp diff --git a/core/src/index/thirdparty/faiss/tests/test_extra_distances.py b/internal/core/src/index/thirdparty/faiss/tests/test_extra_distances.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_extra_distances.py rename to internal/core/src/index/thirdparty/faiss/tests/test_extra_distances.py diff --git a/core/src/index/thirdparty/faiss/tests/test_factory.py b/internal/core/src/index/thirdparty/faiss/tests/test_factory.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_factory.py rename to internal/core/src/index/thirdparty/faiss/tests/test_factory.py diff --git a/core/src/index/thirdparty/faiss/tests/test_index.py b/internal/core/src/index/thirdparty/faiss/tests/test_index.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_index.py rename to internal/core/src/index/thirdparty/faiss/tests/test_index.py diff --git a/core/src/index/thirdparty/faiss/tests/test_index_accuracy.py b/internal/core/src/index/thirdparty/faiss/tests/test_index_accuracy.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_index_accuracy.py rename to internal/core/src/index/thirdparty/faiss/tests/test_index_accuracy.py diff --git a/core/src/index/thirdparty/faiss/tests/test_index_binary.py b/internal/core/src/index/thirdparty/faiss/tests/test_index_binary.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_index_binary.py rename to internal/core/src/index/thirdparty/faiss/tests/test_index_binary.py diff --git a/core/src/index/thirdparty/faiss/tests/test_index_binary_from_float.py b/internal/core/src/index/thirdparty/faiss/tests/test_index_binary_from_float.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_index_binary_from_float.py rename to internal/core/src/index/thirdparty/faiss/tests/test_index_binary_from_float.py diff --git a/core/src/index/thirdparty/faiss/tests/test_index_composite.py b/internal/core/src/index/thirdparty/faiss/tests/test_index_composite.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_index_composite.py rename to internal/core/src/index/thirdparty/faiss/tests/test_index_composite.py diff --git a/core/src/index/thirdparty/faiss/tests/test_io.py b/internal/core/src/index/thirdparty/faiss/tests/test_io.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_io.py rename to internal/core/src/index/thirdparty/faiss/tests/test_io.py diff --git a/core/src/index/thirdparty/faiss/tests/test_ivflib.py b/internal/core/src/index/thirdparty/faiss/tests/test_ivflib.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_ivflib.py rename to internal/core/src/index/thirdparty/faiss/tests/test_ivflib.py diff --git a/core/src/index/thirdparty/faiss/tests/test_ivfpq_codec.cpp b/internal/core/src/index/thirdparty/faiss/tests/test_ivfpq_codec.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_ivfpq_codec.cpp rename to internal/core/src/index/thirdparty/faiss/tests/test_ivfpq_codec.cpp diff --git a/core/src/index/thirdparty/faiss/tests/test_ivfpq_indexing.cpp b/internal/core/src/index/thirdparty/faiss/tests/test_ivfpq_indexing.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_ivfpq_indexing.cpp rename to internal/core/src/index/thirdparty/faiss/tests/test_ivfpq_indexing.cpp diff --git a/core/src/index/thirdparty/faiss/tests/test_lowlevel_ivf.cpp b/internal/core/src/index/thirdparty/faiss/tests/test_lowlevel_ivf.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_lowlevel_ivf.cpp rename to internal/core/src/index/thirdparty/faiss/tests/test_lowlevel_ivf.cpp diff --git a/core/src/index/thirdparty/faiss/tests/test_merge.cpp b/internal/core/src/index/thirdparty/faiss/tests/test_merge.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_merge.cpp rename to internal/core/src/index/thirdparty/faiss/tests/test_merge.cpp diff --git a/core/src/index/thirdparty/faiss/tests/test_meta_index.py b/internal/core/src/index/thirdparty/faiss/tests/test_meta_index.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_meta_index.py rename to internal/core/src/index/thirdparty/faiss/tests/test_meta_index.py diff --git a/core/src/index/thirdparty/faiss/tests/test_omp_threads.cpp b/internal/core/src/index/thirdparty/faiss/tests/test_omp_threads.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_omp_threads.cpp rename to internal/core/src/index/thirdparty/faiss/tests/test_omp_threads.cpp diff --git a/core/src/index/thirdparty/faiss/tests/test_omp_threads_py.py b/internal/core/src/index/thirdparty/faiss/tests/test_omp_threads_py.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_omp_threads_py.py rename to internal/core/src/index/thirdparty/faiss/tests/test_omp_threads_py.py diff --git a/core/src/index/thirdparty/faiss/tests/test_ondisk_ivf.cpp b/internal/core/src/index/thirdparty/faiss/tests/test_ondisk_ivf.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_ondisk_ivf.cpp rename to internal/core/src/index/thirdparty/faiss/tests/test_ondisk_ivf.cpp diff --git a/core/src/index/thirdparty/faiss/tests/test_oom_exception.py b/internal/core/src/index/thirdparty/faiss/tests/test_oom_exception.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_oom_exception.py rename to internal/core/src/index/thirdparty/faiss/tests/test_oom_exception.py diff --git a/core/src/index/thirdparty/faiss/tests/test_pairs_decoding.cpp b/internal/core/src/index/thirdparty/faiss/tests/test_pairs_decoding.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_pairs_decoding.cpp rename to internal/core/src/index/thirdparty/faiss/tests/test_pairs_decoding.cpp diff --git a/core/src/index/thirdparty/faiss/tests/test_params_override.cpp b/internal/core/src/index/thirdparty/faiss/tests/test_params_override.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_params_override.cpp rename to internal/core/src/index/thirdparty/faiss/tests/test_params_override.cpp diff --git a/core/src/index/thirdparty/faiss/tests/test_pq_encoding.cpp b/internal/core/src/index/thirdparty/faiss/tests/test_pq_encoding.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_pq_encoding.cpp rename to internal/core/src/index/thirdparty/faiss/tests/test_pq_encoding.cpp diff --git a/core/src/index/thirdparty/faiss/tests/test_referenced_objects.py b/internal/core/src/index/thirdparty/faiss/tests/test_referenced_objects.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_referenced_objects.py rename to internal/core/src/index/thirdparty/faiss/tests/test_referenced_objects.py diff --git a/core/src/index/thirdparty/faiss/tests/test_sliding_ivf.cpp b/internal/core/src/index/thirdparty/faiss/tests/test_sliding_ivf.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_sliding_ivf.cpp rename to internal/core/src/index/thirdparty/faiss/tests/test_sliding_ivf.cpp diff --git a/core/src/index/thirdparty/faiss/tests/test_standalone_codec.py b/internal/core/src/index/thirdparty/faiss/tests/test_standalone_codec.py similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_standalone_codec.py rename to internal/core/src/index/thirdparty/faiss/tests/test_standalone_codec.py diff --git a/core/src/index/thirdparty/faiss/tests/test_threaded_index.cpp b/internal/core/src/index/thirdparty/faiss/tests/test_threaded_index.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_threaded_index.cpp rename to internal/core/src/index/thirdparty/faiss/tests/test_threaded_index.cpp diff --git a/core/src/index/thirdparty/faiss/tests/test_transfer_invlists.cpp b/internal/core/src/index/thirdparty/faiss/tests/test_transfer_invlists.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tests/test_transfer_invlists.cpp rename to internal/core/src/index/thirdparty/faiss/tests/test_transfer_invlists.cpp diff --git a/core/src/index/thirdparty/faiss/tutorial/cpp/1-Flat.cpp b/internal/core/src/index/thirdparty/faiss/tutorial/cpp/1-Flat.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/cpp/1-Flat.cpp rename to internal/core/src/index/thirdparty/faiss/tutorial/cpp/1-Flat.cpp diff --git a/core/src/index/thirdparty/faiss/tutorial/cpp/2-IVFFlat.cpp b/internal/core/src/index/thirdparty/faiss/tutorial/cpp/2-IVFFlat.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/cpp/2-IVFFlat.cpp rename to internal/core/src/index/thirdparty/faiss/tutorial/cpp/2-IVFFlat.cpp diff --git a/core/src/index/thirdparty/faiss/tutorial/cpp/3-IVFPQ.cpp b/internal/core/src/index/thirdparty/faiss/tutorial/cpp/3-IVFPQ.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/cpp/3-IVFPQ.cpp rename to internal/core/src/index/thirdparty/faiss/tutorial/cpp/3-IVFPQ.cpp diff --git a/core/src/index/thirdparty/faiss/tutorial/cpp/4-GPU.cpp b/internal/core/src/index/thirdparty/faiss/tutorial/cpp/4-GPU.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/cpp/4-GPU.cpp rename to internal/core/src/index/thirdparty/faiss/tutorial/cpp/4-GPU.cpp diff --git a/core/src/index/thirdparty/faiss/tutorial/cpp/5-GPU.cpp b/internal/core/src/index/thirdparty/faiss/tutorial/cpp/5-GPU.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/cpp/5-GPU.cpp rename to internal/core/src/index/thirdparty/faiss/tutorial/cpp/5-GPU.cpp diff --git a/core/src/index/thirdparty/faiss/tutorial/cpp/5-Multiple-GPUs.cpp b/internal/core/src/index/thirdparty/faiss/tutorial/cpp/5-Multiple-GPUs.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/cpp/5-Multiple-GPUs.cpp rename to internal/core/src/index/thirdparty/faiss/tutorial/cpp/5-Multiple-GPUs.cpp diff --git a/core/src/index/thirdparty/faiss/tutorial/cpp/6-GPU.cpp b/internal/core/src/index/thirdparty/faiss/tutorial/cpp/6-GPU.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/cpp/6-GPU.cpp rename to internal/core/src/index/thirdparty/faiss/tutorial/cpp/6-GPU.cpp diff --git a/core/src/index/thirdparty/faiss/tutorial/cpp/6-RUN.cpp b/internal/core/src/index/thirdparty/faiss/tutorial/cpp/6-RUN.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/cpp/6-RUN.cpp rename to internal/core/src/index/thirdparty/faiss/tutorial/cpp/6-RUN.cpp diff --git a/core/src/index/thirdparty/faiss/tutorial/cpp/7-GPU.cpp b/internal/core/src/index/thirdparty/faiss/tutorial/cpp/7-GPU.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/cpp/7-GPU.cpp rename to internal/core/src/index/thirdparty/faiss/tutorial/cpp/7-GPU.cpp diff --git a/core/src/index/thirdparty/faiss/tutorial/cpp/8-GPU.cpp b/internal/core/src/index/thirdparty/faiss/tutorial/cpp/8-GPU.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/cpp/8-GPU.cpp rename to internal/core/src/index/thirdparty/faiss/tutorial/cpp/8-GPU.cpp diff --git a/core/src/index/thirdparty/faiss/tutorial/cpp/9-BinaryFlat.cpp b/internal/core/src/index/thirdparty/faiss/tutorial/cpp/9-BinaryFlat.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/cpp/9-BinaryFlat.cpp rename to internal/core/src/index/thirdparty/faiss/tutorial/cpp/9-BinaryFlat.cpp diff --git a/core/src/index/thirdparty/faiss/tutorial/cpp/Makefile b/internal/core/src/index/thirdparty/faiss/tutorial/cpp/Makefile similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/cpp/Makefile rename to internal/core/src/index/thirdparty/faiss/tutorial/cpp/Makefile diff --git a/core/src/index/thirdparty/faiss/tutorial/cpp/faiss_test.cpp b/internal/core/src/index/thirdparty/faiss/tutorial/cpp/faiss_test.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/cpp/faiss_test.cpp rename to internal/core/src/index/thirdparty/faiss/tutorial/cpp/faiss_test.cpp diff --git a/core/src/index/thirdparty/faiss/tutorial/python/1-Flat.py b/internal/core/src/index/thirdparty/faiss/tutorial/python/1-Flat.py similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/python/1-Flat.py rename to internal/core/src/index/thirdparty/faiss/tutorial/python/1-Flat.py diff --git a/core/src/index/thirdparty/faiss/tutorial/python/2-IVFFlat.py b/internal/core/src/index/thirdparty/faiss/tutorial/python/2-IVFFlat.py similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/python/2-IVFFlat.py rename to internal/core/src/index/thirdparty/faiss/tutorial/python/2-IVFFlat.py diff --git a/core/src/index/thirdparty/faiss/tutorial/python/3-IVFPQ.py b/internal/core/src/index/thirdparty/faiss/tutorial/python/3-IVFPQ.py similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/python/3-IVFPQ.py rename to internal/core/src/index/thirdparty/faiss/tutorial/python/3-IVFPQ.py diff --git a/core/src/index/thirdparty/faiss/tutorial/python/4-GPU.py b/internal/core/src/index/thirdparty/faiss/tutorial/python/4-GPU.py similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/python/4-GPU.py rename to internal/core/src/index/thirdparty/faiss/tutorial/python/4-GPU.py diff --git a/core/src/index/thirdparty/faiss/tutorial/python/5-Multiple-GPUs.py b/internal/core/src/index/thirdparty/faiss/tutorial/python/5-Multiple-GPUs.py similarity index 100% rename from core/src/index/thirdparty/faiss/tutorial/python/5-Multiple-GPUs.py rename to internal/core/src/index/thirdparty/faiss/tutorial/python/5-Multiple-GPUs.py diff --git a/core/src/index/thirdparty/faiss/utils/BinaryDistance.cpp b/internal/core/src/index/thirdparty/faiss/utils/BinaryDistance.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/utils/BinaryDistance.cpp rename to internal/core/src/index/thirdparty/faiss/utils/BinaryDistance.cpp diff --git a/core/src/index/thirdparty/faiss/utils/BinaryDistance.h b/internal/core/src/index/thirdparty/faiss/utils/BinaryDistance.h similarity index 100% rename from core/src/index/thirdparty/faiss/utils/BinaryDistance.h rename to internal/core/src/index/thirdparty/faiss/utils/BinaryDistance.h diff --git a/core/src/index/thirdparty/faiss/utils/ConcurrentBitset.cpp b/internal/core/src/index/thirdparty/faiss/utils/ConcurrentBitset.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/utils/ConcurrentBitset.cpp rename to internal/core/src/index/thirdparty/faiss/utils/ConcurrentBitset.cpp diff --git a/core/src/index/thirdparty/faiss/utils/ConcurrentBitset.h b/internal/core/src/index/thirdparty/faiss/utils/ConcurrentBitset.h similarity index 100% rename from core/src/index/thirdparty/faiss/utils/ConcurrentBitset.h rename to internal/core/src/index/thirdparty/faiss/utils/ConcurrentBitset.h diff --git a/core/src/index/thirdparty/faiss/utils/Heap.cpp b/internal/core/src/index/thirdparty/faiss/utils/Heap.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/utils/Heap.cpp rename to internal/core/src/index/thirdparty/faiss/utils/Heap.cpp diff --git a/core/src/index/thirdparty/faiss/utils/Heap.h b/internal/core/src/index/thirdparty/faiss/utils/Heap.h similarity index 100% rename from core/src/index/thirdparty/faiss/utils/Heap.h rename to internal/core/src/index/thirdparty/faiss/utils/Heap.h diff --git a/core/src/index/thirdparty/faiss/utils/WorkerThread.cpp b/internal/core/src/index/thirdparty/faiss/utils/WorkerThread.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/utils/WorkerThread.cpp rename to internal/core/src/index/thirdparty/faiss/utils/WorkerThread.cpp diff --git a/core/src/index/thirdparty/faiss/utils/WorkerThread.h b/internal/core/src/index/thirdparty/faiss/utils/WorkerThread.h similarity index 100% rename from core/src/index/thirdparty/faiss/utils/WorkerThread.h rename to internal/core/src/index/thirdparty/faiss/utils/WorkerThread.h diff --git a/core/src/index/thirdparty/faiss/utils/distances.cpp b/internal/core/src/index/thirdparty/faiss/utils/distances.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/utils/distances.cpp rename to internal/core/src/index/thirdparty/faiss/utils/distances.cpp diff --git a/core/src/index/thirdparty/faiss/utils/distances.h b/internal/core/src/index/thirdparty/faiss/utils/distances.h similarity index 100% rename from core/src/index/thirdparty/faiss/utils/distances.h rename to internal/core/src/index/thirdparty/faiss/utils/distances.h diff --git a/core/src/index/thirdparty/faiss/utils/distances_avx.h b/internal/core/src/index/thirdparty/faiss/utils/distances_avx.h similarity index 100% rename from core/src/index/thirdparty/faiss/utils/distances_avx.h rename to internal/core/src/index/thirdparty/faiss/utils/distances_avx.h diff --git a/core/src/index/thirdparty/faiss/utils/distances_avx512.h b/internal/core/src/index/thirdparty/faiss/utils/distances_avx512.h similarity index 100% rename from core/src/index/thirdparty/faiss/utils/distances_avx512.h rename to internal/core/src/index/thirdparty/faiss/utils/distances_avx512.h diff --git a/core/src/index/thirdparty/faiss/utils/distances_simd.cpp b/internal/core/src/index/thirdparty/faiss/utils/distances_simd.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/utils/distances_simd.cpp rename to internal/core/src/index/thirdparty/faiss/utils/distances_simd.cpp diff --git a/core/src/index/thirdparty/faiss/utils/distances_simd_avx.cpp b/internal/core/src/index/thirdparty/faiss/utils/distances_simd_avx.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/utils/distances_simd_avx.cpp rename to internal/core/src/index/thirdparty/faiss/utils/distances_simd_avx.cpp diff --git a/core/src/index/thirdparty/faiss/utils/distances_simd_avx512.cpp b/internal/core/src/index/thirdparty/faiss/utils/distances_simd_avx512.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/utils/distances_simd_avx512.cpp rename to internal/core/src/index/thirdparty/faiss/utils/distances_simd_avx512.cpp diff --git a/core/src/index/thirdparty/faiss/utils/extra_distances.cpp b/internal/core/src/index/thirdparty/faiss/utils/extra_distances.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/utils/extra_distances.cpp rename to internal/core/src/index/thirdparty/faiss/utils/extra_distances.cpp diff --git a/core/src/index/thirdparty/faiss/utils/extra_distances.h b/internal/core/src/index/thirdparty/faiss/utils/extra_distances.h similarity index 100% rename from core/src/index/thirdparty/faiss/utils/extra_distances.h rename to internal/core/src/index/thirdparty/faiss/utils/extra_distances.h diff --git a/core/src/index/thirdparty/faiss/utils/hamming-inl.h b/internal/core/src/index/thirdparty/faiss/utils/hamming-inl.h similarity index 100% rename from core/src/index/thirdparty/faiss/utils/hamming-inl.h rename to internal/core/src/index/thirdparty/faiss/utils/hamming-inl.h diff --git a/core/src/index/thirdparty/faiss/utils/hamming.cpp b/internal/core/src/index/thirdparty/faiss/utils/hamming.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/utils/hamming.cpp rename to internal/core/src/index/thirdparty/faiss/utils/hamming.cpp diff --git a/core/src/index/thirdparty/faiss/utils/hamming.h b/internal/core/src/index/thirdparty/faiss/utils/hamming.h similarity index 100% rename from core/src/index/thirdparty/faiss/utils/hamming.h rename to internal/core/src/index/thirdparty/faiss/utils/hamming.h diff --git a/core/src/index/thirdparty/faiss/utils/instruction_set.h b/internal/core/src/index/thirdparty/faiss/utils/instruction_set.h similarity index 100% rename from core/src/index/thirdparty/faiss/utils/instruction_set.h rename to internal/core/src/index/thirdparty/faiss/utils/instruction_set.h diff --git a/core/src/index/thirdparty/faiss/utils/jaccard-inl.h b/internal/core/src/index/thirdparty/faiss/utils/jaccard-inl.h similarity index 100% rename from core/src/index/thirdparty/faiss/utils/jaccard-inl.h rename to internal/core/src/index/thirdparty/faiss/utils/jaccard-inl.h diff --git a/core/src/index/thirdparty/faiss/utils/random.cpp b/internal/core/src/index/thirdparty/faiss/utils/random.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/utils/random.cpp rename to internal/core/src/index/thirdparty/faiss/utils/random.cpp diff --git a/core/src/index/thirdparty/faiss/utils/random.h b/internal/core/src/index/thirdparty/faiss/utils/random.h similarity index 100% rename from core/src/index/thirdparty/faiss/utils/random.h rename to internal/core/src/index/thirdparty/faiss/utils/random.h diff --git a/core/src/index/thirdparty/faiss/utils/substructure-inl.h b/internal/core/src/index/thirdparty/faiss/utils/substructure-inl.h similarity index 100% rename from core/src/index/thirdparty/faiss/utils/substructure-inl.h rename to internal/core/src/index/thirdparty/faiss/utils/substructure-inl.h diff --git a/core/src/index/thirdparty/faiss/utils/superstructure-inl.h b/internal/core/src/index/thirdparty/faiss/utils/superstructure-inl.h similarity index 100% rename from core/src/index/thirdparty/faiss/utils/superstructure-inl.h rename to internal/core/src/index/thirdparty/faiss/utils/superstructure-inl.h diff --git a/core/src/index/thirdparty/faiss/utils/utils.cpp b/internal/core/src/index/thirdparty/faiss/utils/utils.cpp similarity index 100% rename from core/src/index/thirdparty/faiss/utils/utils.cpp rename to internal/core/src/index/thirdparty/faiss/utils/utils.cpp diff --git a/core/src/index/thirdparty/faiss/utils/utils.h b/internal/core/src/index/thirdparty/faiss/utils/utils.h similarity index 100% rename from core/src/index/thirdparty/faiss/utils/utils.h rename to internal/core/src/index/thirdparty/faiss/utils/utils.h diff --git a/core/src/index/thirdparty/hnswlib/bruteforce.h b/internal/core/src/index/thirdparty/hnswlib/bruteforce.h similarity index 100% rename from core/src/index/thirdparty/hnswlib/bruteforce.h rename to internal/core/src/index/thirdparty/hnswlib/bruteforce.h diff --git a/core/src/index/thirdparty/hnswlib/hnswalg.h b/internal/core/src/index/thirdparty/hnswlib/hnswalg.h similarity index 100% rename from core/src/index/thirdparty/hnswlib/hnswalg.h rename to internal/core/src/index/thirdparty/hnswlib/hnswalg.h diff --git a/core/src/index/thirdparty/hnswlib/hnswalg_nm.h b/internal/core/src/index/thirdparty/hnswlib/hnswalg_nm.h similarity index 100% rename from core/src/index/thirdparty/hnswlib/hnswalg_nm.h rename to internal/core/src/index/thirdparty/hnswlib/hnswalg_nm.h diff --git a/core/src/index/thirdparty/hnswlib/hnswlib.h b/internal/core/src/index/thirdparty/hnswlib/hnswlib.h similarity index 100% rename from core/src/index/thirdparty/hnswlib/hnswlib.h rename to internal/core/src/index/thirdparty/hnswlib/hnswlib.h diff --git a/core/src/index/thirdparty/hnswlib/hnswlib_nm.h b/internal/core/src/index/thirdparty/hnswlib/hnswlib_nm.h similarity index 100% rename from core/src/index/thirdparty/hnswlib/hnswlib_nm.h rename to internal/core/src/index/thirdparty/hnswlib/hnswlib_nm.h diff --git a/core/src/index/thirdparty/hnswlib/space_ip.h b/internal/core/src/index/thirdparty/hnswlib/space_ip.h similarity index 100% rename from core/src/index/thirdparty/hnswlib/space_ip.h rename to internal/core/src/index/thirdparty/hnswlib/space_ip.h diff --git a/core/src/index/thirdparty/hnswlib/space_l2.h b/internal/core/src/index/thirdparty/hnswlib/space_l2.h similarity index 100% rename from core/src/index/thirdparty/hnswlib/space_l2.h rename to internal/core/src/index/thirdparty/hnswlib/space_l2.h diff --git a/core/src/index/thirdparty/hnswlib/visited_list_pool.h b/internal/core/src/index/thirdparty/hnswlib/visited_list_pool.h similarity index 100% rename from core/src/index/thirdparty/hnswlib/visited_list_pool.h rename to internal/core/src/index/thirdparty/hnswlib/visited_list_pool.h diff --git a/core/src/index/thirdparty/versions.txt b/internal/core/src/index/thirdparty/versions.txt similarity index 100% rename from core/src/index/thirdparty/versions.txt rename to internal/core/src/index/thirdparty/versions.txt diff --git a/core/src/index/unittest/CMakeLists.txt b/internal/core/src/index/unittest/CMakeLists.txt similarity index 100% rename from core/src/index/unittest/CMakeLists.txt rename to internal/core/src/index/unittest/CMakeLists.txt diff --git a/core/src/index/unittest/Helper.h b/internal/core/src/index/unittest/Helper.h similarity index 100% rename from core/src/index/unittest/Helper.h rename to internal/core/src/index/unittest/Helper.h diff --git a/core/src/index/unittest/SPTAG.cpp b/internal/core/src/index/unittest/SPTAG.cpp similarity index 100% rename from core/src/index/unittest/SPTAG.cpp rename to internal/core/src/index/unittest/SPTAG.cpp diff --git a/core/src/index/unittest/faiss_benchmark/CMakeLists.txt b/internal/core/src/index/unittest/faiss_benchmark/CMakeLists.txt similarity index 100% rename from core/src/index/unittest/faiss_benchmark/CMakeLists.txt rename to internal/core/src/index/unittest/faiss_benchmark/CMakeLists.txt diff --git a/core/src/index/unittest/faiss_benchmark/README.md b/internal/core/src/index/unittest/faiss_benchmark/README.md similarity index 100% rename from core/src/index/unittest/faiss_benchmark/README.md rename to internal/core/src/index/unittest/faiss_benchmark/README.md diff --git a/core/src/index/unittest/faiss_benchmark/faiss_benchmark_test.cpp b/internal/core/src/index/unittest/faiss_benchmark/faiss_benchmark_test.cpp similarity index 100% rename from core/src/index/unittest/faiss_benchmark/faiss_benchmark_test.cpp rename to internal/core/src/index/unittest/faiss_benchmark/faiss_benchmark_test.cpp diff --git a/core/src/index/unittest/faiss_benchmark/faiss_bitset_test.cpp b/internal/core/src/index/unittest/faiss_benchmark/faiss_bitset_test.cpp similarity index 100% rename from core/src/index/unittest/faiss_benchmark/faiss_bitset_test.cpp rename to internal/core/src/index/unittest/faiss_benchmark/faiss_bitset_test.cpp diff --git a/core/src/index/unittest/kdtree.cpp b/internal/core/src/index/unittest/kdtree.cpp similarity index 100% rename from core/src/index/unittest/kdtree.cpp rename to internal/core/src/index/unittest/kdtree.cpp diff --git a/core/src/index/unittest/metric_alg_benchmark/CMakeLists.txt b/internal/core/src/index/unittest/metric_alg_benchmark/CMakeLists.txt similarity index 100% rename from core/src/index/unittest/metric_alg_benchmark/CMakeLists.txt rename to internal/core/src/index/unittest/metric_alg_benchmark/CMakeLists.txt diff --git a/core/src/index/unittest/metric_alg_benchmark/metric_benchmark_test.cpp b/internal/core/src/index/unittest/metric_alg_benchmark/metric_benchmark_test.cpp similarity index 100% rename from core/src/index/unittest/metric_alg_benchmark/metric_benchmark_test.cpp rename to internal/core/src/index/unittest/metric_alg_benchmark/metric_benchmark_test.cpp diff --git a/core/src/index/unittest/sift.50NN.graph b/internal/core/src/index/unittest/sift.50NN.graph similarity index 100% rename from core/src/index/unittest/sift.50NN.graph rename to internal/core/src/index/unittest/sift.50NN.graph diff --git a/core/src/index/unittest/siftsmall_base.fvecs b/internal/core/src/index/unittest/siftsmall_base.fvecs similarity index 100% rename from core/src/index/unittest/siftsmall_base.fvecs rename to internal/core/src/index/unittest/siftsmall_base.fvecs diff --git a/core/src/index/unittest/test_annoy.cpp b/internal/core/src/index/unittest/test_annoy.cpp similarity index 100% rename from core/src/index/unittest/test_annoy.cpp rename to internal/core/src/index/unittest/test_annoy.cpp diff --git a/core/src/index/unittest/test_binaryidmap.cpp b/internal/core/src/index/unittest/test_binaryidmap.cpp similarity index 100% rename from core/src/index/unittest/test_binaryidmap.cpp rename to internal/core/src/index/unittest/test_binaryidmap.cpp diff --git a/core/src/index/unittest/test_binaryivf.cpp b/internal/core/src/index/unittest/test_binaryivf.cpp similarity index 100% rename from core/src/index/unittest/test_binaryivf.cpp rename to internal/core/src/index/unittest/test_binaryivf.cpp diff --git a/core/src/index/unittest/test_common.cpp b/internal/core/src/index/unittest/test_common.cpp similarity index 100% rename from core/src/index/unittest/test_common.cpp rename to internal/core/src/index/unittest/test_common.cpp diff --git a/core/src/index/unittest/test_customized_index.cpp b/internal/core/src/index/unittest/test_customized_index.cpp similarity index 100% rename from core/src/index/unittest/test_customized_index.cpp rename to internal/core/src/index/unittest/test_customized_index.cpp diff --git a/core/src/index/unittest/test_gpuresource.cpp b/internal/core/src/index/unittest/test_gpuresource.cpp similarity index 100% rename from core/src/index/unittest/test_gpuresource.cpp rename to internal/core/src/index/unittest/test_gpuresource.cpp diff --git a/core/src/index/unittest/test_hnsw.cpp b/internal/core/src/index/unittest/test_hnsw.cpp similarity index 100% rename from core/src/index/unittest/test_hnsw.cpp rename to internal/core/src/index/unittest/test_hnsw.cpp diff --git a/core/src/index/unittest/test_idmap.cpp b/internal/core/src/index/unittest/test_idmap.cpp similarity index 100% rename from core/src/index/unittest/test_idmap.cpp rename to internal/core/src/index/unittest/test_idmap.cpp diff --git a/core/src/index/unittest/test_instructionset.cpp b/internal/core/src/index/unittest/test_instructionset.cpp similarity index 100% rename from core/src/index/unittest/test_instructionset.cpp rename to internal/core/src/index/unittest/test_instructionset.cpp diff --git a/core/src/index/unittest/test_ivf.cpp b/internal/core/src/index/unittest/test_ivf.cpp similarity index 100% rename from core/src/index/unittest/test_ivf.cpp rename to internal/core/src/index/unittest/test_ivf.cpp diff --git a/core/src/index/unittest/test_ivf_cpu_nm.cpp b/internal/core/src/index/unittest/test_ivf_cpu_nm.cpp similarity index 100% rename from core/src/index/unittest/test_ivf_cpu_nm.cpp rename to internal/core/src/index/unittest/test_ivf_cpu_nm.cpp diff --git a/core/src/index/unittest/test_ivf_gpu_nm.cpp b/internal/core/src/index/unittest/test_ivf_gpu_nm.cpp similarity index 100% rename from core/src/index/unittest/test_ivf_gpu_nm.cpp rename to internal/core/src/index/unittest/test_ivf_gpu_nm.cpp diff --git a/core/src/index/unittest/test_knowhere.cpp b/internal/core/src/index/unittest/test_knowhere.cpp similarity index 100% rename from core/src/index/unittest/test_knowhere.cpp rename to internal/core/src/index/unittest/test_knowhere.cpp diff --git a/core/src/index/unittest/test_nsg.cpp b/internal/core/src/index/unittest/test_nsg.cpp similarity index 100% rename from core/src/index/unittest/test_nsg.cpp rename to internal/core/src/index/unittest/test_nsg.cpp diff --git a/core/src/index/unittest/test_rhnsw_flat.cpp b/internal/core/src/index/unittest/test_rhnsw_flat.cpp similarity index 100% rename from core/src/index/unittest/test_rhnsw_flat.cpp rename to internal/core/src/index/unittest/test_rhnsw_flat.cpp diff --git a/core/src/index/unittest/test_rhnsw_pq.cpp b/internal/core/src/index/unittest/test_rhnsw_pq.cpp similarity index 100% rename from core/src/index/unittest/test_rhnsw_pq.cpp rename to internal/core/src/index/unittest/test_rhnsw_pq.cpp diff --git a/core/src/index/unittest/test_rhnsw_sq8.cpp b/internal/core/src/index/unittest/test_rhnsw_sq8.cpp similarity index 100% rename from core/src/index/unittest/test_rhnsw_sq8.cpp rename to internal/core/src/index/unittest/test_rhnsw_sq8.cpp diff --git a/core/src/index/unittest/test_sptag.cpp b/internal/core/src/index/unittest/test_sptag.cpp similarity index 100% rename from core/src/index/unittest/test_sptag.cpp rename to internal/core/src/index/unittest/test_sptag.cpp diff --git a/core/src/index/unittest/test_structured_index_sort.cpp b/internal/core/src/index/unittest/test_structured_index_sort.cpp similarity index 100% rename from core/src/index/unittest/test_structured_index_sort.cpp rename to internal/core/src/index/unittest/test_structured_index_sort.cpp diff --git a/core/src/index/unittest/test_vecindex.cpp b/internal/core/src/index/unittest/test_vecindex.cpp similarity index 100% rename from core/src/index/unittest/test_vecindex.cpp rename to internal/core/src/index/unittest/test_vecindex.cpp diff --git a/core/src/index/unittest/test_wrapper.cpp b/internal/core/src/index/unittest/test_wrapper.cpp similarity index 100% rename from core/src/index/unittest/test_wrapper.cpp rename to internal/core/src/index/unittest/test_wrapper.cpp diff --git a/core/src/index/unittest/utils.cpp b/internal/core/src/index/unittest/utils.cpp similarity index 100% rename from core/src/index/unittest/utils.cpp rename to internal/core/src/index/unittest/utils.cpp diff --git a/core/src/index/unittest/utils.h b/internal/core/src/index/unittest/utils.h similarity index 100% rename from core/src/index/unittest/utils.h rename to internal/core/src/index/unittest/utils.h diff --git a/core/src/log/CMakeLists.txt b/internal/core/src/log/CMakeLists.txt similarity index 100% rename from core/src/log/CMakeLists.txt rename to internal/core/src/log/CMakeLists.txt diff --git a/core/src/log/Log.cpp b/internal/core/src/log/Log.cpp similarity index 100% rename from core/src/log/Log.cpp rename to internal/core/src/log/Log.cpp diff --git a/core/src/log/Log.h b/internal/core/src/log/Log.h similarity index 100% rename from core/src/log/Log.h rename to internal/core/src/log/Log.h diff --git a/core/src/log/LogMgr.cpp b/internal/core/src/log/LogMgr.cpp similarity index 100% rename from core/src/log/LogMgr.cpp rename to internal/core/src/log/LogMgr.cpp diff --git a/core/src/log/LogMgr.h b/internal/core/src/log/LogMgr.h similarity index 100% rename from core/src/log/LogMgr.h rename to internal/core/src/log/LogMgr.h diff --git a/core/src/main.cpp b/internal/core/src/main.cpp similarity index 100% rename from core/src/main.cpp rename to internal/core/src/main.cpp diff --git a/core/src/pb/master.pb.cc b/internal/core/src/pb/master.pb.cc similarity index 100% rename from core/src/pb/master.pb.cc rename to internal/core/src/pb/master.pb.cc diff --git a/core/src/pb/master.pb.h b/internal/core/src/pb/master.pb.h similarity index 100% rename from core/src/pb/master.pb.h rename to internal/core/src/pb/master.pb.h diff --git a/core/src/pb/message.pb.cc b/internal/core/src/pb/message.pb.cc similarity index 100% rename from core/src/pb/message.pb.cc rename to internal/core/src/pb/message.pb.cc diff --git a/core/src/pb/message.pb.h b/internal/core/src/pb/message.pb.h similarity index 100% rename from core/src/pb/message.pb.h rename to internal/core/src/pb/message.pb.h diff --git a/core/src/query/BinaryQuery.cpp b/internal/core/src/query/BinaryQuery.cpp similarity index 100% rename from core/src/query/BinaryQuery.cpp rename to internal/core/src/query/BinaryQuery.cpp diff --git a/core/src/query/BinaryQuery.h b/internal/core/src/query/BinaryQuery.h similarity index 100% rename from core/src/query/BinaryQuery.h rename to internal/core/src/query/BinaryQuery.h diff --git a/core/src/query/BooleanQuery.h b/internal/core/src/query/BooleanQuery.h similarity index 100% rename from core/src/query/BooleanQuery.h rename to internal/core/src/query/BooleanQuery.h diff --git a/core/src/query/CMakeLists.txt b/internal/core/src/query/CMakeLists.txt similarity index 100% rename from core/src/query/CMakeLists.txt rename to internal/core/src/query/CMakeLists.txt diff --git a/core/src/query/GeneralQuery.h b/internal/core/src/query/GeneralQuery.h similarity index 100% rename from core/src/query/GeneralQuery.h rename to internal/core/src/query/GeneralQuery.h diff --git a/core/src/utils/BlockingQueue.h b/internal/core/src/utils/BlockingQueue.h similarity index 100% rename from core/src/utils/BlockingQueue.h rename to internal/core/src/utils/BlockingQueue.h diff --git a/core/src/utils/CMakeLists.txt b/internal/core/src/utils/CMakeLists.txt similarity index 100% rename from core/src/utils/CMakeLists.txt rename to internal/core/src/utils/CMakeLists.txt diff --git a/core/src/utils/CommonUtil.cpp b/internal/core/src/utils/CommonUtil.cpp similarity index 100% rename from core/src/utils/CommonUtil.cpp rename to internal/core/src/utils/CommonUtil.cpp diff --git a/core/src/utils/CommonUtil.h b/internal/core/src/utils/CommonUtil.h similarity index 100% rename from core/src/utils/CommonUtil.h rename to internal/core/src/utils/CommonUtil.h diff --git a/core/src/utils/ConfigUtils.cpp b/internal/core/src/utils/ConfigUtils.cpp similarity index 100% rename from core/src/utils/ConfigUtils.cpp rename to internal/core/src/utils/ConfigUtils.cpp diff --git a/core/src/utils/ConfigUtils.h b/internal/core/src/utils/ConfigUtils.h similarity index 100% rename from core/src/utils/ConfigUtils.h rename to internal/core/src/utils/ConfigUtils.h diff --git a/core/src/utils/Error.h b/internal/core/src/utils/Error.h similarity index 100% rename from core/src/utils/Error.h rename to internal/core/src/utils/Error.h diff --git a/core/src/utils/Exception.h b/internal/core/src/utils/Exception.h similarity index 100% rename from core/src/utils/Exception.h rename to internal/core/src/utils/Exception.h diff --git a/core/src/utils/Json.h b/internal/core/src/utils/Json.h similarity index 100% rename from core/src/utils/Json.h rename to internal/core/src/utils/Json.h diff --git a/core/src/utils/Log.h b/internal/core/src/utils/Log.h similarity index 100% rename from core/src/utils/Log.h rename to internal/core/src/utils/Log.h diff --git a/core/src/utils/SignalHandler.cpp b/internal/core/src/utils/SignalHandler.cpp similarity index 100% rename from core/src/utils/SignalHandler.cpp rename to internal/core/src/utils/SignalHandler.cpp diff --git a/core/src/utils/SignalHandler.h b/internal/core/src/utils/SignalHandler.h similarity index 100% rename from core/src/utils/SignalHandler.h rename to internal/core/src/utils/SignalHandler.h diff --git a/core/src/utils/Status.cpp b/internal/core/src/utils/Status.cpp similarity index 100% rename from core/src/utils/Status.cpp rename to internal/core/src/utils/Status.cpp diff --git a/core/src/utils/Status.h b/internal/core/src/utils/Status.h similarity index 100% rename from core/src/utils/Status.h rename to internal/core/src/utils/Status.h diff --git a/core/src/utils/StringHelpFunctions.cpp b/internal/core/src/utils/StringHelpFunctions.cpp similarity index 100% rename from core/src/utils/StringHelpFunctions.cpp rename to internal/core/src/utils/StringHelpFunctions.cpp diff --git a/core/src/utils/StringHelpFunctions.h b/internal/core/src/utils/StringHelpFunctions.h similarity index 100% rename from core/src/utils/StringHelpFunctions.h rename to internal/core/src/utils/StringHelpFunctions.h diff --git a/core/src/utils/ThreadPool.h b/internal/core/src/utils/ThreadPool.h similarity index 100% rename from core/src/utils/ThreadPool.h rename to internal/core/src/utils/ThreadPool.h diff --git a/core/src/utils/TimeRecorder.cpp b/internal/core/src/utils/TimeRecorder.cpp similarity index 100% rename from core/src/utils/TimeRecorder.cpp rename to internal/core/src/utils/TimeRecorder.cpp diff --git a/core/src/utils/TimeRecorder.h b/internal/core/src/utils/TimeRecorder.h similarity index 100% rename from core/src/utils/TimeRecorder.h rename to internal/core/src/utils/TimeRecorder.h diff --git a/core/src/utils/Types.h b/internal/core/src/utils/Types.h similarity index 100% rename from core/src/utils/Types.h rename to internal/core/src/utils/Types.h diff --git a/core/thirdparty/CMakeLists.txt b/internal/core/thirdparty/CMakeLists.txt similarity index 100% rename from core/thirdparty/CMakeLists.txt rename to internal/core/thirdparty/CMakeLists.txt diff --git a/core/thirdparty/easyloggingpp/easylogging++.cc b/internal/core/thirdparty/easyloggingpp/easylogging++.cc similarity index 100% rename from core/thirdparty/easyloggingpp/easylogging++.cc rename to internal/core/thirdparty/easyloggingpp/easylogging++.cc diff --git a/core/thirdparty/easyloggingpp/easylogging++.h b/internal/core/thirdparty/easyloggingpp/easylogging++.h similarity index 100% rename from core/thirdparty/easyloggingpp/easylogging++.h rename to internal/core/thirdparty/easyloggingpp/easylogging++.h diff --git a/core/thirdparty/gtest/CMakeLists.txt b/internal/core/thirdparty/gtest/CMakeLists.txt similarity index 100% rename from core/thirdparty/gtest/CMakeLists.txt rename to internal/core/thirdparty/gtest/CMakeLists.txt diff --git a/core/thirdparty/nlohmann/json.hpp b/internal/core/thirdparty/nlohmann/json.hpp similarity index 100% rename from core/thirdparty/nlohmann/json.hpp rename to internal/core/thirdparty/nlohmann/json.hpp diff --git a/core/thirdparty/opentracing/CMakeLists.txt b/internal/core/thirdparty/opentracing/CMakeLists.txt similarity index 100% rename from core/thirdparty/opentracing/CMakeLists.txt rename to internal/core/thirdparty/opentracing/CMakeLists.txt diff --git a/core/thirdparty/protobuf/CMakeLists.txt b/internal/core/thirdparty/protobuf/CMakeLists.txt similarity index 100% rename from core/thirdparty/protobuf/CMakeLists.txt rename to internal/core/thirdparty/protobuf/CMakeLists.txt diff --git a/core/thirdparty/versions.txt b/internal/core/thirdparty/versions.txt similarity index 100% rename from core/thirdparty/versions.txt rename to internal/core/thirdparty/versions.txt diff --git a/core/thirdparty/yaml-cpp/CMakeLists.txt b/internal/core/thirdparty/yaml-cpp/CMakeLists.txt similarity index 100% rename from core/thirdparty/yaml-cpp/CMakeLists.txt rename to internal/core/thirdparty/yaml-cpp/CMakeLists.txt diff --git a/core/ubuntu_build_deps.sh b/internal/core/ubuntu_build_deps.sh similarity index 100% rename from core/ubuntu_build_deps.sh rename to internal/core/ubuntu_build_deps.sh diff --git a/core/unittest/CMakeLists.txt b/internal/core/unittest/CMakeLists.txt similarity index 90% rename from core/unittest/CMakeLists.txt rename to internal/core/unittest/CMakeLists.txt index a2b05944e8..a9d87e0c42 100644 --- a/core/unittest/CMakeLists.txt +++ b/internal/core/unittest/CMakeLists.txt @@ -21,4 +21,5 @@ target_link_libraries(all_tests knowhere log pthread - ) \ No newline at end of file + ) +install (TARGETS all_tests DESTINATION unittest) \ No newline at end of file diff --git a/core/unittest/test_c_api.cpp b/internal/core/unittest/test_c_api.cpp similarity index 100% rename from core/unittest/test_c_api.cpp rename to internal/core/unittest/test_c_api.cpp diff --git a/core/unittest/test_concurrent_vector.cpp b/internal/core/unittest/test_concurrent_vector.cpp similarity index 100% rename from core/unittest/test_concurrent_vector.cpp rename to internal/core/unittest/test_concurrent_vector.cpp diff --git a/core/unittest/test_dog_segment.cpp b/internal/core/unittest/test_dog_segment.cpp similarity index 66% rename from core/unittest/test_dog_segment.cpp rename to internal/core/unittest/test_dog_segment.cpp index 1202cd7ac4..0ccdcda600 100644 --- a/core/unittest/test_dog_segment.cpp +++ b/internal/core/unittest/test_dog_segment.cpp @@ -24,6 +24,34 @@ using std::cin; using std::cout; using std::endl; +namespace { +auto +generate_data(int N) { + std::vector raw_data; + std::vector timestamps; + std::vector uids; + std::default_random_engine er(42); + std::normal_distribution<> distribution(0.0, 1.0); + std::default_random_engine ei(42); + + for (int i = 0; i < N; ++i) { + uids.push_back(10 * N + i); + timestamps.push_back(0); + // append vec + float vec[16]; + for (auto& x : vec) { + x = distribution(er); + } + raw_data.insert( + raw_data.end(), (const char*)std::begin(vec), (const char*)std::end(vec)); + int age = ei() % 100; + raw_data.insert( + raw_data.end(), (const char*)&age, ((const char*)&age) + sizeof(age)); + } + return std::make_tuple(raw_data, timestamps, uids); +} +} // namespace + TEST(DogSegmentTest, TestABI) { using namespace milvus::engine; @@ -32,6 +60,20 @@ TEST(DogSegmentTest, TestABI) { assert(true); } +TEST(DogSegmentTest, NormalDistributionTest) { + using namespace milvus::dog_segment; + using namespace milvus::engine; + auto schema = std::make_shared(); + schema->AddField("fakevec", DataType::VECTOR_FLOAT, 16); + schema->AddField("age", DataType::INT32); + int N = 1000* 1000; + auto [raw_data, timestamps, uids] = generate_data(N); + auto segment = CreateSegment(schema); + segment->PreInsert(N); + segment->PreDelete(N); + +} + TEST(DogSegmentTest, MockTest) { using namespace milvus::dog_segment; diff --git a/core/unittest/test_indexing.cpp b/internal/core/unittest/test_indexing.cpp similarity index 100% rename from core/unittest/test_indexing.cpp rename to internal/core/unittest/test_indexing.cpp diff --git a/core/unittest/test_naive.cpp b/internal/core/unittest/test_naive.cpp similarity index 100% rename from core/unittest/test_naive.cpp rename to internal/core/unittest/test_naive.cpp diff --git a/errors/errors.go b/internal/errors/errors.go similarity index 100% rename from errors/errors.go rename to internal/errors/errors.go diff --git a/errors/group.go b/internal/errors/group.go similarity index 100% rename from errors/group.go rename to internal/errors/group.go diff --git a/errors/stack.go b/internal/errors/stack.go similarity index 100% rename from errors/stack.go rename to internal/errors/stack.go diff --git a/pkg/master/README.md b/internal/master/README.md similarity index 100% rename from pkg/master/README.md rename to internal/master/README.md diff --git a/pkg/master/mock/collection.go b/internal/master/collection/collection.go similarity index 91% rename from pkg/master/mock/collection.go rename to internal/master/collection/collection.go index 9142686e65..d390638902 100644 --- a/pkg/master/mock/collection.go +++ b/internal/master/collection/collection.go @@ -1,11 +1,11 @@ -package mock +package collection import ( "time" - pb "github.com/czs007/suvlim/pkg/master/grpc/master" - messagepb "github.com/czs007/suvlim/pkg/master/grpc/message" - "github.com/golang/protobuf/proto" + masterpb "github.com/czs007/suvlim/internal/proto/master" + messagepb "github.com/czs007/suvlim/internal/proto/message" + "github.com/gogo/protobuf/proto" jsoniter "github.com/json-iterator/go" ) @@ -46,7 +46,7 @@ func GrpcMarshal(c *Collection) *Collection { schemaSlice = append(schemaSlice, newpbMeta) } pbSchema.FieldMetas = schemaSlice - grpcCollection := &pb.Collection{ + grpcCollection := &masterpb.Collection{ Id: c.ID, Name: c.Name, Schema: pbSchema, diff --git a/internal/master/collection/collection_test.go b/internal/master/collection/collection_test.go new file mode 100644 index 0000000000..f62fde909d --- /dev/null +++ b/internal/master/collection/collection_test.go @@ -0,0 +1,39 @@ +package collection + +import ( + "testing" + "time" + + messagepb "github.com/czs007/suvlim/internal/proto/message" + "github.com/stretchr/testify/assert" +) + +var ( + cid = uint64(10011111234) + name = "test-segment" + createTime = time.Now() + schema = []*messagepb.FieldMeta{} + sIds = []uint64{111111, 222222} + ptags = []string{"default", "test"} +) + +func TestNewCollection(t *testing.T) { + assert := assert.New(t) + c := NewCollection(cid, name, createTime, schema, sIds, ptags) + assert.Equal(cid, c.ID) + assert.Equal(name, c.Name) + for k, v := range schema { + assert.Equal(v.Dim, c.Schema[k].DIM) + assert.Equal(v.FieldName, c.Schema[k].FieldName) + assert.Equal(v.Type, c.Schema[k].Type) + } + assert.Equal(sIds, c.SegmentIDs) + assert.Equal(ptags, c.PartitionTags) +} + +func TestGrpcMarshal(t *testing.T) { + assert := assert.New(t) + c := NewCollection(cid, name, createTime, schema, sIds, ptags) + newc := GrpcMarshal(&c) + assert.NotEqual("", newc.GrpcMarshalString) +} diff --git a/internal/master/controller/collection.go b/internal/master/controller/collection.go new file mode 100644 index 0000000000..34392bf350 --- /dev/null +++ b/internal/master/controller/collection.go @@ -0,0 +1,117 @@ +package controller + +import ( + "log" + "strconv" + "time" + + "github.com/czs007/suvlim/internal/conf" + "github.com/czs007/suvlim/internal/master/collection" + messagepb "github.com/czs007/suvlim/internal/proto/message" + "github.com/czs007/suvlim/internal/master/id" + "github.com/czs007/suvlim/internal/master/kv" + "github.com/czs007/suvlim/internal/master/segment" +) + +func CollectionController(ch chan *messagepb.Mapping, kvbase kv.Base, errch chan error) { + for collectionMeta := range ch { + sID := id.New().Uint64() + cID := id.New().Uint64() + s2ID := id.New().Uint64() + fieldMetas := []*messagepb.FieldMeta{} + if collectionMeta.Schema != nil { + fieldMetas = collectionMeta.Schema.FieldMetas + } + c := collection.NewCollection(cID, collectionMeta.CollectionName, + time.Now(), fieldMetas, []uint64{sID, s2ID}, + []string{"default"}) + cm := collection.GrpcMarshal(&c) + s := segment.NewSegment(sID, cID, collectionMeta.CollectionName, "default", 0, 511, time.Now(), time.Unix(1<<36-1, 0)) + s2 := segment.NewSegment(s2ID, cID, collectionMeta.CollectionName, "default", 512, 1023, time.Now(), time.Unix(1<<36-1, 0)) + collectionData, _ := collection.Collection2JSON(*cm) + segmentData, err := segment.Segment2JSON(s) + if err != nil { + log.Fatal(err) + } + s2Data, err := segment.Segment2JSON(s2) + if err != nil { + log.Fatal(err) + } + err = kvbase.Save("collection/"+strconv.FormatUint(cID, 10), collectionData) + if err != nil { + log.Fatal(err) + } + err = kvbase.Save("segment/"+strconv.FormatUint(sID, 10), segmentData) + if err != nil { + log.Fatal(err) + } + err = kvbase.Save("segment/"+strconv.FormatUint(s2ID, 10), s2Data) + if err != nil { + log.Fatal(err) + } + } +} + +func WriteCollection2Datastore(collectionMeta *messagepb.Mapping, kvbase kv.Base) error { + sID := id.New().Uint64() + cID := id.New().Uint64() + fieldMetas := []*messagepb.FieldMeta{} + if collectionMeta.Schema != nil { + fieldMetas = collectionMeta.Schema.FieldMetas + } + c := collection.NewCollection(cID, collectionMeta.CollectionName, + time.Now(), fieldMetas, []uint64{sID}, + []string{"default"}) + cm := collection.GrpcMarshal(&c) + s := segment.NewSegment(sID, cID, collectionMeta.CollectionName, "default", 0, conf.Config.Pulsar.TopicNum, time.Now(), time.Unix(1<<46-1, 0)) + collectionData, err := collection.Collection2JSON(*cm) + if err != nil { + log.Fatal(err) + return err + } + segmentData, err := segment.Segment2JSON(s) + if err != nil { + log.Fatal(err) + return err + } + err = kvbase.Save("collection/"+strconv.FormatUint(cID, 10), collectionData) + if err != nil { + log.Fatal(err) + return err + } + err = kvbase.Save("segment/"+strconv.FormatUint(sID, 10), segmentData) + if err != nil { + log.Fatal(err) + return err + } + return nil + +} + +func UpdateCollectionIndex(index *messagepb.IndexParam, kvbase kv.Base) error { + collectionName := index.CollectionName + collectionJSON, err := kvbase.Load("collection/" + collectionName) + if err != nil { + return err + } + c, err := collection.JSON2Collection(collectionJSON) + if err != nil { + return err + } + for k, v := range c.IndexParam { + if v.IndexName == index.IndexName { + c.IndexParam[k] = v + } + } + c.IndexParam = append(c.IndexParam, index) + cm := collection.GrpcMarshal(c) + collectionData, err := collection.Collection2JSON(*cm) + if err != nil { + return err + } + err = kvbase.Save("collection/"+collectionName, collectionData) + if err != nil { + return err + } + return nil +} diff --git a/internal/master/controller/segment.go b/internal/master/controller/segment.go new file mode 100644 index 0000000000..51a70e3453 --- /dev/null +++ b/internal/master/controller/segment.go @@ -0,0 +1,114 @@ +package controller + +import ( + "fmt" + "strconv" + "time" + + "github.com/czs007/suvlim/internal/conf" + "github.com/czs007/suvlim/internal/master/collection" + "github.com/czs007/suvlim/internal/master/id" + "github.com/czs007/suvlim/internal/master/informer" + "github.com/czs007/suvlim/internal/master/kv" + "github.com/czs007/suvlim/internal/master/segment" +) + +func SegmentStatsController(kvbase kv.Base, errch chan error) { + ssChan := make(chan segment.SegmentStats, 10) + ssClient := informer.NewPulsarClient() + go segment.Listener(ssChan, ssClient) + for { + select { + case ss := <-ssChan: + errch <- ComputeCloseTime(ss, kvbase) + errch <- UpdateSegmentStatus(ss, kvbase) + case <-time.After(5 * time.Second): + fmt.Println("wait for new request") + return + } + } + +} + +func ComputeCloseTime(ss segment.SegmentStats, kvbase kv.Base) error { + if int(ss.MemorySize) > int(conf.Config.Master.SegmentThreshole*0.8) { + currentTime := time.Now() + memRate := int(ss.MemoryRate) + if memRate == 0 { + memRate = 1 + } + sec := int(conf.Config.Master.SegmentThreshole*0.2) / memRate + data, err := kvbase.Load("segment/" + strconv.Itoa(int(ss.SegementID))) + if err != nil { + return err + } + seg, err := segment.JSON2Segment(data) + if err != nil { + return err + } + seg.CloseTimeStamp = uint64(currentTime.Add(time.Duration(sec) * time.Second).Unix()) + fmt.Println(seg) + updateData, err := segment.Segment2JSON(*seg) + if err != nil { + return err + } + kvbase.Save("segment/"+strconv.Itoa(int(ss.SegementID)), updateData) + //create new segment + newSegID := id.New().Uint64() + newSeg := segment.NewSegment(newSegID, seg.CollectionID, seg.CollectionName, "default", seg.ChannelStart, seg.ChannelEnd, currentTime, time.Unix(1<<36-1, 0)) + newSegData, err := segment.Segment2JSON(*&newSeg) + if err != nil { + return err + } + //save to kv store + kvbase.Save("segment/"+strconv.Itoa(int(newSegID)), newSegData) + // update collection data + c, _ := kvbase.Load("collection/" + strconv.Itoa(int(seg.CollectionID))) + collectionMeta, err := collection.JSON2Collection(c) + if err != nil { + return err + } + segIDs := collectionMeta.SegmentIDs + segIDs = append(segIDs, newSegID) + collectionMeta.SegmentIDs = segIDs + cData, err := collection.Collection2JSON(*collectionMeta) + if err != nil { + return err + } + kvbase.Save("segment/"+strconv.Itoa(int(seg.CollectionID)), cData) + } + return nil +} + +func UpdateSegmentStatus(ss segment.SegmentStats, kvbase kv.Base) error { + segmentData, err := kvbase.Load("segment/" + strconv.Itoa(int(ss.SegementID))) + if err != nil { + return err + } + seg, err := segment.JSON2Segment(segmentData) + if err != nil { + return err + } + var changed bool + changed = false + if seg.Status != ss.Status { + changed = true + seg.Status = ss.Status + } + if seg.Rows != ss.Rows { + changed = true + seg.Rows = ss.Rows + } + + if changed { + segData, err := segment.Segment2JSON(*seg) + if err != nil { + return err + } + err = kvbase.Save("segment/"+strconv.Itoa(int(seg.CollectionID)), segData) + if err != nil { + return err + } + } + return nil +} diff --git a/internal/master/controller/segment_test.go b/internal/master/controller/segment_test.go new file mode 100644 index 0000000000..6b37e50653 --- /dev/null +++ b/internal/master/controller/segment_test.go @@ -0,0 +1,37 @@ +package controller + +import ( + "strconv" + "testing" + "time" + + "github.com/czs007/suvlim/internal/conf" + "github.com/czs007/suvlim/internal/master/kv" + "github.com/czs007/suvlim/internal/master/segment" + "go.etcd.io/etcd/clientv3" +) + +func newKvBase() kv.Base { + etcdAddr := conf.Config.Etcd.Address + etcdAddr += ":" + etcdAddr += strconv.FormatInt(int64(conf.Config.Etcd.Port), 10) + cli, _ := clientv3.New(clientv3.Config{ + Endpoints: []string{etcdAddr}, + DialTimeout: 5 * time.Second, + }) + kvbase := kv.NewEtcdKVBase(cli, conf.Config.Etcd.Rootpath) + return kvbase +} + +func TestComputeClosetTime(t *testing.T) { + kvbase := newKvBase() + var news segment.SegmentStats + for i := 0; i < 10; i++ { + news = segment.SegmentStats{ + SegementID: uint64(6875940398055133887), + MemorySize: uint64(i * 1000), + MemoryRate: 0.9, + } + ComputeCloseTime(news, kvbase) + } +} diff --git a/internal/master/grpc/server.go b/internal/master/grpc/server.go new file mode 100644 index 0000000000..9c54f7f2cc --- /dev/null +++ b/internal/master/grpc/server.go @@ -0,0 +1,69 @@ +package grpc + +import ( + "context" + "fmt" + "net" + "strconv" + + "github.com/czs007/suvlim/internal/conf" + "github.com/czs007/suvlim/internal/master/controller" + masterpb "github.com/czs007/suvlim/internal/proto/master" + messagepb "github.com/czs007/suvlim/internal/proto/message" + "github.com/czs007/suvlim/internal/master/kv" + "google.golang.org/grpc" +) + +func Server(ch chan *messagepb.Mapping, errch chan error, kvbase kv.Base) { + defaultGRPCPort := ":" + defaultGRPCPort += strconv.FormatInt(int64(conf.Config.Master.Port), 10) + lis, err := net.Listen("tcp", defaultGRPCPort) + if err != nil { + // log.Fatal("failed to listen: %v", err) + errch <- err + return + } + s := grpc.NewServer() + masterpb.RegisterMasterServer(s, GRPCMasterServer{CreateRequest: ch, kvbase: kvbase}) + if err := s.Serve(lis); err != nil { + // log.Fatalf("failed to serve: %v", err) + errch <- err + return + } +} + +type GRPCMasterServer struct { + CreateRequest chan *messagepb.Mapping + kvbase kv.Base +} + +func (ms GRPCMasterServer) CreateCollection(ctx context.Context, in *messagepb.Mapping) (*messagepb.Status, error) { + // ms.CreateRequest <- in2 + fmt.Println("Handle a new create collection request") + err := controller.WriteCollection2Datastore(in, ms.kvbase) + if err != nil { + return &messagepb.Status{ + ErrorCode: 100, + Reason: "", + }, err + } + return &messagepb.Status{ + ErrorCode: 0, + Reason: "", + }, nil +} + +func (ms GRPCMasterServer) CreateIndex(ctx context.Context, in *messagepb.IndexParam) (*messagepb.Status, error) { + fmt.Println("Handle a new create index request") + err := controller.UpdateCollectionIndex(in, ms.kvbase) + if err != nil { + return &messagepb.Status{ + ErrorCode: 100, + Reason: "", + }, err + } + return &messagepb.Status{ + ErrorCode: 0, + Reason: "", + }, nil +} diff --git a/pkg/master/id/id.go b/internal/master/id/id.go similarity index 93% rename from pkg/master/id/id.go rename to internal/master/id/id.go index dfa88a73c2..d811b52c5e 100644 --- a/pkg/master/id/id.go +++ b/internal/master/id/id.go @@ -5,7 +5,7 @@ import ( "github.com/rs/xid" - "github.com/czs007/suvlim/errors" + "github.com/czs007/suvlim/internal/errors" ) type ID struct { diff --git a/pkg/master/informer/informer.go b/internal/master/informer/informer.go similarity index 100% rename from pkg/master/informer/informer.go rename to internal/master/informer/informer.go diff --git a/internal/master/informer/pulsar.go b/internal/master/informer/pulsar.go new file mode 100644 index 0000000000..25403c63a5 --- /dev/null +++ b/internal/master/informer/pulsar.go @@ -0,0 +1,34 @@ +package informer + +import ( + "log" + "strconv" + "time" + + "github.com/czs007/suvlim/internal/conf" + + "github.com/apache/pulsar-client-go/pulsar" +) + +func NewPulsarClient() PulsarClient { + pulsarAddr := "pulsar://" + pulsarAddr += conf.Config.Pulsar.Address + pulsarAddr += ":" + pulsarAddr += strconv.FormatInt(int64(conf.Config.Pulsar.Port), 10) + client, err := pulsar.NewClient(pulsar.ClientOptions{ + URL: pulsarAddr, + OperationTimeout: 30 * time.Second, + ConnectionTimeout: 30 * time.Second, + }) + if err != nil { + log.Fatalf("Could not instantiate Pulsar client: %v", err) + } + + return PulsarClient{ + Client: client, + } +} + +type PulsarClient struct { + Client pulsar.Client +} diff --git a/pkg/master/kv/etcd_kv.go b/internal/master/kv/etcd_kv.go similarity index 91% rename from pkg/master/kv/etcd_kv.go rename to internal/master/kv/etcd_kv.go index 081cc8b35f..c10494b9e8 100644 --- a/pkg/master/kv/etcd_kv.go +++ b/internal/master/kv/etcd_kv.go @@ -5,8 +5,8 @@ import ( "path" "time" - "github.com/czs007/suvlim/errors" - "github.com/czs007/suvlim/util/etcdutil" + "github.com/czs007/suvlim/internal/errors" + "github.com/czs007/suvlim/internal/util/etcdutil" "github.com/pingcap/log" "go.etcd.io/etcd/clientv3" "go.uber.org/zap" @@ -34,23 +34,22 @@ func NewEtcdKVBase(client *clientv3.Client, rootPath string) *EtcdKVBase { } } -func (kv *EtcdKVBase) Close(){ +func (kv *EtcdKVBase) Close() { kv.client.Close() } - -func (kv *EtcdKVBase) LoadWithPrefix(key string) ( []string, []string) { +func (kv *EtcdKVBase) LoadWithPrefix(key string) ([]string, []string) { key = path.Join(kv.rootPath, key) println("in loadWithPrefix,", key) - resp, err := etcdutil.EtcdKVGet(kv.client, key,clientv3.WithPrefix()) + resp, err := etcdutil.EtcdKVGet(kv.client, key, clientv3.WithPrefix()) if err != nil { - return [] string {}, [] string {} + return []string{}, []string{} } var keys []string var values []string - for _,kvs := range resp.Kvs{ + for _, kvs := range resp.Kvs { //println(len(kvs.)) - if len(kvs.Key) <= 0{ + if len(kvs.Key) <= 0 { println("KKK") continue } diff --git a/pkg/master/kv/kv.go b/internal/master/kv/kv.go similarity index 100% rename from pkg/master/kv/kv.go rename to internal/master/kv/kv.go diff --git a/pkg/master/mock/segment.go b/internal/master/segment/segment.go similarity index 60% rename from pkg/master/mock/segment.go rename to internal/master/segment/segment.go index b101f8a2cf..4d62611271 100644 --- a/pkg/master/mock/segment.go +++ b/internal/master/segment/segment.go @@ -1,50 +1,13 @@ -package mock +package segment import ( - "bytes" - "encoding/gob" - "github.com/golang/protobuf/proto" "time" - masterpb "github.com/czs007/suvlim/pkg/master/grpc/master" + masterpb "github.com/czs007/suvlim/internal/proto/master" + jsoniter "github.com/json-iterator/go" ) -type SegmentStats struct { - SegementID uint64 - MemorySize uint64 - MemoryRate float64 - Status masterpb.SegmentStatus - Rows int64 -} - -// map[SegmentID]SegmentCloseTime -type SegmentCloseLog map[uint64]uint64 - -func SegmentMarshal(s SegmentStats) ([]byte, error) { - var nb bytes.Buffer - enc := gob.NewEncoder(&nb) - err := enc.Encode(s) - if err != nil { - return []byte{}, err - } - return nb.Bytes(), nil -} - -func SegmentUnMarshal(data []byte) (SegmentStats, error) { - var pbSS masterpb.SegmentStat - err := proto.Unmarshal(data, &pbSS) - if err != nil { - return SegmentStats{}, err - } - var ss = SegmentStats{ - SegementID: pbSS.SegmentId, - MemorySize: pbSS.MemorySize, - MemoryRate: float64(pbSS.MemoryRate), - Status: pbSS.Status, - Rows: pbSS.Rows, - } - return ss, nil -} +var json = jsoniter.ConfigCompatibleWithStandardLibrary type Segment struct { SegmentID uint64 `json:"segment_id"` @@ -71,6 +34,7 @@ func NewSegment(id uint64, collectioID uint64, cName string, ptag string, chStar CloseTimeStamp: uint64(closeTime.Unix()), } } + func Segment2JSON(s Segment) (string, error) { b, err := json.Marshal(&s) if err != nil { diff --git a/internal/master/segment/stats.go b/internal/master/segment/stats.go new file mode 100644 index 0000000000..4ff5b01a7b --- /dev/null +++ b/internal/master/segment/stats.go @@ -0,0 +1,69 @@ +package segment + +import ( + "bytes" + "context" + "encoding/gob" + "fmt" + "log" + + "github.com/apache/pulsar-client-go/pulsar" + "github.com/czs007/suvlim/internal/conf" + masterpb "github.com/czs007/suvlim/internal/proto/master" + "github.com/czs007/suvlim/internal/master/informer" +) + +type SegmentStats struct { + SegementID uint64 + MemorySize uint64 + MemoryRate float64 + Status masterpb.SegmentStatus + Rows int64 +} + +func SegmentMarshal(s SegmentStats) ([]byte, error) { + var nb bytes.Buffer + enc := gob.NewEncoder(&nb) + err := enc.Encode(s) + if err != nil { + return []byte{}, err + } + return nb.Bytes(), nil +} + +func SegmentUnMarshal(data []byte) (SegmentStats, error) { + var ss SegmentStats + dec := gob.NewDecoder(bytes.NewBuffer(data)) + err := dec.Decode(&ss) + if err != nil { + return SegmentStats{}, err + } + return ss, nil +} + +func Listener(ssChan chan SegmentStats, pc informer.PulsarClient) error { + consumer, err := pc.Client.Subscribe(pulsar.ConsumerOptions{ + Topic: conf.Config.Master.PulsarTopic, + SubscriptionName: "my-sub", + Type: pulsar.Shared, + }) + if err != nil { + log.Fatal(err) + } + for { + msg, err := consumer.Receive(context.TODO()) + if err != nil { + log.Fatal(err) + } + m, _ := SegmentUnMarshal(msg.Payload()) + fmt.Printf("Received message msgId: %#v -- content: '%s'\n", + msg.ID(), m.SegementID) + ssChan <- m + consumer.Ack(msg) + } + + if err := consumer.Unsubscribe(); err != nil { + log.Fatal(err) + } + return nil +} diff --git a/internal/master/server.go b/internal/master/server.go new file mode 100644 index 0000000000..66560ff620 --- /dev/null +++ b/internal/master/server.go @@ -0,0 +1,46 @@ +package master + +import ( + "log" + "strconv" + "time" + + "github.com/czs007/suvlim/internal/conf" + "github.com/czs007/suvlim/internal/master/controller" + milvusgrpc "github.com/czs007/suvlim/internal/master/grpc" + messagepb "github.com/czs007/suvlim/internal/proto/message" + "github.com/czs007/suvlim/internal/master/kv" + + "go.etcd.io/etcd/clientv3" +) + +func Run() { + kvbase := newKvBase() + collectionChan := make(chan *messagepb.Mapping) + defer close(collectionChan) + + errorch := make(chan error) + defer close(errorch) + + go milvusgrpc.Server(collectionChan, errorch, kvbase) + go controller.SegmentStatsController(kvbase, errorch) + go controller.CollectionController(collectionChan, kvbase, errorch) + for { + for v := range errorch { + log.Fatal(v) + } + } +} + +func newKvBase() kv.Base { + etcdAddr := conf.Config.Etcd.Address + etcdAddr += ":" + etcdAddr += strconv.FormatInt(int64(conf.Config.Etcd.Port), 10) + cli, _ := clientv3.New(clientv3.Config{ + Endpoints: []string{etcdAddr}, + DialTimeout: 5 * time.Second, + }) + // defer cli.Close() + kvbase := kv.NewEtcdKVBase(cli, conf.Config.Etcd.Rootpath) + return kvbase +} diff --git a/internal/msgclient/msgclient.go b/internal/msgclient/msgclient.go new file mode 100644 index 0000000000..7a246e047d --- /dev/null +++ b/internal/msgclient/msgclient.go @@ -0,0 +1,562 @@ +package msgclient + +import ( + "context" + "fmt" + "log" + "strconv" + + "github.com/apache/pulsar-client-go/pulsar" + "github.com/czs007/suvlim/internal/conf" + masterPb "github.com/czs007/suvlim/internal/proto/master" + msgpb "github.com/czs007/suvlim/internal/proto/message" + "github.com/czs007/suvlim/internal/timesync" + "github.com/golang/protobuf/proto" +) + +type MessageType int + +const ( + InsertOrDelete MessageType = 0 + Search MessageType = 1 + SearchById MessageType = 2 + TimeSync MessageType = 3 + Key2Seg MessageType = 4 + Statistics MessageType = 5 +) + +type ReaderMessageClient struct { + // context + ctx context.Context + + // timesync + timeSyncCfg *timesync.TimeSyncCfg + + // message channel + searchChan chan *msgpb.SearchMsg + key2SegChan chan *msgpb.Key2SegMsg + + // pulsar + client pulsar.Client + //searchResultProducer pulsar.Producer + searchResultProducers map[int64]pulsar.Producer + segmentsStatisticProducer pulsar.Producer + searchConsumer pulsar.Consumer + key2segConsumer pulsar.Consumer + + // batch messages + InsertOrDeleteMsg []*msgpb.InsertOrDeleteMsg + Key2SegMsg []*msgpb.Key2SegMsg + SearchMsg []*msgpb.SearchMsg + timestampBatchStart uint64 + timestampBatchEnd uint64 + batchIDLen int + + //client id + MessageClientID int +} + +func (mc *ReaderMessageClient) GetTimeNow() uint64 { + return mc.timestampBatchEnd +} + +func (mc *ReaderMessageClient) TimeSyncStart() uint64 { + return mc.timestampBatchStart +} + +func (mc *ReaderMessageClient) TimeSyncEnd() uint64 { + return mc.timestampBatchEnd +} + +func (mc *ReaderMessageClient) SendResult(ctx context.Context, msg msgpb.QueryResult, producerKey int64) { + var msgBuffer, _ = proto.Marshal(&msg) + if _, err := mc.searchResultProducers[producerKey].Send(ctx, &pulsar.ProducerMessage{ + Payload: msgBuffer, + }); err != nil { + log.Fatal(err) + } +} + +func (mc *ReaderMessageClient) SendSegmentsStatistic(ctx context.Context, statisticData *[]masterPb.SegmentStat) { + for _, data := range *statisticData { + var stat, _ = proto.Marshal(&data) + if _, err := mc.segmentsStatisticProducer.Send(ctx, &pulsar.ProducerMessage{ + Payload: stat, + }); err != nil { + log.Fatal(err) + } + } +} + +func (mc *ReaderMessageClient) GetSearchChan() <-chan *msgpb.SearchMsg { + return mc.searchChan +} + +func (mc *ReaderMessageClient) receiveSearchMsg() { + for { + select { + case <-mc.ctx.Done(): + return + default: + searchMsg := msgpb.SearchMsg{} + msg, err := mc.searchConsumer.Receive(mc.ctx) + if err != nil { + log.Println(err) + continue + } + err = proto.Unmarshal(msg.Payload(), &searchMsg) + if err != nil { + log.Fatal(err) + } + mc.searchChan <- &searchMsg + mc.searchConsumer.Ack(msg) + } + } +} + +func (mc *ReaderMessageClient) receiveKey2SegMsg() { + for { + select { + case <-mc.ctx.Done(): + return + default: + key2SegMsg := msgpb.Key2SegMsg{} + msg, err := mc.key2segConsumer.Receive(mc.ctx) + if err != nil { + log.Println(err) + continue + } + err = proto.Unmarshal(msg.Payload(), &key2SegMsg) + if err != nil { + log.Fatal(err) + } + mc.key2SegChan <- &key2SegMsg + mc.key2segConsumer.Ack(msg) + } + } +} + +func (mc *ReaderMessageClient) ReceiveMessage() { + + err := mc.timeSyncCfg.Start() + if err != nil { + log.Println(err) + } + go mc.receiveSearchMsg() + go mc.receiveKey2SegMsg() +} + +func (mc *ReaderMessageClient) creatProducer(topicName string) pulsar.Producer { + producer, err := mc.client.CreateProducer(pulsar.ProducerOptions{ + Topic: topicName, + }) + + if err != nil { + log.Fatal(err) + } + return producer +} + +func (mc *ReaderMessageClient) createConsumer(topicName string) pulsar.Consumer { + consumer, err := mc.client.Subscribe(pulsar.ConsumerOptions{ + Topic: topicName, + SubscriptionName: "reader" + strconv.Itoa(mc.MessageClientID), + }) + + if err != nil { + log.Fatal(err) + } + return consumer +} + +func (mc *ReaderMessageClient) createClient(url string) pulsar.Client { + if conf.Config.Pulsar.Authentication { + // create client with Authentication + client, err := pulsar.NewClient(pulsar.ClientOptions{ + URL: url, + Authentication: pulsar.NewAuthenticationToken(conf.Config.Pulsar.Token), + }) + + if err != nil { + log.Fatal(err) + } + return client + } + + // create client without Authentication + client, err := pulsar.NewClient(pulsar.ClientOptions{ + URL: url, + }) + + if err != nil { + log.Fatal(err) + } + return client +} + +func (mc *ReaderMessageClient) InitClient(ctx context.Context, url string) { + // init context + mc.ctx = ctx + + //create client + mc.client = mc.createClient(url) + mc.MessageClientID = conf.Config.Reader.ClientId + + //create producer + mc.searchResultProducers = make(map[int64]pulsar.Producer) + proxyIdList := conf.Config.Master.ProxyIdList + + searchResultTopicName := "SearchResult-" + searchTopicName := "Search" + key2SegTopicName := "Key2Seg" + timeSyncTopicName := "TimeSync" + insertOrDeleteTopicName := "InsertOrDelete-" + + if conf.Config.Pulsar.Authentication { + searchResultTopicName = "SearchResult-" + conf.Config.Pulsar.User + "-" + searchTopicName = "Search-" + conf.Config.Pulsar.User + key2SegTopicName = "Key2Seg-" + conf.Config.Pulsar.User + // timeSyncTopicName = "TimeSync-" + conf.Config.Pulsar.User + insertOrDeleteTopicName = "InsertOrDelete-" + conf.Config.Pulsar.User + "-" + } + + for _, key := range proxyIdList { + topic := searchResultTopicName + topic = topic + strconv.Itoa(int(key)) + mc.searchResultProducers[key] = mc.creatProducer(topic) + } + //mc.searchResultProducer = mc.creatProducer("SearchResult") + SegmentsStatisticTopicName := conf.Config.Master.PulsarTopic + mc.segmentsStatisticProducer = mc.creatProducer(SegmentsStatisticTopicName) + + //create consumer + mc.searchConsumer = mc.createConsumer(searchTopicName) + mc.key2segConsumer = mc.createConsumer(key2SegTopicName) + + // init channel + mc.searchChan = make(chan *msgpb.SearchMsg, conf.Config.Reader.SearchChanSize) + mc.key2SegChan = make(chan *msgpb.Key2SegMsg, conf.Config.Reader.Key2SegChanSize) + + mc.InsertOrDeleteMsg = make([]*msgpb.InsertOrDeleteMsg, 0) + mc.Key2SegMsg = make([]*msgpb.Key2SegMsg, 0) + + //init timesync + timeSyncTopic := timeSyncTopicName + timeSyncSubName := "reader" + strconv.Itoa(mc.MessageClientID) + readTopics := make([]string, 0) + for i := conf.Config.Reader.TopicStart; i < conf.Config.Reader.TopicEnd; i++ { + str := insertOrDeleteTopicName + str = str + strconv.Itoa(i) + readTopics = append(readTopics, str) + } + + readSubName := "reader" + strconv.Itoa(mc.MessageClientID) + readerQueueSize := timesync.WithReaderQueueSize(conf.Config.Reader.ReaderQueueSize) + timeSync, err := timesync.NewTimeSync(ctx, + timeSyncTopic, + timeSyncSubName, + readTopics, + readSubName, + proxyIdList, + conf.Config.Reader.StopFlag, + readerQueueSize) + if err != nil { + log.Fatal(err) + } + mc.timeSyncCfg = timeSync.(*timesync.TimeSyncCfg) + mc.timeSyncCfg.RoleType = timesync.Reader + + mc.timestampBatchStart = 0 + mc.timestampBatchEnd = 0 + mc.batchIDLen = 0 +} + +func (mc *ReaderMessageClient) Close() { + if mc.client != nil { + mc.client.Close() + } + for key, _ := range mc.searchResultProducers { + if mc.searchResultProducers[key] != nil { + mc.searchResultProducers[key].Close() + } + } + if mc.segmentsStatisticProducer != nil { + mc.segmentsStatisticProducer.Close() + } + if mc.searchConsumer != nil { + mc.searchConsumer.Close() + } + if mc.key2segConsumer != nil { + mc.key2segConsumer.Close() + } + if mc.timeSyncCfg != nil { + mc.timeSyncCfg.Close() + } +} + +func (mc *ReaderMessageClient) prepareMsg(messageType MessageType, msgLen int) { + switch messageType { + case InsertOrDelete: + for i := 0; i < msgLen; i++ { + msg := <-mc.timeSyncCfg.InsertOrDelete() + mc.InsertOrDeleteMsg = append(mc.InsertOrDeleteMsg, msg) + } + case TimeSync: + mc.timestampBatchStart = mc.timestampBatchEnd + mc.batchIDLen = 0 + for i := 0; i < msgLen; i++ { + msg, ok := <-mc.timeSyncCfg.TimeSync() + if !ok { + fmt.Println("cnn't get data from timesync chan") + } + if i == msgLen-1 { + mc.timestampBatchEnd = msg.Timestamp + } + mc.batchIDLen += int(msg.NumRecorders) + } + } +} + +func (mc *ReaderMessageClient) PrepareBatchMsg() []int { + // assume the channel not full + mc.InsertOrDeleteMsg = mc.InsertOrDeleteMsg[:0] + mc.batchIDLen = 0 + + // get the length of every channel + timeLen := mc.timeSyncCfg.TimeSyncChanLen() + + // get message from channel to slice + if timeLen > 0 { + mc.prepareMsg(TimeSync, timeLen) + mc.prepareMsg(InsertOrDelete, mc.batchIDLen) + } + return []int{mc.batchIDLen, timeLen} +} + +func (mc *ReaderMessageClient) PrepareKey2SegmentMsg() { + mc.Key2SegMsg = mc.Key2SegMsg[:0] + msgLen := len(mc.key2SegChan) + for i := 0; i < msgLen; i++ { + msg := <-mc.key2SegChan + mc.Key2SegMsg = append(mc.Key2SegMsg, msg) + } +} + +type WriterMessageClient struct { + // timesync + timeSyncCfg *timesync.TimeSyncCfg + + //message channel + searchByIdChan chan *msgpb.EntityIdentity + + // pulsar + client pulsar.Client + key2segProducer pulsar.Producer + searchByIdConsumer pulsar.Consumer + + // batch messages + InsertMsg []*msgpb.InsertOrDeleteMsg + DeleteMsg []*msgpb.InsertOrDeleteMsg + timestampBatchStart uint64 + timestampBatchEnd uint64 + batchIDLen int + + //client id + MessageClientID int +} + +func (mc *WriterMessageClient) Send(ctx context.Context, msg msgpb.Key2SegMsg) { + var msgBuffer, _ = proto.Marshal(&msg) + if _, err := mc.key2segProducer.Send(ctx, &pulsar.ProducerMessage{ + Payload: msgBuffer, + }); err != nil { + log.Fatal(err) + } +} + +func (mc *WriterMessageClient) TimeSync() uint64 { + return mc.timestampBatchEnd +} + +func (mc *WriterMessageClient) SearchByIdChan() chan *msgpb.EntityIdentity { + return mc.searchByIdChan +} + +func (mc *WriterMessageClient) receiveSearchByIdMsg() { + for { + searchByIdMsg := msgpb.EntityIdentity{} + msg, err := mc.searchByIdConsumer.Receive(context.Background()) + err = proto.Unmarshal(msg.Payload(), &searchByIdMsg) + if err != nil { + log.Fatal(err) + } + mc.searchByIdChan <- &searchByIdMsg + mc.searchByIdConsumer.Ack(msg) + } +} + +func (mc *WriterMessageClient) ReceiveMessage() { + err := mc.timeSyncCfg.Start() + if err != nil { + log.Fatal(err) + } + go mc.receiveSearchByIdMsg() +} + +func (mc *WriterMessageClient) creatProducer(topicName string) pulsar.Producer { + producer, err := mc.client.CreateProducer(pulsar.ProducerOptions{ + Topic: topicName, + }) + + if err != nil { + log.Fatal(err) + } + return producer +} + +func (mc *WriterMessageClient) createConsumer(topicName string) pulsar.Consumer { + consumer, err := mc.client.Subscribe(pulsar.ConsumerOptions{ + Topic: topicName, + SubscriptionName: "writer" + strconv.Itoa(mc.MessageClientID), + }) + + if err != nil { + log.Fatal(err) + } + return consumer +} + +func (mc *WriterMessageClient) createClient(url string) pulsar.Client { + if conf.Config.Pulsar.Authentication { + // create client with Authentication + client, err := pulsar.NewClient(pulsar.ClientOptions{ + URL: url, + Authentication: pulsar.NewAuthenticationToken(conf.Config.Pulsar.Token), + }) + + if err != nil { + log.Fatal(err) + } + return client + } + + // create client without Authentication + client, err := pulsar.NewClient(pulsar.ClientOptions{ + URL: url, + }) + + if err != nil { + log.Fatal(err) + } + return client +} + +func (mc *WriterMessageClient) InitClient(url string) { + //create client + mc.client = mc.createClient(url) + mc.MessageClientID = conf.Config.Writer.ClientId + + key2SegTopicName := "Key2Seg" + searchByIdTopicName := "SearchById" + timeSyncTopicName := "TimeSync" + insertOrDeleteTopicName := "InsertOrDelete-" + + if conf.Config.Pulsar.Authentication { + key2SegTopicName = "Key2Seg-" + conf.Config.Pulsar.User + searchByIdTopicName = "Search-" + conf.Config.Pulsar.User + // timeSyncTopicName = "TimeSync-" + conf.Config.Pulsar.User + insertOrDeleteTopicName = "InsertOrDelete-" + conf.Config.Pulsar.User + "-" + } + + //create producer + mc.key2segProducer = mc.creatProducer(key2SegTopicName) + + //create consumer + mc.searchByIdConsumer = mc.createConsumer(searchByIdTopicName) + + //init channel + mc.searchByIdChan = make(chan *msgpb.EntityIdentity, conf.Config.Writer.SearchByIdChanSize) + + //init msg slice + mc.InsertMsg = make([]*msgpb.InsertOrDeleteMsg, 0) + mc.DeleteMsg = make([]*msgpb.InsertOrDeleteMsg, 0) + + //init timesync + timeSyncTopic := timeSyncTopicName + timeSyncSubName := "writer" + strconv.Itoa(mc.MessageClientID) + readTopics := make([]string, 0) + for i := conf.Config.Writer.TopicStart; i < conf.Config.Writer.TopicEnd; i++ { + str := insertOrDeleteTopicName + str = str + strconv.Itoa(i) + readTopics = append(readTopics, str) + } + readSubName := "writer" + strconv.Itoa(mc.MessageClientID) + proxyIdList := conf.Config.Master.ProxyIdList + readerQueueSize := timesync.WithReaderQueueSize(conf.Config.Reader.ReaderQueueSize) + timeSync, err := timesync.NewTimeSync(context.Background(), + timeSyncTopic, + timeSyncSubName, + readTopics, + readSubName, + proxyIdList, + conf.Config.Writer.StopFlag, + readerQueueSize) + if err != nil { + log.Fatal(err) + } + mc.timeSyncCfg = timeSync.(*timesync.TimeSyncCfg) + mc.timeSyncCfg.RoleType = timesync.Writer + + mc.timestampBatchStart = 0 + mc.timestampBatchEnd = 0 + mc.batchIDLen = 0 +} + +func (mc *WriterMessageClient) Close() { + mc.client.Close() + mc.key2segProducer.Close() + mc.searchByIdConsumer.Close() + mc.timeSyncCfg.Close() +} + +func (mc *WriterMessageClient) PrepareMsg(messageType MessageType, msgLen int) { + switch messageType { + case InsertOrDelete: + for i := 0; i < msgLen; i++ { + msg := <-mc.timeSyncCfg.InsertOrDelete() + if msg.Op == msgpb.OpType_INSERT { + mc.InsertMsg = append(mc.InsertMsg, msg) + } else { + mc.DeleteMsg = append(mc.DeleteMsg, msg) + } + } + case TimeSync: + mc.timestampBatchStart = mc.timestampBatchEnd + mc.batchIDLen = 0 + for i := 0; i < msgLen; i++ { + msg := <-mc.timeSyncCfg.TimeSync() + if i == msgLen-1 { + mc.timestampBatchEnd = msg.Timestamp + } + mc.batchIDLen += int(msg.NumRecorders) + } + } +} + +func (mc *WriterMessageClient) PrepareBatchMsg() int { + // assume the channel not full + mc.InsertMsg = mc.InsertMsg[:0] + mc.DeleteMsg = mc.DeleteMsg[:0] + mc.batchIDLen = 0 + + // get the length of every channel + timeLen := len(mc.timeSyncCfg.TimeSync()) + + // get message from channel to slice + if timeLen > 0 { + mc.PrepareMsg(TimeSync, timeLen) + mc.PrepareMsg(InsertOrDelete, mc.batchIDLen) + } + //return []int{insertOrDeleteLen, searchLen, timeLen} + return mc.batchIDLen +} diff --git a/pkg/master/grpc/master/master.pb.go b/internal/proto/master/master.pb.go similarity index 72% rename from pkg/master/grpc/master/master.pb.go rename to internal/proto/master/master.pb.go index 047f76a392..76e98ef386 100644 --- a/pkg/master/grpc/master/master.pb.go +++ b/internal/proto/master/master.pb.go @@ -1,12 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: pkg/master/grpc/master/master.proto +// source: internal/proto/master/master.proto package master import ( context "context" fmt "fmt" - message "github.com/czs007/suvlim/pkg/master/grpc/message" + message "github.com/czs007/suvlim/internal/proto/message" proto "github.com/golang/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -53,7 +53,7 @@ func (x SegmentStatus) String() string { } func (SegmentStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_64c7f42561e95429, []int{0} + return fileDescriptor_14014aea2fd9cd94, []int{0} } type Collection struct { @@ -73,7 +73,7 @@ func (m *Collection) Reset() { *m = Collection{} } func (m *Collection) String() string { return proto.CompactTextString(m) } func (*Collection) ProtoMessage() {} func (*Collection) Descriptor() ([]byte, []int) { - return fileDescriptor_64c7f42561e95429, []int{0} + return fileDescriptor_14014aea2fd9cd94, []int{0} } func (m *Collection) XXX_Unmarshal(b []byte) error { @@ -152,7 +152,7 @@ type Segment struct { OpenTimestamp uint64 `protobuf:"varint,6,opt,name=open_timestamp,json=openTimestamp,proto3" json:"open_timestamp,omitempty"` CloseTimestamp uint64 `protobuf:"varint,7,opt,name=close_timestamp,json=closeTimestamp,proto3" json:"close_timestamp,omitempty"` CollectionName string `protobuf:"bytes,8,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - Status SegmentStatus `protobuf:"varint,9,opt,name=status,proto3,enum=masterpb.SegmentStatus" json:"status,omitempty"` + Status SegmentStatus `protobuf:"varint,9,opt,name=status,proto3,enum=SegmentStatus" json:"status,omitempty"` Rows int64 `protobuf:"varint,10,opt,name=rows,proto3" json:"rows,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -163,7 +163,7 @@ func (m *Segment) Reset() { *m = Segment{} } func (m *Segment) String() string { return proto.CompactTextString(m) } func (*Segment) ProtoMessage() {} func (*Segment) Descriptor() ([]byte, []int) { - return fileDescriptor_64c7f42561e95429, []int{1} + return fileDescriptor_14014aea2fd9cd94, []int{1} } func (m *Segment) XXX_Unmarshal(b []byte) error { @@ -258,7 +258,7 @@ type SegmentStat struct { SegmentId uint64 `protobuf:"varint,1,opt,name=segment_id,json=segmentId,proto3" json:"segment_id,omitempty"` MemorySize uint64 `protobuf:"varint,2,opt,name=memory_size,json=memorySize,proto3" json:"memory_size,omitempty"` MemoryRate float32 `protobuf:"fixed32,3,opt,name=memory_rate,json=memoryRate,proto3" json:"memory_rate,omitempty"` - Status SegmentStatus `protobuf:"varint,4,opt,name=status,proto3,enum=masterpb.SegmentStatus" json:"status,omitempty"` + Status SegmentStatus `protobuf:"varint,4,opt,name=status,proto3,enum=SegmentStatus" json:"status,omitempty"` Rows int64 `protobuf:"varint,5,opt,name=rows,proto3" json:"rows,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -269,7 +269,7 @@ func (m *SegmentStat) Reset() { *m = SegmentStat{} } func (m *SegmentStat) String() string { return proto.CompactTextString(m) } func (*SegmentStat) ProtoMessage() {} func (*SegmentStat) Descriptor() ([]byte, []int) { - return fileDescriptor_64c7f42561e95429, []int{2} + return fileDescriptor_14014aea2fd9cd94, []int{2} } func (m *SegmentStat) XXX_Unmarshal(b []byte) error { @@ -326,56 +326,55 @@ func (m *SegmentStat) GetRows() int64 { } func init() { - proto.RegisterEnum("masterpb.SegmentStatus", SegmentStatus_name, SegmentStatus_value) - proto.RegisterType((*Collection)(nil), "masterpb.Collection") - proto.RegisterType((*Segment)(nil), "masterpb.Segment") - proto.RegisterType((*SegmentStat)(nil), "masterpb.SegmentStat") + proto.RegisterEnum("SegmentStatus", SegmentStatus_name, SegmentStatus_value) + proto.RegisterType((*Collection)(nil), "Collection") + proto.RegisterType((*Segment)(nil), "Segment") + proto.RegisterType((*SegmentStat)(nil), "SegmentStat") } func init() { - proto.RegisterFile("pkg/master/grpc/master/master.proto", fileDescriptor_64c7f42561e95429) + proto.RegisterFile("internal/proto/master/master.proto", fileDescriptor_14014aea2fd9cd94) } -var fileDescriptor_64c7f42561e95429 = []byte{ - // 594 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x61, 0x6b, 0xd3, 0x40, - 0x18, 0xc7, 0x97, 0xb4, 0x4d, 0xd7, 0x27, 0x6d, 0x2d, 0xa7, 0x60, 0x18, 0xc8, 0x42, 0xc7, 0x30, - 0x28, 0x34, 0xdb, 0x7c, 0xe1, 0x2b, 0x11, 0xb6, 0x16, 0x29, 0xb8, 0x6e, 0x24, 0x7b, 0x21, 0xbe, - 0x29, 0xb7, 0xe4, 0xc8, 0x0e, 0x73, 0x49, 0xc8, 0x5d, 0xa7, 0xee, 0x13, 0xf8, 0x7d, 0xfc, 0x6e, - 0x82, 0xef, 0xe4, 0x9e, 0xa4, 0x6b, 0xaa, 0x0e, 0xf1, 0x55, 0x9e, 0xfc, 0xef, 0x97, 0x7b, 0xfe, - 0xf9, 0xe7, 0xb9, 0xc0, 0x41, 0xf1, 0x29, 0xf1, 0x05, 0x95, 0x8a, 0x95, 0x7e, 0x52, 0x16, 0xd1, - 0xba, 0xae, 0x2e, 0x93, 0xa2, 0xcc, 0x55, 0x4e, 0x76, 0xab, 0xbb, 0xe2, 0x7a, 0xef, 0xf0, 0x0f, - 0x9c, 0x49, 0x49, 0x13, 0xb6, 0xbe, 0x56, 0x0f, 0x8c, 0x7f, 0x1a, 0x00, 0x67, 0x79, 0x9a, 0xb2, - 0x48, 0xf1, 0x3c, 0x23, 0x43, 0x30, 0x79, 0xec, 0x18, 0xae, 0xe1, 0xb5, 0x03, 0x93, 0xc7, 0x84, - 0x40, 0x3b, 0xa3, 0x82, 0x39, 0xa6, 0x6b, 0x78, 0xbd, 0x00, 0x6b, 0xf2, 0x12, 0x2c, 0x19, 0xdd, - 0x30, 0x41, 0x9d, 0x96, 0x6b, 0x78, 0xf6, 0xc9, 0xe3, 0x89, 0xe0, 0xe9, 0xed, 0x4a, 0x4e, 0x74, - 0x9b, 0x49, 0x88, 0x4b, 0x41, 0x8d, 0x90, 0x7d, 0xb0, 0xa3, 0x92, 0x51, 0xc5, 0x96, 0x8a, 0x0b, - 0xe6, 0xb4, 0x71, 0x67, 0xa8, 0xa4, 0x2b, 0x2e, 0x98, 0x06, 0x24, 0x4b, 0x04, 0xcb, 0xd4, 0x92, - 0xc7, 0xd2, 0xe9, 0xb8, 0x2d, 0x0d, 0xd4, 0xd2, 0x3c, 0x96, 0xe4, 0x10, 0x86, 0x05, 0x2d, 0x15, - 0xd7, 0xfe, 0x96, 0x8a, 0x26, 0xd2, 0xb1, 0xdc, 0x96, 0xd7, 0x0b, 0x06, 0xf7, 0xea, 0x15, 0x4d, - 0x24, 0x39, 0x86, 0x2e, 0xcf, 0x62, 0xf6, 0x85, 0x49, 0xa7, 0xeb, 0xb6, 0x3c, 0xfb, 0xe4, 0xe9, - 0x96, 0xad, 0xb9, 0x5e, 0xbb, 0xa4, 0x25, 0x15, 0xc1, 0x9a, 0x1b, 0xff, 0x30, 0xa1, 0x1b, 0x56, - 0x8d, 0xc8, 0x33, 0x80, 0x8d, 0x8d, 0x3a, 0x80, 0xde, 0xbd, 0x0b, 0x72, 0x00, 0x83, 0xe8, 0x3e, - 0x25, 0x4d, 0x98, 0x48, 0xf4, 0x37, 0x62, 0x05, 0x6d, 0x39, 0xc5, 0x7c, 0x7a, 0x41, 0xbf, 0x69, - 0x14, 0x77, 0xba, 0xa1, 0x59, 0xc6, 0xd2, 0xa5, 0x54, 0xb4, 0x54, 0x18, 0x49, 0x27, 0xe8, 0xd7, - 0x62, 0xa8, 0x35, 0x4c, 0xad, 0x86, 0x58, 0x16, 0x3b, 0x1d, 0x44, 0xa0, 0x96, 0x66, 0x59, 0xac, - 0x43, 0xc9, 0x0b, 0x96, 0x61, 0xa8, 0x52, 0x51, 0x51, 0x38, 0x16, 0x1a, 0x1a, 0x68, 0xf5, 0x6a, - 0x2d, 0x92, 0xe7, 0xf0, 0x28, 0x4a, 0x73, 0xc9, 0x1a, 0x5c, 0x17, 0xb9, 0x21, 0xca, 0xdb, 0xe0, - 0xe6, 0xfd, 0xf0, 0x93, 0xef, 0xa2, 0xf9, 0xe1, 0x46, 0x5e, 0xe8, 0x8f, 0xef, 0x83, 0x25, 0x15, - 0x55, 0x2b, 0xe9, 0xf4, 0x5c, 0xc3, 0x1b, 0xea, 0x94, 0xeb, 0x89, 0x9b, 0xd4, 0x51, 0x86, 0xb8, - 0x1c, 0xd4, 0x98, 0x9e, 0xa0, 0x32, 0xff, 0x2c, 0x1d, 0x70, 0x0d, 0xaf, 0x15, 0x60, 0x3d, 0xfe, - 0x6e, 0x80, 0xdd, 0xa0, 0xff, 0x15, 0xfe, 0x3e, 0xd8, 0x82, 0x89, 0xbc, 0xfc, 0xba, 0x94, 0xfc, - 0x8e, 0xd5, 0xd1, 0x43, 0x25, 0x85, 0xfc, 0x8e, 0x35, 0x80, 0x92, 0x2a, 0x86, 0xb1, 0x9b, 0x6b, - 0x20, 0xa0, 0xaa, 0xe9, 0xba, 0xfd, 0x7f, 0xae, 0x3b, 0x1b, 0xd7, 0x2f, 0x4e, 0x61, 0xb0, 0x05, - 0x13, 0x00, 0xeb, 0xe2, 0x72, 0xb6, 0x98, 0x4d, 0x47, 0x3b, 0xba, 0x3e, 0x7b, 0x7f, 0x11, 0xce, - 0xa6, 0x23, 0x83, 0xf4, 0x61, 0x77, 0xbe, 0x98, 0xce, 0x3e, 0xcc, 0x17, 0xef, 0x46, 0x26, 0xb1, - 0xa1, 0x8b, 0x77, 0xb3, 0xe9, 0xa8, 0x75, 0xf2, 0xcd, 0x00, 0xeb, 0x1c, 0x5b, 0x93, 0xb7, 0x30, - 0x3a, 0xc3, 0x63, 0xd0, 0x38, 0x7e, 0x4f, 0xb6, 0x66, 0xf6, 0x9c, 0x16, 0x05, 0xcf, 0x92, 0xbd, - 0xdf, 0x0e, 0x18, 0x36, 0x1f, 0xef, 0x90, 0x37, 0x60, 0x57, 0x1b, 0xe0, 0x6c, 0x93, 0x87, 0xe6, - 0xfd, 0x81, 0xc7, 0x4f, 0x8f, 0x3f, 0xfa, 0x09, 0x57, 0x37, 0xab, 0xeb, 0x49, 0x94, 0x0b, 0x3f, - 0xba, 0x93, 0x47, 0x47, 0xaf, 0x7d, 0xb9, 0xba, 0x4d, 0xb9, 0xf0, 0xff, 0xfe, 0xab, 0xb9, 0xb6, - 0xf0, 0x9f, 0xf1, 0xea, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe0, 0x1b, 0xc4, 0x72, 0x8b, 0x04, - 0x00, 0x00, +var fileDescriptor_14014aea2fd9cd94 = []byte{ + // 586 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xdf, 0x6e, 0xd3, 0x30, + 0x14, 0xc6, 0x97, 0xb4, 0x4d, 0xd7, 0x93, 0xb6, 0x54, 0x06, 0x89, 0x68, 0x12, 0x5a, 0x54, 0xfe, + 0x45, 0x20, 0xa5, 0xa3, 0x5c, 0x70, 0x85, 0x90, 0xb6, 0x56, 0xa8, 0x12, 0xeb, 0xa6, 0x64, 0x17, + 0x88, 0x9b, 0xca, 0x4b, 0xac, 0xcc, 0x52, 0xec, 0x44, 0xb1, 0x3b, 0x60, 0x4f, 0xc0, 0xb3, 0xf0, + 0x6e, 0x3c, 0x00, 0x77, 0x28, 0x27, 0xe9, 0x9a, 0x4e, 0x4c, 0x70, 0x65, 0xfb, 0xf3, 0xaf, 0xf6, + 0xd7, 0xcf, 0xe7, 0x04, 0xc6, 0x5c, 0x6a, 0x56, 0x48, 0x9a, 0x4e, 0xf2, 0x22, 0xd3, 0xd9, 0x44, + 0x50, 0xa5, 0x59, 0x51, 0x0f, 0x3e, 0x6a, 0x07, 0xcf, 0xee, 0x32, 0x4c, 0x29, 0x9a, 0xb0, 0xcd, + 0x58, 0x51, 0xe3, 0xdf, 0x06, 0xc0, 0x49, 0x96, 0xa6, 0x2c, 0xd2, 0x3c, 0x93, 0x64, 0x08, 0x26, + 0x8f, 0x1d, 0xc3, 0x35, 0xbc, 0x76, 0x60, 0xf2, 0x98, 0x10, 0x68, 0x4b, 0x2a, 0x98, 0x63, 0xba, + 0x86, 0xd7, 0x0b, 0x70, 0x4e, 0x5e, 0x83, 0xa5, 0xa2, 0x2b, 0x26, 0xa8, 0xd3, 0x72, 0x0d, 0xcf, + 0x9e, 0x3e, 0xf4, 0x05, 0x4f, 0xaf, 0xd7, 0xca, 0x4f, 0x8a, 0x3c, 0xf2, 0x43, 0xdc, 0x0a, 0x6a, + 0x84, 0x1c, 0x82, 0x1d, 0x15, 0x8c, 0x6a, 0xb6, 0xd2, 0x5c, 0x30, 0xa7, 0x8d, 0x27, 0x43, 0x25, + 0x5d, 0x70, 0xc1, 0x4a, 0x40, 0xb1, 0x44, 0x30, 0xa9, 0x57, 0x3c, 0x56, 0x4e, 0xc7, 0x6d, 0x95, + 0x40, 0x2d, 0x2d, 0x62, 0x45, 0x9e, 0xc3, 0x30, 0xa7, 0x85, 0xe6, 0xa5, 0xbf, 0x95, 0xa6, 0x89, + 0x72, 0x2c, 0xb7, 0xe5, 0xf5, 0x82, 0xc1, 0xad, 0x7a, 0x41, 0x13, 0x45, 0xde, 0x40, 0x97, 0xcb, + 0x98, 0x7d, 0x63, 0xca, 0xe9, 0xba, 0x2d, 0xcf, 0x9e, 0x3e, 0xde, 0xb1, 0xb5, 0x28, 0xf7, 0xce, + 0x69, 0x41, 0x45, 0xb0, 0xe1, 0xc6, 0xbf, 0x4c, 0xe8, 0x86, 0xd5, 0x45, 0xe4, 0x09, 0xc0, 0xd6, + 0x46, 0x1d, 0x40, 0xef, 0xd6, 0x05, 0x79, 0x0a, 0x83, 0xe8, 0x36, 0xa5, 0x92, 0x30, 0x91, 0xe8, + 0x6f, 0xc5, 0x0a, 0xda, 0x71, 0x8a, 0xf9, 0xf4, 0x82, 0x7e, 0xd3, 0x28, 0x9e, 0x74, 0x45, 0xa5, + 0x64, 0xe9, 0x4a, 0x69, 0x5a, 0x68, 0x8c, 0xa4, 0x13, 0xf4, 0x6b, 0x31, 0x2c, 0x35, 0x4c, 0xad, + 0x86, 0x98, 0x8c, 0x9d, 0x0e, 0x22, 0x50, 0x4b, 0x73, 0x19, 0x97, 0xa1, 0x64, 0x39, 0x93, 0x18, + 0xaa, 0xd2, 0x54, 0xe4, 0x8e, 0x85, 0x86, 0x06, 0xa5, 0x7a, 0xb1, 0x11, 0xc9, 0x4b, 0x78, 0x10, + 0xa5, 0x99, 0x62, 0x0d, 0xae, 0x8b, 0xdc, 0x10, 0xe5, 0x5d, 0x70, 0xfb, 0xff, 0xf0, 0xc9, 0xf7, + 0xd1, 0xfc, 0x70, 0x2b, 0x2f, 0xcb, 0xc7, 0x7f, 0x01, 0x96, 0xd2, 0x54, 0xaf, 0x95, 0xd3, 0x73, + 0x0d, 0x6f, 0x38, 0x1d, 0xfa, 0x75, 0x82, 0x21, 0xaa, 0x41, 0xbd, 0x5b, 0x16, 0x4e, 0x91, 0x7d, + 0x55, 0x0e, 0xb8, 0x86, 0xd7, 0x0a, 0x70, 0x3e, 0xfe, 0x69, 0x80, 0xdd, 0xa0, 0xff, 0x95, 0xf9, + 0x21, 0xd8, 0x82, 0x89, 0xac, 0xf8, 0xbe, 0x52, 0xfc, 0x86, 0xd5, 0x89, 0x43, 0x25, 0x85, 0xfc, + 0x86, 0x35, 0x80, 0x82, 0x6a, 0x86, 0x69, 0x9b, 0x1b, 0x20, 0xa0, 0xba, 0x69, 0xb6, 0xfd, 0x5f, + 0x66, 0x3b, 0x5b, 0xb3, 0xaf, 0x8e, 0x61, 0xb0, 0x03, 0x13, 0x00, 0xeb, 0xec, 0x7c, 0xbe, 0x9c, + 0xcf, 0x46, 0x7b, 0xe5, 0xfc, 0xe4, 0xd3, 0x59, 0x38, 0x9f, 0x8d, 0x0c, 0xd2, 0x87, 0xfd, 0xc5, + 0x72, 0x36, 0xff, 0xbc, 0x58, 0x7e, 0x1c, 0x99, 0xc4, 0x86, 0x2e, 0xae, 0xe6, 0xb3, 0x51, 0x6b, + 0xfa, 0xc3, 0x00, 0xeb, 0x14, 0x7b, 0x92, 0x7c, 0x80, 0xd1, 0x09, 0x16, 0x7d, 0xa3, 0xd9, 0x1e, + 0xed, 0x54, 0xe8, 0x29, 0xcd, 0x73, 0x2e, 0x93, 0x83, 0x3b, 0xed, 0x84, 0x97, 0x8f, 0xf7, 0xc8, + 0x7b, 0xb0, 0xab, 0x03, 0xb0, 0x92, 0xc9, 0x7d, 0xd5, 0x7d, 0xcf, 0xcf, 0x8f, 0x8f, 0xbe, 0xf8, + 0x09, 0xd7, 0x57, 0xeb, 0x4b, 0x3f, 0xca, 0xc4, 0x24, 0xba, 0x51, 0x47, 0x47, 0xef, 0x26, 0x6a, + 0x7d, 0x9d, 0x72, 0x31, 0xf9, 0xeb, 0xc7, 0xe4, 0xd2, 0xc2, 0xd5, 0xdb, 0x3f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x51, 0x48, 0x1b, 0x7b, 0x6c, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -404,7 +403,7 @@ func NewMasterClient(cc *grpc.ClientConn) MasterClient { func (c *masterClient) CreateCollection(ctx context.Context, in *message.Mapping, opts ...grpc.CallOption) (*message.Status, error) { out := new(message.Status) - err := c.cc.Invoke(ctx, "/masterpb.Master/CreateCollection", in, out, opts...) + err := c.cc.Invoke(ctx, "/Master/CreateCollection", in, out, opts...) if err != nil { return nil, err } @@ -413,7 +412,7 @@ func (c *masterClient) CreateCollection(ctx context.Context, in *message.Mapping func (c *masterClient) CreateIndex(ctx context.Context, in *message.IndexParam, opts ...grpc.CallOption) (*message.Status, error) { out := new(message.Status) - err := c.cc.Invoke(ctx, "/masterpb.Master/CreateIndex", in, out, opts...) + err := c.cc.Invoke(ctx, "/Master/CreateIndex", in, out, opts...) if err != nil { return nil, err } @@ -451,7 +450,7 @@ func _Master_CreateCollection_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/masterpb.Master/CreateCollection", + FullMethod: "/Master/CreateCollection", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MasterServer).CreateCollection(ctx, req.(*message.Mapping)) @@ -469,7 +468,7 @@ func _Master_CreateIndex_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/masterpb.Master/CreateIndex", + FullMethod: "/Master/CreateIndex", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MasterServer).CreateIndex(ctx, req.(*message.IndexParam)) @@ -478,7 +477,7 @@ func _Master_CreateIndex_Handler(srv interface{}, ctx context.Context, dec func( } var _Master_serviceDesc = grpc.ServiceDesc{ - ServiceName: "masterpb.Master", + ServiceName: "Master", HandlerType: (*MasterServer)(nil), Methods: []grpc.MethodDesc{ { @@ -491,5 +490,5 @@ var _Master_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "pkg/master/grpc/master/master.proto", + Metadata: "internal/proto/master/master.proto", } diff --git a/proto/master.proto b/internal/proto/master/master.proto similarity index 88% rename from proto/master.proto rename to internal/proto/master/master.proto index eee4a751a9..12df06f3d7 100644 --- a/proto/master.proto +++ b/internal/proto/master/master.proto @@ -1,10 +1,8 @@ syntax = "proto3"; -package masterpb; +option go_package="github.com/czs007/suvlim/internal/proto/master"; -option go_package="master"; - -import "message.proto"; +import "internal/proto/message/message.proto"; message Collection { uint64 id=1; @@ -36,7 +34,6 @@ message Segment { int64 rows=10; } - message SegmentStat { uint64 segment_id=1; uint64 memory_size=2; diff --git a/pkg/master/grpc/message/message.pb.go b/internal/proto/message/message.pb.go similarity index 86% rename from pkg/master/grpc/message/message.pb.go rename to internal/proto/message/message.pb.go index 5e0cb65c7a..9a3d03526e 100644 --- a/pkg/master/grpc/message/message.pb.go +++ b/internal/proto/message/message.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: pkg/master/grpc/message/message.proto +// source: internal/proto/message/message.proto package message @@ -112,7 +112,7 @@ func (x ErrorCode) String() string { } func (ErrorCode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{0} + return fileDescriptor_a25be62442992adf, []int{0} } //* @@ -166,7 +166,7 @@ func (x DataType) String() string { } func (DataType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{1} + return fileDescriptor_a25be62442992adf, []int{1} } type CompareOperator int32 @@ -203,7 +203,7 @@ func (x CompareOperator) String() string { } func (CompareOperator) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{2} + return fileDescriptor_a25be62442992adf, []int{2} } type Occur int32 @@ -234,7 +234,7 @@ func (x Occur) String() string { } func (Occur) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{3} + return fileDescriptor_a25be62442992adf, []int{3} } ////////////////////pulsar////////////////////////////////////// @@ -260,7 +260,7 @@ func (x OpType) String() string { } func (OpType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{4} + return fileDescriptor_a25be62442992adf, []int{4} } type ReqType int32 @@ -354,7 +354,7 @@ func (x ReqType) String() string { } func (ReqType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{5} + return fileDescriptor_a25be62442992adf, []int{5} } type SyncType int32 @@ -379,7 +379,7 @@ func (x SyncType) String() string { } func (SyncType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{6} + return fileDescriptor_a25be62442992adf, []int{6} } type Status struct { @@ -394,7 +394,7 @@ func (m *Status) Reset() { *m = Status{} } func (m *Status) String() string { return proto.CompactTextString(m) } func (*Status) ProtoMessage() {} func (*Status) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{0} + return fileDescriptor_a25be62442992adf, []int{0} } func (m *Status) XXX_Unmarshal(b []byte) error { @@ -443,7 +443,7 @@ func (m *KeyValuePair) Reset() { *m = KeyValuePair{} } func (m *KeyValuePair) String() string { return proto.CompactTextString(m) } func (*KeyValuePair) ProtoMessage() {} func (*KeyValuePair) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{1} + return fileDescriptor_a25be62442992adf, []int{1} } func (m *KeyValuePair) XXX_Unmarshal(b []byte) error { @@ -491,7 +491,7 @@ func (m *CollectionName) Reset() { *m = CollectionName{} } func (m *CollectionName) String() string { return proto.CompactTextString(m) } func (*CollectionName) ProtoMessage() {} func (*CollectionName) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{2} + return fileDescriptor_a25be62442992adf, []int{2} } func (m *CollectionName) XXX_Unmarshal(b []byte) error { @@ -533,7 +533,7 @@ func (m *CollectionNameList) Reset() { *m = CollectionNameList{} } func (m *CollectionNameList) String() string { return proto.CompactTextString(m) } func (*CollectionNameList) ProtoMessage() {} func (*CollectionNameList) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{3} + return fileDescriptor_a25be62442992adf, []int{3} } func (m *CollectionNameList) XXX_Unmarshal(b []byte) error { @@ -582,7 +582,7 @@ func (m *FieldName) Reset() { *m = FieldName{} } func (m *FieldName) String() string { return proto.CompactTextString(m) } func (*FieldName) ProtoMessage() {} func (*FieldName) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{4} + return fileDescriptor_a25be62442992adf, []int{4} } func (m *FieldName) XXX_Unmarshal(b []byte) error { @@ -639,7 +639,7 @@ func (m *Mapping) Reset() { *m = Mapping{} } func (m *Mapping) String() string { return proto.CompactTextString(m) } func (*Mapping) ProtoMessage() {} func (*Mapping) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{5} + return fileDescriptor_a25be62442992adf, []int{5} } func (m *Mapping) XXX_Unmarshal(b []byte) error { @@ -702,7 +702,7 @@ func (m *MappingList) Reset() { *m = MappingList{} } func (m *MappingList) String() string { return proto.CompactTextString(m) } func (*MappingList) ProtoMessage() {} func (*MappingList) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{6} + return fileDescriptor_a25be62442992adf, []int{6} } func (m *MappingList) XXX_Unmarshal(b []byte) error { @@ -751,7 +751,7 @@ func (m *PartitionParam) Reset() { *m = PartitionParam{} } func (m *PartitionParam) String() string { return proto.CompactTextString(m) } func (*PartitionParam) ProtoMessage() {} func (*PartitionParam) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{7} + return fileDescriptor_a25be62442992adf, []int{7} } func (m *PartitionParam) XXX_Unmarshal(b []byte) error { @@ -800,7 +800,7 @@ func (m *PartitionList) Reset() { *m = PartitionList{} } func (m *PartitionList) String() string { return proto.CompactTextString(m) } func (*PartitionList) ProtoMessage() {} func (*PartitionList) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{8} + return fileDescriptor_a25be62442992adf, []int{8} } func (m *PartitionList) XXX_Unmarshal(b []byte) error { @@ -849,7 +849,7 @@ func (m *VectorRowRecord) Reset() { *m = VectorRowRecord{} } func (m *VectorRowRecord) String() string { return proto.CompactTextString(m) } func (*VectorRowRecord) ProtoMessage() {} func (*VectorRowRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{9} + return fileDescriptor_a25be62442992adf, []int{9} } func (m *VectorRowRecord) XXX_Unmarshal(b []byte) error { @@ -896,7 +896,7 @@ func (m *EntityIds) Reset() { *m = EntityIds{} } func (m *EntityIds) String() string { return proto.CompactTextString(m) } func (*EntityIds) ProtoMessage() {} func (*EntityIds) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{10} + return fileDescriptor_a25be62442992adf, []int{10} } func (m *EntityIds) XXX_Unmarshal(b []byte) error { @@ -942,7 +942,7 @@ func (m *VectorRecord) Reset() { *m = VectorRecord{} } func (m *VectorRecord) String() string { return proto.CompactTextString(m) } func (*VectorRecord) ProtoMessage() {} func (*VectorRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{11} + return fileDescriptor_a25be62442992adf, []int{11} } func (m *VectorRecord) XXX_Unmarshal(b []byte) error { @@ -982,7 +982,7 @@ func (m *VectorParam) Reset() { *m = VectorParam{} } func (m *VectorParam) String() string { return proto.CompactTextString(m) } func (*VectorParam) ProtoMessage() {} func (*VectorParam) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{12} + return fileDescriptor_a25be62442992adf, []int{12} } func (m *VectorParam) XXX_Unmarshal(b []byte) error { @@ -1032,7 +1032,7 @@ func (m *FieldMeta) Reset() { *m = FieldMeta{} } func (m *FieldMeta) String() string { return proto.CompactTextString(m) } func (*FieldMeta) ProtoMessage() {} func (*FieldMeta) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{13} + return fileDescriptor_a25be62442992adf, []int{13} } func (m *FieldMeta) XXX_Unmarshal(b []byte) error { @@ -1085,7 +1085,7 @@ func (m *Schema) Reset() { *m = Schema{} } func (m *Schema) String() string { return proto.CompactTextString(m) } func (*Schema) ProtoMessage() {} func (*Schema) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{14} + return fileDescriptor_a25be62442992adf, []int{14} } func (m *Schema) XXX_Unmarshal(b []byte) error { @@ -1124,7 +1124,7 @@ func (m *RowData) Reset() { *m = RowData{} } func (m *RowData) String() string { return proto.CompactTextString(m) } func (*RowData) ProtoMessage() {} func (*RowData) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{15} + return fileDescriptor_a25be62442992adf, []int{15} } func (m *RowData) XXX_Unmarshal(b []byte) error { @@ -1169,7 +1169,7 @@ func (m *InsertParam) Reset() { *m = InsertParam{} } func (m *InsertParam) String() string { return proto.CompactTextString(m) } func (*InsertParam) ProtoMessage() {} func (*InsertParam) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{16} + return fileDescriptor_a25be62442992adf, []int{16} } func (m *InsertParam) XXX_Unmarshal(b []byte) error { @@ -1247,7 +1247,7 @@ func (m *SearchParam) Reset() { *m = SearchParam{} } func (m *SearchParam) String() string { return proto.CompactTextString(m) } func (*SearchParam) ProtoMessage() {} func (*SearchParam) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{17} + return fileDescriptor_a25be62442992adf, []int{17} } func (m *SearchParam) XXX_Unmarshal(b []byte) error { @@ -1315,7 +1315,7 @@ func (m *SearchInSegmentParam) Reset() { *m = SearchInSegmentParam{} } func (m *SearchInSegmentParam) String() string { return proto.CompactTextString(m) } func (*SearchInSegmentParam) ProtoMessage() {} func (*SearchInSegmentParam) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{18} + return fileDescriptor_a25be62442992adf, []int{18} } func (m *SearchInSegmentParam) XXX_Unmarshal(b []byte) error { @@ -1364,7 +1364,7 @@ func (m *Entities) Reset() { *m = Entities{} } func (m *Entities) String() string { return proto.CompactTextString(m) } func (*Entities) ProtoMessage() {} func (*Entities) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{19} + return fileDescriptor_a25be62442992adf, []int{19} } func (m *Entities) XXX_Unmarshal(b []byte) error { @@ -1433,7 +1433,7 @@ func (m *QueryResult) Reset() { *m = QueryResult{} } func (m *QueryResult) String() string { return proto.CompactTextString(m) } func (*QueryResult) ProtoMessage() {} func (*QueryResult) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{20} + return fileDescriptor_a25be62442992adf, []int{20} } func (m *QueryResult) XXX_Unmarshal(b []byte) error { @@ -1524,7 +1524,7 @@ func (m *StringReply) Reset() { *m = StringReply{} } func (m *StringReply) String() string { return proto.CompactTextString(m) } func (*StringReply) ProtoMessage() {} func (*StringReply) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{21} + return fileDescriptor_a25be62442992adf, []int{21} } func (m *StringReply) XXX_Unmarshal(b []byte) error { @@ -1573,7 +1573,7 @@ func (m *BoolReply) Reset() { *m = BoolReply{} } func (m *BoolReply) String() string { return proto.CompactTextString(m) } func (*BoolReply) ProtoMessage() {} func (*BoolReply) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{22} + return fileDescriptor_a25be62442992adf, []int{22} } func (m *BoolReply) XXX_Unmarshal(b []byte) error { @@ -1622,7 +1622,7 @@ func (m *CollectionRowCount) Reset() { *m = CollectionRowCount{} } func (m *CollectionRowCount) String() string { return proto.CompactTextString(m) } func (*CollectionRowCount) ProtoMessage() {} func (*CollectionRowCount) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{23} + return fileDescriptor_a25be62442992adf, []int{23} } func (m *CollectionRowCount) XXX_Unmarshal(b []byte) error { @@ -1670,7 +1670,7 @@ func (m *Command) Reset() { *m = Command{} } func (m *Command) String() string { return proto.CompactTextString(m) } func (*Command) ProtoMessage() {} func (*Command) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{24} + return fileDescriptor_a25be62442992adf, []int{24} } func (m *Command) XXX_Unmarshal(b []byte) error { @@ -1727,7 +1727,7 @@ func (m *IndexParam) Reset() { *m = IndexParam{} } func (m *IndexParam) String() string { return proto.CompactTextString(m) } func (*IndexParam) ProtoMessage() {} func (*IndexParam) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{25} + return fileDescriptor_a25be62442992adf, []int{25} } func (m *IndexParam) XXX_Unmarshal(b []byte) error { @@ -1796,7 +1796,7 @@ func (m *FlushParam) Reset() { *m = FlushParam{} } func (m *FlushParam) String() string { return proto.CompactTextString(m) } func (*FlushParam) ProtoMessage() {} func (*FlushParam) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{26} + return fileDescriptor_a25be62442992adf, []int{26} } func (m *FlushParam) XXX_Unmarshal(b []byte) error { @@ -1838,7 +1838,7 @@ func (m *CompactParam) Reset() { *m = CompactParam{} } func (m *CompactParam) String() string { return proto.CompactTextString(m) } func (*CompactParam) ProtoMessage() {} func (*CompactParam) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{27} + return fileDescriptor_a25be62442992adf, []int{27} } func (m *CompactParam) XXX_Unmarshal(b []byte) error { @@ -1887,7 +1887,7 @@ func (m *DeleteByIDParam) Reset() { *m = DeleteByIDParam{} } func (m *DeleteByIDParam) String() string { return proto.CompactTextString(m) } func (*DeleteByIDParam) ProtoMessage() {} func (*DeleteByIDParam) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{28} + return fileDescriptor_a25be62442992adf, []int{28} } func (m *DeleteByIDParam) XXX_Unmarshal(b []byte) error { @@ -1965,7 +1965,7 @@ func (m *CollectionInfo) Reset() { *m = CollectionInfo{} } func (m *CollectionInfo) String() string { return proto.CompactTextString(m) } func (*CollectionInfo) ProtoMessage() {} func (*CollectionInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{29} + return fileDescriptor_a25be62442992adf, []int{29} } func (m *CollectionInfo) XXX_Unmarshal(b []byte) error { @@ -2014,7 +2014,7 @@ func (m *GetEntityIDsParam) Reset() { *m = GetEntityIDsParam{} } func (m *GetEntityIDsParam) String() string { return proto.CompactTextString(m) } func (*GetEntityIDsParam) ProtoMessage() {} func (*GetEntityIDsParam) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{30} + return fileDescriptor_a25be62442992adf, []int{30} } func (m *GetEntityIDsParam) XXX_Unmarshal(b []byte) error { @@ -2064,7 +2064,7 @@ func (m *EntityIdentity) Reset() { *m = EntityIdentity{} } func (m *EntityIdentity) String() string { return proto.CompactTextString(m) } func (*EntityIdentity) ProtoMessage() {} func (*EntityIdentity) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{31} + return fileDescriptor_a25be62442992adf, []int{31} } func (m *EntityIdentity) XXX_Unmarshal(b []byte) error { @@ -2119,7 +2119,7 @@ func (m *VectorFieldParam) Reset() { *m = VectorFieldParam{} } func (m *VectorFieldParam) String() string { return proto.CompactTextString(m) } func (*VectorFieldParam) ProtoMessage() {} func (*VectorFieldParam) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{32} + return fileDescriptor_a25be62442992adf, []int{32} } func (m *VectorFieldParam) XXX_Unmarshal(b []byte) error { @@ -2163,7 +2163,7 @@ func (m *FieldType) Reset() { *m = FieldType{} } func (m *FieldType) String() string { return proto.CompactTextString(m) } func (*FieldType) ProtoMessage() {} func (*FieldType) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{33} + return fileDescriptor_a25be62442992adf, []int{33} } func (m *FieldType) XXX_Unmarshal(b []byte) error { @@ -2246,7 +2246,7 @@ func (m *FieldParam) Reset() { *m = FieldParam{} } func (m *FieldParam) String() string { return proto.CompactTextString(m) } func (*FieldParam) ProtoMessage() {} func (*FieldParam) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{34} + return fileDescriptor_a25be62442992adf, []int{34} } func (m *FieldParam) XXX_Unmarshal(b []byte) error { @@ -2315,7 +2315,7 @@ func (m *VectorFieldRecord) Reset() { *m = VectorFieldRecord{} } func (m *VectorFieldRecord) String() string { return proto.CompactTextString(m) } func (*VectorFieldRecord) ProtoMessage() {} func (*VectorFieldRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{35} + return fileDescriptor_a25be62442992adf, []int{35} } func (m *VectorFieldRecord) XXX_Unmarshal(b []byte) error { @@ -2359,7 +2359,7 @@ func (m *TermQuery) Reset() { *m = TermQuery{} } func (m *TermQuery) String() string { return proto.CompactTextString(m) } func (*TermQuery) ProtoMessage() {} func (*TermQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{36} + return fileDescriptor_a25be62442992adf, []int{36} } func (m *TermQuery) XXX_Unmarshal(b []byte) error { @@ -2434,7 +2434,7 @@ func (m *CompareExpr) Reset() { *m = CompareExpr{} } func (m *CompareExpr) String() string { return proto.CompactTextString(m) } func (*CompareExpr) ProtoMessage() {} func (*CompareExpr) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{37} + return fileDescriptor_a25be62442992adf, []int{37} } func (m *CompareExpr) XXX_Unmarshal(b []byte) error { @@ -2483,7 +2483,7 @@ func (m *RangeQuery) Reset() { *m = RangeQuery{} } func (m *RangeQuery) String() string { return proto.CompactTextString(m) } func (*RangeQuery) ProtoMessage() {} func (*RangeQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{38} + return fileDescriptor_a25be62442992adf, []int{38} } func (m *RangeQuery) XXX_Unmarshal(b []byte) error { @@ -2547,7 +2547,7 @@ func (m *VectorQuery) Reset() { *m = VectorQuery{} } func (m *VectorQuery) String() string { return proto.CompactTextString(m) } func (*VectorQuery) ProtoMessage() {} func (*VectorQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{39} + return fileDescriptor_a25be62442992adf, []int{39} } func (m *VectorQuery) XXX_Unmarshal(b []byte) error { @@ -2615,7 +2615,7 @@ func (m *BooleanQuery) Reset() { *m = BooleanQuery{} } func (m *BooleanQuery) String() string { return proto.CompactTextString(m) } func (*BooleanQuery) ProtoMessage() {} func (*BooleanQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{40} + return fileDescriptor_a25be62442992adf, []int{40} } func (m *BooleanQuery) XXX_Unmarshal(b []byte) error { @@ -2666,7 +2666,7 @@ func (m *GeneralQuery) Reset() { *m = GeneralQuery{} } func (m *GeneralQuery) String() string { return proto.CompactTextString(m) } func (*GeneralQuery) ProtoMessage() {} func (*GeneralQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{41} + return fileDescriptor_a25be62442992adf, []int{41} } func (m *GeneralQuery) XXX_Unmarshal(b []byte) error { @@ -2774,7 +2774,7 @@ func (m *SearchParamPB) Reset() { *m = SearchParamPB{} } func (m *SearchParamPB) String() string { return proto.CompactTextString(m) } func (*SearchParamPB) ProtoMessage() {} func (*SearchParamPB) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{42} + return fileDescriptor_a25be62442992adf, []int{42} } func (m *SearchParamPB) XXX_Unmarshal(b []byte) error { @@ -2842,7 +2842,7 @@ func (m *QueryReqMsg) Reset() { *m = QueryReqMsg{} } func (m *QueryReqMsg) String() string { return proto.CompactTextString(m) } func (*QueryReqMsg) ProtoMessage() {} func (*QueryReqMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{43} + return fileDescriptor_a25be62442992adf, []int{43} } func (m *QueryReqMsg) XXX_Unmarshal(b []byte) error { @@ -2946,7 +2946,7 @@ func (m *ManipulationReqMsg) Reset() { *m = ManipulationReqMsg{} } func (m *ManipulationReqMsg) String() string { return proto.CompactTextString(m) } func (*ManipulationReqMsg) ProtoMessage() {} func (*ManipulationReqMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{44} + return fileDescriptor_a25be62442992adf, []int{44} } func (m *ManipulationReqMsg) XXX_Unmarshal(b []byte) error { @@ -3057,7 +3057,7 @@ func (m *InsertOrDeleteMsg) Reset() { *m = InsertOrDeleteMsg{} } func (m *InsertOrDeleteMsg) String() string { return proto.CompactTextString(m) } func (*InsertOrDeleteMsg) ProtoMessage() {} func (*InsertOrDeleteMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{45} + return fileDescriptor_a25be62442992adf, []int{45} } func (m *InsertOrDeleteMsg) XXX_Unmarshal(b []byte) error { @@ -3167,7 +3167,7 @@ func (m *SearchMsg) Reset() { *m = SearchMsg{} } func (m *SearchMsg) String() string { return proto.CompactTextString(m) } func (*SearchMsg) ProtoMessage() {} func (*SearchMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{46} + return fileDescriptor_a25be62442992adf, []int{46} } func (m *SearchMsg) XXX_Unmarshal(b []byte) error { @@ -3264,7 +3264,7 @@ func (m *TimeSyncMsg) Reset() { *m = TimeSyncMsg{} } func (m *TimeSyncMsg) String() string { return proto.CompactTextString(m) } func (*TimeSyncMsg) ProtoMessage() {} func (*TimeSyncMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{47} + return fileDescriptor_a25be62442992adf, []int{47} } func (m *TimeSyncMsg) XXX_Unmarshal(b []byte) error { @@ -3319,7 +3319,7 @@ func (m *Key2SegMsg) Reset() { *m = Key2SegMsg{} } func (m *Key2SegMsg) String() string { return proto.CompactTextString(m) } func (*Key2SegMsg) ProtoMessage() {} func (*Key2SegMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_0802b3a25fb57244, []int{48} + return fileDescriptor_a25be62442992adf, []int{48} } func (m *Key2SegMsg) XXX_Unmarshal(b []byte) error { @@ -3421,217 +3421,216 @@ func init() { } func init() { - proto.RegisterFile("pkg/master/grpc/message/message.proto", fileDescriptor_0802b3a25fb57244) + proto.RegisterFile("internal/proto/message/message.proto", fileDescriptor_a25be62442992adf) } -var fileDescriptor_0802b3a25fb57244 = []byte{ - // 3284 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x3a, 0x4d, 0x73, 0x1b, 0xc9, - 0x75, 0x18, 0x0c, 0x08, 0x60, 0xde, 0x00, 0x64, 0xb3, 0x45, 0x49, 0x94, 0xb4, 0x8a, 0xb4, 0xb3, - 0xb5, 0x89, 0x56, 0xa9, 0x92, 0xb4, 0xdc, 0x8d, 0xa4, 0x44, 0xbb, 0x9b, 0x05, 0x81, 0x21, 0x39, - 0x11, 0x08, 0x50, 0x0d, 0x50, 0xda, 0x8f, 0x4a, 0x21, 0x43, 0x4c, 0x0b, 0x9c, 0x25, 0x80, 0x81, - 0x66, 0x06, 0xa2, 0x90, 0x63, 0xee, 0x49, 0x65, 0x93, 0x5c, 0x72, 0x71, 0x95, 0x7d, 0xb6, 0x5d, - 0xae, 0xf2, 0x3f, 0xf0, 0xc9, 0x5e, 0x1f, 0x7c, 0xdc, 0xc3, 0x56, 0xf9, 0xe8, 0xf2, 0xcd, 0x17, - 0xdb, 0x67, 0x57, 0x7f, 0x0c, 0x30, 0x03, 0x02, 0x14, 0x21, 0xda, 0x3e, 0xa1, 0xe7, 0x75, 0xf7, - 0xeb, 0xf7, 0xdd, 0xef, 0xbd, 0x06, 0xbc, 0x3b, 0x38, 0xea, 0xdc, 0xed, 0xd9, 0x41, 0x48, 0xfd, - 0xbb, 0x1d, 0x7f, 0xd0, 0xbe, 0xdb, 0xa3, 0x41, 0x60, 0x77, 0x68, 0xf4, 0x7b, 0x67, 0xe0, 0x7b, - 0xa1, 0x87, 0xf5, 0x9e, 0xdb, 0x7d, 0x39, 0x0c, 0xee, 0xb0, 0x25, 0xc6, 0x33, 0xc8, 0x36, 0x42, - 0x3b, 0x1c, 0x06, 0xf8, 0x1f, 0x00, 0xa8, 0xef, 0x7b, 0x7e, 0xab, 0xed, 0x39, 0x74, 0x5d, 0xb9, - 0xa9, 0xdc, 0x5a, 0xde, 0xb8, 0x74, 0x27, 0xb6, 0xf6, 0x8e, 0xc9, 0xa6, 0xcb, 0x9e, 0x43, 0x89, - 0x46, 0xa3, 0x21, 0xbe, 0x04, 0x59, 0x9f, 0xda, 0x81, 0xd7, 0x5f, 0x4f, 0xdf, 0x54, 0x6e, 0x69, - 0x44, 0x7e, 0x19, 0xf7, 0xa1, 0xf0, 0x98, 0x8e, 0x9e, 0xda, 0xdd, 0x21, 0xdd, 0xb3, 0x5d, 0x1f, - 0x23, 0x50, 0x8f, 0xe8, 0x88, 0xe3, 0xd5, 0x08, 0x1b, 0xe2, 0x35, 0x58, 0x7a, 0xc9, 0xa6, 0xe5, - 0x46, 0xf1, 0x61, 0xfc, 0x23, 0x2c, 0x97, 0xbd, 0x6e, 0x97, 0xb6, 0x43, 0xd7, 0xeb, 0xd7, 0xec, - 0x1e, 0xc5, 0x7f, 0x07, 0x2b, 0xed, 0x31, 0xa4, 0xd5, 0xb7, 0x7b, 0x54, 0x62, 0x59, 0x6e, 0x27, - 0x16, 0x1a, 0x5d, 0xc0, 0xc9, 0xad, 0x55, 0x37, 0x08, 0xf1, 0xdf, 0x43, 0x36, 0xe0, 0x1c, 0xf2, - 0x5d, 0xfa, 0xc6, 0x85, 0x04, 0x4f, 0x82, 0x79, 0x22, 0x97, 0xe0, 0xf7, 0x00, 0x4d, 0x9d, 0x15, - 0xac, 0xa7, 0x6f, 0xaa, 0xb7, 0x34, 0xb2, 0x92, 0x3c, 0x2c, 0x30, 0x1a, 0xa0, 0x6d, 0xb9, 0xb4, - 0xeb, 0x2c, 0x44, 0x23, 0xbe, 0x0e, 0xf0, 0x9c, 0xed, 0x12, 0x6b, 0x04, 0xe7, 0xda, 0xf3, 0x08, - 0x8f, 0xf1, 0x8d, 0x02, 0xb9, 0x5d, 0x7b, 0x30, 0x70, 0xfb, 0x9d, 0xc5, 0x08, 0x9f, 0x41, 0x40, - 0x7a, 0x26, 0x01, 0x0c, 0x6b, 0xfb, 0x90, 0xf6, 0xec, 0x75, 0x75, 0x16, 0x56, 0x3e, 0x45, 0xe4, - 0x12, 0xfc, 0x11, 0x14, 0xe8, 0xab, 0xd0, 0xb7, 0x5b, 0x03, 0xdb, 0xb7, 0x7b, 0xc1, 0x7a, 0xe6, - 0xa6, 0x7a, 0x4b, 0xdf, 0xb8, 0x92, 0xd8, 0x12, 0xd7, 0x32, 0xd1, 0xf9, 0xf2, 0x3d, 0xbe, 0xda, - 0x08, 0x40, 0x97, 0xbc, 0x2c, 0xae, 0x88, 0x07, 0x50, 0xe8, 0x89, 0xbd, 0xad, 0xae, 0x1b, 0x84, - 0x5c, 0x09, 0xfa, 0xc6, 0x5a, 0x62, 0x8b, 0x44, 0x4e, 0xf4, 0xde, 0xe4, 0x14, 0xe3, 0x31, 0x2c, - 0xef, 0xd9, 0x7e, 0xe8, 0x32, 0x86, 0x39, 0x1d, 0x67, 0xd7, 0x0d, 0x02, 0x35, 0xb4, 0x3b, 0x52, - 0x6e, 0x6c, 0x68, 0x74, 0xa1, 0x38, 0x46, 0xb6, 0x38, 0x0f, 0x77, 0xe0, 0xc2, 0x20, 0xda, 0xdd, - 0x0a, 0xed, 0x4e, 0xcb, 0xf6, 0x7d, 0x7b, 0x24, 0xed, 0x69, 0x75, 0x3c, 0xd5, 0xb4, 0x3b, 0x25, - 0x36, 0x61, 0x3c, 0x81, 0x95, 0xa7, 0xb4, 0x1d, 0x7a, 0x3e, 0xf1, 0x8e, 0x09, 0x6d, 0x7b, 0xbe, - 0xc3, 0xcd, 0xa5, 0xeb, 0xd9, 0x61, 0xcb, 0xb1, 0x43, 0x7b, 0x5d, 0xb9, 0xa9, 0xde, 0x4a, 0x13, - 0x8d, 0x43, 0x2a, 0x76, 0x68, 0xe3, 0x1b, 0xa0, 0x1f, 0xb8, 0x7d, 0xdb, 0x1f, 0x89, 0x79, 0x46, - 0x79, 0x81, 0x80, 0x00, 0xb1, 0x05, 0xc6, 0xbf, 0x81, 0x66, 0xf6, 0x43, 0x37, 0x1c, 0x59, 0x4e, - 0xb0, 0x18, 0xf1, 0x7f, 0x0b, 0x2b, 0x94, 0xef, 0x6c, 0xb9, 0x4e, 0x8c, 0x70, 0x95, 0x14, 0xa9, - 0x44, 0x28, 0x88, 0xde, 0x82, 0x82, 0x24, 0x5a, 0x50, 0x7c, 0x1f, 0x72, 0x3e, 0x1f, 0x05, 0x9c, - 0x5c, 0x7d, 0xe3, 0xad, 0xc4, 0x29, 0x53, 0x0c, 0x92, 0x68, 0xb1, 0xf1, 0x25, 0xe8, 0x62, 0x4e, - 0x28, 0x0d, 0x43, 0xe6, 0x2b, 0x16, 0x54, 0x84, 0xa6, 0xf8, 0x18, 0x3f, 0x04, 0xf0, 0xbd, 0xe3, - 0x96, 0xd8, 0xc1, 0x99, 0x9d, 0xb6, 0xc5, 0x38, 0x25, 0x44, 0xf3, 0xa3, 0x53, 0x8c, 0x8e, 0xf4, - 0xd5, 0x5d, 0x1a, 0xda, 0x53, 0x2e, 0xa8, 0x4c, 0xb9, 0x20, 0x7e, 0x0f, 0x32, 0xe1, 0x68, 0x20, - 0xdc, 0x67, 0x79, 0xe3, 0x62, 0x02, 0x3f, 0x93, 0x69, 0x73, 0x34, 0xa0, 0x84, 0x2f, 0x61, 0x06, - 0xe3, 0xb8, 0x3d, 0xee, 0x48, 0x2a, 0x61, 0x43, 0xa3, 0x04, 0x59, 0xe1, 0x42, 0xf8, 0x01, 0xe8, - 0xe2, 0x94, 0x1e, 0x0d, 0xed, 0x48, 0x16, 0xc9, 0x78, 0x3a, 0x26, 0x89, 0x08, 0x82, 0xd8, 0x30, - 0x30, 0xae, 0x43, 0x8e, 0x78, 0xc7, 0x5c, 0xbd, 0x18, 0x32, 0x07, 0x5d, 0xef, 0x80, 0xd3, 0x58, - 0x20, 0x7c, 0x6c, 0x7c, 0x3f, 0x0d, 0xba, 0xd5, 0x0f, 0xa8, 0x1f, 0x2e, 0x68, 0xdd, 0x13, 0xc7, - 0x4f, 0xbf, 0xde, 0xf1, 0xdf, 0x07, 0x26, 0xbd, 0x40, 0x98, 0x95, 0x3a, 0xc3, 0xf7, 0x24, 0x89, - 0x24, 0xcf, 0x96, 0x71, 0x62, 0x67, 0x18, 0x4c, 0x66, 0x86, 0xc1, 0xe0, 0x77, 0xa0, 0x98, 0xf0, - 0x8a, 0xf5, 0x25, 0x4e, 0x6e, 0x21, 0xee, 0x0f, 0x27, 0x02, 0x4f, 0x76, 0xa1, 0xc0, 0xf3, 0x5b, - 0x05, 0xf4, 0x06, 0xb5, 0xfd, 0xf6, 0xe1, 0x82, 0x32, 0x7a, 0x04, 0x85, 0x97, 0xdc, 0x84, 0xc4, - 0xb9, 0x32, 0xea, 0xac, 0xcf, 0xb0, 0x31, 0x8e, 0x98, 0xe8, 0x2f, 0x63, 0x26, 0xcb, 0xac, 0x21, - 0xe8, 0x72, 0x6b, 0xd0, 0x08, 0x1b, 0x9e, 0x64, 0x35, 0xc3, 0x5d, 0xff, 0x74, 0x56, 0x97, 0x16, - 0x62, 0xf5, 0x18, 0xd6, 0x04, 0xa7, 0x56, 0xbf, 0x41, 0x3b, 0x3d, 0xda, 0x97, 0x66, 0x61, 0x40, - 0xf1, 0xb9, 0xdb, 0xa5, 0x13, 0x5d, 0x28, 0xfc, 0x68, 0x9d, 0x01, 0x23, 0x4d, 0x3c, 0x82, 0x42, - 0xc0, 0xf7, 0x8e, 0xb9, 0x55, 0x4e, 0x70, 0x1b, 0x13, 0x23, 0xd1, 0x83, 0xc9, 0x87, 0xf1, 0xff, - 0x0a, 0xe4, 0x79, 0x68, 0x71, 0xe9, 0x82, 0x91, 0x05, 0x81, 0xea, 0x3a, 0x81, 0x8c, 0x26, 0x6c, - 0x88, 0xaf, 0x81, 0xf6, 0xd2, 0xee, 0xba, 0x4e, 0xcb, 0xf7, 0x8e, 0xb9, 0xb5, 0xe5, 0x49, 0x9e, - 0x03, 0x88, 0x77, 0x9c, 0x34, 0xc5, 0xcc, 0x59, 0x4c, 0xd1, 0xf8, 0x49, 0x1a, 0xf4, 0x27, 0x43, - 0xea, 0x8f, 0x08, 0x0d, 0x86, 0xdd, 0x05, 0xa3, 0xf6, 0xfb, 0x90, 0xa7, 0x92, 0x2f, 0x29, 0x91, - 0x64, 0x0c, 0x88, 0x98, 0x26, 0xe3, 0x65, 0xf8, 0x32, 0xe4, 0x58, 0x60, 0xea, 0x0f, 0xa3, 0x58, - 0x90, 0xf5, 0xbd, 0xe3, 0xda, 0xb0, 0xc7, 0x92, 0xa3, 0xa0, 0xed, 0xf9, 0x54, 0xdc, 0x9c, 0x69, - 0x22, 0xbf, 0xf0, 0x5b, 0xa0, 0x39, 0x6e, 0x10, 0xda, 0xfd, 0x36, 0x15, 0x0a, 0x4f, 0x93, 0x09, - 0xe0, 0x7c, 0xc6, 0x8f, 0xaf, 0x40, 0xfe, 0x05, 0xe3, 0xbd, 0xe5, 0x3a, 0xeb, 0xb9, 0x9b, 0xca, - 0xad, 0x0c, 0xc9, 0xf1, 0x6f, 0xcb, 0x61, 0x53, 0x03, 0xdf, 0x7b, 0xc5, 0xa7, 0xf2, 0x9c, 0xd0, - 0x1c, 0xff, 0xb6, 0x1c, 0xe3, 0x5f, 0x41, 0x6f, 0x84, 0x3e, 0xbb, 0x4d, 0xe9, 0xa0, 0x3b, 0x5a, - 0x4c, 0x62, 0x6f, 0x43, 0x21, 0xe0, 0x7b, 0x5b, 0x3e, 0xdb, 0x2c, 0x2f, 0x50, 0x3d, 0x98, 0xe0, - 0x33, 0x9e, 0x81, 0xb6, 0xe9, 0x79, 0xdd, 0x37, 0x40, 0x7e, 0x1d, 0xe0, 0xc0, 0xf3, 0xba, 0x31, - 0xd4, 0x79, 0xa2, 0x1d, 0x44, 0xb8, 0x8c, 0x20, 0x9e, 0xf3, 0x11, 0xef, 0xb8, 0xec, 0x0d, 0xfb, - 0x0b, 0x2a, 0xfc, 0x1e, 0xac, 0xc5, 0xa2, 0x03, 0x53, 0x64, 0x9b, 0x21, 0xe1, 0x67, 0xa9, 0x04, - 0xb7, 0x4f, 0xa0, 0x37, 0xae, 0x41, 0xae, 0xec, 0xf5, 0x7a, 0x76, 0xdf, 0x61, 0xc6, 0xdc, 0xee, - 0x39, 0x51, 0x5a, 0xdb, 0xee, 0x39, 0xc6, 0xaf, 0x15, 0x00, 0xab, 0xef, 0xd0, 0x57, 0xc2, 0x11, - 0xff, 0x32, 0x59, 0x5c, 0xf2, 0x0e, 0x53, 0xa7, 0xef, 0xb0, 0xeb, 0x00, 0x2e, 0x23, 0x41, 0x4c, - 0x67, 0xc4, 0x34, 0x87, 0xf0, 0xe9, 0xf3, 0x85, 0x9c, 0x4f, 0x01, 0xb6, 0xba, 0xc3, 0x40, 0xc6, - 0xd6, 0x0d, 0xb8, 0x38, 0x45, 0x72, 0x22, 0xe0, 0x5c, 0x48, 0x12, 0x2e, 0x72, 0x86, 0x7d, 0x28, - 0x94, 0xbd, 0xde, 0xc0, 0x6e, 0x2f, 0x7a, 0x87, 0xbd, 0x05, 0x5a, 0x78, 0xe8, 0xd3, 0xe0, 0xd0, - 0xeb, 0x8a, 0x04, 0x40, 0x21, 0x13, 0x80, 0xb1, 0x0f, 0x2b, 0x15, 0xda, 0xa5, 0x21, 0xdd, 0x1c, - 0x59, 0x95, 0x05, 0x31, 0x5f, 0x81, 0xfc, 0x54, 0x9e, 0x93, 0x73, 0x65, 0x86, 0xf3, 0x45, 0xbc, - 0x22, 0xb1, 0xfa, 0xcf, 0xbd, 0xc5, 0x74, 0x7a, 0x0d, 0x34, 0x96, 0xbd, 0xb4, 0xdc, 0xfe, 0x73, - 0x4f, 0x6a, 0x33, 0xcf, 0x00, 0x0c, 0x93, 0xf1, 0x25, 0xac, 0x6e, 0xd3, 0x50, 0xa6, 0x68, 0x95, - 0x60, 0x41, 0xa2, 0xaf, 0x03, 0x04, 0x22, 0xe8, 0x33, 0x8f, 0x16, 0xf6, 0xaa, 0x49, 0x88, 0xe5, - 0x18, 0x43, 0x58, 0x8e, 0x92, 0x3f, 0x71, 0x05, 0xff, 0x39, 0xc4, 0xc1, 0x72, 0xce, 0x89, 0xe9, - 0x05, 0x3c, 0x5c, 0x6b, 0x32, 0x81, 0x11, 0x85, 0xd1, 0x3d, 0x40, 0xe2, 0x8e, 0xe4, 0xf9, 0x8d, - 0x60, 0x89, 0x07, 0xbc, 0x1e, 0xed, 0x07, 0xae, 0xcc, 0xe9, 0x54, 0x32, 0x01, 0x18, 0xff, 0xa5, - 0xc8, 0xfc, 0x8c, 0xe5, 0x56, 0xf8, 0x43, 0xd0, 0x58, 0xac, 0x6f, 0xf1, 0x2c, 0x4c, 0x39, 0x25, - 0x0b, 0xdb, 0x49, 0x91, 0xbc, 0x23, 0xc7, 0x78, 0xf3, 0xc4, 0xd5, 0xcd, 0x34, 0x73, 0x7d, 0xc6, - 0xd5, 0x3d, 0x21, 0x6b, 0x27, 0x95, 0xb8, 0xc1, 0x37, 0x73, 0xb2, 0x22, 0x35, 0xbe, 0x55, 0x00, - 0x62, 0xd4, 0x2f, 0x43, 0xda, 0x15, 0x3e, 0x9e, 0x21, 0x69, 0xd7, 0x61, 0x79, 0x59, 0xcc, 0x37, - 0xf9, 0x78, 0x9c, 0x36, 0xaa, 0xaf, 0x4f, 0x1b, 0x3f, 0x82, 0x82, 0xf0, 0xce, 0x33, 0x57, 0x55, - 0xee, 0x38, 0x9e, 0x04, 0xe7, 0x74, 0xde, 0x6d, 0x58, 0x8d, 0x49, 0x41, 0xe6, 0xec, 0x1b, 0x51, - 0x25, 0x7e, 0x96, 0x8c, 0x5d, 0x8a, 0xe8, 0x3b, 0x05, 0xb4, 0x26, 0xf5, 0x7b, 0xfc, 0x9e, 0x7d, - 0x5d, 0x4e, 0x7d, 0x0d, 0x34, 0xb7, 0x1f, 0xb6, 0xa2, 0x72, 0x9f, 0xd9, 0x53, 0xde, 0xed, 0x87, - 0x9c, 0x46, 0x76, 0x7d, 0x38, 0xde, 0xf0, 0xa0, 0x4b, 0xe5, 0x3c, 0xb3, 0x28, 0x85, 0xe8, 0x02, - 0x26, 0x96, 0x88, 0x04, 0x61, 0x48, 0xf9, 0x15, 0x9b, 0xe1, 0xe6, 0x93, 0xe7, 0x00, 0x76, 0xc9, - 0xae, 0xc1, 0xd2, 0x81, 0xe7, 0x05, 0x21, 0x4f, 0x24, 0xd3, 0x44, 0x7c, 0x9c, 0x33, 0x83, 0xb4, - 0x41, 0xe7, 0x11, 0xca, 0xa7, 0xe6, 0xab, 0x81, 0x8f, 0x1f, 0x42, 0xde, 0x1b, 0x50, 0xdf, 0x0e, - 0x3d, 0x5f, 0x5a, 0x64, 0x52, 0x46, 0x72, 0x6d, 0x5d, 0xae, 0x21, 0xe3, 0xd5, 0x78, 0x1d, 0x72, - 0x7c, 0xdc, 0x77, 0xa4, 0xb5, 0x44, 0x9f, 0xc6, 0x4f, 0x15, 0x00, 0x62, 0xf7, 0x3b, 0xf4, 0x4c, - 0x12, 0xdc, 0x88, 0xe3, 0x39, 0x99, 0x94, 0xc6, 0x88, 0x1d, 0x9f, 0x30, 0x11, 0x8c, 0x7a, 0x9a, - 0x60, 0x16, 0xab, 0xe9, 0xbf, 0x55, 0xa2, 0x3a, 0xed, 0x4c, 0x64, 0xdf, 0x00, 0x5d, 0x24, 0x23, - 0x82, 0x90, 0x34, 0x27, 0x04, 0x38, 0x68, 0x93, 0x53, 0x13, 0x2b, 0x17, 0xd5, 0x05, 0xca, 0x45, - 0xe6, 0x82, 0xa1, 0x37, 0x38, 0x92, 0xc6, 0xc0, 0xc7, 0xe7, 0xf4, 0x8c, 0x57, 0x50, 0x60, 0x29, - 0x0a, 0xb5, 0xfb, 0x82, 0xb3, 0x5b, 0xb0, 0xe4, 0xb5, 0xdb, 0xc3, 0x48, 0xe1, 0x38, 0x81, 0xa6, - 0xce, 0x66, 0x88, 0x58, 0x80, 0x3f, 0x81, 0x62, 0x87, 0xf6, 0xa9, 0x6f, 0x77, 0x5b, 0x9c, 0x33, - 0xa9, 0xa1, 0xe4, 0xc1, 0xdb, 0x62, 0x85, 0x48, 0x4b, 0x0b, 0x9d, 0xd8, 0x97, 0xf1, 0x9f, 0x69, - 0x28, 0xc4, 0xa7, 0xf1, 0xa7, 0x50, 0x3c, 0x10, 0xa4, 0x48, 0x84, 0xca, 0x8c, 0x5a, 0x37, 0x4e, - 0xec, 0x4e, 0x8a, 0x14, 0x0e, 0xe2, 0xc4, 0x3f, 0x00, 0x08, 0xa9, 0xdf, 0x1b, 0xd3, 0xa3, 0x9c, - 0x28, 0x3e, 0xc7, 0xbe, 0xbb, 0x93, 0x22, 0x5a, 0x38, 0x76, 0xe4, 0x7f, 0x02, 0xdd, 0x67, 0x46, - 0x29, 0x77, 0x8a, 0x1e, 0xd1, 0xe5, 0x64, 0xbe, 0x3d, 0x36, 0xda, 0x9d, 0x14, 0x01, 0x7f, 0x62, - 0xc2, 0x1f, 0x8f, 0x43, 0xb0, 0xd8, 0x9c, 0x99, 0x51, 0x4f, 0xc4, 0x6c, 0x67, 0x12, 0x7d, 0xf9, - 0x27, 0x8b, 0xbe, 0x7c, 0x9f, 0xf1, 0x1b, 0x05, 0x8a, 0xb1, 0xba, 0x63, 0x6f, 0xf3, 0xec, 0xf7, - 0xd6, 0x82, 0x2d, 0x97, 0x93, 0xaa, 0x53, 0x67, 0x48, 0x7a, 0xbe, 0xea, 0xce, 0xe9, 0x4c, 0xbf, - 0x9b, 0xd4, 0x29, 0x2f, 0x76, 0x83, 0xce, 0x5f, 0xa9, 0x4e, 0x7d, 0x17, 0x96, 0x13, 0x32, 0x8a, - 0xee, 0xf0, 0x62, 0x5c, 0x3c, 0x41, 0x54, 0xce, 0x66, 0x26, 0xe5, 0xec, 0xb9, 0xfc, 0x8b, 0xe7, - 0x6e, 0x6e, 0x8f, 0x06, 0xa1, 0xdd, 0x1b, 0xac, 0x67, 0xf9, 0x5d, 0x3a, 0x01, 0x24, 0x4a, 0x93, - 0x5c, 0xa2, 0x34, 0x49, 0x14, 0x34, 0xf9, 0x64, 0x41, 0x73, 0x17, 0xf2, 0x3e, 0x7d, 0x21, 0x32, - 0x05, 0x8d, 0xbb, 0xe9, 0x54, 0x69, 0x48, 0x5f, 0xf0, 0x7b, 0x37, 0xe7, 0x8b, 0x81, 0xf1, 0x3d, - 0x15, 0xf0, 0xae, 0xdd, 0x77, 0x07, 0xc3, 0xae, 0xcd, 0x53, 0xfa, 0x05, 0x05, 0x7f, 0xa2, 0xa2, - 0x4f, 0xcf, 0x68, 0x5e, 0xbc, 0x0d, 0x85, 0x81, 0xef, 0xf6, 0x6c, 0x7f, 0xd4, 0x3a, 0xa2, 0x23, - 0x21, 0xde, 0x0c, 0xd1, 0x25, 0xec, 0x31, 0x1d, 0x05, 0x6f, 0x50, 0xd4, 0x26, 0xe5, 0xb7, 0x34, - 0x2d, 0xbf, 0x64, 0x2a, 0x28, 0xc5, 0x3b, 0x4e, 0x05, 0xd9, 0x74, 0xfb, 0xd0, 0xee, 0xf7, 0x69, - 0x77, 0x52, 0x16, 0x6a, 0x12, 0x32, 0x25, 0xc7, 0xfc, 0x19, 0xe4, 0x98, 0x50, 0x97, 0x96, 0x54, - 0xd7, 0xb4, 0x95, 0xc0, 0x42, 0x2e, 0xf1, 0x1f, 0x2a, 0xac, 0x8a, 0xf6, 0x56, 0xdd, 0x17, 0xc9, - 0xfc, 0x42, 0xfa, 0x49, 0xc8, 0x55, 0x84, 0xbd, 0xd7, 0xc9, 0x15, 0x81, 0x3a, 0x74, 0x9d, 0xa8, - 0x89, 0x37, 0x74, 0x9d, 0x59, 0x6d, 0x9b, 0x93, 0x4a, 0x5e, 0x54, 0x1d, 0xea, 0xe9, 0xea, 0x50, - 0xe3, 0xea, 0x78, 0x07, 0xd2, 0xde, 0x40, 0x2a, 0x22, 0x59, 0x5b, 0xd4, 0x07, 0x5c, 0x0f, 0x69, - 0x6f, 0xc0, 0x72, 0xa2, 0x76, 0xd7, 0x95, 0x27, 0x08, 0x1d, 0xe4, 0x05, 0xe0, 0xdc, 0x4a, 0xf8, - 0x59, 0x1a, 0x34, 0x11, 0x80, 0x17, 0x12, 0x7e, 0xec, 0x2e, 0x17, 0xa2, 0x3f, 0xe3, 0x5d, 0x7e, - 0x42, 0xde, 0xea, 0x8c, 0x36, 0x99, 0x54, 0x53, 0x66, 0xa2, 0xa6, 0xd3, 0x35, 0x90, 0x10, 0x4f, - 0xf6, 0x35, 0xe2, 0xc9, 0x2d, 0x14, 0xc9, 0xa2, 0xde, 0x74, 0x9e, 0x93, 0x29, 0x7a, 0xd3, 0x32, - 0x5a, 0x6a, 0xe3, 0x68, 0x69, 0xbc, 0x02, 0xbd, 0xe9, 0xf6, 0x68, 0x63, 0xd4, 0x6f, 0x33, 0x29, - 0x5e, 0x86, 0xdc, 0x80, 0x52, 0xbf, 0x65, 0x39, 0xb2, 0xfe, 0xc9, 0xb2, 0x4f, 0x8b, 0xb3, 0xd1, - 0x1c, 0xb3, 0x91, 0x16, 0x6c, 0x8c, 0x01, 0x78, 0x03, 0xb4, 0x60, 0xd4, 0x6f, 0xb7, 0xe6, 0xd6, - 0x16, 0x0c, 0x3f, 0xb7, 0x89, 0x7c, 0x20, 0x47, 0xc6, 0x97, 0x00, 0x8f, 0xe9, 0x68, 0xa3, 0x41, - 0x3b, 0xec, 0x60, 0x29, 0x38, 0x65, 0x8e, 0xe0, 0xd2, 0xa7, 0x9b, 0xae, 0xca, 0x93, 0xf5, 0x89, - 0xe9, 0xde, 0xfe, 0x41, 0x06, 0xb4, 0xf1, 0x43, 0x20, 0xd6, 0x21, 0xd7, 0xd8, 0x2f, 0x97, 0xcd, - 0x46, 0x03, 0xa5, 0xf0, 0x1a, 0xa0, 0xfd, 0x9a, 0xf9, 0xd9, 0x9e, 0x59, 0x6e, 0x9a, 0x95, 0x96, - 0x49, 0x48, 0x9d, 0x20, 0x05, 0x63, 0x58, 0x2e, 0xd7, 0x6b, 0x35, 0xb3, 0xdc, 0x6c, 0x6d, 0x95, - 0xac, 0xaa, 0x59, 0x41, 0x69, 0x7c, 0x11, 0x56, 0xf7, 0x4c, 0xb2, 0x6b, 0x35, 0x1a, 0x56, 0xbd, - 0xd6, 0xaa, 0x98, 0x35, 0xcb, 0xac, 0x20, 0x15, 0x5f, 0x81, 0x8b, 0xe5, 0x7a, 0xb5, 0x6a, 0x96, - 0x9b, 0x0c, 0x5c, 0xab, 0x37, 0x5b, 0xe6, 0x67, 0x56, 0xa3, 0xd9, 0x40, 0x19, 0x86, 0xdb, 0xaa, - 0x56, 0xcd, 0xed, 0x52, 0xb5, 0x55, 0x22, 0xdb, 0xfb, 0xbb, 0x66, 0xad, 0x89, 0x96, 0x18, 0x9e, - 0x08, 0x5a, 0xb1, 0x76, 0xcd, 0x1a, 0x43, 0x87, 0x72, 0xf8, 0x12, 0xe0, 0x08, 0x6c, 0xd5, 0x2a, - 0xe6, 0x67, 0xad, 0xe6, 0xe7, 0x7b, 0x26, 0xca, 0xe3, 0x6b, 0x70, 0x39, 0x82, 0xc7, 0xcf, 0x29, - 0xed, 0x9a, 0x48, 0xc3, 0x08, 0x0a, 0xd1, 0x64, 0xb3, 0xbe, 0xf7, 0x18, 0x41, 0x1c, 0x3b, 0xa9, - 0x3f, 0x23, 0x66, 0xb9, 0x4e, 0x2a, 0x48, 0x8f, 0x83, 0x9f, 0x9a, 0xe5, 0x66, 0x9d, 0xb4, 0xac, - 0x0a, 0x2a, 0x30, 0xe2, 0x23, 0x70, 0xc3, 0x2c, 0x91, 0xf2, 0x4e, 0x8b, 0x98, 0x8d, 0xfd, 0x6a, - 0x13, 0x15, 0x99, 0x08, 0xb6, 0xac, 0xaa, 0xc9, 0x39, 0xda, 0xaa, 0xef, 0xd7, 0x2a, 0x68, 0x19, - 0xaf, 0x80, 0xbe, 0x6b, 0x36, 0x4b, 0x91, 0x4c, 0x56, 0xd8, 0xf9, 0xe5, 0x52, 0x79, 0xc7, 0x8c, - 0x20, 0x08, 0xaf, 0xc3, 0x5a, 0xb9, 0x54, 0x63, 0x9b, 0xca, 0xc4, 0x2c, 0x35, 0xcd, 0xd6, 0x56, - 0xbd, 0x5a, 0x31, 0x09, 0x5a, 0x65, 0x0c, 0x4e, 0xcd, 0x58, 0x55, 0x13, 0xe1, 0xd8, 0x8e, 0x8a, - 0x59, 0x35, 0x27, 0x3b, 0x2e, 0xc4, 0x76, 0x44, 0x33, 0x6c, 0xc7, 0x1a, 0x63, 0x66, 0x73, 0xdf, - 0xaa, 0x56, 0xa4, 0xa0, 0x84, 0xd2, 0x2e, 0xe2, 0x55, 0x28, 0x46, 0xcc, 0xd4, 0xaa, 0x56, 0xa3, - 0x89, 0x2e, 0xe1, 0xcb, 0x70, 0x21, 0x02, 0xed, 0x9a, 0x4d, 0x62, 0x95, 0x85, 0x54, 0x2f, 0xb3, - 0xb5, 0xf5, 0xfd, 0x66, 0xab, 0xbe, 0xd5, 0xda, 0x35, 0x77, 0xeb, 0xe4, 0x73, 0xb4, 0x7e, 0xfb, - 0x6b, 0x05, 0xf2, 0x51, 0xd1, 0x8b, 0xf3, 0x90, 0xa9, 0xd5, 0x6b, 0x26, 0x4a, 0xb1, 0xd1, 0x66, - 0xbd, 0x5e, 0x45, 0x0a, 0x1b, 0x59, 0xb5, 0xe6, 0x43, 0x94, 0xc6, 0x1a, 0x2c, 0x59, 0xb5, 0xe6, - 0xfb, 0xf7, 0x91, 0x2a, 0x87, 0x1f, 0x6c, 0xa0, 0x8c, 0x1c, 0xde, 0xff, 0x10, 0x2d, 0xb1, 0xe1, - 0x56, 0xb5, 0x5e, 0x6a, 0x22, 0xc0, 0x00, 0xd9, 0x4a, 0x7d, 0x7f, 0xb3, 0x6a, 0x22, 0x9d, 0x8d, - 0x1b, 0x4d, 0x62, 0xd5, 0xb6, 0xd1, 0x1a, 0xa3, 0x40, 0x6a, 0x62, 0xd3, 0xaa, 0x95, 0xc8, 0xe7, - 0xc8, 0x61, 0xd2, 0x94, 0x20, 0xb1, 0x99, 0xde, 0x2e, 0xc3, 0xca, 0x54, 0x99, 0x86, 0xb3, 0x90, - 0xae, 0x36, 0x51, 0x0a, 0xe7, 0x40, 0xad, 0x36, 0x4d, 0xa4, 0x30, 0x80, 0xf9, 0x04, 0xa5, 0xd9, - 0xef, 0x76, 0x13, 0xa9, 0x6c, 0x62, 0xbb, 0x69, 0xa2, 0x0c, 0x03, 0xd4, 0x4c, 0xb4, 0x74, 0xfb, - 0x21, 0x2c, 0xf1, 0xd4, 0x9f, 0x19, 0xbe, 0x55, 0x7b, 0x5a, 0xaa, 0x5a, 0x15, 0xc1, 0xd7, 0xee, - 0x7e, 0xa3, 0x89, 0x14, 0x4e, 0xd5, 0x4e, 0x7d, 0xbf, 0xca, 0x8c, 0xbc, 0x00, 0x79, 0x06, 0x65, - 0x5a, 0x47, 0xea, 0xed, 0x9b, 0x90, 0x15, 0xc1, 0x9b, 0xad, 0xb1, 0x6a, 0x0d, 0x93, 0xb0, 0x93, - 0x19, 0x47, 0x5c, 0x1f, 0x48, 0xb9, 0xfd, 0x2b, 0x15, 0x72, 0xf2, 0xa2, 0x65, 0x18, 0x8f, 0xca, - 0x3d, 0x07, 0xa5, 0x98, 0x82, 0x8e, 0xca, 0x3e, 0xb5, 0x43, 0x3a, 0x69, 0x42, 0x21, 0x07, 0x5f, - 0x80, 0x95, 0xa3, 0x8a, 0xef, 0x0d, 0x62, 0x40, 0xca, 0xec, 0xec, 0x68, 0xc7, 0x0e, 0x62, 0xb0, - 0xe7, 0xcc, 0x71, 0x8e, 0xaa, 0x6e, 0x10, 0x4e, 0x80, 0x01, 0xea, 0x30, 0x73, 0x38, 0xda, 0xa6, - 0x61, 0xb2, 0xaf, 0x85, 0x0e, 0x99, 0x92, 0x93, 0xf0, 0x46, 0x68, 0x87, 0x01, 0x72, 0x39, 0x6a, - 0xde, 0xfc, 0x8c, 0xda, 0xdf, 0xe8, 0x2b, 0x7c, 0x11, 0x90, 0x24, 0x6d, 0xfc, 0x48, 0x8a, 0x7e, - 0xae, 0xe0, 0x0b, 0xb0, 0xcc, 0x49, 0x9b, 0x00, 0x7f, 0xc1, 0xa2, 0x40, 0x91, 0x91, 0x36, 0x81, - 0x7d, 0xa3, 0xe0, 0x35, 0x58, 0xe1, 0xa4, 0x8d, 0x81, 0x01, 0xfa, 0xa5, 0x82, 0x57, 0xa1, 0x20, - 0xb1, 0xf2, 0x2e, 0x2a, 0xfa, 0x61, 0x1a, 0xaf, 0x00, 0x70, 0x8c, 0x02, 0xf0, 0xa3, 0xb4, 0x38, - 0x82, 0x06, 0x6d, 0xdf, 0x3d, 0x90, 0xab, 0x7e, 0xcc, 0xe4, 0x9d, 0x3b, 0x12, 0xa9, 0x03, 0xfa, - 0x6f, 0x95, 0x2f, 0x19, 0xb7, 0xd6, 0x36, 0x47, 0x56, 0x05, 0x7d, 0xad, 0xe2, 0x4b, 0xb0, 0x7a, - 0x24, 0xb2, 0x8a, 0x18, 0xfc, 0x7f, 0x54, 0xbe, 0x55, 0x5c, 0x78, 0xe8, 0x7f, 0x55, 0xce, 0x17, - 0xa3, 0xcb, 0xaa, 0x8c, 0x1f, 0x55, 0xd0, 0xff, 0xa9, 0x82, 0x5c, 0xcf, 0x76, 0x62, 0xe2, 0xfd, - 0xbd, 0x8a, 0x75, 0xc8, 0x1e, 0xf1, 0x76, 0x28, 0xfa, 0x83, 0x8a, 0x8b, 0x90, 0x3f, 0x92, 0x9d, - 0x4d, 0xf4, 0x47, 0xf5, 0xf6, 0x0d, 0xc8, 0x47, 0xe1, 0x99, 0x69, 0x94, 0x98, 0x25, 0x66, 0x2d, - 0x1a, 0x2c, 0x3d, 0x23, 0x16, 0x53, 0xf9, 0xc6, 0x77, 0x45, 0x28, 0xee, 0xf2, 0x60, 0xde, 0xa0, - 0xfe, 0x4b, 0xb7, 0x4d, 0xf1, 0x3f, 0x03, 0x9a, 0xd6, 0x36, 0x9e, 0xf9, 0xea, 0x7d, 0x75, 0x56, - 0xd3, 0xd1, 0x48, 0xe1, 0x2d, 0x28, 0x26, 0x4c, 0x00, 0x5f, 0x9b, 0x6a, 0x14, 0xc4, 0xaf, 0xec, - 0xab, 0x97, 0x4e, 0x94, 0x94, 0xa2, 0xad, 0x9e, 0xc2, 0x16, 0xe0, 0x48, 0xc2, 0x67, 0x45, 0x36, - 0x93, 0x4e, 0x23, 0x85, 0x9f, 0x30, 0xcf, 0x1b, 0xf6, 0xc3, 0xb3, 0xe2, 0xb9, 0x31, 0x67, 0x72, - 0xdc, 0x7f, 0x4f, 0xe1, 0x7f, 0x81, 0x95, 0xc6, 0x21, 0xfb, 0x1c, 0x1b, 0xf5, 0x94, 0x94, 0x64, - 0x7f, 0x7e, 0x2e, 0xae, 0xe8, 0xef, 0x21, 0x46, 0x0a, 0xef, 0x01, 0x4e, 0xe2, 0xe2, 0x3d, 0xde, - 0x53, 0x29, 0x9c, 0x37, 0xc9, 0x7b, 0xba, 0x29, 0x5c, 0x81, 0xe5, 0xa4, 0x6f, 0x9e, 0x8e, 0x6d, - 0x8e, 0x26, 0x3f, 0x06, 0x3d, 0xe6, 0x07, 0x38, 0x59, 0x84, 0x4f, 0x5e, 0x18, 0xe6, 0x6d, 0x2f, - 0x43, 0x31, 0xe1, 0x22, 0xf3, 0x11, 0xcc, 0x9b, 0x30, 0x52, 0xf8, 0x11, 0x68, 0x63, 0xc7, 0x5b, - 0x98, 0x02, 0x13, 0x56, 0xa6, 0xc2, 0xc3, 0x94, 0x1c, 0x92, 0x7f, 0xd4, 0x98, 0x8f, 0xa6, 0x10, - 0x8f, 0x1c, 0xa7, 0xe3, 0x98, 0x6f, 0xd0, 0x8f, 0x61, 0x99, 0xa9, 0x79, 0x12, 0x6c, 0x4e, 0x57, - 0xca, 0xd5, 0xd9, 0xa7, 0x48, 0x9b, 0x61, 0xc2, 0x8d, 0x87, 0xb8, 0x37, 0x62, 0xec, 0x23, 0xc8, - 0x8a, 0x78, 0x85, 0xd7, 0xa7, 0x24, 0x3b, 0x7e, 0xde, 0x9f, 0xe2, 0x67, 0xfc, 0x5f, 0x0e, 0x2e, - 0x96, 0x62, 0x22, 0xbe, 0x4d, 0x91, 0x90, 0xec, 0xfc, 0x5f, 0x9d, 0xfd, 0x86, 0x69, 0xa4, 0xf0, - 0x0e, 0x14, 0xe2, 0x2f, 0x10, 0xf8, 0x6f, 0xa6, 0x5a, 0x1f, 0x53, 0x8f, 0x13, 0xa7, 0x10, 0xf4, - 0x09, 0x64, 0x45, 0x0c, 0xc5, 0x73, 0x9f, 0x90, 0xaf, 0x26, 0x67, 0x62, 0x6f, 0xb4, 0xdc, 0x0f, - 0x57, 0xa6, 0x9e, 0xb2, 0xf1, 0xdb, 0x33, 0x10, 0x25, 0x1f, 0xba, 0x4f, 0xc5, 0xf8, 0x00, 0xd4, - 0x72, 0xcf, 0x99, 0x13, 0x19, 0xa6, 0x88, 0x8c, 0x3d, 0x56, 0xa6, 0x70, 0x09, 0x60, 0xf2, 0x92, - 0x84, 0x93, 0x65, 0xcc, 0xd4, 0x13, 0xd3, 0x3c, 0xe5, 0x6e, 0xc3, 0xea, 0x9e, 0x4f, 0xbb, 0x89, - 0xfb, 0xe2, 0x8d, 0xc2, 0xc0, 0x03, 0x58, 0xe2, 0xf7, 0xcb, 0x94, 0xfb, 0x4d, 0x9e, 0xe0, 0xe6, - 0x6d, 0x7c, 0xc4, 0x5f, 0x29, 0xd9, 0x5d, 0x84, 0xaf, 0x9c, 0x6c, 0x16, 0xcb, 0xb7, 0xb7, 0x79, - 0x9b, 0x37, 0x21, 0x2f, 0xf5, 0xb6, 0x89, 0xaf, 0xce, 0x53, 0xe7, 0xde, 0xe6, 0x69, 0xe2, 0xdf, - 0xdc, 0xf8, 0xe2, 0x5e, 0xc7, 0x0d, 0x0f, 0x87, 0x07, 0x77, 0xda, 0x5e, 0xef, 0x6e, 0xfb, 0xdf, - 0x83, 0x7b, 0xf7, 0x1e, 0xdc, 0x0d, 0x86, 0x2f, 0xbb, 0x6e, 0xef, 0xee, 0x9c, 0xbf, 0x2a, 0x1e, - 0x64, 0xf9, 0x7f, 0x14, 0x3f, 0xf8, 0x53, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8f, 0x0a, 0x17, 0x37, - 0xcc, 0x28, 0x00, 0x00, +var fileDescriptor_a25be62442992adf = []byte{ + // 3277 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x3a, 0xcd, 0x73, 0x1b, 0x49, + 0xf5, 0x1a, 0x8d, 0x2c, 0x69, 0x9e, 0x24, 0xbb, 0xdd, 0x71, 0x12, 0x27, 0xd9, 0xfc, 0x92, 0x9d, + 0xfd, 0x7d, 0x64, 0xf3, 0xab, 0xca, 0x87, 0x77, 0x7f, 0x49, 0x7e, 0x64, 0x77, 0x59, 0x59, 0x1a, + 0xdb, 0x43, 0x64, 0xc9, 0x69, 0xc9, 0xc9, 0x7e, 0x14, 0x25, 0xc6, 0x9a, 0x8e, 0x3d, 0x6b, 0x69, + 0x46, 0x99, 0x19, 0xc5, 0x11, 0x47, 0xee, 0x50, 0x2c, 0x70, 0xe1, 0x42, 0x15, 0x9c, 0x81, 0xa2, + 0x8a, 0xff, 0x80, 0x13, 0x2c, 0x07, 0x8e, 0x7b, 0xd8, 0x2a, 0x8e, 0x14, 0x37, 0x2e, 0xc0, 0x99, + 0xea, 0x8f, 0x91, 0x66, 0x64, 0xc9, 0xb1, 0x62, 0xe0, 0xa4, 0x9e, 0xd7, 0xdd, 0xaf, 0xdf, 0x77, + 0xbf, 0xf7, 0x5a, 0xf0, 0x9f, 0x8e, 0x1b, 0x52, 0xdf, 0xb5, 0xba, 0xb7, 0xfb, 0xbe, 0x17, 0x7a, + 0xb7, 0x7b, 0x34, 0x08, 0xac, 0x7d, 0x1a, 0xfd, 0xde, 0xe2, 0x50, 0x5c, 0xe8, 0x39, 0xdd, 0x17, + 0x83, 0xe0, 0xd6, 0xbe, 0xdf, 0xef, 0xe8, 0x4f, 0x21, 0xdb, 0x0c, 0xad, 0x70, 0x10, 0xe0, 0xff, + 0x03, 0xa0, 0xbe, 0xef, 0xf9, 0xed, 0x8e, 0x67, 0xd3, 0x55, 0xe5, 0xba, 0x72, 0x63, 0x71, 0xed, + 0xc2, 0xad, 0xd8, 0xda, 0x5b, 0x06, 0x9b, 0xae, 0x78, 0x36, 0x25, 0x1a, 0x8d, 0x86, 0xf8, 0x02, + 0x64, 0x7d, 0x6a, 0x05, 0x9e, 0xbb, 0x9a, 0xbe, 0xae, 0xdc, 0xd0, 0x88, 0xfc, 0xd2, 0xef, 0x41, + 0xf1, 0x11, 0x1d, 0x3e, 0xb1, 0xba, 0x03, 0xba, 0x63, 0x39, 0x3e, 0x46, 0xa0, 0x1e, 0xd2, 0x21, + 0xc7, 0xab, 0x11, 0x36, 0xc4, 0x2b, 0xb0, 0xf0, 0x82, 0x4d, 0xcb, 0x8d, 0xe2, 0x43, 0xff, 0x7f, + 0x58, 0xac, 0x78, 0xdd, 0x2e, 0xed, 0x84, 0x8e, 0xe7, 0xd6, 0xad, 0x1e, 0xc5, 0xff, 0x03, 0x4b, + 0x9d, 0x11, 0xa4, 0xed, 0x5a, 0x3d, 0x2a, 0xb1, 0x2c, 0x76, 0x12, 0x0b, 0xf5, 0x2e, 0xe0, 0xe4, + 0xd6, 0x9a, 0x13, 0x84, 0xf8, 0x7f, 0x21, 0x1b, 0x70, 0x0e, 0xf9, 0xae, 0xc2, 0xda, 0xb9, 0x04, + 0x4f, 0x82, 0x79, 0x22, 0x97, 0xe0, 0xb7, 0x01, 0x4d, 0x9c, 0x15, 0xac, 0xa6, 0xaf, 0xab, 0x37, + 0x34, 0xb2, 0x94, 0x3c, 0x2c, 0xd0, 0x9b, 0xa0, 0x6d, 0x38, 0xb4, 0x6b, 0xcf, 0x45, 0x23, 0xbe, + 0x0a, 0xf0, 0x8c, 0xed, 0x12, 0x6b, 0x04, 0xe7, 0xda, 0xb3, 0x08, 0x8f, 0xfe, 0x85, 0x02, 0xb9, + 0x6d, 0xab, 0xdf, 0x77, 0xdc, 0xfd, 0xf9, 0x08, 0x9f, 0x42, 0x40, 0x7a, 0x2a, 0x01, 0x0c, 0x6b, + 0xe7, 0x80, 0xf6, 0xac, 0x55, 0x75, 0x1a, 0x56, 0x3e, 0x45, 0xe4, 0x12, 0xfc, 0x1e, 0x14, 0xe9, + 0xcb, 0xd0, 0xb7, 0xda, 0x7d, 0xcb, 0xb7, 0x7a, 0xc1, 0x6a, 0xe6, 0xba, 0x7a, 0xa3, 0xb0, 0x76, + 0x29, 0xb1, 0x25, 0xae, 0x65, 0x52, 0xe0, 0xcb, 0x77, 0xf8, 0x6a, 0x3d, 0x80, 0x82, 0xe4, 0x65, + 0x7e, 0x45, 0xdc, 0x87, 0x62, 0x4f, 0xec, 0x6d, 0x77, 0x9d, 0x20, 0xe4, 0x4a, 0x28, 0xac, 0xad, + 0x24, 0xb6, 0x48, 0xe4, 0xa4, 0xd0, 0x1b, 0x9f, 0xa2, 0x3f, 0x82, 0xc5, 0x1d, 0xcb, 0x0f, 0x1d, + 0xc6, 0x30, 0xa7, 0xe3, 0xf4, 0xba, 0x41, 0xa0, 0x86, 0xd6, 0xbe, 0x94, 0x1b, 0x1b, 0xea, 0x5d, + 0x28, 0x8d, 0x90, 0xcd, 0xcf, 0xc3, 0x2d, 0x38, 0xd7, 0x8f, 0x76, 0xb7, 0x43, 0x6b, 0xbf, 0x6d, + 0xf9, 0xbe, 0x35, 0x94, 0xf6, 0xb4, 0x3c, 0x9a, 0x6a, 0x59, 0xfb, 0x65, 0x36, 0xa1, 0x3f, 0x86, + 0xa5, 0x27, 0xb4, 0x13, 0x7a, 0x3e, 0xf1, 0x8e, 0x08, 0xed, 0x78, 0xbe, 0xcd, 0xcd, 0xa5, 0xeb, + 0x59, 0x61, 0xdb, 0xb6, 0x42, 0x6b, 0x55, 0xb9, 0xae, 0xde, 0x48, 0x13, 0x8d, 0x43, 0xaa, 0x56, + 0x68, 0xe1, 0x6b, 0x50, 0xd8, 0x73, 0x5c, 0xcb, 0x1f, 0x8a, 0x79, 0x46, 0x79, 0x91, 0x80, 0x00, + 0xb1, 0x05, 0xfa, 0xb7, 0x40, 0x33, 0xdc, 0xd0, 0x09, 0x87, 0xa6, 0x1d, 0xcc, 0x47, 0xfc, 0x7f, + 0xc3, 0x12, 0xe5, 0x3b, 0xdb, 0x8e, 0x1d, 0x23, 0x5c, 0x25, 0x25, 0x2a, 0x11, 0x0a, 0xa2, 0x37, + 0xa0, 0x28, 0x89, 0x16, 0x14, 0xdf, 0x83, 0x9c, 0xcf, 0x47, 0x01, 0x27, 0xb7, 0xb0, 0xf6, 0x46, + 0xe2, 0x94, 0x09, 0x06, 0x49, 0xb4, 0x58, 0xff, 0x14, 0x0a, 0x62, 0x4e, 0x28, 0x0d, 0x43, 0xe6, + 0x33, 0x16, 0x54, 0x84, 0xa6, 0xf8, 0x18, 0x3f, 0x00, 0xf0, 0xbd, 0xa3, 0xb6, 0xd8, 0xc1, 0x99, + 0x9d, 0xb4, 0xc5, 0x38, 0x25, 0x44, 0xf3, 0xa3, 0x53, 0xf4, 0x7d, 0xe9, 0xab, 0xdb, 0x34, 0xb4, + 0x26, 0x5c, 0x50, 0x99, 0x70, 0x41, 0xfc, 0x36, 0x64, 0xc2, 0x61, 0x5f, 0xb8, 0xcf, 0xe2, 0xda, + 0xf9, 0x04, 0x7e, 0x26, 0xd3, 0xd6, 0xb0, 0x4f, 0x09, 0x5f, 0xc2, 0x0c, 0xc6, 0x76, 0x7a, 0xdc, + 0x91, 0x54, 0xc2, 0x86, 0x7a, 0x19, 0xb2, 0xc2, 0x85, 0xf0, 0x7d, 0x28, 0x88, 0x53, 0x7a, 0x34, + 0xb4, 0x22, 0x59, 0x24, 0xe3, 0xe9, 0x88, 0x24, 0x22, 0x08, 0x62, 0xc3, 0x40, 0xbf, 0x0a, 0x39, + 0xe2, 0x1d, 0x71, 0xf5, 0x62, 0xc8, 0xec, 0x75, 0xbd, 0x3d, 0x4e, 0x63, 0x91, 0xf0, 0xb1, 0xfe, + 0xd3, 0x34, 0x14, 0x4c, 0x37, 0xa0, 0x7e, 0x38, 0xa7, 0x75, 0x8f, 0x1d, 0x3f, 0xfd, 0x6a, 0xc7, + 0xbf, 0x0b, 0x4c, 0x7a, 0x81, 0x30, 0x2b, 0x75, 0x8a, 0xef, 0x49, 0x12, 0x49, 0x9e, 0x2d, 0xe3, + 0xc4, 0x4e, 0x31, 0x98, 0xcc, 0x14, 0x83, 0xc1, 0x6f, 0x41, 0x29, 0xe1, 0x15, 0xab, 0x0b, 0x9c, + 0xdc, 0x62, 0xdc, 0x1f, 0x8e, 0x05, 0x9e, 0xec, 0x5c, 0x81, 0xe7, 0xcf, 0x0a, 0x14, 0x9a, 0xd4, + 0xf2, 0x3b, 0x07, 0x73, 0xca, 0xe8, 0x21, 0x14, 0x5f, 0x70, 0x13, 0x12, 0xe7, 0xca, 0xa8, 0xb3, + 0x3a, 0xc5, 0xc6, 0x38, 0x62, 0x52, 0x78, 0x11, 0x33, 0x59, 0x66, 0x0d, 0x41, 0x97, 0x5b, 0x83, + 0x46, 0xd8, 0xf0, 0x38, 0xab, 0x19, 0xee, 0xfa, 0x27, 0xb3, 0xba, 0x30, 0x17, 0xab, 0x47, 0xb0, + 0x22, 0x38, 0x35, 0xdd, 0x26, 0xdd, 0xef, 0x51, 0x57, 0x9a, 0x85, 0x0e, 0xa5, 0x67, 0x4e, 0x97, + 0x8e, 0x75, 0xa1, 0xf0, 0xa3, 0x0b, 0x0c, 0x18, 0x69, 0xe2, 0x21, 0x14, 0x03, 0xbe, 0x77, 0xc4, + 0xad, 0x72, 0x8c, 0xdb, 0x98, 0x18, 0x49, 0x21, 0x18, 0x7f, 0xe8, 0x3f, 0x56, 0x20, 0xcf, 0x43, + 0x8b, 0x43, 0xe7, 0x8c, 0x2c, 0x08, 0x54, 0xc7, 0x0e, 0x64, 0x34, 0x61, 0x43, 0x7c, 0x05, 0xb4, + 0x17, 0x56, 0xd7, 0xb1, 0xdb, 0xbe, 0x77, 0xc4, 0xad, 0x2d, 0x4f, 0xf2, 0x1c, 0x40, 0xbc, 0xa3, + 0xa4, 0x29, 0x66, 0x4e, 0x63, 0x8a, 0xfa, 0xaf, 0xd2, 0x50, 0x78, 0x3c, 0xa0, 0xfe, 0x90, 0xd0, + 0x60, 0xd0, 0x9d, 0x33, 0x6a, 0xdf, 0x85, 0x3c, 0x95, 0x7c, 0x49, 0x89, 0x24, 0x63, 0x40, 0xc4, + 0x34, 0x19, 0x2d, 0xc3, 0x17, 0x21, 0xc7, 0x02, 0x93, 0x3b, 0x88, 0x62, 0x41, 0xd6, 0xf7, 0x8e, + 0xea, 0x83, 0x1e, 0x4b, 0x8e, 0x82, 0x8e, 0xe7, 0x53, 0x71, 0x73, 0xa6, 0x89, 0xfc, 0xc2, 0x6f, + 0x80, 0x66, 0x3b, 0x41, 0x68, 0xb9, 0x1d, 0x2a, 0x14, 0x9e, 0x26, 0x63, 0xc0, 0xd9, 0x8c, 0x1f, + 0x5f, 0x82, 0xfc, 0x73, 0xc6, 0x7b, 0xdb, 0xb1, 0x57, 0x73, 0xd7, 0x95, 0x1b, 0x19, 0x92, 0xe3, + 0xdf, 0xa6, 0xcd, 0xa6, 0xfa, 0xbe, 0xf7, 0x92, 0x4f, 0xe5, 0x39, 0xa1, 0x39, 0xfe, 0x6d, 0xda, + 0xfa, 0x37, 0xa1, 0xd0, 0x0c, 0x7d, 0x76, 0x9b, 0xd2, 0x7e, 0x77, 0x38, 0x9f, 0xc4, 0xde, 0x84, + 0x62, 0xc0, 0xf7, 0xb6, 0x7d, 0xb6, 0x59, 0x5e, 0xa0, 0x85, 0x60, 0x8c, 0x4f, 0x7f, 0x0a, 0xda, + 0xba, 0xe7, 0x75, 0x5f, 0x03, 0xf9, 0x55, 0x80, 0x3d, 0xcf, 0xeb, 0xc6, 0x50, 0xe7, 0x89, 0xb6, + 0x17, 0xe1, 0xd2, 0x83, 0x78, 0xce, 0x47, 0xbc, 0xa3, 0x8a, 0x37, 0x70, 0xe7, 0x54, 0xf8, 0x1d, + 0x58, 0x89, 0x45, 0x07, 0xa6, 0xc8, 0x0e, 0x43, 0xc2, 0xcf, 0x52, 0x09, 0xee, 0x1c, 0x43, 0xaf, + 0x5f, 0x81, 0x5c, 0xc5, 0xeb, 0xf5, 0x2c, 0xd7, 0x66, 0xc6, 0xdc, 0xe9, 0xd9, 0x51, 0x5a, 0xdb, + 0xe9, 0xd9, 0xfa, 0x1f, 0x15, 0x00, 0xd3, 0xb5, 0xe9, 0x4b, 0xe1, 0x88, 0xff, 0x9a, 0x2c, 0x2e, + 0x79, 0x87, 0xa9, 0x93, 0x77, 0xd8, 0x55, 0x00, 0x87, 0x91, 0x20, 0xa6, 0x33, 0x62, 0x9a, 0x43, + 0xf8, 0xf4, 0xd9, 0x42, 0xce, 0x87, 0x00, 0x1b, 0xdd, 0x41, 0x20, 0x63, 0xeb, 0x1a, 0x9c, 0x9f, + 0x20, 0x39, 0x11, 0x70, 0xce, 0x25, 0x09, 0x17, 0x39, 0xc3, 0x2e, 0x14, 0x2b, 0x5e, 0xaf, 0x6f, + 0x75, 0xe6, 0xbd, 0xc3, 0xde, 0x00, 0x2d, 0x3c, 0xf0, 0x69, 0x70, 0xe0, 0x75, 0x45, 0x02, 0xa0, + 0x90, 0x31, 0x40, 0xdf, 0x85, 0xa5, 0x2a, 0xed, 0xd2, 0x90, 0xae, 0x0f, 0xcd, 0xea, 0x9c, 0x98, + 0x2f, 0x41, 0x7e, 0x22, 0xcf, 0xc9, 0x39, 0x32, 0xc3, 0xf9, 0x24, 0x5e, 0x91, 0x98, 0xee, 0x33, + 0x6f, 0x3e, 0x9d, 0x5e, 0x01, 0x8d, 0x65, 0x2f, 0x6d, 0xc7, 0x7d, 0xe6, 0x49, 0x6d, 0xe6, 0x19, + 0x80, 0x61, 0xd2, 0x3f, 0x85, 0xe5, 0x4d, 0x1a, 0xca, 0x14, 0xad, 0x1a, 0xcc, 0x49, 0xf4, 0x55, + 0x80, 0x40, 0x04, 0x7d, 0xe6, 0xd1, 0xc2, 0x5e, 0x35, 0x09, 0x31, 0x6d, 0x7d, 0x00, 0x8b, 0x51, + 0xf2, 0x27, 0xae, 0xe0, 0x7f, 0x86, 0x38, 0x58, 0xce, 0x39, 0x36, 0xbd, 0x80, 0x87, 0x6b, 0x4d, + 0x26, 0x30, 0xa2, 0x30, 0xba, 0x03, 0x48, 0xdc, 0x91, 0x3c, 0xbf, 0x11, 0x2c, 0xf1, 0x80, 0xd7, + 0xa3, 0x6e, 0xe0, 0xc8, 0x9c, 0x4e, 0x25, 0x63, 0x80, 0xfe, 0x3d, 0x45, 0xe6, 0x67, 0x2c, 0xb7, + 0xc2, 0xef, 0x82, 0xc6, 0x62, 0x7d, 0x9b, 0x67, 0x61, 0xca, 0x09, 0x59, 0xd8, 0x56, 0x8a, 0xe4, + 0x6d, 0x39, 0xc6, 0xeb, 0xc7, 0xae, 0x6e, 0xa6, 0x99, 0xab, 0x53, 0xae, 0xee, 0x31, 0x59, 0x5b, + 0xa9, 0xc4, 0x0d, 0xbe, 0x9e, 0x93, 0x15, 0xa9, 0xfe, 0xa5, 0x02, 0x10, 0xa3, 0x7e, 0x11, 0xd2, + 0x8e, 0xf0, 0xf1, 0x0c, 0x49, 0x3b, 0x36, 0xcb, 0xcb, 0x62, 0xbe, 0xc9, 0xc7, 0xa3, 0xb4, 0x51, + 0x7d, 0x75, 0xda, 0xf8, 0x1e, 0x14, 0x85, 0x77, 0x9e, 0xba, 0xaa, 0x72, 0x46, 0xf1, 0x24, 0x38, + 0xa3, 0xf3, 0x6e, 0xc2, 0x72, 0x4c, 0x0a, 0x32, 0x67, 0x5f, 0x8b, 0x2a, 0xf1, 0xd3, 0x64, 0xec, + 0x52, 0x44, 0x5f, 0x29, 0xa0, 0xb5, 0xa8, 0xdf, 0xe3, 0xf7, 0xec, 0xab, 0x72, 0xea, 0x2b, 0xa0, + 0x39, 0x6e, 0xd8, 0x8e, 0xca, 0x7d, 0x66, 0x4f, 0x79, 0xc7, 0x0d, 0x39, 0x8d, 0xec, 0xfa, 0xb0, + 0xbd, 0xc1, 0x5e, 0x97, 0xca, 0x79, 0x66, 0x51, 0x0a, 0x29, 0x08, 0x98, 0x58, 0x22, 0x12, 0x84, + 0x01, 0xe5, 0x57, 0x6c, 0x86, 0x9b, 0x4f, 0x9e, 0x03, 0xd8, 0x25, 0xbb, 0x02, 0x0b, 0x7b, 0x9e, + 0x17, 0x84, 0x3c, 0x91, 0x4c, 0x13, 0xf1, 0x71, 0xc6, 0x0c, 0xd2, 0x82, 0x02, 0x8f, 0x50, 0x3e, + 0x35, 0x5e, 0xf6, 0x7d, 0xfc, 0x00, 0xf2, 0x5e, 0x9f, 0xfa, 0x56, 0xe8, 0xf9, 0xd2, 0x22, 0x93, + 0x32, 0x92, 0x6b, 0x1b, 0x72, 0x0d, 0x19, 0xad, 0xc6, 0xab, 0x90, 0xe3, 0x63, 0xd7, 0x96, 0xd6, + 0x12, 0x7d, 0xea, 0xbf, 0x56, 0x00, 0x88, 0xe5, 0xee, 0xd3, 0x53, 0x49, 0x70, 0x2d, 0x8e, 0xe7, + 0x78, 0x52, 0x1a, 0x23, 0x76, 0x74, 0xc2, 0x58, 0x30, 0xea, 0x49, 0x82, 0x99, 0xaf, 0xa6, 0xff, + 0x52, 0x89, 0xea, 0xb4, 0x53, 0x91, 0x7d, 0x0d, 0x0a, 0x22, 0x19, 0x11, 0x84, 0xa4, 0x39, 0x21, + 0xc0, 0x41, 0xeb, 0x9c, 0x9a, 0x58, 0xb9, 0xa8, 0xce, 0x51, 0x2e, 0x32, 0x17, 0x0c, 0xbd, 0xfe, + 0xa1, 0x34, 0x06, 0x3e, 0x3e, 0xa3, 0x67, 0xbc, 0x84, 0x22, 0x4b, 0x51, 0xa8, 0xe5, 0x0a, 0xce, + 0x6e, 0xc0, 0x82, 0xd7, 0xe9, 0x0c, 0x22, 0x85, 0xe3, 0x04, 0x9a, 0x06, 0x9b, 0x21, 0x62, 0x01, + 0xfe, 0x00, 0x4a, 0xfb, 0xd4, 0xa5, 0xbe, 0xd5, 0x6d, 0x73, 0xce, 0xa4, 0x86, 0x92, 0x07, 0x6f, + 0x8a, 0x15, 0x22, 0x2d, 0x2d, 0xee, 0xc7, 0xbe, 0xf4, 0xef, 0xa6, 0xa1, 0x18, 0x9f, 0xc6, 0x1f, + 0x42, 0x69, 0x4f, 0x90, 0x22, 0x11, 0x2a, 0x53, 0x6a, 0xdd, 0x38, 0xb1, 0x5b, 0x29, 0x52, 0xdc, + 0x8b, 0x13, 0x7f, 0x1f, 0x20, 0xa4, 0x7e, 0x6f, 0x44, 0x8f, 0x72, 0xac, 0xf8, 0x1c, 0xf9, 0xee, + 0x56, 0x8a, 0x68, 0xe1, 0xc8, 0x91, 0xbf, 0x06, 0x05, 0x9f, 0x19, 0xa5, 0xdc, 0x29, 0x7a, 0x44, + 0x17, 0x93, 0xf9, 0xf6, 0xc8, 0x68, 0xb7, 0x52, 0x04, 0xfc, 0xb1, 0x09, 0xbf, 0x3f, 0x0a, 0xc1, + 0x62, 0x73, 0x66, 0x4a, 0x3d, 0x11, 0xb3, 0x9d, 0x71, 0xf4, 0xe5, 0x9f, 0x2c, 0xfa, 0xf2, 0x7d, + 0xfa, 0x9f, 0x14, 0x28, 0xc5, 0xea, 0x8e, 0x9d, 0xf5, 0xd3, 0xdf, 0x5b, 0x73, 0xb6, 0x5c, 0x8e, + 0xab, 0x4e, 0x9d, 0x22, 0xe9, 0xd9, 0xaa, 0x3b, 0xa3, 0x33, 0xfd, 0x65, 0x5c, 0xa7, 0x3c, 0xdf, + 0x0e, 0xf6, 0xff, 0x4d, 0x75, 0xea, 0x7f, 0xc1, 0x62, 0x42, 0x46, 0xd1, 0x1d, 0x5e, 0x8a, 0x8b, + 0x27, 0x88, 0xca, 0xd9, 0xcc, 0xb8, 0x9c, 0x3d, 0x93, 0x7f, 0xf1, 0xdc, 0xcd, 0xe9, 0xd1, 0x20, + 0xb4, 0x7a, 0xfd, 0xd5, 0x2c, 0xbf, 0x4b, 0xc7, 0x80, 0x44, 0x69, 0x92, 0x4b, 0x94, 0x26, 0x89, + 0x82, 0x26, 0x9f, 0x2c, 0x68, 0x6e, 0x43, 0xde, 0xa7, 0xcf, 0x45, 0xa6, 0xa0, 0x71, 0x37, 0x9d, + 0x28, 0x0d, 0xe9, 0x73, 0x7e, 0xef, 0xe6, 0x7c, 0x31, 0xd0, 0x7f, 0xa2, 0x02, 0xde, 0xb6, 0x5c, + 0xa7, 0x3f, 0xe8, 0x5a, 0x3c, 0xa5, 0x9f, 0x53, 0xf0, 0xc7, 0x2a, 0xfa, 0xf4, 0x94, 0xe6, 0xc5, + 0x9b, 0x50, 0xec, 0xfb, 0x4e, 0xcf, 0xf2, 0x87, 0xed, 0x43, 0x3a, 0x14, 0xe2, 0xcd, 0x90, 0x82, + 0x84, 0x3d, 0xa2, 0xc3, 0xe0, 0x35, 0x8a, 0xda, 0xa4, 0xfc, 0x16, 0x26, 0xe5, 0x97, 0x4c, 0x05, + 0xa5, 0x78, 0x47, 0xa9, 0x20, 0x9b, 0xee, 0x1c, 0x58, 0xae, 0x4b, 0xbb, 0xe3, 0xb2, 0x50, 0x93, + 0x90, 0x09, 0x39, 0xe6, 0x4f, 0x21, 0xc7, 0x84, 0xba, 0xb4, 0xa4, 0xba, 0x26, 0xad, 0x04, 0xe6, + 0x72, 0x89, 0xef, 0xa8, 0xb0, 0x2c, 0xda, 0x5b, 0x0d, 0x5f, 0x24, 0xf3, 0x73, 0xe9, 0x27, 0x21, + 0x57, 0x11, 0xf6, 0x5e, 0x25, 0x57, 0x04, 0xea, 0xc0, 0xb1, 0xa3, 0x26, 0xde, 0xc0, 0xb1, 0xa7, + 0xb5, 0x6d, 0x8e, 0x2b, 0x79, 0x5e, 0x75, 0xa8, 0x27, 0xab, 0x43, 0x8d, 0xab, 0xe3, 0x2d, 0x48, + 0x7b, 0x7d, 0xa9, 0x88, 0x64, 0x6d, 0xd1, 0xe8, 0x73, 0x3d, 0xa4, 0xbd, 0x3e, 0xcb, 0x89, 0x3a, + 0x5d, 0x47, 0x9e, 0x20, 0x74, 0x90, 0x17, 0x80, 0x33, 0x2b, 0xe1, 0x37, 0x69, 0xd0, 0x44, 0x00, + 0x9e, 0x4b, 0xf8, 0xb1, 0xbb, 0x5c, 0x88, 0xfe, 0x94, 0x77, 0xf9, 0x31, 0x79, 0xab, 0x53, 0xda, + 0x64, 0x52, 0x4d, 0x99, 0xb1, 0x9a, 0x4e, 0xd6, 0x40, 0x42, 0x3c, 0xd9, 0x57, 0x88, 0x27, 0x37, + 0x57, 0x24, 0x8b, 0x7a, 0xd3, 0x79, 0x4e, 0xa6, 0xe8, 0x4d, 0xcb, 0x68, 0xa9, 0x8d, 0xa2, 0xa5, + 0xfe, 0x12, 0x0a, 0x2d, 0xa7, 0x47, 0x9b, 0x43, 0xb7, 0xc3, 0xa4, 0x78, 0x11, 0x72, 0x7d, 0x4a, + 0xfd, 0xb6, 0x69, 0xcb, 0xfa, 0x27, 0xcb, 0x3e, 0x4d, 0xce, 0x46, 0x6b, 0xc4, 0x46, 0x5a, 0xb0, + 0x31, 0x02, 0xe0, 0x35, 0xd0, 0x82, 0xa1, 0xdb, 0x69, 0xcf, 0xac, 0x2d, 0x18, 0x7e, 0x6e, 0x13, + 0xf9, 0x40, 0x8e, 0xf4, 0x4f, 0x01, 0x1e, 0xd1, 0xe1, 0x5a, 0x93, 0xee, 0xb3, 0x83, 0xa5, 0xe0, + 0x94, 0x19, 0x82, 0x4b, 0x9f, 0x6c, 0xba, 0x2a, 0x4f, 0xd6, 0xc7, 0xa6, 0x7b, 0xf3, 0x67, 0x19, + 0xd0, 0x46, 0x0f, 0x81, 0xb8, 0x00, 0xb9, 0xe6, 0x6e, 0xa5, 0x62, 0x34, 0x9b, 0x28, 0x85, 0x57, + 0x00, 0xed, 0xd6, 0x8d, 0x8f, 0x76, 0x8c, 0x4a, 0xcb, 0xa8, 0xb6, 0x0d, 0x42, 0x1a, 0x04, 0x29, + 0x18, 0xc3, 0x62, 0xa5, 0x51, 0xaf, 0x1b, 0x95, 0x56, 0x7b, 0xa3, 0x6c, 0xd6, 0x8c, 0x2a, 0x4a, + 0xe3, 0xf3, 0xb0, 0xbc, 0x63, 0x90, 0x6d, 0xb3, 0xd9, 0x34, 0x1b, 0xf5, 0x76, 0xd5, 0xa8, 0x9b, + 0x46, 0x15, 0xa9, 0xf8, 0x12, 0x9c, 0xaf, 0x34, 0x6a, 0x35, 0xa3, 0xd2, 0x62, 0xe0, 0x7a, 0xa3, + 0xd5, 0x36, 0x3e, 0x32, 0x9b, 0xad, 0x26, 0xca, 0x30, 0xdc, 0x66, 0xad, 0x66, 0x6c, 0x96, 0x6b, + 0xed, 0x32, 0xd9, 0xdc, 0xdd, 0x36, 0xea, 0x2d, 0xb4, 0xc0, 0xf0, 0x44, 0xd0, 0xaa, 0xb9, 0x6d, + 0xd4, 0x19, 0x3a, 0x94, 0xc3, 0x17, 0x00, 0x47, 0x60, 0xb3, 0x5e, 0x35, 0x3e, 0x6a, 0xb7, 0x3e, + 0xde, 0x31, 0x50, 0x1e, 0x5f, 0x81, 0x8b, 0x11, 0x3c, 0x7e, 0x4e, 0x79, 0xdb, 0x40, 0x1a, 0x46, + 0x50, 0x8c, 0x26, 0x5b, 0x8d, 0x9d, 0x47, 0x08, 0xe2, 0xd8, 0x49, 0xe3, 0x29, 0x31, 0x2a, 0x0d, + 0x52, 0x45, 0x85, 0x38, 0xf8, 0x89, 0x51, 0x69, 0x35, 0x48, 0xdb, 0xac, 0xa2, 0x22, 0x23, 0x3e, + 0x02, 0x37, 0x8d, 0x32, 0xa9, 0x6c, 0xb5, 0x89, 0xd1, 0xdc, 0xad, 0xb5, 0x50, 0x89, 0x89, 0x60, + 0xc3, 0xac, 0x19, 0x9c, 0xa3, 0x8d, 0xc6, 0x6e, 0xbd, 0x8a, 0x16, 0xf1, 0x12, 0x14, 0xb6, 0x8d, + 0x56, 0x39, 0x92, 0xc9, 0x12, 0x3b, 0xbf, 0x52, 0xae, 0x6c, 0x19, 0x11, 0x04, 0xe1, 0x55, 0x58, + 0xa9, 0x94, 0xeb, 0x6c, 0x53, 0x85, 0x18, 0xe5, 0x96, 0xd1, 0xde, 0x68, 0xd4, 0xaa, 0x06, 0x41, + 0xcb, 0x8c, 0xc1, 0x89, 0x19, 0xb3, 0x66, 0x20, 0x1c, 0xdb, 0x51, 0x35, 0x6a, 0xc6, 0x78, 0xc7, + 0xb9, 0xd8, 0x8e, 0x68, 0x86, 0xed, 0x58, 0x61, 0xcc, 0xac, 0xef, 0x9a, 0xb5, 0xaa, 0x14, 0x94, + 0x50, 0xda, 0x79, 0xbc, 0x0c, 0xa5, 0x88, 0x99, 0x7a, 0xcd, 0x6c, 0xb6, 0xd0, 0x05, 0x7c, 0x11, + 0xce, 0x45, 0xa0, 0x6d, 0xa3, 0x45, 0xcc, 0x8a, 0x90, 0xea, 0x45, 0xb6, 0xb6, 0xb1, 0xdb, 0x6a, + 0x37, 0x36, 0xda, 0xdb, 0xc6, 0x76, 0x83, 0x7c, 0x8c, 0x56, 0x6f, 0x7e, 0xae, 0x40, 0x3e, 0x2a, + 0x7a, 0x71, 0x1e, 0x32, 0xf5, 0x46, 0xdd, 0x40, 0x29, 0x36, 0x5a, 0x6f, 0x34, 0x6a, 0x48, 0x61, + 0x23, 0xb3, 0xde, 0x7a, 0x80, 0xd2, 0x58, 0x83, 0x05, 0xb3, 0xde, 0xba, 0x7b, 0x0f, 0xa9, 0x72, + 0xf8, 0xce, 0x1a, 0xca, 0xc8, 0xe1, 0xbd, 0x77, 0xd1, 0x02, 0x1b, 0x6e, 0xd4, 0x1a, 0xe5, 0x16, + 0x02, 0x0c, 0x90, 0xad, 0x36, 0x76, 0xd7, 0x6b, 0x06, 0x2a, 0xb0, 0x71, 0xb3, 0x45, 0xcc, 0xfa, + 0x26, 0x5a, 0x61, 0x14, 0x48, 0x4d, 0xac, 0x9b, 0xf5, 0x32, 0xf9, 0x18, 0xd9, 0x4c, 0x9a, 0x12, + 0x24, 0x36, 0xd3, 0x9b, 0x15, 0x58, 0x9a, 0x28, 0xd3, 0x70, 0x16, 0xd2, 0xb5, 0x16, 0x4a, 0xe1, + 0x1c, 0xa8, 0xb5, 0x96, 0x81, 0x14, 0x06, 0x30, 0x1e, 0xa3, 0x34, 0xfb, 0xdd, 0x6c, 0x21, 0x95, + 0x4d, 0x6c, 0xb6, 0x0c, 0x94, 0x61, 0x80, 0xba, 0x81, 0x16, 0x6e, 0x3e, 0x80, 0x05, 0x9e, 0xfa, + 0x33, 0xc3, 0x37, 0xeb, 0x4f, 0xca, 0x35, 0xb3, 0x2a, 0xf8, 0xda, 0xde, 0x6d, 0xb6, 0x90, 0xc2, + 0xa9, 0xda, 0x6a, 0xec, 0xd6, 0x98, 0x91, 0x17, 0x21, 0xcf, 0xa0, 0x4c, 0xeb, 0x48, 0xbd, 0x79, + 0x1d, 0xb2, 0x22, 0x78, 0xb3, 0x35, 0x66, 0xbd, 0x69, 0x10, 0x76, 0x32, 0xe3, 0x88, 0xeb, 0x03, + 0x29, 0x37, 0xff, 0xa0, 0x42, 0x4e, 0x5e, 0xb4, 0x0c, 0xe3, 0x61, 0xa5, 0x67, 0xa3, 0x14, 0x53, + 0xd0, 0x61, 0xc5, 0xa7, 0x56, 0x48, 0xc7, 0x4d, 0x28, 0x64, 0xe3, 0x73, 0xb0, 0x74, 0x58, 0xf5, + 0xbd, 0x7e, 0x0c, 0x48, 0x99, 0x9d, 0x1d, 0x6e, 0x59, 0x41, 0x0c, 0xf6, 0x8c, 0x39, 0xce, 0x61, + 0xcd, 0x09, 0xc2, 0x31, 0x30, 0x40, 0xfb, 0xcc, 0x1c, 0x0e, 0x37, 0x69, 0x98, 0xec, 0x6b, 0xa1, + 0x03, 0xa6, 0xe4, 0x24, 0xbc, 0x19, 0x5a, 0x61, 0x80, 0x1c, 0x8e, 0x9a, 0x37, 0x3f, 0xa3, 0xf6, + 0x37, 0xfa, 0x0c, 0x9f, 0x07, 0x24, 0x49, 0x1b, 0x3d, 0x92, 0xa2, 0xdf, 0x2a, 0xf8, 0x1c, 0x2c, + 0x72, 0xd2, 0xc6, 0xc0, 0xdf, 0xb1, 0x28, 0x50, 0x62, 0xa4, 0x8d, 0x61, 0x5f, 0x28, 0x78, 0x05, + 0x96, 0x38, 0x69, 0x23, 0x60, 0x80, 0x7e, 0xaf, 0xe0, 0x65, 0x28, 0x4a, 0xac, 0xbc, 0x8b, 0x8a, + 0x7e, 0x9e, 0xc6, 0x4b, 0x00, 0x1c, 0xa3, 0x00, 0xfc, 0x22, 0x2d, 0x8e, 0xa0, 0x41, 0xc7, 0x77, + 0xf6, 0xe4, 0xaa, 0x5f, 0x32, 0x79, 0xe7, 0x0e, 0x45, 0xea, 0x80, 0xbe, 0xaf, 0xf2, 0x25, 0xa3, + 0xd6, 0xda, 0xfa, 0xd0, 0xac, 0xa2, 0xcf, 0x55, 0x7c, 0x01, 0x96, 0x0f, 0x45, 0x56, 0x11, 0x83, + 0xff, 0x40, 0xe5, 0x5b, 0xc5, 0x85, 0x87, 0x7e, 0xa8, 0x72, 0xbe, 0x18, 0x5d, 0x66, 0x75, 0xf4, + 0xa8, 0x82, 0x7e, 0xa4, 0x0a, 0x72, 0x3d, 0xcb, 0x8e, 0x89, 0xf7, 0xaf, 0x2a, 0x2e, 0x40, 0xf6, + 0x90, 0xb7, 0x43, 0xd1, 0xdf, 0x54, 0x5c, 0x82, 0xfc, 0xa1, 0xec, 0x6c, 0xa2, 0xbf, 0xab, 0x37, + 0xaf, 0x41, 0x3e, 0x0a, 0xcf, 0x4c, 0xa3, 0xc4, 0x28, 0x33, 0x6b, 0xd1, 0x60, 0xe1, 0x29, 0x31, + 0x99, 0xca, 0xd7, 0xbe, 0x2a, 0x41, 0x69, 0x9b, 0x07, 0xf3, 0x26, 0xf5, 0x5f, 0x38, 0x1d, 0x8a, + 0xbf, 0x0e, 0x68, 0x52, 0xdb, 0x78, 0xea, 0xab, 0xf7, 0xe5, 0x69, 0x4d, 0x47, 0x3d, 0x85, 0x37, + 0xa0, 0x94, 0x30, 0x01, 0x7c, 0x65, 0xa2, 0x51, 0x10, 0xbf, 0xb2, 0x2f, 0x5f, 0x38, 0x56, 0x52, + 0x8a, 0xb6, 0x7a, 0x0a, 0x9b, 0x80, 0x23, 0x09, 0x9f, 0x16, 0xd9, 0x54, 0x3a, 0xf5, 0x14, 0x7e, + 0xcc, 0x3c, 0x6f, 0xe0, 0x86, 0xa7, 0xc5, 0x73, 0x6d, 0xc6, 0xe4, 0xa8, 0xff, 0x9e, 0xc2, 0xdf, + 0x80, 0xa5, 0xe6, 0x01, 0xfb, 0x1c, 0x19, 0xf5, 0x84, 0x94, 0x64, 0x7f, 0x7e, 0x26, 0xae, 0xe8, + 0xef, 0x21, 0x7a, 0x0a, 0xef, 0x00, 0x4e, 0xe2, 0xe2, 0x3d, 0xde, 0x13, 0x29, 0x9c, 0x35, 0xc9, + 0x7b, 0xba, 0x29, 0x5c, 0x85, 0xc5, 0xa4, 0x6f, 0x9e, 0x8c, 0x6d, 0x86, 0x26, 0xdf, 0x87, 0x42, + 0xcc, 0x0f, 0x70, 0xb2, 0x08, 0x1f, 0xbf, 0x30, 0xcc, 0xda, 0x5e, 0x81, 0x52, 0xc2, 0x45, 0x66, + 0x23, 0x98, 0x35, 0xa1, 0xa7, 0xf0, 0x43, 0xd0, 0x46, 0x8e, 0x37, 0x37, 0x05, 0x06, 0x2c, 0x4d, + 0x84, 0x87, 0x09, 0x39, 0x24, 0xff, 0xa8, 0x31, 0x1b, 0x4d, 0x31, 0x1e, 0x39, 0x4e, 0xc6, 0x31, + 0xdb, 0xa0, 0x1f, 0xc1, 0x22, 0x53, 0xf3, 0x38, 0xd8, 0x9c, 0xac, 0x94, 0xcb, 0xd3, 0x4f, 0x91, + 0x36, 0xc3, 0x84, 0x1b, 0x0f, 0x71, 0xaf, 0xc5, 0xd8, 0x7b, 0x90, 0x15, 0xf1, 0x0a, 0xaf, 0x4e, + 0x48, 0x76, 0xf4, 0xbc, 0x3f, 0xc1, 0xcf, 0xe8, 0xbf, 0x1c, 0x5c, 0x2c, 0xa5, 0x44, 0x7c, 0x9b, + 0x20, 0x21, 0xd9, 0xf9, 0xbf, 0x3c, 0xfd, 0x0d, 0x53, 0x4f, 0xe1, 0x2d, 0x28, 0xc6, 0x5f, 0x20, + 0xf0, 0x7f, 0x4c, 0xb4, 0x3e, 0x26, 0x1e, 0x27, 0x4e, 0x20, 0xe8, 0x03, 0xc8, 0x8a, 0x18, 0x8a, + 0x67, 0x3e, 0x21, 0x5f, 0x4e, 0xce, 0xc4, 0xde, 0x68, 0xb9, 0x1f, 0x2e, 0x4d, 0x3c, 0x65, 0xe3, + 0x37, 0xa7, 0x20, 0x4a, 0x3e, 0x74, 0x9f, 0x88, 0xf1, 0x3e, 0xa8, 0x95, 0x9e, 0x3d, 0x23, 0x32, + 0x4c, 0x10, 0x19, 0x7b, 0xac, 0x4c, 0xe1, 0x32, 0xc0, 0xf8, 0x25, 0x09, 0x27, 0xcb, 0x98, 0x89, + 0x27, 0xa6, 0x59, 0xca, 0xdd, 0x84, 0xe5, 0x1d, 0x9f, 0x76, 0x13, 0xf7, 0xc5, 0x6b, 0x85, 0x81, + 0xfb, 0xb0, 0xc0, 0xef, 0x97, 0x09, 0xf7, 0x1b, 0x3f, 0xc1, 0xcd, 0xda, 0xf8, 0x90, 0xbf, 0x52, + 0xb2, 0xbb, 0x08, 0x5f, 0x3a, 0xde, 0x2c, 0x96, 0x6f, 0x6f, 0xb3, 0x36, 0xaf, 0x43, 0x5e, 0xea, + 0x6d, 0x1d, 0x5f, 0x9e, 0xa5, 0xce, 0x9d, 0xf5, 0x93, 0xc4, 0xbf, 0x7e, 0xf7, 0x93, 0xdb, 0xfb, + 0x4e, 0x78, 0x30, 0xd8, 0xbb, 0xd5, 0xf1, 0x7a, 0xb7, 0x3b, 0xdf, 0x0e, 0xee, 0xdc, 0xb9, 0x7f, + 0x3b, 0x18, 0xbc, 0xe8, 0x3a, 0xbd, 0xdb, 0xd3, 0xff, 0xa9, 0xb8, 0x97, 0xe5, 0x9f, 0xef, 0xfc, + 0x23, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x07, 0xf2, 0xaf, 0xca, 0x28, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -4863,5 +4862,5 @@ var _MilvusService_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "pkg/master/grpc/message/message.proto", + Metadata: "internal/proto/message/message.proto", } diff --git a/pkg/master/grpc/message/message.proto b/internal/proto/message/message.proto similarity index 99% rename from pkg/master/grpc/message/message.proto rename to internal/proto/message/message.proto index ee280f27d6..0891815609 100644 --- a/pkg/master/grpc/message/message.proto +++ b/internal/proto/message/message.proto @@ -1,7 +1,8 @@ syntax = "proto3"; package milvus.grpc; -option go_package="github.com/czs007/suvlim/pkg/master/grpc/message"; + +option go_package="github.com/czs007/suvlim/internal/proto/message"; enum ErrorCode { SUCCESS = 0; @@ -724,7 +725,6 @@ message QueryReqMsg { ReqType req_type = 9; } - message ManipulationReqMsg { string collection_name = 1; string partition_tag = 2; diff --git a/proxy-go/proxy_node/manipulation_req.go b/internal/proxy/manipulation_req.go similarity index 97% rename from proxy-go/proxy_node/manipulation_req.go rename to internal/proxy/manipulation_req.go index 81c8e4924c..3c87dddf9a 100644 --- a/proxy-go/proxy_node/manipulation_req.go +++ b/internal/proxy/manipulation_req.go @@ -1,8 +1,8 @@ -package proxy_node +package proxy import ( "github.com/apache/pulsar-client-go/pulsar" - pb "github.com/czs007/suvlim/pkg/master/grpc/message" + pb "github.com/czs007/suvlim/internal/proto/message" "github.com/golang/protobuf/proto" "log" "sync" diff --git a/proxy-go/proxy_node/proxy_node.go b/internal/proxy/proxy_node.go similarity index 97% rename from proxy-go/proxy_node/proxy_node.go rename to internal/proxy/proxy_node.go index 5237330519..4490865163 100644 --- a/proxy-go/proxy_node/proxy_node.go +++ b/internal/proxy/proxy_node.go @@ -1,11 +1,11 @@ -package proxy_node +package proxy import ( "context" "fmt" "github.com/apache/pulsar-client-go/pulsar" - "github.com/czs007/suvlim/conf" - pb "github.com/czs007/suvlim/pkg/master/grpc/message" + "github.com/czs007/suvlim/internal/conf" + pb "github.com/czs007/suvlim/internal/proto/message" etcd "go.etcd.io/etcd/clientv3" "strconv" ) diff --git a/proxy-go/proxy_node/proxy_node_test.go b/internal/proxy/proxy_node_test.go similarity index 99% rename from proxy-go/proxy_node/proxy_node_test.go rename to internal/proxy/proxy_node_test.go index 3b3ab7be05..3ddce63aae 100644 --- a/proxy-go/proxy_node/proxy_node_test.go +++ b/internal/proxy/proxy_node_test.go @@ -1,12 +1,12 @@ -package proxy_node +package proxy import ( "context" "encoding/binary" "encoding/json" "github.com/apache/pulsar-client-go/pulsar" - mpb "github.com/czs007/suvlim/pkg/master/grpc/master" - pb "github.com/czs007/suvlim/pkg/master/grpc/message" + mpb "github.com/czs007/suvlim/internal/proto/master" + pb "github.com/czs007/suvlim/internal/proto/message" "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" etcd "go.etcd.io/etcd/clientv3" diff --git a/proxy-go/proxy_node/query_req.go b/internal/proxy/query_req.go similarity index 98% rename from proxy-go/proxy_node/query_req.go rename to internal/proxy/query_req.go index 512c377995..fd6a3fe4a1 100644 --- a/proxy-go/proxy_node/query_req.go +++ b/internal/proxy/query_req.go @@ -1,9 +1,9 @@ -package proxy_node +package proxy import ( "fmt" "github.com/apache/pulsar-client-go/pulsar" - pb "github.com/czs007/suvlim/pkg/master/grpc/message" + pb "github.com/czs007/suvlim/internal/proto/message" "github.com/golang/protobuf/proto" "log" "sort" diff --git a/proxy-go/proxy_node/readertimesync.go b/internal/proxy/readertimesync.go similarity index 98% rename from proxy-go/proxy_node/readertimesync.go rename to internal/proxy/readertimesync.go index 6959d44664..48f8f2f871 100644 --- a/proxy-go/proxy_node/readertimesync.go +++ b/internal/proxy/readertimesync.go @@ -1,11 +1,11 @@ -package proxy_node +package proxy import ( "context" "fmt" "github.com/apache/pulsar-client-go/pulsar" - "github.com/czs007/suvlim/conf" - pb "github.com/czs007/suvlim/pkg/master/grpc/message" + "github.com/czs007/suvlim/internal/conf" + pb "github.com/czs007/suvlim/internal/proto/message" "github.com/golang/protobuf/proto" "log" "sort" diff --git a/proxy-go/proxy_node/readertimesync_test.go b/internal/proxy/readertimesync_test.go similarity index 99% rename from proxy-go/proxy_node/readertimesync_test.go rename to internal/proxy/readertimesync_test.go index 7fc271bb72..384d43b104 100644 --- a/proxy-go/proxy_node/readertimesync_test.go +++ b/internal/proxy/readertimesync_test.go @@ -1,9 +1,9 @@ -package proxy_node +package proxy import ( "context" "github.com/apache/pulsar-client-go/pulsar" - pb "github.com/czs007/suvlim/pkg/master/grpc/message" + pb "github.com/czs007/suvlim/internal/proto/message" "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "log" diff --git a/proxy-go/proxy_node/request_scheduler.go b/internal/proxy/request_scheduler.go similarity index 98% rename from proxy-go/proxy_node/request_scheduler.go rename to internal/proxy/request_scheduler.go index 0242107041..4173a68fc9 100644 --- a/proxy-go/proxy_node/request_scheduler.go +++ b/internal/proxy/request_scheduler.go @@ -1,4 +1,4 @@ -package proxy_node +package proxy import "sync" diff --git a/proxy-go/proxy_node/server.go b/internal/proxy/server.go similarity index 98% rename from proxy-go/proxy_node/server.go rename to internal/proxy/server.go index 40ed7a992d..25bc6bc2e8 100644 --- a/proxy-go/proxy_node/server.go +++ b/internal/proxy/server.go @@ -1,12 +1,12 @@ -package proxy_node +package proxy import ( "context" "encoding/json" "fmt" - mpb "github.com/czs007/suvlim/pkg/master/grpc/master" - pb "github.com/czs007/suvlim/pkg/master/grpc/message" - master "github.com/czs007/suvlim/pkg/master/mock" + mpb "github.com/czs007/suvlim/internal/proto/master" + pb "github.com/czs007/suvlim/internal/proto/message" + "github.com/czs007/suvlim/internal/master/collection" "github.com/golang/protobuf/proto" etcd "go.etcd.io/etcd/clientv3" "go.uber.org/atomic" @@ -380,7 +380,7 @@ func (s *proxyServer) WatchEtcd() error { for _, cob := range cos.Kvs { // TODO: simplify collection struct var co mpb.Collection - var mco master.Collection + var mco collection.Collection if err := json.Unmarshal(cob.Value, &mco); err != nil { return err } @@ -417,7 +417,7 @@ func (s *proxyServer) WatchEtcd() error { defer s.collectionMux.Unlock() for _, e := range coe.Events { var co mpb.Collection - var mco master.Collection + var mco collection.Collection if err := json.Unmarshal(e.Kv.Value, &mco); err != nil { log.Printf("unmarshal Collection failed, error = %v", err) } else { diff --git a/proxy-go/proxy_node/server_test.go b/internal/proxy/server_test.go similarity index 99% rename from proxy-go/proxy_node/server_test.go rename to internal/proxy/server_test.go index 466ca7bfa5..5ed7c249d5 100644 --- a/proxy-go/proxy_node/server_test.go +++ b/internal/proxy/server_test.go @@ -1,12 +1,12 @@ -package proxy_node +package proxy import ( "context" "encoding/binary" "encoding/json" "github.com/apache/pulsar-client-go/pulsar" - mpb "github.com/czs007/suvlim/pkg/master/grpc/master" - pb "github.com/czs007/suvlim/pkg/master/grpc/message" + mpb "github.com/czs007/suvlim/internal/proto/master" + pb "github.com/czs007/suvlim/internal/proto/message" "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "go.etcd.io/etcd/clientv3" diff --git a/proxy-go/proxy_node/timestamporacle.go b/internal/proxy/timestamporacle.go similarity index 97% rename from proxy-go/proxy_node/timestamporacle.go rename to internal/proxy/timestamporacle.go index 6dfdc3b906..c63a873feb 100644 --- a/proxy-go/proxy_node/timestamporacle.go +++ b/internal/proxy/timestamporacle.go @@ -1,9 +1,9 @@ -package proxy_node +package proxy import ( "context" "fmt" - pb "github.com/czs007/suvlim/pkg/master/grpc/message" + pb "github.com/czs007/suvlim/internal/proto/message" etcd "go.etcd.io/etcd/clientv3" "log" "strconv" diff --git a/proxy-go/proxy_node/timestamporacle_test.go b/internal/proxy/timestamporacle_test.go similarity index 97% rename from proxy-go/proxy_node/timestamporacle_test.go rename to internal/proxy/timestamporacle_test.go index 05b67db6fa..1c329c8cf3 100644 --- a/proxy-go/proxy_node/timestamporacle_test.go +++ b/internal/proxy/timestamporacle_test.go @@ -1,4 +1,4 @@ -package proxy_node +package proxy import ( "context" diff --git a/proxy-go/proxy_node/timetick.go b/internal/proxy/timetick.go similarity index 96% rename from proxy-go/proxy_node/timetick.go rename to internal/proxy/timetick.go index e0ee013419..63fde699d6 100644 --- a/proxy-go/proxy_node/timetick.go +++ b/internal/proxy/timetick.go @@ -1,10 +1,10 @@ -package proxy_node +package proxy import ( "context" "fmt" "github.com/apache/pulsar-client-go/pulsar" - pb "github.com/czs007/suvlim/pkg/master/grpc/message" + pb "github.com/czs007/suvlim/internal/proto/message" "github.com/golang/protobuf/proto" "log" "time" diff --git a/proxy-go/proxy_node/timetick_test.go b/internal/proxy/timetick_test.go similarity index 96% rename from proxy-go/proxy_node/timetick_test.go rename to internal/proxy/timetick_test.go index b29506cdd0..ee5aed8b0b 100644 --- a/proxy-go/proxy_node/timetick_test.go +++ b/internal/proxy/timetick_test.go @@ -1,9 +1,9 @@ -package proxy_node +package proxy import ( "context" "github.com/apache/pulsar-client-go/pulsar" - pb "github.com/czs007/suvlim/pkg/master/grpc/message" + pb "github.com/czs007/suvlim/internal/proto/message" "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "testing" diff --git a/proxy-go/proxy_node/util.go b/internal/proxy/util.go similarity index 95% rename from proxy-go/proxy_node/util.go rename to internal/proxy/util.go index 0fc053f8aa..47a0b3144b 100644 --- a/proxy-go/proxy_node/util.go +++ b/internal/proxy/util.go @@ -1,4 +1,4 @@ -package proxy_node +package proxy import ( "encoding/binary" diff --git a/proxy-go/proxy_node/util_test.go b/internal/proxy/util_test.go similarity index 95% rename from proxy-go/proxy_node/util_test.go rename to internal/proxy/util_test.go index 38a9532349..bae00fdc76 100644 --- a/proxy-go/proxy_node/util_test.go +++ b/internal/proxy/util_test.go @@ -1,4 +1,4 @@ -package proxy_node +package proxy import ( "github.com/stretchr/testify/assert" diff --git a/reader/read_node/collection.go b/internal/reader/collection.go similarity index 100% rename from reader/read_node/collection.go rename to internal/reader/collection.go diff --git a/reader/read_node/index.go b/internal/reader/index.go similarity index 92% rename from reader/read_node/index.go rename to internal/reader/index.go index 2b0025be68..429b6f63ce 100644 --- a/reader/read_node/index.go +++ b/internal/reader/index.go @@ -13,7 +13,7 @@ package reader */ import "C" import ( - msgPb "github.com/czs007/suvlim/pkg/master/grpc/message" + msgPb "github.com/czs007/suvlim/internal/proto/message" ) type IndexConfig struct{} diff --git a/reader/read_node/index_test.go b/internal/reader/index_test.go similarity index 93% rename from reader/read_node/index_test.go rename to internal/reader/index_test.go index 358c998179..72132854dd 100644 --- a/reader/read_node/index_test.go +++ b/internal/reader/index_test.go @@ -1,9 +1,10 @@ package reader import ( + "context" "encoding/binary" "fmt" - msgPb "github.com/czs007/suvlim/pkg/master/grpc/message" + msgPb "github.com/czs007/suvlim/internal/proto/message" "math" "testing" @@ -12,7 +13,8 @@ import ( func TestIndex_BuildIndex(t *testing.T) { // 1. Construct node, collection, partition and segment - node := NewQueryNode(0, 0) + ctx := context.Background() + node := NewQueryNode(ctx, 0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) @@ -74,4 +76,5 @@ func TestIndex_BuildIndex(t *testing.T) { partition.DeleteSegment(segment) collection.DeletePartition(partition) node.DeleteCollection(collection) + node.Close() } diff --git a/reader/read_node/meta.go b/internal/reader/meta.go similarity index 81% rename from reader/read_node/meta.go rename to internal/reader/meta.go index bda1a9638d..cb7f4d8294 100644 --- a/reader/read_node/meta.go +++ b/internal/reader/meta.go @@ -1,7 +1,6 @@ package reader import ( - "context" "fmt" "log" "path" @@ -11,9 +10,10 @@ import ( "sync" "time" - "github.com/czs007/suvlim/conf" - "github.com/czs007/suvlim/pkg/master/kv" - "github.com/czs007/suvlim/pkg/master/mock" + "github.com/czs007/suvlim/internal/conf" + "github.com/czs007/suvlim/internal/master/kv" + "github.com/czs007/suvlim/internal/master/segment" + "github.com/czs007/suvlim/internal/master/collection" "go.etcd.io/etcd/clientv3" "go.etcd.io/etcd/mvcc/mvccpb" ) @@ -36,9 +36,9 @@ func GetSegmentObjId(key string) string { func isCollectionObj(key string) bool { prefix := path.Join(conf.Config.Etcd.Rootpath, CollectonPrefix) + "/" prefix = strings.TrimSpace(prefix) - println("prefix is :$", prefix) + // println("prefix is :$", prefix) index := strings.Index(key, prefix) - println("index is :", index) + // println("index is :", index) return index == 0 } @@ -49,16 +49,23 @@ func isSegmentObj(key string) bool { return index == 0 } -func isSegmentChannelRangeInQueryNodeChannelRange(segment *mock.Segment) bool { +func isSegmentChannelRangeInQueryNodeChannelRange(segment *segment.Segment) bool { if segment.ChannelStart > segment.ChannelEnd { log.Printf("Illegal segment channel range") return false } - // TODO: add query node channel range check - return true + + var queryNodeChannelStart = conf.Config.Reader.TopicStart + var queryNodeChannelEnd = conf.Config.Reader.TopicEnd + + if segment.ChannelStart >= queryNodeChannelStart && segment.ChannelEnd <= queryNodeChannelEnd { + return true + } + + return false } -func printCollectionStruct(obj *mock.Collection) { +func printCollectionStruct(obj *collection.Collection) { v := reflect.ValueOf(obj) v = reflect.Indirect(v) typeOfS := v.Type() @@ -71,7 +78,7 @@ func printCollectionStruct(obj *mock.Collection) { } } -func printSegmentStruct(obj *mock.Segment) { +func printSegmentStruct(obj *segment.Segment) { v := reflect.ValueOf(obj) v = reflect.Indirect(v) typeOfS := v.Type() @@ -83,12 +90,12 @@ func printSegmentStruct(obj *mock.Segment) { func (node *QueryNode) processCollectionCreate(id string, value string) { println(fmt.Sprintf("Create Collection:$%s$", id)) - collection, err := mock.JSON2Collection(value) + collection, err := collection.JSON2Collection(value) if err != nil { println("error of json 2 collection") println(err.Error()) } - printCollectionStruct(collection) + //printCollectionStruct(collection) newCollection := node.NewCollection(collection.ID, collection.Name, collection.GrpcMarshalString) for _, partitionTag := range collection.PartitionTags { newCollection.NewPartition(partitionTag) @@ -97,17 +104,16 @@ func (node *QueryNode) processCollectionCreate(id string, value string) { func (node *QueryNode) processSegmentCreate(id string, value string) { println("Create Segment: ", id) - segment, err := mock.JSON2Segment(value) + segment, err := segment.JSON2Segment(value) if err != nil { println("error of json 2 segment") println(err.Error()) } - printSegmentStruct(segment) + //printSegmentStruct(segment) - // TODO: fix this after channel range config finished - //if !isSegmentChannelRangeInQueryNodeChannelRange(segment) { - // return - //} + if !isSegmentChannelRangeInQueryNodeChannelRange(segment) { + return + } collection := node.GetCollectionByID(segment.CollectionID) if collection != nil { @@ -125,7 +131,7 @@ func (node *QueryNode) processSegmentCreate(id string, value string) { } func (node *QueryNode) processCreate(key string, msg string) { - println("process create", key, ":", msg) + println("process create", key) if isCollectionObj(key) { objID := GetCollectionObjId(key) node.processCollectionCreate(objID, msg) @@ -138,19 +144,18 @@ func (node *QueryNode) processCreate(key string, msg string) { } func (node *QueryNode) processSegmentModify(id string, value string) { - println("Modify Segment: ", id) + // println("Modify Segment: ", id) - segment, err := mock.JSON2Segment(value) + segment, err := segment.JSON2Segment(value) if err != nil { println("error of json 2 segment") println(err.Error()) } - printSegmentStruct(segment) + // printSegmentStruct(segment) - // TODO: fix this after channel range config finished - //if !isSegmentChannelRangeInQueryNodeChannelRange(segment) { - // return - //} + if !isSegmentChannelRangeInQueryNodeChannelRange(segment) { + return + } seg, err := node.GetSegmentBySegmentID(int64(segment.SegmentID)) // todo change to uint64 if seg != nil { @@ -159,13 +164,13 @@ func (node *QueryNode) processSegmentModify(id string, value string) { } func (node *QueryNode) processCollectionModify(id string, value string) { - println("Modify Collection: ", id) - collection, err := mock.JSON2Collection(value) + // println("Modify Collection: ", id) + collection, err := collection.JSON2Collection(value) if err != nil { println("error of json 2 collection") println(err.Error()) } - printCollectionStruct(collection) + // printCollectionStruct(collection) goCollection := node.GetCollectionByID(collection.ID) if goCollection != nil { @@ -175,7 +180,7 @@ func (node *QueryNode) processCollectionModify(id string, value string) { } func (node *QueryNode) processModify(key string, msg string) { - println("process modify") + // println("process modify") if isCollectionObj(key) { objID := GetCollectionObjId(key) node.processCollectionModify(objID, msg) @@ -214,7 +219,7 @@ func (node *QueryNode) processResp(resp clientv3.WatchResponse) error { if err != nil { return err } - println("processResp!!!!!\n") + // println("processResp!!!!!\n") for _, ev := range resp.Events { if ev.IsCreate() { @@ -269,12 +274,12 @@ func (node *QueryNode) InitFromMeta() error { return nil } -func (node *QueryNode) RunMetaService(ctx context.Context, wg *sync.WaitGroup) { +func (node *QueryNode) RunMetaService(wg *sync.WaitGroup) { //node.InitFromMeta() metaChan := node.kvBase.WatchWithPrefix("") for { select { - case <-ctx.Done(): + case <-node.ctx.Done(): wg.Done() println("DONE!!!!!!") return diff --git a/reader/read_node/partition.go b/internal/reader/partition.go similarity index 100% rename from reader/read_node/partition.go rename to internal/reader/partition.go diff --git a/reader/read_node/query_node.go b/internal/reader/query_node.go similarity index 73% rename from reader/read_node/query_node.go rename to internal/reader/query_node.go index 5611c1543f..ee83902a4a 100644 --- a/reader/read_node/query_node.go +++ b/internal/reader/query_node.go @@ -14,18 +14,20 @@ package reader import "C" import ( + "context" "encoding/json" "fmt" - "github.com/stretchr/testify/assert" "log" "sort" "sync" "sync/atomic" "time" - msgPb "github.com/czs007/suvlim/pkg/master/grpc/message" - "github.com/czs007/suvlim/pkg/master/kv" - "github.com/czs007/suvlim/reader/message_client" + "github.com/czs007/suvlim/internal/conf" + msgPb "github.com/czs007/suvlim/internal/proto/message" + "github.com/czs007/suvlim/internal/master/kv" + "github.com/czs007/suvlim/internal/msgclient" + "github.com/stretchr/testify/assert" //"github.com/stretchr/testify/assert" ) @@ -68,16 +70,31 @@ type QueryInfo struct { type MsgCounter struct { InsertCounter int64 + InsertTime time.Time + DeleteCounter int64 + DeleteTime time.Time + SearchCounter int64 + SearchTime time.Time +} + +type InsertLog struct { + MsgLength int + DurationInMilliseconds int64 + InsertTime time.Time + NumSince int64 + Speed float64 } type QueryNode struct { + // context + ctx context.Context + QueryNodeId uint64 Collections []*Collection SegmentsMap map[int64]*Segment - messageClient *message_client.MessageClient - //mc *message_client.MessageClient + messageClient *msgclient.ReaderMessageClient queryNodeTimeSync *QueryNodeTime buffer QueryNodeDataBuffer deletePreprocessData DeletePreprocessData @@ -85,16 +102,17 @@ type QueryNode struct { insertData InsertData kvBase *kv.EtcdKVBase msgCounter *MsgCounter + InsertLogs []InsertLog } -func NewQueryNode(queryNodeId uint64, timeSync uint64) *QueryNode { - mc := message_client.MessageClient{} +func NewQueryNode(ctx context.Context, queryNodeId uint64, timeSync uint64) *QueryNode { + mc := msgclient.ReaderMessageClient{} queryNodeTimeSync := &QueryNodeTime{ ReadTimeSyncMin: timeSync, ReadTimeSyncMax: timeSync, WriteTimeSync: timeSync, - ServiceTimeSync: timeSync, + ServiceTimeSync: timeSync, TSOTimeSync: timeSync, } @@ -114,6 +132,7 @@ func NewQueryNode(queryNodeId uint64, timeSync uint64) *QueryNode { } return &QueryNode{ + ctx: ctx, QueryNodeId: queryNodeId, Collections: nil, SegmentsMap: segmentsMap, @@ -125,16 +144,20 @@ func NewQueryNode(queryNodeId uint64, timeSync uint64) *QueryNode { } func (node *QueryNode) Close() { - node.messageClient.Close() - node.kvBase.Close() + if node.messageClient != nil { + node.messageClient.Close() + } + if node.kvBase != nil { + node.kvBase.Close() + } } -func CreateQueryNode(queryNodeId uint64, timeSync uint64, mc *message_client.MessageClient) *QueryNode { +func CreateQueryNode(ctx context.Context, queryNodeId uint64, timeSync uint64, mc *msgclient.ReaderMessageClient) *QueryNode { queryNodeTimeSync := &QueryNodeTime{ ReadTimeSyncMin: timeSync, ReadTimeSyncMax: timeSync, WriteTimeSync: timeSync, - ServiceTimeSync: timeSync, + ServiceTimeSync: timeSync, TSOTimeSync: timeSync, } @@ -149,11 +172,15 @@ func CreateQueryNode(queryNodeId uint64, timeSync uint64, mc *message_client.Mes msgCounter := MsgCounter{ InsertCounter: 0, + InsertTime: time.Now(), DeleteCounter: 0, + DeleteTime: time.Now(), SearchCounter: 0, + SearchTime: time.Now(), } return &QueryNode{ + ctx: ctx, QueryNodeId: queryNodeId, Collections: nil, SegmentsMap: segmentsMap, @@ -161,6 +188,7 @@ func CreateQueryNode(queryNodeId uint64, timeSync uint64, mc *message_client.Mes queryNodeTimeSync: queryNodeTimeSync, buffer: buffer, msgCounter: &msgCounter, + InsertLogs: make([]InsertLog, 0), } } @@ -245,69 +273,70 @@ func (node *QueryNode) InitQueryNodeCollection() { func (node *QueryNode) RunInsertDelete(wg *sync.WaitGroup) { const Debug = true - const CountMsgNum = 1000 * 1000 + const CountInsertMsgBaseline = 1000 * 1000 + var BaselineCounter int64 = 0 if Debug { - var printFlag = true - var startTime = true - var start time.Time - for { - var msgLen = node.PrepareBatchMsg() - var timeRange = TimeRange{node.messageClient.TimeSyncStart(), node.messageClient.TimeSyncEnd()} - assert.NotEqual(nil, 0, timeRange.timestampMin) - assert.NotEqual(nil, 0, timeRange.timestampMax) + select { + case <-node.ctx.Done(): + wg.Done() + return + default: + var msgLen = node.PrepareBatchMsg() + var timeRange = TimeRange{node.messageClient.TimeSyncStart(), node.messageClient.TimeSyncEnd()} + assert.NotEqual(nil, 0, timeRange.timestampMin) + assert.NotEqual(nil, 0, timeRange.timestampMax) - if msgLen[0] == 0 && len(node.buffer.InsertDeleteBuffer) <= 0 { + if node.msgCounter.InsertCounter/CountInsertMsgBaseline != BaselineCounter { + node.WriteQueryLog() + BaselineCounter = node.msgCounter.InsertCounter / CountInsertMsgBaseline + } + + if msgLen[0] == 0 && len(node.buffer.InsertDeleteBuffer) <= 0 { + node.queryNodeTimeSync.UpdateSearchTimeSync(timeRange) + continue + } + + node.QueryNodeDataInit() + node.MessagesPreprocess(node.messageClient.InsertOrDeleteMsg, timeRange) + //fmt.Println("MessagesPreprocess Done") + node.WriterDelete() + node.PreInsertAndDelete() + //fmt.Println("PreInsertAndDelete Done") + node.DoInsertAndDelete() + //fmt.Println("DoInsertAndDelete Done") node.queryNodeTimeSync.UpdateSearchTimeSync(timeRange) - continue - } - - if startTime { - fmt.Println("============> Start Test <============") - startTime = false - start = time.Now() - } - - node.QueryNodeDataInit() - node.MessagesPreprocess(node.messageClient.InsertOrDeleteMsg, timeRange) - //fmt.Println("MessagesPreprocess Done") - node.WriterDelete() - node.PreInsertAndDelete() - //fmt.Println("PreInsertAndDelete Done") - node.DoInsertAndDelete() - //fmt.Println("DoInsertAndDelete Done") - node.queryNodeTimeSync.UpdateSearchTimeSync(timeRange) - - // Test insert time - if printFlag && node.msgCounter.InsertCounter >= CountMsgNum { - printFlag = false - timeSince := time.Since(start) - fmt.Println("============> Do", node.msgCounter.InsertCounter, "Insert in", timeSince, "<============") } } - } + } else { + for { + select { + case <-node.ctx.Done(): + wg.Done() + return + default: + var msgLen = node.PrepareBatchMsg() + var timeRange = TimeRange{node.messageClient.TimeSyncStart(), node.messageClient.TimeSyncEnd()} + assert.NotEqual(nil, 0, timeRange.timestampMin) + assert.NotEqual(nil, 0, timeRange.timestampMax) - for { - var msgLen = node.PrepareBatchMsg() - var timeRange = TimeRange{node.messageClient.TimeSyncStart(), node.messageClient.TimeSyncEnd()} - assert.NotEqual(nil, 0, timeRange.timestampMin) - assert.NotEqual(nil, 0, timeRange.timestampMax) + if msgLen[0] == 0 && len(node.buffer.InsertDeleteBuffer) <= 0 { + node.queryNodeTimeSync.UpdateSearchTimeSync(timeRange) + continue + } - if msgLen[0] == 0 && len(node.buffer.InsertDeleteBuffer) <= 0 { - node.queryNodeTimeSync.UpdateSearchTimeSync(timeRange) - continue + node.QueryNodeDataInit() + node.MessagesPreprocess(node.messageClient.InsertOrDeleteMsg, timeRange) + //fmt.Println("MessagesPreprocess Done") + node.WriterDelete() + node.PreInsertAndDelete() + //fmt.Println("PreInsertAndDelete Done") + node.DoInsertAndDelete() + //fmt.Println("DoInsertAndDelete Done") + node.queryNodeTimeSync.UpdateSearchTimeSync(timeRange) + } } - - node.QueryNodeDataInit() - node.MessagesPreprocess(node.messageClient.InsertOrDeleteMsg, timeRange) - //fmt.Println("MessagesPreprocess Done") - node.WriterDelete() - node.PreInsertAndDelete() - //fmt.Println("PreInsertAndDelete Done") - node.DoInsertAndDelete() - //fmt.Println("DoInsertAndDelete Done") - node.queryNodeTimeSync.UpdateSearchTimeSync(timeRange) } wg.Done() } @@ -328,20 +357,23 @@ func (node *QueryNode) TestInsertDelete(timeRange TimeRange) { func (node *QueryNode) RunSearch(wg *sync.WaitGroup) { for { select { + case <-node.ctx.Done(): + wg.Done() + return case msg := <-node.messageClient.GetSearchChan(): node.messageClient.SearchMsg = node.messageClient.SearchMsg[:0] node.messageClient.SearchMsg = append(node.messageClient.SearchMsg, msg) - fmt.Println("Do Search...") - for { - if node.messageClient.SearchMsg[0].Timestamp < node.queryNodeTimeSync.ServiceTimeSync { - var status = node.Search(node.messageClient.SearchMsg) - if status.ErrorCode != 0 { - fmt.Println("Search Failed") - node.PublishFailedSearchResult() - } - break - } + //for { + //if node.messageClient.SearchMsg[0].Timestamp < node.queryNodeTimeSync.ServiceTimeSync { + var status = node.Search(node.messageClient.SearchMsg) + fmt.Println("Do Search done") + if status.ErrorCode != 0 { + fmt.Println("Search Failed") + node.PublishFailedSearchResult() } + //break + //} + //} default: } } @@ -484,9 +516,9 @@ func (node *QueryNode) PreInsertAndDelete() msgPb.Status { func (node *QueryNode) DoInsertAndDelete() msgPb.Status { var wg sync.WaitGroup // Do insert - for segmentID, records := range node.insertData.insertRecords { + for segmentID := range node.insertData.insertRecords { wg.Add(1) - go node.DoInsert(segmentID, &records, &wg) + go node.DoInsert(segmentID, &wg) } // Do delete @@ -496,16 +528,15 @@ func (node *QueryNode) DoInsertAndDelete() msgPb.Status { } wg.Add(1) var deleteTimestamps = node.deleteData.deleteTimestamps[segmentID] - fmt.Println("Doing delete......") go node.DoDelete(segmentID, &deleteIDs, &deleteTimestamps, &wg) + fmt.Println("Do delete done") } wg.Wait() return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS} } -func (node *QueryNode) DoInsert(segmentID int64, records *[][]byte, wg *sync.WaitGroup) msgPb.Status { - fmt.Println("Doing insert..., len = ", len(node.insertData.insertIDs[segmentID])) +func (node *QueryNode) DoInsert(segmentID int64, wg *sync.WaitGroup) msgPb.Status { var targetSegment, err = node.GetSegmentBySegmentID(segmentID) if err != nil { fmt.Println(err.Error()) @@ -514,10 +545,14 @@ func (node *QueryNode) DoInsert(segmentID int64, records *[][]byte, wg *sync.Wai ids := node.insertData.insertIDs[segmentID] timestamps := node.insertData.insertTimestamps[segmentID] + records := node.insertData.insertRecords[segmentID] offsets := node.insertData.insertOffset[segmentID] - node.msgCounter.InsertCounter += int64(len(ids)) - err = targetSegment.SegmentInsert(offsets, &ids, ×tamps, records) + err = targetSegment.SegmentInsert(offsets, &ids, ×tamps, &records) + fmt.Println("Do insert done, len = ", len(node.insertData.insertIDs[segmentID])) + + node.QueryLog(len(ids)) + if err != nil { fmt.Println(err.Error()) return msgPb.Status{ErrorCode: 1} @@ -556,7 +591,7 @@ func (node *QueryNode) QueryJson2Info(queryJson *string) *QueryInfo { return nil } - fmt.Println(query) + //fmt.Println(query) return &query } @@ -573,18 +608,16 @@ func (node *QueryNode) Search(searchMessages []*msgPb.SearchMsg) msgPb.Status { // TODO: Do not receive batched search requests for _, msg := range searchMessages { var clientId = msg.ClientId - var resultsTmp = make([]SearchResultTmp, 0) - var searchTimestamp = msg.Timestamp - // ServiceTimeSync update by readerTimeSync, which is get from proxy. + // ServiceTimeSync update by TimeSync, which is get from proxy. // Proxy send this timestamp per `conf.Config.Timesync.Interval` milliseconds. // However, timestamp of search request (searchTimestamp) is precision time. // So the ServiceTimeSync is always less than searchTimestamp. // Here, we manually make searchTimestamp's logic time minus `conf.Config.Timesync.Interval` milliseconds. // Which means `searchTimestamp.logicTime = searchTimestamp.logicTime - conf.Config.Timesync.Interval`. - // var logicTimestamp = searchTimestamp << 46 >> 46 - // searchTimestamp = (searchTimestamp >> 18 - uint64(conf.Config.Timesync.Interval)) << 18 + logicTimestamp + var logicTimestamp = searchTimestamp << 46 >> 46 + searchTimestamp = (searchTimestamp>>18-uint64(conf.Config.Timesync.Interval+600))<<18 + logicTimestamp var vector = msg.Records // We now only the first Json is valid. @@ -593,31 +626,55 @@ func (node *QueryNode) Search(searchMessages []*msgPb.SearchMsg) msgPb.Status { // 1. Timestamp check // TODO: return or wait? Or adding graceful time if searchTimestamp > node.queryNodeTimeSync.ServiceTimeSync { - fmt.Println("Invalid query time, timestamp = ", searchTimestamp >> 18, ", SearchTimeSync = ", node.queryNodeTimeSync.ServiceTimeSync >> 18) + fmt.Println("Invalid query time, timestamp = ", searchTimestamp>>18, ", SearchTimeSync = ", node.queryNodeTimeSync.ServiceTimeSync>>18) return msgPb.Status{ErrorCode: 1} } // 2. Get query information from query json query := node.QueryJson2Info(&queryJson) + // 2d slice for receiving multiple queries's results + var resultsTmp = make([][]SearchResultTmp, query.NumQueries) + for i := 0; i < int(query.NumQueries); i++ { + resultsTmp[i] = make([]SearchResultTmp, 0) + } // 3. Do search in all segments for _, segment := range node.SegmentsMap { + if segment.GetRowCount() <= 0 { + // Skip empty segment + continue + } + + //fmt.Println("Search in segment:", segment.SegmentId, ",segment rows:", segment.GetRowCount()) var res, err = segment.SegmentSearch(query, searchTimestamp, vector) if err != nil { fmt.Println(err.Error()) return msgPb.Status{ErrorCode: 1} } - for i := 0; i < len(res.ResultIds); i++ { - resultsTmp = append(resultsTmp, SearchResultTmp{ResultId: res.ResultIds[i], ResultDistance: res.ResultDistances[i]}) + for i := 0; i < int(query.NumQueries); i++ { + for j := i * query.TopK; j < (i+1)*query.TopK; j++ { + resultsTmp[i] = append(resultsTmp[i], SearchResultTmp{ + ResultId: res.ResultIds[j], + ResultDistance: res.ResultDistances[j], + }) + } } } // 4. Reduce results - sort.Slice(resultsTmp, func(i, j int) bool { - return resultsTmp[i].ResultDistance < resultsTmp[j].ResultDistance - }) - resultsTmp = resultsTmp[:query.TopK] + for _, rTmp := range resultsTmp { + sort.Slice(rTmp, func(i, j int) bool { + return rTmp[i].ResultDistance < rTmp[j].ResultDistance + }) + } + + for _, rTmp := range resultsTmp { + if len(rTmp) > query.TopK { + rTmp = rTmp[:query.TopK] + } + } + var entities = msgPb.Entities{ Ids: make([]int64, 0), } @@ -627,18 +684,22 @@ func (node *QueryNode) Search(searchMessages []*msgPb.SearchMsg) msgPb.Status { }, Entities: &entities, Distances: make([]float32, 0), - QueryId: msg.Uid, - ClientId: clientId, + QueryId: uint64(msg.Uid), + ProxyId: clientId, } - for _, res := range resultsTmp { - results.Entities.Ids = append(results.Entities.Ids, res.ResultId) - results.Distances = append(results.Distances, res.ResultDistance) - results.Scores = append(results.Distances, float32(0)) + for _, rTmp := range resultsTmp { + for _, res := range rTmp { + results.Entities.Ids = append(results.Entities.Ids, res.ResultId) + results.Distances = append(results.Distances, res.ResultDistance) + results.Scores = append(results.Distances, float32(0)) + } } - - results.RowNum = int64(len(results.Distances)) + // Send numQueries to RowNum. + results.RowNum = query.NumQueries // 5. publish result to pulsar + //fmt.Println(results.Entities.Ids) + //fmt.Println(results.Distances) node.PublishSearchResult(&results) } diff --git a/reader/read_node/query_node_time.go b/internal/reader/query_node_time.go similarity index 100% rename from reader/read_node/query_node_time.go rename to internal/reader/query_node_time.go diff --git a/reader/read_node/quety_node_test.go b/internal/reader/quety_node_test.go similarity index 100% rename from reader/read_node/quety_node_test.go rename to internal/reader/quety_node_test.go diff --git a/reader/read_node/reader.go b/internal/reader/reader.go similarity index 60% rename from reader/read_node/reader.go rename to internal/reader/reader.go index f9c9927dd5..ba3c11b73d 100644 --- a/reader/read_node/reader.go +++ b/internal/reader/reader.go @@ -2,18 +2,17 @@ package reader import ( "context" - "github.com/czs007/suvlim/reader/message_client" + "github.com/czs007/suvlim/internal/msgclient" "log" "sync" ) -func StartQueryNode(pulsarURL string) { - mc := message_client.MessageClient{} - mc.InitClient(pulsarURL) +func StartQueryNode(ctx context.Context, pulsarURL string) { + mc := msgclient.ReaderMessageClient{} + mc.InitClient(ctx, pulsarURL) mc.ReceiveMessage() - qn := CreateQueryNode(0, 0, &mc) - ctx := context.Background() + qn := CreateQueryNode(ctx, 0, 0, &mc) // Segments Services go qn.SegmentManagementService() @@ -28,7 +27,7 @@ func StartQueryNode(pulsarURL string) { } wg.Add(3) - go qn.RunMetaService(ctx, &wg) + go qn.RunMetaService(&wg) go qn.RunInsertDelete(&wg) go qn.RunSearch(&wg) wg.Wait() diff --git a/internal/reader/reader_test.go b/internal/reader/reader_test.go new file mode 100644 index 0000000000..1882c9a3f9 --- /dev/null +++ b/internal/reader/reader_test.go @@ -0,0 +1,25 @@ +package reader + +import ( + "context" + "github.com/czs007/suvlim/internal/conf" + "strconv" + "testing" + "time" +) + +const ctxTimeInMillisecond = 10 + +// NOTE: start pulsar before test +func TestReader_startQueryNode(t *testing.T) { + conf.LoadConfig("config.yaml") + + d := time.Now().Add(ctxTimeInMillisecond * time.Millisecond) + ctx, _ := context.WithDeadline(context.Background(), d) + + pulsarAddr := "pulsar://" + pulsarAddr += conf.Config.Pulsar.Address + pulsarAddr += ":" + pulsarAddr += strconv.FormatInt(int64(conf.Config.Pulsar.Port), 10) + StartQueryNode(ctx, pulsarAddr) +} diff --git a/reader/read_node/result.go b/internal/reader/result.go similarity index 77% rename from reader/read_node/result.go rename to internal/reader/result.go index 38106539b2..10ce594158 100644 --- a/reader/read_node/result.go +++ b/internal/reader/result.go @@ -2,8 +2,8 @@ package reader import ( "context" - masterPb "github.com/czs007/suvlim/pkg/master/grpc/master" - msgPb "github.com/czs007/suvlim/pkg/master/grpc/message" + masterPb "github.com/czs007/suvlim/internal/proto/master" + msgPb "github.com/czs007/suvlim/internal/proto/message" ) type ResultEntityIds []int64 @@ -16,7 +16,7 @@ type SearchResult struct { func (node *QueryNode) PublishSearchResult(results *msgPb.QueryResult) msgPb.Status { var ctx = context.Background() - node.messageClient.SendResult(ctx, *results, results.ClientId) + node.messageClient.SendResult(ctx, *results, results.ProxyId) return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS} } @@ -31,7 +31,7 @@ func (node *QueryNode) PublishFailedSearchResult() msgPb.Status { var ctx = context.Background() - node.messageClient.SendResult(ctx, results, results.ClientId) + node.messageClient.SendResult(ctx, results, results.ProxyId) return msgPb.Status{ErrorCode: msgPb.ErrorCode_SUCCESS} } diff --git a/reader/read_node/result_test.go b/internal/reader/result_test.go similarity index 51% rename from reader/read_node/result_test.go rename to internal/reader/result_test.go index d82f3559fc..0dcf3136d9 100644 --- a/reader/read_node/result_test.go +++ b/internal/reader/result_test.go @@ -1,21 +1,39 @@ package reader import ( + "context" + "github.com/czs007/suvlim/internal/conf" + "github.com/czs007/suvlim/internal/msgclient" + "strconv" "testing" + "time" - masterPb "github.com/czs007/suvlim/pkg/master/grpc/master" - msgPb "github.com/czs007/suvlim/pkg/master/grpc/message" + masterPb "github.com/czs007/suvlim/internal/proto/master" + msgPb "github.com/czs007/suvlim/internal/proto/message" ) +// NOTE: start pulsar before test func TestResult_PublishSearchResult(t *testing.T) { + conf.LoadConfig("config.yaml") + + d := time.Now().Add(ctxTimeInMillisecond * time.Millisecond) + ctx, _ := context.WithDeadline(context.Background(), d) + + mc := msgclient.ReaderMessageClient{} + pulsarAddr := "pulsar://" + pulsarAddr += conf.Config.Pulsar.Address + pulsarAddr += ":" + pulsarAddr += strconv.FormatInt(int64(conf.Config.Pulsar.Port), 10) + mc.InitClient(ctx, pulsarAddr) + + node := CreateQueryNode(ctx, 0, 0, &mc) + // Construct node, collection, partition and segment - node := NewQueryNode(0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) node.SegmentsMap[0] = segment - // TODO: start pulsar server const N = 10 var entityIDs = msgPb.Entities{ Ids: make([]int64, N), @@ -29,11 +47,26 @@ func TestResult_PublishSearchResult(t *testing.T) { result.Distances = append(result.Distances, float32(i)) } node.PublishSearchResult(&result) + node.Close() } +// NOTE: start pulsar before test func TestResult_PublishFailedSearchResult(t *testing.T) { + conf.LoadConfig("config.yaml") + + d := time.Now().Add(ctxTimeInMillisecond * time.Millisecond) + ctx, _ := context.WithDeadline(context.Background(), d) + + mc := msgclient.ReaderMessageClient{} + pulsarAddr := "pulsar://" + pulsarAddr += conf.Config.Pulsar.Address + pulsarAddr += ":" + pulsarAddr += strconv.FormatInt(int64(conf.Config.Pulsar.Port), 10) + mc.InitClient(ctx, pulsarAddr) + + node := CreateQueryNode(ctx, 0, 0, &mc) + // Construct node, collection, partition and segment - node := NewQueryNode(0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) @@ -41,11 +74,27 @@ func TestResult_PublishFailedSearchResult(t *testing.T) { // TODO: start pulsar server node.PublishFailedSearchResult() + + node.Close() } +// NOTE: start pulsar before test func TestResult_PublicStatistic(t *testing.T) { + conf.LoadConfig("config.yaml") + + d := time.Now().Add(ctxTimeInMillisecond * time.Millisecond) + ctx, _ := context.WithDeadline(context.Background(), d) + + mc := msgclient.ReaderMessageClient{} + pulsarAddr := "pulsar://" + pulsarAddr += conf.Config.Pulsar.Address + pulsarAddr += ":" + pulsarAddr += strconv.FormatInt(int64(conf.Config.Pulsar.Port), 10) + mc.InitClient(ctx, pulsarAddr) + + node := CreateQueryNode(ctx, 0, 0, &mc) + // Construct node, collection, partition and segment - node := NewQueryNode(0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) @@ -66,4 +115,6 @@ func TestResult_PublicStatistic(t *testing.T) { // TODO: start pulsar server node.PublicStatistic(&statisticData) + + node.Close() } diff --git a/reader/read_node/segment.go b/internal/reader/segment.go similarity index 87% rename from reader/read_node/segment.go rename to internal/reader/segment.go index 1dac55875c..ace5cac22c 100644 --- a/reader/read_node/segment.go +++ b/internal/reader/segment.go @@ -14,8 +14,9 @@ package reader import "C" import ( "fmt" - "github.com/czs007/suvlim/errors" - msgPb "github.com/czs007/suvlim/pkg/master/grpc/message" + "github.com/czs007/suvlim/internal/errors" + msgPb "github.com/czs007/suvlim/internal/proto/message" + "github.com/stretchr/testify/assert" "strconv" "unsafe" ) @@ -83,15 +84,16 @@ func (s *Segment) CloseSegment(collection* Collection) error { } // Build index after closing segment - s.SegmentStatus = SegmentIndexing - fmt.Println("Building index...") - s.buildIndex(collection) + //s.SegmentStatus = SegmentIndexing + //fmt.Println("Building index...") + //s.buildIndex(collection) // TODO: remove redundant segment indexed status // Change segment status to indexed - s.SegmentStatus = SegmentIndexed - fmt.Println("Segment closed and indexed") + //s.SegmentStatus = SegmentIndexed + //fmt.Println("Segment closed and indexed") + fmt.Println("Segment closed") return nil } @@ -142,9 +144,13 @@ func (s *Segment) SegmentInsert(offset int64, entityIDs *[]int64, timestamps *[] var numOfRow = len(*entityIDs) var sizeofPerRow = len((*records)[0]) - var rawData = make([]byte, numOfRow*sizeofPerRow) + assert.Equal(nil, numOfRow, len(*records)) + + var rawData = make([]byte, numOfRow * sizeofPerRow) + var copyOffset = 0 for i := 0; i < len(*records); i++ { - copy(rawData, (*records)[i]) + copy(rawData[copyOffset:], (*records)[i]) + copyOffset += sizeofPerRow } var cOffset = C.long(offset) @@ -212,8 +218,8 @@ func (s *Segment) SegmentSearch(query *QueryInfo, timestamp uint64, vectorRecord field_name: C.CString(query.FieldName), } - resultIds := make([]int64, query.TopK) - resultDistances := make([]float32, query.TopK) + resultIds := make([]int64, int64(query.TopK) * query.NumQueries) + resultDistances := make([]float32, int64(query.TopK) * query.NumQueries) var cTimestamp = C.ulong(timestamp) var cResultIds = (*C.long)(&resultIds[0]) @@ -236,7 +242,7 @@ func (s *Segment) SegmentSearch(query *QueryInfo, timestamp uint64, vectorRecord return nil, errors.New("Search failed, error code = " + strconv.Itoa(int(status))) } - fmt.Println("Search Result---- Ids =", resultIds, ", Distances =", resultDistances) + //fmt.Println("Search Result---- Ids =", resultIds, ", Distances =", resultDistances) return &SearchResult{ResultIds: resultIds, ResultDistances: resultDistances}, nil } diff --git a/reader/read_node/segment_service.go b/internal/reader/segment_service.go similarity index 82% rename from reader/read_node/segment_service.go rename to internal/reader/segment_service.go index 75380be6ae..80985941ab 100644 --- a/reader/read_node/segment_service.go +++ b/internal/reader/segment_service.go @@ -2,8 +2,8 @@ package reader import ( "fmt" - masterPb "github.com/czs007/suvlim/pkg/master/grpc/master" - msgPb "github.com/czs007/suvlim/pkg/master/grpc/message" + masterPb "github.com/czs007/suvlim/internal/proto/master" + msgPb "github.com/czs007/suvlim/internal/proto/message" "log" "strconv" "time" @@ -19,11 +19,10 @@ func (node *QueryNode) SegmentsManagement() { for _, partition := range collection.Partitions { for _, segment := range partition.Segments { if segment.SegmentStatus != SegmentOpened { - log.Println("Segment have been closed") continue } - fmt.Println("timeNow = ", timeNow, "SegmentCloseTime = ", segment.SegmentCloseTime) + // fmt.Println("timeNow = ", timeNow, "SegmentCloseTime = ", segment.SegmentCloseTime) if timeNow >= segment.SegmentCloseTime { go segment.CloseSegment(collection) } @@ -36,8 +35,13 @@ func (node *QueryNode) SegmentManagementService() { sleepMillisecondTime := 1000 fmt.Println("do segments management in ", strconv.Itoa(sleepMillisecondTime), "ms") for { - time.Sleep(time.Duration(sleepMillisecondTime) * time.Millisecond) - node.SegmentsManagement() + select { + case <-node.ctx.Done(): + return + default: + time.Sleep(time.Duration(sleepMillisecondTime) * time.Millisecond) + node.SegmentsManagement() + } } } @@ -92,7 +96,12 @@ func (node *QueryNode) SegmentStatisticService() { sleepMillisecondTime := 1000 fmt.Println("do segments statistic in ", strconv.Itoa(sleepMillisecondTime), "ms") for { - time.Sleep(time.Duration(sleepMillisecondTime) * time.Millisecond) - node.SegmentStatistic(sleepMillisecondTime) + select { + case <-node.ctx.Done(): + return + default: + time.Sleep(time.Duration(sleepMillisecondTime) * time.Millisecond) + node.SegmentStatistic(sleepMillisecondTime) + } } } diff --git a/reader/read_node/segment_service_test.go b/internal/reader/segment_service_test.go similarity index 51% rename from reader/read_node/segment_service_test.go rename to internal/reader/segment_service_test.go index ae0590a867..d79bd9d9b9 100644 --- a/reader/read_node/segment_service_test.go +++ b/internal/reader/segment_service_test.go @@ -1,53 +1,93 @@ package reader import ( + "context" + "github.com/czs007/suvlim/internal/conf" + "github.com/czs007/suvlim/internal/msgclient" + "strconv" "testing" + "time" ) func TestSegmentManagement_SegmentsManagement(t *testing.T) { // Construct node, collection, partition and segment - node := NewQueryNode(0, 0) + ctx := context.Background() + node := NewQueryNode(ctx, 0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) node.SegmentsMap[0] = segment - // TODO: fix segment management node.SegmentsManagement() + + node.Close() } func TestSegmentManagement_SegmentService(t *testing.T) { + d := time.Now().Add(ctxTimeInMillisecond * time.Millisecond) + ctx, _ := context.WithDeadline(context.Background(), d) + // Construct node, collection, partition and segment - node := NewQueryNode(0, 0) + node := NewQueryNode(ctx, 0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) node.SegmentsMap[0] = segment - // TODO: fix segment service node.SegmentManagementService() + + node.Close() } +// NOTE: start pulsar before test func TestSegmentManagement_SegmentStatistic(t *testing.T) { + conf.LoadConfig("config.yaml") + ctx, _ := context.WithCancel(context.Background()) + + mc := msgclient.ReaderMessageClient{} + pulsarAddr := "pulsar://" + pulsarAddr += conf.Config.Pulsar.Address + pulsarAddr += ":" + pulsarAddr += strconv.FormatInt(int64(conf.Config.Pulsar.Port), 10) + mc.InitClient(ctx, pulsarAddr) + + mc.ReceiveMessage() + node := CreateQueryNode(ctx, 0, 0, &mc) + // Construct node, collection, partition and segment - node := NewQueryNode(0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) node.SegmentsMap[0] = segment - // TODO: start pulsar server node.SegmentStatistic(1000) + + node.Close() } +// NOTE: start pulsar before test func TestSegmentManagement_SegmentStatisticService(t *testing.T) { + conf.LoadConfig("config.yaml") + d := time.Now().Add(ctxTimeInMillisecond * time.Millisecond) + ctx, _ := context.WithDeadline(context.Background(), d) + + mc := msgclient.ReaderMessageClient{} + pulsarAddr := "pulsar://" + pulsarAddr += conf.Config.Pulsar.Address + pulsarAddr += ":" + pulsarAddr += strconv.FormatInt(int64(conf.Config.Pulsar.Port), 10) + mc.InitClient(ctx, pulsarAddr) + + mc.ReceiveMessage() + node := CreateQueryNode(ctx, 0, 0, &mc) + // Construct node, collection, partition and segment - node := NewQueryNode(0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) node.SegmentsMap[0] = segment - // TODO: start pulsar server node.SegmentStatisticService() + + node.Close() } diff --git a/reader/read_node/segment_test.go b/internal/reader/segment_test.go similarity index 89% rename from reader/read_node/segment_test.go rename to internal/reader/segment_test.go index 3d83c99d67..6428b0164e 100644 --- a/reader/read_node/segment_test.go +++ b/internal/reader/segment_test.go @@ -1,18 +1,20 @@ package reader import ( + "context" "encoding/binary" "fmt" "math" "testing" - msgPb "github.com/czs007/suvlim/pkg/master/grpc/message" + msgPb "github.com/czs007/suvlim/internal/proto/message" "github.com/stretchr/testify/assert" ) func TestSegment_ConstructorAndDestructor(t *testing.T) { // 1. Construct node, collection, partition and segment - node := NewQueryNode(0, 0) + ctx := context.Background() + node := NewQueryNode(ctx, 0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) @@ -21,11 +23,14 @@ func TestSegment_ConstructorAndDestructor(t *testing.T) { partition.DeleteSegment(segment) collection.DeletePartition(partition) node.DeleteCollection(collection) + + node.Close() } func TestSegment_SegmentInsert(t *testing.T) { // 1. Construct node, collection, partition and segment - node := NewQueryNode(0, 0) + ctx := context.Background() + node := NewQueryNode(ctx, 0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) @@ -66,11 +71,14 @@ func TestSegment_SegmentInsert(t *testing.T) { partition.DeleteSegment(segment) collection.DeletePartition(partition) node.DeleteCollection(collection) + + node.Close() } func TestSegment_SegmentDelete(t *testing.T) { + ctx := context.Background() // 1. Construct node, collection, partition and segment - node := NewQueryNode(0, 0) + node := NewQueryNode(ctx, 0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) @@ -91,11 +99,14 @@ func TestSegment_SegmentDelete(t *testing.T) { partition.DeleteSegment(segment) collection.DeletePartition(partition) node.DeleteCollection(collection) + + node.Close() } func TestSegment_SegmentSearch(t *testing.T) { + ctx := context.Background() // 1. Construct node, collection, partition and segment - node := NewQueryNode(0, 0) + node := NewQueryNode(ctx, 0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) @@ -152,11 +163,14 @@ func TestSegment_SegmentSearch(t *testing.T) { partition.DeleteSegment(segment) collection.DeletePartition(partition) node.DeleteCollection(collection) + + node.Close() } func TestSegment_SegmentPreInsert(t *testing.T) { + ctx := context.Background() // 1. Construct node, collection, partition and segment - node := NewQueryNode(0, 0) + node := NewQueryNode(ctx, 0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) @@ -169,11 +183,14 @@ func TestSegment_SegmentPreInsert(t *testing.T) { partition.DeleteSegment(segment) collection.DeletePartition(partition) node.DeleteCollection(collection) + + node.Close() } func TestSegment_SegmentPreDelete(t *testing.T) { + ctx := context.Background() // 1. Construct node, collection, partition and segment - node := NewQueryNode(0, 0) + node := NewQueryNode(ctx, 0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) @@ -186,13 +203,16 @@ func TestSegment_SegmentPreDelete(t *testing.T) { partition.DeleteSegment(segment) collection.DeletePartition(partition) node.DeleteCollection(collection) + + node.Close() } // Segment util functions test //////////////////////////////////////////////////////////////////////////// func TestSegment_GetStatus(t *testing.T) { + ctx := context.Background() // 1. Construct node, collection, partition and segment - node := NewQueryNode(0, 0) + node := NewQueryNode(ctx, 0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) @@ -205,11 +225,14 @@ func TestSegment_GetStatus(t *testing.T) { partition.DeleteSegment(segment) collection.DeletePartition(partition) node.DeleteCollection(collection) + + node.Close() } func TestSegment_Close(t *testing.T) { + ctx := context.Background() // 1. Construct node, collection, partition and segment - node := NewQueryNode(0, 0) + node := NewQueryNode(ctx, 0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) @@ -222,11 +245,14 @@ func TestSegment_Close(t *testing.T) { partition.DeleteSegment(segment) collection.DeletePartition(partition) node.DeleteCollection(collection) + + node.Close() } func TestSegment_GetRowCount(t *testing.T) { + ctx := context.Background() // 1. Construct node, collection, partition and segment - node := NewQueryNode(0, 0) + node := NewQueryNode(ctx, 0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) @@ -271,11 +297,14 @@ func TestSegment_GetRowCount(t *testing.T) { partition.DeleteSegment(segment) collection.DeletePartition(partition) node.DeleteCollection(collection) + + node.Close() } func TestSegment_GetDeletedCount(t *testing.T) { + ctx := context.Background() // 1. Construct node, collection, partition and segment - node := NewQueryNode(0, 0) + node := NewQueryNode(ctx, 0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) @@ -301,11 +330,14 @@ func TestSegment_GetDeletedCount(t *testing.T) { partition.DeleteSegment(segment) collection.DeletePartition(partition) node.DeleteCollection(collection) + + node.Close() } func TestSegment_GetMemSize(t *testing.T) { + ctx := context.Background() // 1. Construct node, collection, partition and segment - node := NewQueryNode(0, 0) + node := NewQueryNode(ctx, 0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) @@ -344,22 +376,28 @@ func TestSegment_GetMemSize(t *testing.T) { // 6. Get memory usage in bytes var memSize = segment.GetMemSize() - assert.Equal(t, memSize, uint64(1048714)) + assert.Equal(t, memSize, uint64(2785280)) // 7. Destruct collection, partition and segment partition.DeleteSegment(segment) collection.DeletePartition(partition) node.DeleteCollection(collection) + + node.Close() } func TestSegment_RealSchemaTest(t *testing.T) { + ctx := context.Background() // 1. Construct node, collection, partition and segment //var schemaString = "id: 6873737669791618215\nname: \"collection0\"\nschema: \u003c\n " + // "field_metas: \u003c\n field_name: \"age\"\n type: INT32\n dim: 1\n \u003e\n " + // "field_metas: \u003c\n field_name: \"field_1\"\n type: VECTOR_FLOAT\n dim: 16\n \u003e\n" + // "\u003e\ncreate_time: 1600416765\nsegment_ids: 6873737669791618215\npartition_tags: \"default\"\n" - var schemaString = "id: 6875229265736357360\nname: \"collection0\"\nschema: \u003c\n field_metas: \u003c\n field_name: \"field_3\"\n type: INT32\n \u003e\n field_metas: \u003c\n field_name: \"field_vec\"\n type: VECTOR_FLOAT\n \u003e\n\u003e\ncreate_time: 1600764055\nsegment_ids: 6875229265736357360\npartition_tags: \"default\"\n" - node := NewQueryNode(0, 0) + var schemaString = "id: 6875229265736357360\nname: \"collection0\"\nschema: \u003c\n " + + "field_metas: \u003c\n field_name: \"field_3\"\n type: INT32\n dim: 1\n \u003e\n " + + "field_metas: \u003c\n field_name: \"field_vec\"\n type: VECTOR_FLOAT\n dim: 16\n " + + "\u003e\n\u003e\ncreate_time: 1600764055\nsegment_ids: 6875229265736357360\npartition_tags: \"default\"\n" + node := NewQueryNode(ctx, 0, 0) var collection = node.NewCollection(0, "collection0", schemaString) var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) @@ -400,4 +438,6 @@ func TestSegment_RealSchemaTest(t *testing.T) { partition.DeleteSegment(segment) collection.DeletePartition(partition) node.DeleteCollection(collection) + + node.Close() } diff --git a/reader/read_node/util_functions.go b/internal/reader/util_functions.go similarity index 59% rename from reader/read_node/util_functions.go rename to internal/reader/util_functions.go index c9071d4e04..40c2c456c6 100644 --- a/reader/read_node/util_functions.go +++ b/internal/reader/util_functions.go @@ -1,8 +1,13 @@ package reader import ( + "encoding/json" "errors" + "fmt" + log "github.com/apache/pulsar/pulsar-client-go/logutil" + "os" "strconv" + "time" ) // Function `GetSegmentByEntityId` should return entityIDs, timestamps and segmentIDs @@ -68,3 +73,54 @@ func (c *Collection) GetPartitionByName(partitionName string) (partition *Partit return nil // TODO: remove from c.Partitions } + +func (node *QueryNode) QueryLog(length int) { + node.msgCounter.InsertCounter += int64(length) + timeNow := time.Now() + duration := timeNow.Sub(node.msgCounter.InsertTime) + speed := float64(length) / duration.Seconds() + + insertLog := InsertLog{ + MsgLength: length, + DurationInMilliseconds: duration.Milliseconds(), + InsertTime: timeNow, + NumSince: node.msgCounter.InsertCounter, + Speed: speed, + } + + node.InsertLogs = append(node.InsertLogs, insertLog) + node.msgCounter.InsertTime = timeNow +} + +func (node *QueryNode) WriteQueryLog() { + f, err := os.OpenFile("/tmp/query_node_insert.txt", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) + if err != nil { + log.Fatal(err) + } + + // write logs + for _, insertLog := range node.InsertLogs { + insertLogJson, err := json.Marshal(&insertLog) + if err != nil { + log.Fatal(err) + } + + writeString := string(insertLogJson) + "\n" + fmt.Println(writeString) + + _, err2 := f.WriteString(writeString) + if err2 != nil { + log.Fatal(err2) + } + } + + // reset InsertLogs buffer + node.InsertLogs = make([]InsertLog, 0) + + err = f.Close() + if err != nil { + log.Fatal(err) + } + + fmt.Println("write log done") +} diff --git a/reader/read_node/util_functions_test.go b/internal/reader/util_functions_test.go similarity index 52% rename from reader/read_node/util_functions_test.go rename to internal/reader/util_functions_test.go index 7f0ae295e4..0d9fe62315 100644 --- a/reader/read_node/util_functions_test.go +++ b/internal/reader/util_functions_test.go @@ -1,18 +1,42 @@ package reader import ( + "context" + "github.com/czs007/suvlim/internal/conf" + "github.com/czs007/suvlim/internal/msgclient" + "strconv" "testing" + "time" "github.com/stretchr/testify/assert" ) +// NOTE: start pulsar before test func TestUtilFunctions_GetKey2Segments(t *testing.T) { - // TODO: Add GetKey2Segments test + conf.LoadConfig("config.yaml") + d := time.Now().Add(ctxTimeInMillisecond * time.Millisecond) + ctx, _ := context.WithDeadline(context.Background(), d) + + mc := msgclient.ReaderMessageClient{} + pulsarAddr := "pulsar://" + pulsarAddr += conf.Config.Pulsar.Address + pulsarAddr += ":" + pulsarAddr += strconv.FormatInt(int64(conf.Config.Pulsar.Port), 10) + mc.InitClient(ctx, pulsarAddr) + + mc.ReceiveMessage() + node := CreateQueryNode(ctx, 0, 0, &mc) + + node.messageClient.PrepareKey2SegmentMsg() + var _, _, _ = node.GetKey2Segments() + + node.Close() } func TestUtilFunctions_GetCollectionByCollectionName(t *testing.T) { + ctx := context.Background() // 1. Construct node, and collections - node := NewQueryNode(0, 0) + node := NewQueryNode(ctx, 0, 0) var _ = node.NewCollection(0, "collection0", "") // 2. Get collection by collectionName @@ -21,12 +45,15 @@ func TestUtilFunctions_GetCollectionByCollectionName(t *testing.T) { assert.Equal(t, c0.CollectionName, "collection0") c0 = node.GetCollectionByID(0) assert.NotNil(t, c0) - assert.Equal(t, c0.CollectionID, 0) + assert.Equal(t, c0.CollectionID, uint64(0)) + + node.Close() } func TestUtilFunctions_GetSegmentBySegmentID(t *testing.T) { + ctx := context.Background() // 1. Construct node, collection, partition and segment - node := NewQueryNode(0, 0) + node := NewQueryNode(ctx, 0, 0) var collection = node.NewCollection(0, "collection0", "") var partition = collection.NewPartition("partition0") var segment = partition.NewSegment(0) @@ -36,4 +63,6 @@ func TestUtilFunctions_GetSegmentBySegmentID(t *testing.T) { var s0, err = node.GetSegmentBySegmentID(0) assert.NoError(t, err) assert.Equal(t, s0.SegmentId, int64(0)) + + node.Close() } diff --git a/storage/internal/S3/S3_test.go b/internal/storage/internal/S3/S3_test.go similarity index 98% rename from storage/internal/S3/S3_test.go rename to internal/storage/internal/S3/S3_test.go index c8b82f6213..42af73968a 100644 --- a/storage/internal/S3/S3_test.go +++ b/internal/storage/internal/S3/S3_test.go @@ -2,7 +2,7 @@ package S3_driver_test import ( "context" - s3_driver "github.com/czs007/suvlim/storage/internal/S3" + s3_driver "github.com/czs007/suvlim/internal/storage/internal/S3" "github.com/stretchr/testify/assert" "testing" ) diff --git a/storage/internal/S3/s3_engine.go b/internal/storage/internal/S3/s3_engine.go similarity index 96% rename from storage/internal/S3/s3_engine.go rename to internal/storage/internal/S3/s3_engine.go index 3e7f762277..12b3cf6445 100644 --- a/storage/internal/S3/s3_engine.go +++ b/internal/storage/internal/S3/s3_engine.go @@ -6,12 +6,12 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" -// "github.com/aws/aws-sdk-go/service/s3/s3manager" - . "github.com/czs007/suvlim/storage/pkg/types" + "github.com/czs007/suvlim/internal/conf" + . "github.com/czs007/suvlim/internal/storage/type" "io" ) -var bucketName = "zilliz-hz" +var bucketName = conf.Config.Writer.Bucket type S3Store struct { client *s3.S3 diff --git a/storage/internal/S3/s3_store.go b/internal/storage/internal/S3/s3_store.go similarity index 98% rename from storage/internal/S3/s3_store.go rename to internal/storage/internal/S3/s3_store.go index 9f340ecaf7..e1845d8ed6 100644 --- a/storage/internal/S3/s3_store.go +++ b/internal/storage/internal/S3/s3_store.go @@ -4,8 +4,8 @@ import ( "context" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/czs007/suvlim/storage/internal/minio/codec" - . "github.com/czs007/suvlim/storage/pkg/types" + "github.com/czs007/suvlim/internal/storage/internal/minio/codec" + . "github.com/czs007/suvlim/internal/storage/type" ) type S3Driver struct { diff --git a/storage/internal/minio/codec/codec.go b/internal/storage/internal/minio/codec/codec.go similarity index 100% rename from storage/internal/minio/codec/codec.go rename to internal/storage/internal/minio/codec/codec.go diff --git a/storage/internal/minio/minio_store.go b/internal/storage/internal/minio/minio_store.go similarity index 97% rename from storage/internal/minio/minio_store.go rename to internal/storage/internal/minio/minio_store.go index 8319f3aa31..193bd1ec9f 100644 --- a/storage/internal/minio/minio_store.go +++ b/internal/storage/internal/minio/minio_store.go @@ -2,9 +2,9 @@ package minio_driver import ( "context" - "github.com/czs007/suvlim/storage/internal/minio/codec" - . "github.com/czs007/suvlim/storage/internal/minio/codec" - . "github.com/czs007/suvlim/storage/pkg/types" + "github.com/czs007/suvlim/internal/storage/internal/minio/codec" + . "github.com/czs007/suvlim/internal/storage/internal/minio/codec" + . "github.com/czs007/suvlim/internal/storage/type" "github.com/minio/minio-go/v7" "github.com/minio/minio-go/v7/pkg/credentials" ) diff --git a/storage/internal/minio/minio_storeEngine.go b/internal/storage/internal/minio/minio_storeEngine.go similarity index 95% rename from storage/internal/minio/minio_storeEngine.go rename to internal/storage/internal/minio/minio_storeEngine.go index 0a62eb8dd4..5a3b8c4fc8 100644 --- a/storage/internal/minio/minio_storeEngine.go +++ b/internal/storage/internal/minio/minio_storeEngine.go @@ -3,12 +3,13 @@ package minio_driver import ( "bytes" "context" + "github.com/czs007/suvlim/internal/conf" + . "github.com/czs007/suvlim/internal/storage/type" "github.com/minio/minio-go/v7" "io" - . "github.com/czs007/suvlim/storage/pkg/types" ) -var bucketName = "zilliz" +var bucketName = conf.Config.Writer.Bucket type minioStore struct { client *minio.Client diff --git a/storage/internal/minio/minio_test.go b/internal/storage/internal/minio/minio_test.go similarity index 98% rename from storage/internal/minio/minio_test.go rename to internal/storage/internal/minio/minio_test.go index 66f23b64fb..dff1d42127 100644 --- a/storage/internal/minio/minio_test.go +++ b/internal/storage/internal/minio/minio_test.go @@ -2,7 +2,7 @@ package minio_driver_test import ( "context" - minio_driver "github.com/czs007/suvlim/storage/internal/minio" + minio_driver "github.com/czs007/suvlim/internal/storage/internal/minio" "github.com/stretchr/testify/assert" "testing" ) diff --git a/storage/internal/tikv/codec/codec.go b/internal/storage/internal/tikv/codec/codec.go similarity index 100% rename from storage/internal/tikv/codec/codec.go rename to internal/storage/internal/tikv/codec/codec.go diff --git a/storage/internal/tikv/tikv_store.go b/internal/storage/internal/tikv/tikv_store.go similarity index 98% rename from storage/internal/tikv/tikv_store.go rename to internal/storage/internal/tikv/tikv_store.go index 84df3eecc8..0368782658 100644 --- a/storage/internal/tikv/tikv_store.go +++ b/internal/storage/internal/tikv/tikv_store.go @@ -3,9 +3,9 @@ package tikv_driver import ( "context" "errors" - "github.com/czs007/suvlim/conf" - . "github.com/czs007/suvlim/storage/internal/tikv/codec" - . "github.com/czs007/suvlim/storage/pkg/types" + "github.com/czs007/suvlim/internal/conf" + . "github.com/czs007/suvlim/internal/storage/internal/tikv/codec" + . "github.com/czs007/suvlim/internal/storage/type" "github.com/tikv/client-go/config" "github.com/tikv/client-go/rawkv" "strconv" @@ -87,6 +87,7 @@ type TikvStore struct { } func NewTikvStore(ctx context.Context) (*TikvStore, error) { + conf.LoadConfig("config.yaml") var pdAddress0 = conf.Config.Storage.Address + ":" + strconv.FormatInt(int64(conf.Config.Storage.Port), 10) pdAddrs := []string{pdAddress0} conf := config.Default() diff --git a/storage/internal/tikv/tikv_test.go b/internal/storage/internal/tikv/tikv_test.go similarity index 94% rename from storage/internal/tikv/tikv_test.go rename to internal/storage/internal/tikv/tikv_test.go index c8d82ac9ca..1307038f8c 100644 --- a/storage/internal/tikv/tikv_test.go +++ b/internal/storage/internal/tikv/tikv_test.go @@ -4,9 +4,10 @@ import ( "bytes" "context" "fmt" - . "github.com/czs007/suvlim/storage/internal/tikv/codec" - . "github.com/czs007/suvlim/storage/pkg/types" + . "github.com/czs007/suvlim/internal/storage/internal/tikv/codec" + . "github.com/czs007/suvlim/internal/storage/type" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "math" "os" "sort" @@ -32,7 +33,7 @@ func TestTikvEngine_Prefix(t *testing.T) { // Put some key with same prefix key := prefix err := engine.Put(ctx, key, value) - assert.Nil(t, err) + require.Nil(t, err) key = EncodeKey(prefix, 0, "") err = engine.Put(ctx, key, value) assert.Nil(t, err) @@ -121,7 +122,7 @@ func TestTikvStore_BatchRow(t *testing.T) { size := 0 var testKeys []Key var testValues []Value - var segment = "test" + var segments []string var timestamps []Timestamp for i := 0; size/store.engine.conf.Raw.MaxBatchPutSize < 1; i++ { key := fmt.Sprint("key", i) @@ -130,6 +131,7 @@ func TestTikvStore_BatchRow(t *testing.T) { value := fmt.Sprint("value", i) size += len(value) testValues = append(testValues, []byte(value)) + segments = append(segments, "test") v, err := store.GetRow(ctx, Key(key), math.MaxUint64) assert.Nil(t, v) assert.Nil(t, err) @@ -139,7 +141,7 @@ func TestTikvStore_BatchRow(t *testing.T) { for range testKeys { timestamps = append(timestamps, 1) } - err := store.PutRows(ctx, testKeys, testValues, segment, timestamps) + err := store.PutRows(ctx, testKeys, testValues, segments, timestamps) assert.Nil(t, err) // Batch get rows @@ -155,7 +157,10 @@ func TestTikvStore_BatchRow(t *testing.T) { } // Delete all test rows - err = store.DeleteRows(ctx, testKeys, math.MaxUint64) + for i, _ := range timestamps { + timestamps[i] = math.MaxUint64 + } + err = store.DeleteRows(ctx, testKeys, timestamps) assert.Nil(t, err) // Ensure all test row is deleted for i, _ := range timestamps { diff --git a/storage/pkg/storage.go b/internal/storage/storage.go similarity index 51% rename from storage/pkg/storage.go rename to internal/storage/storage.go index 7d3b2eced2..08059a29ee 100644 --- a/storage/pkg/storage.go +++ b/internal/storage/storage.go @@ -3,30 +3,30 @@ package storage import ( "context" "errors" - S3Driver "github.com/czs007/suvlim/storage/internal/S3" - minIODriver "github.com/czs007/suvlim/storage/internal/minio" - tikvDriver "github.com/czs007/suvlim/storage/internal/tikv" - "github.com/czs007/suvlim/storage/pkg/types" + S3Driver "github.com/czs007/suvlim/internal/storage/internal/S3" + minIODriver "github.com/czs007/suvlim/internal/storage/internal/minio" + tikvDriver "github.com/czs007/suvlim/internal/storage/internal/tikv" + "github.com/czs007/suvlim/internal/storage/type" ) -func NewStore(ctx context.Context, driver types.DriverType) (types.Store, error) { +func NewStore(ctx context.Context, driver storagetype.DriverType) (storagetype.Store, error) { var err error - var store types.Store + var store storagetype.Store switch driver{ - case types.TIKVDriver: + case storagetype.TIKVDriver: store, err = tikvDriver.NewTikvStore(ctx) if err != nil { panic(err.Error()) } return store, nil - case types.MinIODriver: + case storagetype.MinIODriver: store, err = minIODriver.NewMinioDriver(ctx) if err != nil { //panic(err.Error()) return nil, err } return store, nil - case types.S3DRIVER: + case storagetype.S3DRIVER: store , err = S3Driver.NewS3Driver(ctx) if err != nil { //panic(err.Error()) diff --git a/storage/pkg/types/types.go b/internal/storage/type/storagetype.go similarity index 99% rename from storage/pkg/types/types.go rename to internal/storage/type/storagetype.go index f0875b4bfe..55afd08211 100644 --- a/storage/pkg/types/types.go +++ b/internal/storage/type/storagetype.go @@ -1,4 +1,4 @@ -package types +package storagetype import ( "context" diff --git a/timesync/readertimesync.go b/internal/timesync/timesync.go similarity index 59% rename from timesync/readertimesync.go rename to internal/timesync/timesync.go index 4c6201f205..55ec705253 100644 --- a/timesync/readertimesync.go +++ b/internal/timesync/timesync.go @@ -1,21 +1,40 @@ -package readertimesync +package timesync import ( "context" + "encoding/json" "fmt" - "github.com/apache/pulsar-client-go/pulsar" - "github.com/czs007/suvlim/conf" - pb "github.com/czs007/suvlim/pkg/master/grpc/message" - "github.com/golang/protobuf/proto" "log" + "os" "sort" "strconv" "sync" + "time" + + "github.com/apache/pulsar-client-go/pulsar" + "github.com/czs007/suvlim/internal/conf" + pb "github.com/czs007/suvlim/internal/proto/message" + "github.com/golang/protobuf/proto" +) + +type InsertLog struct { + MsgLength int + DurationInMilliseconds int64 + InsertTime time.Time + NumSince int64 + Speed float64 +} + +type TimeSyncRole int + +const ( + Reader TimeSyncRole = 0 + Writer TimeSyncRole = 1 ) const ReadStopFlagEnd int64 = 0 -type ReaderTimeSync interface { +type TimeSync interface { Start() error Close() TimeSync() <-chan TimeSyncMsg @@ -28,9 +47,9 @@ type TimeSyncMsg struct { NumRecorders int64 } -type ReaderTimeSyncOption func(*ReaderTimeSyncCfg) +type TimeSyncOption func(*TimeSyncCfg) -type ReaderTimeSyncCfg struct { +type TimeSyncCfg struct { pulsarClient pulsar.Client timeSyncConsumer pulsar.Consumer @@ -47,8 +66,9 @@ type ReaderTimeSyncCfg struct { revTimesyncFromReader map[uint64]int - ctx context.Context - cancel context.CancelFunc + ctx context.Context + InsertLogs []InsertLog + RoleType TimeSyncRole } /* @@ -62,15 +82,16 @@ func toMillisecond(ts *pb.TimeSyncMsg) int { return int(ts.GetTimestamp() >> 18) } -func NewReaderTimeSync( +func NewTimeSync( + ctx context.Context, timeSyncTopic string, timeSyncSubName string, readTopics []string, readSubName string, proxyIdList []int64, readStopFlagClientId int64, - opts ...ReaderTimeSyncOption, -) (ReaderTimeSync, error) { + opts ...TimeSyncOption, +) (TimeSync, error) { pulsarAddr := "pulsar://" pulsarAddr += conf.Config.Pulsar.Address pulsarAddr += ":" @@ -89,7 +110,7 @@ func NewReaderTimeSync( return nil, fmt.Errorf("there are two proxies have the same id = %d", proxyIdList[i]) } } - r := &ReaderTimeSyncCfg{ + r := &TimeSyncCfg{ interval: interval, proxyIdList: proxyIdList, } @@ -113,9 +134,19 @@ func NewReaderTimeSync( r.timesyncMsgChan = make(chan TimeSyncMsg, len(readTopics)*r.readerQueueSize) r.insertOrDeleteChan = make(chan *pb.InsertOrDeleteMsg, len(readTopics)*r.readerQueueSize) r.revTimesyncFromReader = make(map[uint64]int) - r.ctx, r.cancel = context.WithCancel(context.Background()) + r.ctx = ctx + + var client pulsar.Client + var err error + if conf.Config.Pulsar.Authentication { + client, err = pulsar.NewClient(pulsar.ClientOptions{ + URL: pulsarAddr, + Authentication: pulsar.NewAuthenticationToken(conf.Config.Pulsar.Token), + }) + } else { + client, err = pulsar.NewClient(pulsar.ClientOptions{URL: pulsarAddr}) + } - client, err := pulsar.NewClient(pulsar.ClientOptions{URL: pulsarAddr}) if err != nil { return nil, fmt.Errorf("connect pulsar failed, %v", err) } @@ -155,39 +186,46 @@ func NewReaderTimeSync( return r, nil } -func (r *ReaderTimeSyncCfg) Close() { - r.cancel() - r.timeSyncConsumer.Close() - r.readerConsumer.Close() - for i := 0; i < len(r.readerProducer); i++ { - r.readerProducer[i].Close() +func (r *TimeSyncCfg) Close() { + if r.timeSyncConsumer != nil { + r.timeSyncConsumer.Close() + } + if r.readerConsumer != nil { + r.readerConsumer.Close() + } + for i := 0; i < len(r.readerProducer); i++ { + if r.readerProducer[i] != nil { + r.readerProducer[i].Close() + } + } + if r.pulsarClient != nil { + r.pulsarClient.Close() } - r.pulsarClient.Close() } -func (r *ReaderTimeSyncCfg) Start() error { +func (r *TimeSyncCfg) Start() error { go r.startReadTopics() go r.startTimeSync() return r.ctx.Err() } -func (r *ReaderTimeSyncCfg) InsertOrDelete() <-chan *pb.InsertOrDeleteMsg { +func (r *TimeSyncCfg) InsertOrDelete() <-chan *pb.InsertOrDeleteMsg { return r.insertOrDeleteChan } -func (r *ReaderTimeSyncCfg) TimeSync() <-chan TimeSyncMsg { +func (r *TimeSyncCfg) TimeSync() <-chan TimeSyncMsg { return r.timesyncMsgChan } -func (r *ReaderTimeSyncCfg) TimeSyncChanLen() int { +func (r *TimeSyncCfg) TimeSyncChanLen() int { return len(r.timesyncMsgChan) } -func (r *ReaderTimeSyncCfg) IsInsertDeleteChanFull() bool { +func (r *TimeSyncCfg) IsInsertDeleteChanFull() bool { return len(r.insertOrDeleteChan) == len(r.readerProducer)*r.readerQueueSize } -func (r *ReaderTimeSyncCfg) alignTimeSync(ts []*pb.TimeSyncMsg) []*pb.TimeSyncMsg { +func (r *TimeSyncCfg) alignTimeSync(ts []*pb.TimeSyncMsg) []*pb.TimeSyncMsg { if len(r.proxyIdList) > 1 { if len(ts) > 1 { for i := 1; i < len(r.proxyIdList); i++ { @@ -216,7 +254,7 @@ func (r *ReaderTimeSyncCfg) alignTimeSync(ts []*pb.TimeSyncMsg) []*pb.TimeSyncMs return ts } -func (r *ReaderTimeSyncCfg) readTimeSync(ctx context.Context, ts []*pb.TimeSyncMsg, n int) ([]*pb.TimeSyncMsg, error) { +func (r *TimeSyncCfg) readTimeSync(ctx context.Context, ts []*pb.TimeSyncMsg, n int) ([]*pb.TimeSyncMsg, error) { for i := 0; i < n; i++ { select { case <-ctx.Done(): @@ -239,7 +277,7 @@ func (r *ReaderTimeSyncCfg) readTimeSync(ctx context.Context, ts []*pb.TimeSyncM return ts, nil } -func (r *ReaderTimeSyncCfg) sendEOFMsg(ctx context.Context, msg *pulsar.ProducerMessage, index int, wg *sync.WaitGroup) { +func (r *TimeSyncCfg) sendEOFMsg(ctx context.Context, msg *pulsar.ProducerMessage, index int, wg *sync.WaitGroup) { if _, err := r.readerProducer[index].Send(ctx, msg); err != nil { //TODO, log error log.Printf("Send timesync flag error %v", err) @@ -247,55 +285,107 @@ func (r *ReaderTimeSyncCfg) sendEOFMsg(ctx context.Context, msg *pulsar.Producer wg.Done() } -func (r *ReaderTimeSyncCfg) startTimeSync() { +func (r *TimeSyncCfg) startTimeSync() { + ctx := r.ctx tsm := make([]*pb.TimeSyncMsg, 0, len(r.proxyIdList)*2) - ctx, _ := context.WithCancel(r.ctx) var err error for { - //var start time.Time - for len(tsm) != len(r.proxyIdList) { - tsm = r.alignTimeSync(tsm) - tsm, err = r.readTimeSync(ctx, tsm, len(r.proxyIdList)-len(tsm)) - if err != nil { - if ctx.Err() != nil { - return - } else { - //TODO, log error msg - log.Printf("read time sync error %v", err) + select { + case <-ctx.Done(): + return + default: + //var start time.Time + for len(tsm) != len(r.proxyIdList) { + tsm = r.alignTimeSync(tsm) + tsm, err = r.readTimeSync(ctx, tsm, len(r.proxyIdList)-len(tsm)) + if err != nil { + if ctx.Err() != nil { + return + } else { + //TODO, log error msg + log.Printf("read time sync error %v", err) + } } } - } - ts := tsm[0].Timestamp - for i := 1; i < len(tsm); i++ { - if tsm[i].Timestamp < ts { - ts = tsm[i].Timestamp + ts := tsm[0].Timestamp + for i := 1; i < len(tsm); i++ { + if tsm[i].Timestamp < ts { + ts = tsm[i].Timestamp + } } - } - tsm = tsm[:0] - //send timestamp flag to reader channel - msg := pb.InsertOrDeleteMsg{Timestamp: ts, ClientId: r.readStopFlagClientId} - payload, err := proto.Marshal(&msg) - if err != nil { - //TODO log error - log.Printf("Marshal timesync flag error %v", err) - } else { - wg := sync.WaitGroup{} - wg.Add(len(r.readerProducer)) - for index := range r.readerProducer { - go r.sendEOFMsg(ctx, &pulsar.ProducerMessage{Payload: payload}, index, &wg) + tsm = tsm[:0] + //send timestamp flag to reader channel + msg := pb.InsertOrDeleteMsg{Timestamp: ts, ClientId: r.readStopFlagClientId} + payload, err := proto.Marshal(&msg) + if err != nil { + //TODO log error + log.Printf("Marshal timesync flag error %v", err) + } else { + wg := sync.WaitGroup{} + wg.Add(len(r.readerProducer)) + for index := range r.readerProducer { + go r.sendEOFMsg(ctx, &pulsar.ProducerMessage{Payload: payload}, index, &wg) + } + wg.Wait() } - wg.Wait() } } } -func (r *ReaderTimeSyncCfg) isReadStopFlag(imsg *pb.InsertOrDeleteMsg) bool { +func (r *TimeSyncCfg) isReadStopFlag(imsg *pb.InsertOrDeleteMsg) bool { return imsg.ClientId < ReadStopFlagEnd } -func (r *ReaderTimeSyncCfg) startReadTopics() { - ctx, _ := context.WithCancel(r.ctx) +func (r *TimeSyncCfg) WriteInsertLog() { + fileName := "/tmp/reader_get_pulsar.txt" + if r.RoleType == Writer { + fileName = "/tmp/writer_get_pulsar.txt" + } + + f, err := os.OpenFile(fileName, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) + if err != nil { + log.Fatal(err) + } + + // write logs + for _, insertLog := range r.InsertLogs { + insertLogJson, err := json.Marshal(&insertLog) + if err != nil { + log.Fatal(err) + } + + writeString := string(insertLogJson) + "\n" + //fmt.Println(writeString) + + _, err2 := f.WriteString(writeString) + if err2 != nil { + log.Fatal(err2) + } + } + + // reset InsertLogs buffer + r.InsertLogs = make([]InsertLog, 0) + + err = f.Close() + if err != nil { + log.Fatal(err) + } + + fmt.Println("write get pulsar log done") +} + +func (r *TimeSyncCfg) startReadTopics() { + ctx := r.ctx tsm := TimeSyncMsg{Timestamp: 0, NumRecorders: 0} + const Debug = true + const WriterBaseline = 1000 * 1000 + const LogBaseline = 100000 + var Counter int64 = 0 + var LastCounter int64 = 0 + r.InsertLogs = make([]InsertLog, 0) + InsertTime := time.Now() + var BaselineCounter int64 = 0 + for { select { case <-ctx.Done(): @@ -332,15 +422,39 @@ func (r *ReaderTimeSyncCfg) startReadTopics() { log.Printf("WARN : Insert or delete chan is full ...") } tsm.NumRecorders++ - r.insertOrDeleteChan <- &imsg + if Debug { + r.insertOrDeleteChan <- &imsg + Counter++ + if Counter%LogBaseline == 0 { + timeNow := time.Now() + duration := timeNow.Sub(InsertTime) + speed := float64(Counter-LastCounter) / duration.Seconds() + insertLog := InsertLog{ + MsgLength: int(Counter - LastCounter), + DurationInMilliseconds: duration.Milliseconds(), + InsertTime: timeNow, + NumSince: Counter, + Speed: speed, + } + r.InsertLogs = append(r.InsertLogs, insertLog) + LastCounter = Counter + InsertTime = timeNow + } + if Counter/WriterBaseline != BaselineCounter { + r.WriteInsertLog() + BaselineCounter = Counter / WriterBaseline + } + } else { + r.insertOrDeleteChan <- &imsg + } } r.readerConsumer.AckID(msg.ID()) } } } -func WithReaderQueueSize(size int) ReaderTimeSyncOption { - return func(r *ReaderTimeSyncCfg) { +func WithReaderQueueSize(size int) TimeSyncOption { + return func(r *TimeSyncCfg) { r.readerQueueSize = size } } diff --git a/timesync/readertimesync_test.go b/internal/timesync/timesync_test.go similarity index 95% rename from timesync/readertimesync_test.go rename to internal/timesync/timesync_test.go index 4d72a8375f..b36d0c9c21 100644 --- a/timesync/readertimesync_test.go +++ b/internal/timesync/timesync_test.go @@ -1,14 +1,15 @@ -package readertimesync +package timesync import ( "context" - "github.com/apache/pulsar-client-go/pulsar" - pb "github.com/czs007/suvlim/pkg/master/grpc/message" - "github.com/golang/protobuf/proto" "log" "sync" "testing" "time" + + "github.com/apache/pulsar-client-go/pulsar" + pb "github.com/czs007/suvlim/internal/proto/message" + "github.com/golang/protobuf/proto" ) const ( @@ -44,7 +45,7 @@ const ( ) func TestAlignTimeSync(t *testing.T) { - r := &ReaderTimeSyncCfg{ + r := &TimeSyncCfg{ proxyIdList: []int64{1, 2, 3}, interval: 200, } @@ -75,7 +76,7 @@ func TestAlignTimeSync(t *testing.T) { } func TestAlignTimeSync2(t *testing.T) { - r := &ReaderTimeSyncCfg{ + r := &TimeSyncCfg{ proxyIdList: []int64{1, 2, 3}, interval: 200, } @@ -104,7 +105,7 @@ func TestAlignTimeSync2(t *testing.T) { } func TestAlignTimeSync3(t *testing.T) { - r := &ReaderTimeSyncCfg{ + r := &TimeSyncCfg{ proxyIdList: []int64{1, 2, 3}, interval: 200, } @@ -142,7 +143,7 @@ func TestAlignTimeSync3(t *testing.T) { } func TestAlignTimeSync4(t *testing.T) { - r := &ReaderTimeSyncCfg{ + r := &TimeSyncCfg{ proxyIdList: []int64{1}, interval: 200, } @@ -173,7 +174,7 @@ func TestAlignTimeSync4(t *testing.T) { } func TestAlignTimeSync5(t *testing.T) { - r := &ReaderTimeSyncCfg{ + r := &TimeSyncCfg{ proxyIdList: []int64{1, 2, 3}, interval: 200, } @@ -205,8 +206,9 @@ func TestAlignTimeSync5(t *testing.T) { } } -func TestNewReaderTimeSync(t *testing.T) { - r, err := NewReaderTimeSync(timeSyncTopic, +func TestNewTimeSync(t *testing.T) { + r, err := NewTimeSync(context.Background(), + timeSyncTopic, timeSyncSubName, []string{readerTopic1, readerTopic2, readerTopic3, readerTopic4}, readerSubName, @@ -217,7 +219,7 @@ func TestNewReaderTimeSync(t *testing.T) { if err != nil { t.Fatal(err) } - rr := r.(*ReaderTimeSyncCfg) + rr := r.(*TimeSyncCfg) if rr.pulsarClient == nil { t.Fatalf("create pulsar client failed") } @@ -287,8 +289,9 @@ func TestPulsarClient(t *testing.T) { } } -func TestReaderTimesync(t *testing.T) { - r, err := NewReaderTimeSync(timeSyncTopic, +func TestTimeSync(t *testing.T) { + r, err := NewTimeSync(context.Background(), + timeSyncTopic, timeSyncSubName, []string{readerTopic1, readerTopic2, readerTopic3, readerTopic4}, readerSubName, @@ -299,7 +302,7 @@ func TestReaderTimesync(t *testing.T) { if err != nil { t.Fatal(err) } - rr := r.(*ReaderTimeSyncCfg) + rr := r.(*TimeSyncCfg) pt1, err := rr.pulsarClient.CreateProducer(pulsar.ProducerOptions{Topic: timeSyncTopic}) if err != nil { t.Fatalf("create time sync producer 1 error %v", err) @@ -376,7 +379,7 @@ func TestReaderTimesync(t *testing.T) { pr4.Close() } -func TestReaderTimesync2(t *testing.T) { +func TestTimeSync2(t *testing.T) { client, _ := pulsar.NewClient(pulsar.ClientOptions{URL: pulsarAddr}) pt1, _ := client.CreateProducer(pulsar.ProducerOptions{Topic: timeSyncTopic2}) pt2, _ := client.CreateProducer(pulsar.ProducerOptions{Topic: timeSyncTopic2}) @@ -388,7 +391,8 @@ func TestReaderTimesync2(t *testing.T) { go startProxy(pt1, 1, pr1, 1, pr2, 2, 2*time.Second, t) go startProxy(pt2, 2, pr3, 3, pr4, 4, 2*time.Second, t) - r1, _ := NewReaderTimeSync(timeSyncTopic2, + r1, _ := NewTimeSync(context.Background(), + timeSyncTopic2, timeSyncSubName1, []string{readerTopic12, readerTopic22, readerTopic32, readerTopic42}, readerSubName1, @@ -397,7 +401,8 @@ func TestReaderTimesync2(t *testing.T) { WithReaderQueueSize(1024), ) - r2, _ := NewReaderTimeSync(timeSyncTopic2, + r2, _ := NewTimeSync(context.Background(), + timeSyncTopic2, timeSyncSubName2, []string{readerTopic12, readerTopic22, readerTopic32, readerTopic42}, readerSubName2, @@ -407,7 +412,7 @@ func TestReaderTimesync2(t *testing.T) { ) ctx, _ := context.WithTimeout(context.Background(), 3*time.Second) - rt := []ReaderTimeSync{r1, r2} + rt := []TimeSync{r1, r2} var wg sync.WaitGroup for _, r := range rt { r := r @@ -460,7 +465,7 @@ func TestReaderTimesync2(t *testing.T) { pr4.Close() } -func TestReaderTimesync3(t *testing.T) { +func TestTimeSync3(t *testing.T) { client, _ := pulsar.NewClient(pulsar.ClientOptions{URL: pulsarAddr}) pt, _ := client.CreateProducer(pulsar.ProducerOptions{Topic: timeSyncTopic3}) pr1, _ := client.CreateProducer(pulsar.ProducerOptions{Topic: readerTopic13}) @@ -506,7 +511,8 @@ func TestReaderTimesync3(t *testing.T) { } }() - r, err := NewReaderTimeSync(timeSyncTopic3, + r, err := NewTimeSync(context.Background(), + timeSyncTopic3, timeSyncSubName3, []string{readerTopic13, readerTopic23, readerTopic33, readerTopic43}, readerSubName3, diff --git a/util/etcdutil/etcdutil.go b/internal/util/etcdutil/etcdutil.go similarity index 99% rename from util/etcdutil/etcdutil.go rename to internal/util/etcdutil/etcdutil.go index 03be1c2646..1c26d583e6 100644 --- a/util/etcdutil/etcdutil.go +++ b/internal/util/etcdutil/etcdutil.go @@ -19,8 +19,8 @@ import ( "net/http" "time" + "github.com/czs007/suvlim/internal/errors" "github.com/gogo/protobuf/proto" - "github.com/czs007/suvlim/errors" "github.com/pingcap/log" "go.etcd.io/etcd/clientv3" "go.etcd.io/etcd/etcdserver" diff --git a/util/etcdutil/etcdutil_test.go b/internal/util/etcdutil/etcdutil_test.go similarity index 100% rename from util/etcdutil/etcdutil_test.go rename to internal/util/etcdutil/etcdutil_test.go diff --git a/internal/writer/writer.go b/internal/writer/writer.go new file mode 100644 index 0000000000..9d44ad1697 --- /dev/null +++ b/internal/writer/writer.go @@ -0,0 +1,226 @@ +package writer + +import ( + "context" + "encoding/binary" + "encoding/json" + "fmt" + "github.com/czs007/suvlim/internal/conf" + msgpb "github.com/czs007/suvlim/internal/proto/message" + "github.com/czs007/suvlim/internal/storage" + storagetype "github.com/czs007/suvlim/internal/storage/type" + "github.com/czs007/suvlim/internal/msgclient" + "log" + "os" + "strconv" + "sync" + "time" +) + +type SegmentIdInfo struct { + CollectionName string + EntityId int64 + SegmentIds []string +} + +type MsgCounter struct { + InsertCounter int64 + InsertTime time.Time + // InsertedRecordSize float64 + + DeleteCounter int64 + DeleteTime time.Time +} + +type InsertLog struct { + MsgLength int + DurationInMilliseconds int64 + InsertTime time.Time + NumSince int64 + Speed float64 +} + +type WriteNode struct { + KvStore *storagetype.Store + MessageClient *msgclient.WriterMessageClient + TimeSync uint64 + MsgCounter *MsgCounter + InsertLogs []InsertLog +} + +func (wn *WriteNode) Close() { + wn.MessageClient.Close() +} + +func NewWriteNode(ctx context.Context, + address string, + topics []string, + timeSync uint64) (*WriteNode, error) { + kv, err := storage.NewStore(context.Background(), storagetype.MinIODriver) + mc := msgclient.WriterMessageClient{} + + msgCounter := MsgCounter{ + InsertCounter: 0, + InsertTime: time.Now(), + DeleteCounter: 0, + DeleteTime: time.Now(), + // InsertedRecordSize: 0, + } + + return &WriteNode{ + KvStore: &kv, + MessageClient: &mc, + TimeSync: timeSync, + MsgCounter: &msgCounter, + InsertLogs: make([]InsertLog, 0), + }, err +} + +func (wn *WriteNode) InsertBatchData(ctx context.Context, data []*msgpb.InsertOrDeleteMsg, wg *sync.WaitGroup) error { + var prefixKey string + var suffixKey string + var prefixKeys [][]byte + var suffixKeys []string + var binaryData [][]byte + var timeStamp []uint64 + byteArr := make([]byte, 8) + intData := uint64(0) + binary.BigEndian.PutUint64(byteArr, intData) + + for i := 0; i < len(data); i++ { + prefixKey = data[i].CollectionName + "-" + strconv.FormatUint(uint64(data[i].Uid), 10) + suffixKey = strconv.FormatUint(uint64(data[i].SegmentId), 10) + prefixKeys = append(prefixKeys, []byte(prefixKey)) + suffixKeys = append(suffixKeys, suffixKey) + binaryData = append(binaryData, byteArr) + timeStamp = append(timeStamp, uint64(data[i].Timestamp)) + } + + error := (*wn.KvStore).PutRows(ctx, prefixKeys, binaryData, suffixKeys, timeStamp) + if error != nil { + fmt.Println("Can't insert data!") + wg.Done() + return error + } + wg.Done() + return nil +} + +func (wn *WriteNode) DeleteBatchData(ctx context.Context, data []*msgpb.InsertOrDeleteMsg) error { + var prefixKey string + var prefixKeys [][]byte + var timeStamps []uint64 + + for i := 0; i < len(data); i++ { + prefixKey = data[i].CollectionName + "-" + strconv.FormatUint(uint64(data[i].Uid), 10) + prefixKeys = append(prefixKeys, []byte(prefixKey)) + timeStamps = append(timeStamps, uint64(data[i].Timestamp)) + segmentString, _ := (*wn.KvStore).GetSegments(ctx, []byte(prefixKey), uint64(data[i].Timestamp)) + + var segmentIds []int64 + for _, str := range segmentString { + id, err := strconv.ParseInt(str, 10, 64) + if err != nil { + fmt.Println(str, " is not an integer.") + } + segmentIds = append(segmentIds, id) + } + + segmentInfo := msgpb.Key2SegMsg{ + Uid: data[i].Uid, + SegmentId: segmentIds, + Timestamp: data[i].Timestamp, + } + wn.MessageClient.Send(ctx, segmentInfo) + } + + wn.MsgCounter.DeleteCounter += int64(len(timeStamps)) + + err := (*wn.KvStore).DeleteRows(ctx, prefixKeys, timeStamps) + if err != nil { + fmt.Println("Can't delete data") + return err + } + return nil +} + +func (wn *WriteNode) UpdateTimeSync(timeSync uint64) { + wn.TimeSync = timeSync +} + +func (wn *WriteNode) DoWriteNode(ctx context.Context) { + numInsertData := len(wn.MessageClient.InsertMsg) + numGoRoute := conf.Config.Writer.Parallelism + batchSize := numInsertData / numGoRoute + if numInsertData%numGoRoute != 0 { + batchSize += 1 + } + start := 0 + end := 0 + wg := sync.WaitGroup{} + for end < numInsertData { + if end+batchSize >= numInsertData { + end = numInsertData + } else { + end = end + batchSize + } + wg.Add(1) + go wn.InsertBatchData(ctx, wn.MessageClient.InsertMsg[start:end], &wg) + start = end + } + wg.Wait() + wn.WriterLog(numInsertData) + wn.DeleteBatchData(ctx, wn.MessageClient.DeleteMsg) + wn.UpdateTimeSync(wn.MessageClient.TimeSync()) +} + +func (wn *WriteNode) WriterLog(length int) { + wn.MsgCounter.InsertCounter += int64(length) + timeNow := time.Now() + duration := timeNow.Sub(wn.MsgCounter.InsertTime) + speed := float64(length) / duration.Seconds() + + insertLog := InsertLog{ + MsgLength: length, + DurationInMilliseconds: duration.Milliseconds(), + InsertTime: timeNow, + NumSince: wn.MsgCounter.InsertCounter, + Speed: speed, + } + + wn.InsertLogs = append(wn.InsertLogs, insertLog) + wn.MsgCounter.InsertTime = timeNow +} + +func (wn *WriteNode) WriteWriterLog() { + f, err := os.OpenFile("/tmp/write_node_insert.txt", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) + if err != nil { + log.Fatal(err) + } + + // write logs + for _, insertLog := range wn.InsertLogs { + insertLogJson, err := json.Marshal(&insertLog) + if err != nil { + log.Fatal(err) + } + + writeString := string(insertLogJson) + "\n" + //fmt.Println(writeString) + + _, err2 := f.WriteString(writeString) + if err2 != nil { + log.Fatal(err2) + } + } + + // reset InsertLogs buffer + wn.InsertLogs = make([]InsertLog, 0) + + err = f.Close() + if err != nil { + log.Fatal(err) + } + + fmt.Println("write write node log done") +} diff --git a/master/client/base_client.go b/master/client/base_client.go deleted file mode 100644 index c92eccd96e..0000000000 --- a/master/client/base_client.go +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright 2019 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package pd - -import ( - "context" - "reflect" - "sort" - "sync" - "time" - - "github.com/czs007/suvlim/errors" - "github.com/czs007/suvlim/pkg/pdpb" - "github.com/czs007/suvlim/util/grpcutil" - "github.com/pingcap/log" - "go.uber.org/zap" - "google.golang.org/grpc" -) - -// baseClient is a basic client for all other complex client. -type baseClient struct { - urls []string - clusterID uint64 - connMu struct { - sync.RWMutex - clientConns map[string]*grpc.ClientConn - leader string - } - - checkLeaderCh chan struct{} - - wg sync.WaitGroup - ctx context.Context - cancel context.CancelFunc - - security SecurityOption - - gRPCDialOptions []grpc.DialOption - timeout time.Duration -} - -// SecurityOption records options about tls -type SecurityOption struct { - CAPath string - CertPath string - KeyPath string -} - -// ClientOption configures client. -type ClientOption func(c *baseClient) - -// WithGRPCDialOptions configures the client with gRPC dial options. -func WithGRPCDialOptions(opts ...grpc.DialOption) ClientOption { - return func(c *baseClient) { - c.gRPCDialOptions = append(c.gRPCDialOptions, opts...) - } -} - -// WithCustomTimeoutOption configures the client with timeout option. -func WithCustomTimeoutOption(timeout time.Duration) ClientOption { - return func(c *baseClient) { - c.timeout = timeout - } -} - -// newBaseClient returns a new baseClient. -func newBaseClient(ctx context.Context, urls []string, security SecurityOption, opts ...ClientOption) (*baseClient, error) { - ctx1, cancel := context.WithCancel(ctx) - c := &baseClient{ - urls: urls, - checkLeaderCh: make(chan struct{}, 1), - ctx: ctx1, - cancel: cancel, - security: security, - timeout: defaultPDTimeout, - } - c.connMu.clientConns = make(map[string]*grpc.ClientConn) - for _, opt := range opts { - opt(c) - } - - log.Info("[pd] init cluster id", zap.Uint64("cluster-id", c.clusterID)) - - c.wg.Add(1) - go c.leaderLoop() - - return c, nil -} - -func (c *baseClient) initRetry(f func() error) error { - var err error - for i := 0; i < maxInitClusterRetries; i++ { - if err = f(); err == nil { - return nil - } - select { - case <-c.ctx.Done(): - return err - case <-time.After(time.Second): - } - } - return errors.WithStack(err) -} - -func (c *baseClient) leaderLoop() { - defer c.wg.Done() - - ctx, cancel := context.WithCancel(c.ctx) - defer cancel() - - for { - select { - case <-c.checkLeaderCh: - case <-time.After(time.Minute): - case <-ctx.Done(): - return - } - } -} - - -// GetClusterID returns the ClusterID. -func (c *baseClient) GetClusterID(context.Context) uint64 { - return c.clusterID -} - -// GetLeaderAddr returns the leader address. -// For testing use. -func (c *baseClient) GetLeaderAddr() string { - c.connMu.RLock() - defer c.connMu.RUnlock() - return c.connMu.leader -} - -// GetURLs returns the URLs. -// For testing use. It should only be called when the client is closed. -func (c *baseClient) GetURLs() []string { - return c.urls -} - - -func (c *baseClient) updateURLs(members []*pdpb.Member) { - urls := make([]string, 0, len(members)) - for _, m := range members { - urls = append(urls, m.GetClientUrls()...) - } - - sort.Strings(urls) - // the url list is same. - if reflect.DeepEqual(c.urls, urls) { - return - } - - log.Info("[pd] update member urls", zap.Strings("old-urls", c.urls), zap.Strings("new-urls", urls)) - c.urls = urls -} - - -func (c *baseClient) getOrCreateGRPCConn(addr string) (*grpc.ClientConn, error) { - c.connMu.RLock() - conn, ok := c.connMu.clientConns[addr] - c.connMu.RUnlock() - if ok { - return conn, nil - } - tlsCfg, err := grpcutil.SecurityConfig{ - CAPath: c.security.CAPath, - CertPath: c.security.CertPath, - KeyPath: c.security.KeyPath, - }.ToTLSConfig() - if err != nil { - return nil, errors.WithStack(err) - } - dctx, cancel := context.WithTimeout(c.ctx, dialTimeout) - defer cancel() - cc, err := grpcutil.GetClientConn(dctx, addr, tlsCfg, c.gRPCDialOptions...) - if err != nil { - return nil, errors.WithStack(err) - } - c.connMu.Lock() - defer c.connMu.Unlock() - if old, ok := c.connMu.clientConns[addr]; ok { - cc.Close() - log.Debug("use old connection", zap.String("target", cc.Target()), zap.String("state", cc.GetState().String())) - return old, nil - } - - c.connMu.clientConns[addr] = cc - return cc, nil -} diff --git a/master/client/client.go b/master/client/client.go deleted file mode 100644 index ffad2705fe..0000000000 --- a/master/client/client.go +++ /dev/null @@ -1,403 +0,0 @@ -// Copyright 2016 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package pd - -import ( - "context" - "strings" - "sync" - "time" - - "github.com/opentracing/opentracing-go" - "github.com/czs007/suvlim/errors" - "github.com/czs007/suvlim/pkg/pdpb" - "github.com/pingcap/log" - "go.uber.org/zap" -) - - -// Client is a PD (Placement Driver) client. -// It should not be used after calling Close(). -type Client interface { - // GetClusterID gets the cluster ID from PD. - GetClusterID(ctx context.Context) uint64 - // GetMemberInfo gets the members Info from PD - //GetMemberInfo(ctx context.Context) ([]*pdpb.Member, error) - // GetLeaderAddr returns current leader's address. It returns "" before - // syncing leader from server. - GetLeaderAddr() string - // GetTS gets a timestamp from PD. - GetTS(ctx context.Context) (int64, int64, error) - // GetTSAsync gets a timestamp from PD, without block the caller. - GetTSAsync(ctx context.Context) TSFuture - Close() -} - -type tsoRequest struct { - start time.Time - ctx context.Context - done chan error - physical int64 - logical int64 -} - -const ( - defaultPDTimeout = 3 * time.Second - dialTimeout = 3 * time.Second - updateLeaderTimeout = time.Second // Use a shorter timeout to recover faster from network isolation. - maxMergeTSORequests = 10000 // should be higher if client is sending requests in burst - maxInitClusterRetries = 100 -) - -var ( - // errFailInitClusterID is returned when failed to load clusterID from all supplied PD addresses. - errFailInitClusterID = errors.New("[pd] failed to get cluster id") - // errClosing is returned when request is canceled when client is closing. - errClosing = errors.New("[pd] closing") - // errTSOLength is returned when the number of response timestamps is inconsistent with request. - errTSOLength = errors.New("[pd] tso length in rpc response is incorrect") -) - -type client struct { - *baseClient - tsoRequests chan *tsoRequest - - lastPhysical int64 - lastLogical int64 - - tsDeadlineCh chan deadline -} - -// NewClient creates a PD client. -func NewClient(pdAddrs []string, security SecurityOption, opts ...ClientOption) (Client, error) { - return NewClientWithContext(context.Background(), pdAddrs, security, opts...) -} - -// NewClientWithContext creates a PD client with context. -func NewClientWithContext(ctx context.Context, pdAddrs []string, security SecurityOption, opts ...ClientOption) (Client, error) { - log.Info("[pd] create pd client with endpoints", zap.Strings("pd-address", pdAddrs)) - base, err := newBaseClient(ctx, addrsToUrls(pdAddrs), security, opts...) - if err != nil { - return nil, err - } - c := &client{ - baseClient: base, - tsoRequests: make(chan *tsoRequest, maxMergeTSORequests), - tsDeadlineCh: make(chan deadline, 1), - } - - c.wg.Add(2) - go c.tsLoop() - go c.tsCancelLoop() - - return c, nil -} - -type deadline struct { - timer <-chan time.Time - done chan struct{} - cancel context.CancelFunc -} - -func (c *client) tsCancelLoop() { - defer c.wg.Done() - - ctx, cancel := context.WithCancel(c.ctx) - defer cancel() - - for { - select { - case d := <-c.tsDeadlineCh: - select { - case <-d.timer: - log.Error("tso request is canceled due to timeout") - d.cancel() - case <-d.done: - case <-ctx.Done(): - return - } - case <-ctx.Done(): - return - } - } -} - -func (c *client) checkStreamTimeout(loopCtx context.Context, cancel context.CancelFunc, createdCh chan struct{}) { - select { - case <-time.After(c.timeout): - cancel() - case <-createdCh: - return - case <-loopCtx.Done(): - return - } -} - - -func (c *client) tsLoop() { - defer c.wg.Done() - - loopCtx, loopCancel := context.WithCancel(c.ctx) - defer loopCancel() - - defaultSize := maxMergeTSORequests + 1 - requests := make([]*tsoRequest, defaultSize) - createdCh := make(chan struct{}) - - var opts []opentracing.StartSpanOption - var stream pdpb.PD_TsoClient - var cancel context.CancelFunc - - for { - var err error - - if stream == nil { - var ctx context.Context - ctx, cancel = context.WithCancel(loopCtx) - go c.checkStreamTimeout(loopCtx, cancel, createdCh) - stream, err = c.leaderClient().Tso(ctx) - if stream != nil { - createdCh <- struct{}{} - } - if err != nil { - select { - case <-loopCtx.Done(): - cancel() - return - default: - } - log.Error("[pd] create tso stream error") - cancel() - c.revokeTSORequest(errors.WithStack(err)) - select { - case <-time.After(time.Second): - case <-loopCtx.Done(): - return - } - continue - } - } - - select { - case first := <-c.tsoRequests: - pendingPlus1 := len(c.tsoRequests) + 1 - requests[0] = first - for i := 1; i < pendingPlus1; i++ { - requests[i] = <-c.tsoRequests - } - done := make(chan struct{}) - dl := deadline{ - timer: time.After(c.timeout), - done: done, - cancel: cancel, - } - select { - case c.tsDeadlineCh <- dl: - case <-loopCtx.Done(): - cancel() - return - } - opts = extractSpanReference(requests[:pendingPlus1], opts[:0]) - err = c.processTSORequests(stream, requests[:pendingPlus1], opts) - close(done) - case <-loopCtx.Done(): - cancel() - return - } - - if err != nil { - select { - case <-loopCtx.Done(): - cancel() - return - default: - } - log.Error("[pd] getTS error") - cancel() - stream, cancel = nil, nil - } - } -} - -func extractSpanReference(requests []*tsoRequest, opts []opentracing.StartSpanOption) []opentracing.StartSpanOption { - for _, req := range requests { - if span := opentracing.SpanFromContext(req.ctx); span != nil { - opts = append(opts, opentracing.ChildOf(span.Context())) - } - } - return opts -} - -func (c *client) processTSORequests(stream pdpb.PD_TsoClient, requests []*tsoRequest, opts []opentracing.StartSpanOption) error { - if len(opts) > 0 { - span := opentracing.StartSpan("pdclient.processTSORequests", opts...) - defer span.Finish() - } - count := len(requests) - //start := time.Now() - req := &pdpb.TsoRequest{ - Header: c.requestHeader(), - Count: uint32(count), - } - - if err := stream.Send(req); err != nil { - err = errors.WithStack(err) - c.finishTSORequest(requests, 0, 0, err) - return err - } - resp, err := stream.Recv() - if err != nil { - err = errors.WithStack(err) - c.finishTSORequest(requests, 0, 0, err) - return err - } - - if resp.GetCount() != uint32(len(requests)) { - err = errors.WithStack(errTSOLength) - c.finishTSORequest(requests, 0, 0, err) - return err - } - - physical, logical := resp.GetTimestamp().GetPhysical(), resp.GetTimestamp().GetLogical() - // Server returns the highest ts. - logical -= int64(resp.GetCount() - 1) - if tsLessEqual(physical, logical, c.lastPhysical, c.lastLogical) { - panic(errors.Errorf("timestamp fallback, newly acquired ts (%d,%d) is less or equal to last one (%d, %d)", - physical, logical, c.lastLogical, c.lastLogical)) - } - c.lastPhysical = physical - c.lastLogical = logical + int64(len(requests)) - 1 - c.finishTSORequest(requests, physical, logical, nil) - return nil -} - -func tsLessEqual(physical, logical, thatPhysical, thatLogical int64) bool { - if physical == thatPhysical { - return logical <= thatLogical - } - return physical < thatPhysical -} - -func (c *client) finishTSORequest(requests []*tsoRequest, physical, firstLogical int64, err error) { - for i := 0; i < len(requests); i++ { - if span := opentracing.SpanFromContext(requests[i].ctx); span != nil { - span.Finish() - } - requests[i].physical, requests[i].logical = physical, firstLogical+int64(i) - requests[i].done <- err - } -} - -func (c *client) revokeTSORequest(err error) { - n := len(c.tsoRequests) - for i := 0; i < n; i++ { - req := <-c.tsoRequests - req.done <- err - } -} - -func (c *client) Close() { - c.cancel() - c.wg.Wait() - - c.revokeTSORequest(errors.WithStack(errClosing)) - - c.connMu.Lock() - defer c.connMu.Unlock() - for _, cc := range c.connMu.clientConns { - if err := cc.Close(); err != nil { - log.Error("[pd] failed to close gRPC clientConn") - } - } -} - -// leaderClient gets the client of current PD leader. -func (c *client) leaderClient() pdpb.PDClient { - c.connMu.RLock() - defer c.connMu.RUnlock() - - return pdpb.NewPDClient(c.connMu.clientConns[c.connMu.leader]) -} - -var tsoReqPool = sync.Pool{ - New: func() interface{} { - return &tsoRequest{ - done: make(chan error, 1), - physical: 0, - logical: 0, - } - }, -} - -func (c *client) GetTSAsync(ctx context.Context) TSFuture { - if span := opentracing.SpanFromContext(ctx); span != nil { - span = opentracing.StartSpan("GetTSAsync", opentracing.ChildOf(span.Context())) - ctx = opentracing.ContextWithSpan(ctx, span) - } - req := tsoReqPool.Get().(*tsoRequest) - req.ctx = ctx - req.start = time.Now() - c.tsoRequests <- req - - return req -} - -// TSFuture is a future which promises to return a TSO. -type TSFuture interface { - // Wait gets the physical and logical time, it would block caller if data is not available yet. - Wait() (int64, int64, error) -} - -func (req *tsoRequest) Wait() (physical int64, logical int64, err error) { - // If tso command duration is observed very high, the reason could be it - // takes too long for Wait() be called. - select { - case err = <-req.done: - err = errors.WithStack(err) - defer tsoReqPool.Put(req) - if err != nil { - return 0, 0, err - } - physical, logical = req.physical, req.logical - return - case <-req.ctx.Done(): - return 0, 0, errors.WithStack(req.ctx.Err()) - } -} - -func (c *client) GetTS(ctx context.Context) (physical int64, logical int64, err error) { - resp := c.GetTSAsync(ctx) - return resp.Wait() -} - - - -func (c *client) requestHeader() *pdpb.RequestHeader { - return &pdpb.RequestHeader{ - ClusterId: c.clusterID, - } -} - -func addrsToUrls(addrs []string) []string { - // Add default schema "http://" to addrs. - urls := make([]string, 0, len(addrs)) - for _, addr := range addrs { - if strings.Contains(addr, "://") { - urls = append(urls, addr) - } else { - urls = append(urls, "http://"+addr) - } - } - return urls -} diff --git a/master/config/config.go b/master/config/config.go deleted file mode 100644 index 10ae04dd2e..0000000000 --- a/master/config/config.go +++ /dev/null @@ -1,533 +0,0 @@ -// Copyright 2016 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package config - -import ( - "bytes" - "encoding/json" - "flag" - "fmt" - - "github.com/czs007/suvlim/util/grpcutil" - - //"google.golang.org/grpc" - "net/url" - "os" - "path/filepath" - "strings" - "time" - - "github.com/BurntSushi/toml" - "github.com/czs007/suvlim/errors" - "github.com/czs007/suvlim/util/typeutil" - "github.com/pingcap/log" - "go.etcd.io/etcd/embed" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" -) - -// Config is the pd server configuration. -type Config struct { - flagSet *flag.FlagSet - Version bool `json:"-"` - ConfigCheck bool `json:"-"` - - ClientUrls string `toml:"client-urls" json:"client-urls"` - PeerUrls string `toml:"peer-urls" json:"peer-urls"` - AdvertiseClientUrls string `toml:"advertise-client-urls" json:"advertise-client-urls"` - AdvertisePeerUrls string `toml:"advertise-peer-urls" json:"advertise-peer-urls"` - - Name string `toml:"name" json:"name"` - DataDir string `toml:"data-dir" json:"data-dir"` - EnableGRPCGateway bool `json:"enable-grpc-gateway"` - - InitialCluster string `toml:"initial-cluster" json:"initial-cluster"` - InitialClusterState string `toml:"initial-cluster-state" json:"initial-cluster-state"` - InitialClusterToken string `toml:"initial-cluster-token" json:"initial-cluster-token"` - - LeaderLease int64 `toml:"lease" json:"lease"` - Log log.Config `toml:"log" json:"log"` - LogFileDeprecated string `toml:"log-file" json:"log-file,omitempty"` - LogLevelDeprecated string `toml:"log-level" json:"log-level,omitempty"` - - PDServerCfg PDServerConfig `toml:"pd-server" json:"pd-server"` - - TickInterval typeutil.Duration `toml:"tick-interval"` - ElectionInterval typeutil.Duration `toml:"election-interval"` - DisableStrictReconfigCheck bool - - // TsoSaveInterval is the interval to save timestamp. - TsoSaveInterval typeutil.Duration `toml:"tso-save-interval" json:"tso-save-interval"` - - PreVote bool `toml:"enable-prevote"` - Security grpcutil.SecurityConfig `toml:"security" json:"security"` - - configFile string - - // For all warnings during parsing. - WarningMsgs []string - - HeartbeatStreamBindInterval typeutil.Duration - - logger *zap.Logger - logProps *log.ZapProperties - - //ServiceRegister func(*grpc.Server) `json:"-"` -} - -// NewConfig creates a new config. -func NewConfig() *Config { - cfg := &Config{} - cfg.HeartbeatStreamBindInterval = typeutil.NewDuration(defaultHeartbeatStreamRebindInterval) - cfg.TickInterval = typeutil.NewDuration(defaultTickInterval) - cfg.ElectionInterval = typeutil.NewDuration(defaultElectionInterval) - cfg.flagSet = flag.NewFlagSet("pd", flag.ContinueOnError) - fs := cfg.flagSet - fs.BoolVar(&cfg.Version, "V", false, "print version information and exit") - fs.BoolVar(&cfg.Version, "version", false, "print version information and exit") - fs.StringVar(&cfg.configFile, "config", "", "config file") - fs.BoolVar(&cfg.ConfigCheck, "config-check", false, "check config file validity and exit") - - fs.StringVar(&cfg.Name, "name", defaultName, "human-readable name for this pd member") - - fs.StringVar(&cfg.DataDir, "data-dir", "/data/pd/data", "path to the data directory (default 'default.${name}')") - fs.StringVar(&cfg.ClientUrls, "client-urls", defaultClientUrls, "url for client traffic") - fs.StringVar(&cfg.AdvertiseClientUrls, "advertise-client-urls", defaultClientUrls, "advertise url for client traffic (default '${client-urls}')") - fs.StringVar(&cfg.PeerUrls, "peer-urls", defaultPeerUrls, "url for peer traffic") - fs.StringVar(&cfg.AdvertisePeerUrls, "advertise-peer-urls", defaultPeerUrls, "advertise url for peer traffic (default '${peer-urls}')") - fs.StringVar(&cfg.InitialCluster, "initial-cluster", "pd=http://127.0.0.1:12380", "initial cluster configuration for bootstrapping, e,g. pd=http://127.0.0.1:2380") - fs.StringVar(&cfg.InitialClusterState, "initial-cluster-start", defaultInitialClusterState, "initial cluster state") - fs.StringVar(&cfg.Log.Level, "L", "", "log level: debug, info, warn, error, fatal (default 'info')") - fs.StringVar(&cfg.Log.File.Filename, "log-file", "", "log file path") - return cfg -} - -const ( - defaultLeaderLease = int64(3) - defaultName = "pd" - defaultClientUrls = "http://127.0.0.1:12379,http://127.0.0.1:12378,http://127.0.0.1:12377" - defaultPeerUrls = "http://127.0.0.1:12380,http://127.0.0.1:12381,http://127.0.0.1:12382" - defaultInitialClusterState = embed.ClusterStateFlagNew - defaultInitialClusterToken = "pd-cluster" - - // etcd use 100ms for heartbeat and 1s for election timeout. - // We can enlarge both a little to reduce the network aggression. - // now embed etcd use TickMs for heartbeat, we will update - // after embed etcd decouples tick and heartbeat. - defaultTickInterval = 500 * time.Millisecond - // embed etcd has a check that `5 * tick > election` - defaultElectionInterval = 3000 * time.Millisecond - - defaultHeartbeatStreamRebindInterval = time.Minute - - defaultMaxResetTSGap = 24 * time.Hour - defaultEnableGRPCGateway = true - defaultDisableErrorVerbose = true -) - -func init() { - -} - -func adjustString(v *string, defValue string) { - if len(*v) == 0 { - *v = defValue - } -} - -func adjustUint64(v *uint64, defValue uint64) { - if *v == 0 { - *v = defValue - } -} - -func adjustInt64(v *int64, defValue int64) { - if *v == 0 { - *v = defValue - } -} - -func adjustFloat64(v *float64, defValue float64) { - if *v == 0 { - *v = defValue - } -} - -func adjustDuration(v *typeutil.Duration, defValue time.Duration) { - if v.Duration == 0 { - v.Duration = defValue - } -} - -func adjustPath(p *string) { - absPath, err := filepath.Abs(*p) - if err == nil { - *p = absPath - } -} - -// Parse parses flag definitions from the argument list. -func (c *Config) Parse(arguments []string) error { - // Parse first to get config file. - err := c.flagSet.Parse(arguments) - if err != nil { - return errors.WithStack(err) - } - - // Load config file if specified. - var meta *toml.MetaData - if c.configFile != "" { - meta, err = c.configFromFile(c.configFile) - if err != nil { - return err - } - - // Backward compatibility for toml config - if c.LogFileDeprecated != "" { - msg := fmt.Sprintf("log-file in %s is deprecated, use [log.file] instead", c.configFile) - c.WarningMsgs = append(c.WarningMsgs, msg) - if c.Log.File.Filename == "" { - c.Log.File.Filename = c.LogFileDeprecated - } - } - if c.LogLevelDeprecated != "" { - msg := fmt.Sprintf("log-level in %s is deprecated, use [log] instead", c.configFile) - c.WarningMsgs = append(c.WarningMsgs, msg) - if c.Log.Level == "" { - c.Log.Level = c.LogLevelDeprecated - } - } - if meta.IsDefined("schedule", "disable-raft-learner") { - msg := fmt.Sprintf("disable-raft-learner in %s is deprecated", c.configFile) - c.WarningMsgs = append(c.WarningMsgs, msg) - } - if meta.IsDefined("dashboard", "disable-telemetry") { - msg := fmt.Sprintf("disable-telemetry in %s is deprecated, use enable-telemetry instead", c.configFile) - c.WarningMsgs = append(c.WarningMsgs, msg) - } - } - - // Parse again to replace with command line options. - err = c.flagSet.Parse(arguments) - if err != nil { - return errors.WithStack(err) - } - - if len(c.flagSet.Args()) != 0 { - return errors.Errorf("'%s' is an invalid flag", c.flagSet.Arg(0)) - } - - err = c.Adjust(meta) - return err -} - -// Validate is used to validate if some configurations are right. -func (c *Config) Validate() error { - dataDir, err := filepath.Abs(c.DataDir) - if err != nil { - return errors.WithStack(err) - } - logFile, err := filepath.Abs(c.Log.File.Filename) - if err != nil { - return errors.WithStack(err) - } - rel, err := filepath.Rel(dataDir, filepath.Dir(logFile)) - if err != nil { - return errors.WithStack(err) - } - if !strings.HasPrefix(rel, "..") { - return errors.New("log directory shouldn't be the subdirectory of data directory") - } - - return nil -} - -// Utility to test if a configuration is defined. -type configMetaData struct { - meta *toml.MetaData - path []string -} - -func newConfigMetadata(meta *toml.MetaData) *configMetaData { - return &configMetaData{meta: meta} -} - -func (m *configMetaData) IsDefined(key string) bool { - if m.meta == nil { - return false - } - keys := append([]string(nil), m.path...) - keys = append(keys, key) - return m.meta.IsDefined(keys...) -} - -func (m *configMetaData) Child(path ...string) *configMetaData { - newPath := append([]string(nil), m.path...) - newPath = append(newPath, path...) - return &configMetaData{ - meta: m.meta, - path: newPath, - } -} - -func (m *configMetaData) CheckUndecoded() error { - if m.meta == nil { - return nil - } - undecoded := m.meta.Undecoded() - if len(undecoded) == 0 { - return nil - } - errInfo := "Config contains undefined item: " - for _, key := range undecoded { - errInfo += key.String() + ", " - } - return errors.New(errInfo[:len(errInfo)-2]) -} - -// Adjust is used to adjust the PD configurations. -func (c *Config) Adjust(meta *toml.MetaData) error { - configMetaData := newConfigMetadata(meta) - if err := configMetaData.CheckUndecoded(); err != nil { - c.WarningMsgs = append(c.WarningMsgs, err.Error()) - } - - if c.Name == "" { - hostname, err := os.Hostname() - if err != nil { - return err - } - adjustString(&c.Name, fmt.Sprintf("%s-%s", defaultName, hostname)) - } - adjustString(&c.DataDir, fmt.Sprintf("default.%s", c.Name)) - adjustPath(&c.DataDir) - - if err := c.Validate(); err != nil { - return err - } - - adjustString(&c.ClientUrls, defaultClientUrls) - adjustString(&c.AdvertiseClientUrls, c.ClientUrls) - adjustString(&c.PeerUrls, defaultPeerUrls) - adjustString(&c.AdvertisePeerUrls, c.PeerUrls) - - if len(c.InitialCluster) == 0 { - // The advertise peer urls may be http://127.0.0.1:2380,http://127.0.0.1:2381 - // so the initial cluster is pd=http://127.0.0.1:2380,pd=http://127.0.0.1:2381 - items := strings.Split(c.AdvertisePeerUrls, ",") - - sep := "" - for _, item := range items { - c.InitialCluster += fmt.Sprintf("%s%s=%s", sep, c.Name, item) - sep = "," - } - } - - adjustString(&c.InitialClusterState, defaultInitialClusterState) - adjustString(&c.InitialClusterToken, defaultInitialClusterToken) - - adjustInt64(&c.LeaderLease, defaultLeaderLease) - - adjustDuration(&c.TsoSaveInterval, time.Duration(defaultLeaderLease)*time.Second) - - adjustDuration(&c.TickInterval, defaultTickInterval) - adjustDuration(&c.ElectionInterval, defaultElectionInterval) - - if err := c.PDServerCfg.adjust(configMetaData.Child("pd-server")); err != nil { - return err - } - - c.adjustLog(configMetaData.Child("log")) - adjustDuration(&c.HeartbeatStreamBindInterval, defaultHeartbeatStreamRebindInterval) - - if !configMetaData.IsDefined("enable-prevote") { - c.PreVote = true - } - if !configMetaData.IsDefined("enable-grpc-gateway") { - c.EnableGRPCGateway = defaultEnableGRPCGateway - } - - return nil -} - -func (c *Config) adjustLog(meta *configMetaData) { - if !meta.IsDefined("disable-error-verbose") { - c.Log.DisableErrorVerbose = defaultDisableErrorVerbose - } -} - -// Clone returns a cloned configuration. -func (c *Config) Clone() *Config { - cfg := &Config{} - *cfg = *c - return cfg -} - -func (c *Config) String() string { - data, err := json.MarshalIndent(c, "", " ") - if err != nil { - return "" - } - return string(data) -} - -// configFromFile loads config from file. -func (c *Config) configFromFile(path string) (*toml.MetaData, error) { - meta, err := toml.DecodeFile(path, c) - return &meta, errors.WithStack(err) -} - -// PDServerConfig is the configuration for pd server. -type PDServerConfig struct { - // MaxResetTSGap is the max gap to reset the tso. - MaxResetTSGap typeutil.Duration `toml:"max-gap-reset-ts" json:"max-gap-reset-ts"` -} - -func (c *PDServerConfig) adjust(meta *configMetaData) error { - adjustDuration(&c.MaxResetTSGap, defaultMaxResetTSGap) - return nil -} - -// Clone returns a cloned PD server config. -func (c *PDServerConfig) Clone() *PDServerConfig { - return &PDServerConfig{ - MaxResetTSGap: c.MaxResetTSGap, - } -} - -// ParseUrls parse a string into multiple urls. -// Export for api. -func ParseUrls(s string) ([]url.URL, error) { - items := strings.Split(s, ",") - urls := make([]url.URL, 0, len(items)) - for _, item := range items { - u, err := url.Parse(item) - if err != nil { - return nil, errors.WithStack(err) - } - - urls = append(urls, *u) - } - - return urls, nil -} - -// SetupLogger setup the logger. -func (c *Config) SetupLogger() error { - lg, p, err := log.InitLogger(&c.Log, zap.AddStacktrace(zapcore.FatalLevel)) - if err != nil { - return err - } - c.logger = lg - c.logProps = p - return nil -} - -// GetZapLogger gets the created zap logger. -func (c *Config) GetZapLogger() *zap.Logger { - return c.logger -} - -// GetZapLogProperties gets properties of the zap logger. -func (c *Config) GetZapLogProperties() *log.ZapProperties { - return c.logProps -} - -// GetConfigFile gets the config file. -func (c *Config) GetConfigFile() string { - return c.configFile -} - -// RewriteFile rewrites the config file after updating the config. -func (c *Config) RewriteFile(new *Config) error { - filePath := c.GetConfigFile() - if filePath == "" { - return nil - } - var buf bytes.Buffer - if err := toml.NewEncoder(&buf).Encode(*new); err != nil { - return err - } - dir := filepath.Dir(filePath) - tmpfile := filepath.Join(dir, "tmp_pd.toml") - - f, err := os.Create(tmpfile) - if err != nil { - return err - } - defer f.Close() - if _, err := f.Write(buf.Bytes()); err != nil { - return err - } - if err := f.Sync(); err != nil { - return err - } - return os.Rename(tmpfile, filePath) -} - -func (c *Config) GenEmbedEtcdConfig() (*embed.Config, error) { - cfg := embed.NewConfig() - cfg.Name = c.Name - cfg.Dir = c.DataDir - cfg.WalDir = "" - cfg.InitialCluster = c.InitialCluster - cfg.ClusterState = c.InitialClusterState - cfg.InitialClusterToken = c.InitialClusterToken - cfg.EnablePprof = true - cfg.PreVote = c.PreVote - cfg.StrictReconfigCheck = !c.DisableStrictReconfigCheck - cfg.TickMs = uint(c.TickInterval.Duration / time.Millisecond) - cfg.ElectionMs = uint(c.ElectionInterval.Duration / time.Millisecond) - - allowedCN, serr := c.Security.GetOneAllowedCN() - if serr != nil { - return nil, serr - } - cfg.ClientTLSInfo.ClientCertAuth = len(c.Security.CAPath) != 0 - cfg.ClientTLSInfo.TrustedCAFile = c.Security.CAPath - cfg.ClientTLSInfo.CertFile = c.Security.CertPath - cfg.ClientTLSInfo.KeyFile = c.Security.KeyPath - // Client no need to set the CN. (cfg.ClientTLSInfo.AllowedCN = allowedCN) - cfg.PeerTLSInfo.ClientCertAuth = len(c.Security.CAPath) != 0 - cfg.PeerTLSInfo.TrustedCAFile = c.Security.CAPath - cfg.PeerTLSInfo.CertFile = c.Security.CertPath - cfg.PeerTLSInfo.KeyFile = c.Security.KeyPath - cfg.PeerTLSInfo.AllowedCN = allowedCN - // cfg.ZapLoggerBuilder = embed.NewZapCoreLoggerBuilder(c.logger, c.logger.Core(), c.logProps.Syncer) - cfg.EnableGRPCGateway = c.EnableGRPCGateway - cfg.EnableV2 = true - cfg.Logger = "zap" - var err error - cfg.LPUrls, err = ParseUrls(c.PeerUrls) - if err != nil { - return nil, err - } - - cfg.APUrls, err = ParseUrls(c.AdvertisePeerUrls) - if err != nil { - return nil, err - } - - cfg.LCUrls, err = ParseUrls(c.ClientUrls) - if err != nil { - return nil, err - } - - cfg.ACUrls, err = ParseUrls(c.AdvertiseClientUrls) - if err != nil { - return nil, err - } - - return cfg, nil -} diff --git a/master/config/persist_options.go b/master/config/persist_options.go deleted file mode 100644 index 78bdce8dcb..0000000000 --- a/master/config/persist_options.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2017 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package config - -import ( - "sync/atomic" - "time" - //"github.com/czs007/suvlim/master/kv" - "github.com/czs007/suvlim/master/meta" - -) - -// PersistOptions wraps all configurations that need to persist to storage and -// allows to access them safely. -type PersistOptions struct { - pdServerConfig atomic.Value -} - -// NewPersistOptions creates a new PersistOptions instance. -func NewPersistOptions(cfg *Config) *PersistOptions { - o := &PersistOptions{} - o.pdServerConfig.Store(&cfg.PDServerCfg) - return o -} - -// GetPDServerConfig returns pd server configurations. -func (o *PersistOptions) GetPDServerConfig() *PDServerConfig { - return o.pdServerConfig.Load().(*PDServerConfig) -} - -// SetPDServerConfig sets the PD configuration. -func (o *PersistOptions) SetPDServerConfig(cfg *PDServerConfig) { - o.pdServerConfig.Store(cfg) -} - - -// GetMaxResetTSGap gets the max gap to reset the tso. -func (o *PersistOptions) GetMaxResetTSGap() time.Duration { - return o.GetPDServerConfig().MaxResetTSGap.Duration -} - - -// Persist saves the configuration to the storage. -func (o *PersistOptions) Persist(storage *meta.Storage) error { - cfg := &Config{ - PDServerCfg: *o.GetPDServerConfig(), - } - err := storage.SaveConfig(cfg) - return err -} - -// Reload reloads the configuration from the storage. -func (o *PersistOptions) Reload(storage *meta.Storage) error { - cfg := &Config{} - // pass nil to initialize cfg to default values (all items undefined) - cfg.Adjust(nil) - - isExist, err := storage.LoadConfig(cfg) - if err != nil { - return err - } - if isExist { - o.pdServerConfig.Store(&cfg.PDServerCfg) - } - return nil -} diff --git a/master/config/util.go b/master/config/util.go deleted file mode 100644 index 11fdbf8a18..0000000000 --- a/master/config/util.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2019 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package config - -import ( - "net/url" - "regexp" - "github.com/czs007/suvlim/errors" -) - -const ( - // Label key consists of alphanumeric characters, '-', '_', '.' or '/', and must start and end with an - // alphanumeric character. If can also contain an extra '$' at the beginning. - keyFormat = "^[$]?[A-Za-z0-9]([-A-Za-z0-9_./]*[A-Za-z0-9])?$" - // Value key can be any combination of alphanumeric characters, '-', '_', '.' or '/'. It can also be empty to - // mark the label as deleted. - valueFormat = "^[-A-Za-z0-9_./]*$" -) - -func validateFormat(s, format string) error { - isValid, _ := regexp.MatchString(format, s) - if !isValid { - return errors.Errorf("%s does not match format %q", s, format) - } - return nil -} - -// ValidateURLWithScheme checks the format of the URL. -func ValidateURLWithScheme(rawURL string) error { - u, err := url.ParseRequestURI(rawURL) - if err != nil { - return err - } - if u.Scheme == "" || u.Host == "" { - return errors.Errorf("%s has no scheme", rawURL) - } - return nil -} diff --git a/master/election/leadership.go b/master/election/leadership.go deleted file mode 100644 index 645dc775b9..0000000000 --- a/master/election/leadership.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2020 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package election - -import ( - "context" - "sync/atomic" - "github.com/czs007/suvlim/errors" - "github.com/czs007/suvlim/pkg/pdpb" - "github.com/czs007/suvlim/util/etcdutil" - "github.com/czs007/suvlim/master/kv" - "go.etcd.io/etcd/clientv3" -) - -// GetLeader gets the corresponding leader from etcd by given leaderPath (as the key). -func GetLeader(c *clientv3.Client, leaderPath string) (*pdpb.Member, int64, error) { - leader := &pdpb.Member{} - ok, rev, err := etcdutil.GetProtoMsgWithModRev(c, leaderPath, leader) - if err != nil { - return nil, 0, err - } - if !ok { - return nil, 0, nil - } - - return leader, rev, nil -} - -// Leadership is used to manage the leadership campaigning. -type Leadership struct { - // purpose is used to show what this election for - purpose string - // The lease which is used to get this leadership - lease atomic.Value // stored as *lease - client *clientv3.Client - // leaderKey and leaderValue are key-value pair in etcd - leaderKey string - leaderValue string -} - -// NewLeadership creates a new Leadership. -func NewLeadership(client *clientv3.Client, leaderKey, purpose string) *Leadership { - leadership := &Leadership{ - purpose: purpose, - client: client, - leaderKey: leaderKey, - } - return leadership -} - -// getLease gets the lease of leadership, only if leadership is valid, -// i.e the owner is a true leader, the lease is not nil. -func (ls *Leadership) getLease() *lease { - l := ls.lease.Load() - if l == nil { - return nil - } - return l.(*lease) -} - -func (ls *Leadership) setLease(lease *lease) { - ls.lease.Store(lease) -} - -// GetClient is used to get the etcd client. -func (ls *Leadership) GetClient() *clientv3.Client { - return ls.client -} - -// Keep will keep the leadership available by update the lease's expired time continuously -func (ls *Leadership) Keep(ctx context.Context) { - ls.getLease().KeepAlive(ctx) -} - -// Check returns whether the leadership is still available -func (ls *Leadership) Check() bool { - return ls != nil && ls.getLease() != nil && !ls.getLease().IsExpired() -} - -// LeaderTxn returns txn() with a leader comparison to guarantee that -// the transaction can be executed only if the server is leader. -func (ls *Leadership) LeaderTxn(cs ...clientv3.Cmp) clientv3.Txn { - txn := kv.NewSlowLogTxn(ls.client) - return txn.If(append(cs, ls.leaderCmp())...) -} - -func (ls *Leadership) leaderCmp() clientv3.Cmp { - return clientv3.Compare(clientv3.Value(ls.leaderKey), "=", ls.leaderValue) -} - -// DeleteLeader deletes the corresponding leader from etcd by given leaderPath (as the key). -func (ls *Leadership) DeleteLeader() error { - // delete leader itself and let others start a new election again. - resp, err := ls.LeaderTxn().Then(clientv3.OpDelete(ls.leaderKey)).Commit() - if err != nil { - return errors.WithStack(err) - } - if !resp.Succeeded { - return errors.New("resign leader failed, we are not leader already") - } - - return nil -} - -// Reset does some defer job such as closing lease, resetting lease etc. -func (ls *Leadership) Reset() { - ls.getLease().Close() -} diff --git a/master/election/lease.go b/master/election/lease.go deleted file mode 100644 index fa2bf73d58..0000000000 --- a/master/election/lease.go +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright 2019 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package election - -import ( - "context" - "sync/atomic" - "time" - - "github.com/czs007/suvlim/errors" - "github.com/pingcap/log" - "github.com/tikv/pd/pkg/etcdutil" - "go.etcd.io/etcd/clientv3" - "go.uber.org/zap" -) - -const ( - revokeLeaseTimeout = time.Second - requestTimeout = etcdutil.DefaultRequestTimeout - slowRequestTime = etcdutil.DefaultSlowRequestTime -) - -// lease is used as the low-level mechanism for campaigning and renewing elected leadership. -// The way to gain and maintain leadership is to update and keep the lease alive continuously. -type lease struct { - // purpose is used to show what this election for - Purpose string - // etcd client and lease - client *clientv3.Client - lease clientv3.Lease - ID clientv3.LeaseID - // leaseTimeout and expireTime are used to control the lease's lifetime - leaseTimeout time.Duration - expireTime atomic.Value -} - -// Grant uses `lease.Grant` to initialize the lease and expireTime. -func (l *lease) Grant(leaseTimeout int64) error { - start := time.Now() - ctx, cancel := context.WithTimeout(l.client.Ctx(), requestTimeout) - leaseResp, err := l.lease.Grant(ctx, leaseTimeout) - cancel() - if err != nil { - return errors.WithStack(err) - } - if cost := time.Since(start); cost > slowRequestTime { - log.Warn("lease grants too slow", zap.Duration("cost", cost), zap.String("purpose", l.Purpose)) - } - log.Info("lease granted", zap.Int64("lease-id", int64(leaseResp.ID)), zap.Int64("lease-timeout", leaseTimeout), zap.String("purpose", l.Purpose)) - l.ID = leaseResp.ID - l.leaseTimeout = time.Duration(leaseTimeout) * time.Second - l.expireTime.Store(start.Add(time.Duration(leaseResp.TTL) * time.Second)) - return nil -} - -// Close releases the lease. -func (l *lease) Close() error { - // Reset expire time. - l.expireTime.Store(time.Time{}) - // Try to revoke lease to make subsequent elections faster. - ctx, cancel := context.WithTimeout(l.client.Ctx(), revokeLeaseTimeout) - defer cancel() - l.lease.Revoke(ctx, l.ID) - return l.lease.Close() -} - -// IsExpired checks if the lease is expired. If it returns true, -// current leader should step down and try to re-elect again. -func (l *lease) IsExpired() bool { - if l.expireTime.Load() == nil { - return false - } - return time.Now().After(l.expireTime.Load().(time.Time)) -} - -// KeepAlive auto renews the lease and update expireTime. -func (l *lease) KeepAlive(ctx context.Context) { - ctx, cancel := context.WithCancel(ctx) - defer cancel() - timeCh := l.keepAliveWorker(ctx, l.leaseTimeout/3) - - var maxExpire time.Time - for { - select { - case t := <-timeCh: - if t.After(maxExpire) { - maxExpire = t - l.expireTime.Store(t) - } - case <-time.After(l.leaseTimeout): - log.Info("lease timeout", zap.Time("expire", l.expireTime.Load().(time.Time)), zap.String("purpose", l.Purpose)) - return - case <-ctx.Done(): - return - } - } -} - -// Periodically call `lease.KeepAliveOnce` and post back latest received expire time into the channel. -func (l *lease) keepAliveWorker(ctx context.Context, interval time.Duration) <-chan time.Time { - ch := make(chan time.Time) - - go func() { - ticker := time.NewTicker(interval) - defer ticker.Stop() - - log.Info("start lease keep alive worker", zap.Duration("interval", interval), zap.String("purpose", l.Purpose)) - defer log.Info("stop lease keep alive worker", zap.String("purpose", l.Purpose)) - - for { - go func() { - start := time.Now() - ctx1, cancel := context.WithTimeout(ctx, l.leaseTimeout) - defer cancel() - res, err := l.lease.KeepAliveOnce(ctx1, l.ID) - if err != nil { - log.Warn("lease keep alive failed", zap.Error(err), zap.String("purpose", l.Purpose)) - return - } - if res.TTL > 0 { - expire := start.Add(time.Duration(res.TTL) * time.Second) - select { - case ch <- expire: - case <-ctx1.Done(): - } - } - }() - - select { - case <-ctx.Done(): - return - case <-ticker.C: - } - } - }() - - return ch -} diff --git a/master/grpc/client/main.go b/master/grpc/client/main.go deleted file mode 100644 index dbe5a7463f..0000000000 --- a/master/grpc/client/main.go +++ /dev/null @@ -1,42 +0,0 @@ -package main - -import ( - "context" - "fmt" - "log" - "time" - - master "github.com/czs007/suvlim/master/grpc/proto" - "google.golang.org/grpc" -) - -const ( - masterAddress = "192.168.2.28:50051" -) - - -func main() { - con, err := grpc.Dial(masterAddress, grpc.WithInsecure(), grpc.WithBlock()) - if err != nil { - log.Fatalf("did not connect %v", err) - } - - masterClient := master.NewGreeterClient(con) - ctx, cancel := context.WithTimeout(context.Background(), time.Second) - - defer cancel() - proxyAddress, err := masterClient.GetAddress(ctx, &master.EmptyRequest{}) - if err != nil { - log.Printf("could not get address: %v", err) - } - log.Printf("you can connect the proxy server: %v", proxyAddress.GetAddress()) - con.Close() - - test, err := masterClient.GetAddress(ctx, &master.EmptyRequest{}) - fmt.Println(test.GetAddress()) - - con, err = grpc.Dial(proxyAddress.GetAddress(), grpc.WithInsecure(), grpc.WithBlock()) - proxyClient := master.NewHelloServiceClient(con) - helloReply, err := proxyClient.SayHello(ctx, &master.HelloRequest{Name: "hahaha"}) - fmt.Println(helloReply.Msg) -} \ No newline at end of file diff --git a/master/grpc/proto/hello.pb.go b/master/grpc/proto/hello.pb.go deleted file mode 100644 index 17fb6e0352..0000000000 --- a/master/grpc/proto/hello.pb.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: hello.proto - -package master - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type HelloRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HelloRequest) Reset() { *m = HelloRequest{} } -func (m *HelloRequest) String() string { return proto.CompactTextString(m) } -func (*HelloRequest) ProtoMessage() {} -func (*HelloRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_61ef911816e0a8ce, []int{0} -} - -func (m *HelloRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HelloRequest.Unmarshal(m, b) -} -func (m *HelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HelloRequest.Marshal(b, m, deterministic) -} -func (m *HelloRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HelloRequest.Merge(m, src) -} -func (m *HelloRequest) XXX_Size() int { - return xxx_messageInfo_HelloRequest.Size(m) -} -func (m *HelloRequest) XXX_DiscardUnknown() { - xxx_messageInfo_HelloRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_HelloRequest proto.InternalMessageInfo - -func (m *HelloRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type HelloReply struct { - Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HelloReply) Reset() { *m = HelloReply{} } -func (m *HelloReply) String() string { return proto.CompactTextString(m) } -func (*HelloReply) ProtoMessage() {} -func (*HelloReply) Descriptor() ([]byte, []int) { - return fileDescriptor_61ef911816e0a8ce, []int{1} -} - -func (m *HelloReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HelloReply.Unmarshal(m, b) -} -func (m *HelloReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HelloReply.Marshal(b, m, deterministic) -} -func (m *HelloReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_HelloReply.Merge(m, src) -} -func (m *HelloReply) XXX_Size() int { - return xxx_messageInfo_HelloReply.Size(m) -} -func (m *HelloReply) XXX_DiscardUnknown() { - xxx_messageInfo_HelloReply.DiscardUnknown(m) -} - -var xxx_messageInfo_HelloReply proto.InternalMessageInfo - -func (m *HelloReply) GetMsg() string { - if m != nil { - return m.Msg - } - return "" -} - -func init() { - proto.RegisterType((*HelloRequest)(nil), "milvus.HelloRequest") - proto.RegisterType((*HelloReply)(nil), "milvus.HelloReply") -} - -func init() { proto.RegisterFile("hello.proto", fileDescriptor_61ef911816e0a8ce) } - -var fileDescriptor_61ef911816e0a8ce = []byte{ - // 148 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xce, 0x48, 0xcd, 0xc9, - 0xc9, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xcb, 0xcd, 0xcc, 0x29, 0x2b, 0x2d, 0x56, - 0x52, 0xe2, 0xe2, 0xf1, 0x00, 0x09, 0x07, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x08, 0x09, 0x71, - 0xb1, 0xe4, 0x25, 0xe6, 0xa6, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x81, 0xd9, 0x4a, 0x72, - 0x5c, 0x5c, 0x50, 0x35, 0x05, 0x39, 0x95, 0x42, 0x02, 0x5c, 0xcc, 0xb9, 0xc5, 0xe9, 0x50, 0x05, - 0x20, 0xa6, 0x91, 0x1b, 0xd4, 0x8c, 0xe0, 0xd4, 0xa2, 0xb2, 0xcc, 0xe4, 0x54, 0x21, 0x33, 0x2e, - 0x8e, 0xe0, 0xc4, 0x4a, 0xb0, 0x90, 0x90, 0x88, 0x1e, 0xc4, 0x22, 0x3d, 0x64, 0x5b, 0xa4, 0x84, - 0xd0, 0x44, 0x0b, 0x72, 0x2a, 0x95, 0x18, 0x9c, 0x38, 0xa2, 0xd8, 0x72, 0x13, 0x8b, 0x4b, 0x52, - 0x8b, 0x92, 0xd8, 0xc0, 0x8e, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xd9, 0xed, 0x42, 0x91, - 0xb3, 0x00, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// HelloServiceClient is the client API for HelloService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type HelloServiceClient interface { - SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) -} - -type helloServiceClient struct { - cc *grpc.ClientConn -} - -func NewHelloServiceClient(cc *grpc.ClientConn) HelloServiceClient { - return &helloServiceClient{cc} -} - -func (c *helloServiceClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) { - out := new(HelloReply) - err := c.cc.Invoke(ctx, "/milvus.HelloService/SayHello", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// HelloServiceServer is the server API for HelloService service. -type HelloServiceServer interface { - SayHello(context.Context, *HelloRequest) (*HelloReply, error) -} - -// UnimplementedHelloServiceServer can be embedded to have forward compatible implementations. -type UnimplementedHelloServiceServer struct { -} - -func (*UnimplementedHelloServiceServer) SayHello(ctx context.Context, req *HelloRequest) (*HelloReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented") -} - -func RegisterHelloServiceServer(s *grpc.Server, srv HelloServiceServer) { - s.RegisterService(&_HelloService_serviceDesc, srv) -} - -func _HelloService_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HelloRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(HelloServiceServer).SayHello(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/milvus.HelloService/SayHello", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HelloServiceServer).SayHello(ctx, req.(*HelloRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _HelloService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "milvus.HelloService", - HandlerType: (*HelloServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SayHello", - Handler: _HelloService_SayHello_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "hello.proto", -} diff --git a/master/grpc/proto/hello.proto b/master/grpc/proto/hello.proto deleted file mode 100644 index c15887ed42..0000000000 --- a/master/grpc/proto/hello.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; - -option go_package = "master"; - -package milvus; - -message HelloRequest{ -string name = 1; -} - -message HelloReply{ -string msg = 1; -} - -service HelloService{ - rpc SayHello (HelloRequest) returns (HelloReply){} -} \ No newline at end of file diff --git a/master/grpc/proto/master.pb.go b/master/grpc/proto/master.pb.go deleted file mode 100644 index 9ec35d64df..0000000000 --- a/master/grpc/proto/master.pb.go +++ /dev/null @@ -1,281 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: master.proto - -package master - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// The request message containing the user's name. -type Request struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { - return fileDescriptor_f9c348dec43a6705, []int{0} -} - -func (m *Request) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Request.Unmarshal(m, b) -} -func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Request.Marshal(b, m, deterministic) -} -func (m *Request) XXX_Merge(src proto.Message) { - xxx_messageInfo_Request.Merge(m, src) -} -func (m *Request) XXX_Size() int { - return xxx_messageInfo_Request.Size(m) -} -func (m *Request) XXX_DiscardUnknown() { - xxx_messageInfo_Request.DiscardUnknown(m) -} - -var xxx_messageInfo_Request proto.InternalMessageInfo - -func (m *Request) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -type EmptyRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EmptyRequest) Reset() { *m = EmptyRequest{} } -func (m *EmptyRequest) String() string { return proto.CompactTextString(m) } -func (*EmptyRequest) ProtoMessage() {} -func (*EmptyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f9c348dec43a6705, []int{1} -} - -func (m *EmptyRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EmptyRequest.Unmarshal(m, b) -} -func (m *EmptyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EmptyRequest.Marshal(b, m, deterministic) -} -func (m *EmptyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_EmptyRequest.Merge(m, src) -} -func (m *EmptyRequest) XXX_Size() int { - return xxx_messageInfo_EmptyRequest.Size(m) -} -func (m *EmptyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_EmptyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_EmptyRequest proto.InternalMessageInfo - -// The response message containing the greetings -type Reply struct { - Status bool `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Reply) Reset() { *m = Reply{} } -func (m *Reply) String() string { return proto.CompactTextString(m) } -func (*Reply) ProtoMessage() {} -func (*Reply) Descriptor() ([]byte, []int) { - return fileDescriptor_f9c348dec43a6705, []int{2} -} - -func (m *Reply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Reply.Unmarshal(m, b) -} -func (m *Reply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Reply.Marshal(b, m, deterministic) -} -func (m *Reply) XXX_Merge(src proto.Message) { - xxx_messageInfo_Reply.Merge(m, src) -} -func (m *Reply) XXX_Size() int { - return xxx_messageInfo_Reply.Size(m) -} -func (m *Reply) XXX_DiscardUnknown() { - xxx_messageInfo_Reply.DiscardUnknown(m) -} - -var xxx_messageInfo_Reply proto.InternalMessageInfo - -func (m *Reply) GetStatus() bool { - if m != nil { - return m.Status - } - return false -} - -func init() { - proto.RegisterType((*Request)(nil), "master.Request") - proto.RegisterType((*EmptyRequest)(nil), "master.EmptyRequest") - proto.RegisterType((*Reply)(nil), "master.Reply") -} - -func init() { proto.RegisterFile("master.proto", fileDescriptor_f9c348dec43a6705) } - -var fileDescriptor_f9c348dec43a6705 = []byte{ - // 196 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xc9, 0x4d, 0x2c, 0x2e, - 0x49, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, 0xf0, 0x94, 0x94, 0xb9, 0xd8, - 0x83, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0x24, 0xb8, 0xd8, 0x13, 0x53, 0x52, 0x8a, 0x52, - 0x8b, 0x8b, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x60, 0x5c, 0x25, 0x3e, 0x2e, 0x1e, 0xd7, - 0xdc, 0x82, 0x92, 0x4a, 0xa8, 0x4a, 0x25, 0x79, 0x2e, 0xd6, 0xa0, 0xd4, 0x82, 0x9c, 0x4a, 0x21, - 0x31, 0x2e, 0xb6, 0xe2, 0x92, 0xc4, 0x92, 0x52, 0x88, 0x0e, 0x8e, 0x20, 0x28, 0xcf, 0xa8, 0x98, - 0x8b, 0xdd, 0xbd, 0x28, 0x35, 0xb5, 0x24, 0xb5, 0x48, 0xc8, 0x90, 0x8b, 0x37, 0x28, 0xb5, 0x20, - 0xbf, 0xa8, 0xc4, 0x11, 0x62, 0x98, 0x10, 0xbf, 0x1e, 0xd4, 0x21, 0x50, 0xd3, 0xa4, 0x78, 0x11, - 0x02, 0x05, 0x39, 0x95, 0x4a, 0x0c, 0x42, 0xa6, 0x5c, 0x5c, 0xee, 0xa9, 0x70, 0xf5, 0x22, 0x30, - 0x69, 0x64, 0x27, 0x48, 0xa1, 0x9b, 0xa2, 0xc4, 0xe0, 0xa4, 0xcd, 0x25, 0x04, 0x15, 0x4b, 0x2f, - 0x2a, 0x48, 0x86, 0xca, 0x3b, 0x71, 0xfb, 0x82, 0xe9, 0x00, 0x90, 0xaf, 0x03, 0x18, 0xa3, 0xa0, - 0xfe, 0x4e, 0x62, 0x03, 0x07, 0x83, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xe4, 0x39, 0x2c, - 0x16, 0x01, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// GreeterClient is the client API for Greeter service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type GreeterClient interface { - // receive a grpc_server address and set to etcd. - ReportAddress(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error) - // send a grpc_server address to client - GetAddress(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Request, error) -} - -type greeterClient struct { - cc *grpc.ClientConn -} - -func NewGreeterClient(cc *grpc.ClientConn) GreeterClient { - return &greeterClient{cc} -} - -func (c *greeterClient) ReportAddress(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error) { - out := new(Reply) - err := c.cc.Invoke(ctx, "/master.Greeter/ReportAddress", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *greeterClient) GetAddress(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*Request, error) { - out := new(Request) - err := c.cc.Invoke(ctx, "/master.Greeter/GetAddress", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// GreeterServer is the server API for Greeter service. -type GreeterServer interface { - // receive a grpc_server address and set to etcd. - ReportAddress(context.Context, *Request) (*Reply, error) - // send a grpc_server address to client - GetAddress(context.Context, *EmptyRequest) (*Request, error) -} - -// UnimplementedGreeterServer can be embedded to have forward compatible implementations. -type UnimplementedGreeterServer struct { -} - -func (*UnimplementedGreeterServer) ReportAddress(ctx context.Context, req *Request) (*Reply, error) { - return nil, status.Errorf(codes.Unimplemented, "method ReportAddress not implemented") -} -func (*UnimplementedGreeterServer) GetAddress(ctx context.Context, req *EmptyRequest) (*Request, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAddress not implemented") -} - -func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) { - s.RegisterService(&_Greeter_serviceDesc, srv) -} - -func _Greeter_ReportAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Request) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GreeterServer).ReportAddress(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/master.Greeter/ReportAddress", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GreeterServer).ReportAddress(ctx, req.(*Request)) - } - return interceptor(ctx, in, info, handler) -} - -func _Greeter_GetAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EmptyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GreeterServer).GetAddress(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/master.Greeter/GetAddress", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GreeterServer).GetAddress(ctx, req.(*EmptyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Greeter_serviceDesc = grpc.ServiceDesc{ - ServiceName: "master.Greeter", - HandlerType: (*GreeterServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ReportAddress", - Handler: _Greeter_ReportAddress_Handler, - }, - { - MethodName: "GetAddress", - Handler: _Greeter_GetAddress_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "master.proto", -} diff --git a/master/grpc/proto/master.proto b/master/grpc/proto/master.proto deleted file mode 100644 index 4c43857f6e..0000000000 --- a/master/grpc/proto/master.proto +++ /dev/null @@ -1,31 +0,0 @@ -syntax = "proto3"; - -option go_package = "master"; -option java_multiple_files = true; -option java_package = "master.grpc.master"; -option java_outer_classname = "MasterProto"; - -package master; - -// The greeting service definition. -service Greeter { - // receive a grpc_server address and set to etcd. - rpc ReportAddress (Request) returns (Reply) {} - - // send a grpc_server address to client - rpc GetAddress (EmptyRequest) returns (Request) {} -} - -// The request message containing the user's name. -message Request { - string address = 1; -} - -message EmptyRequest { - -} - -// The response message containing the greetings -message Reply { - bool status = 1; -} diff --git a/master/grpc/server/main.go b/master/grpc/server/main.go deleted file mode 100644 index 8d56fb84cc..0000000000 --- a/master/grpc/server/main.go +++ /dev/null @@ -1,87 +0,0 @@ -package main - -import ( - "context" - "fmt" - "go.etcd.io/etcd/clientv3" - "google.golang.org/grpc" - "log" - "net" - "time" - - pd "github.com/czs007/suvlim/master/grpc/proto" -) - -const ( - port = ":50051" -) - -var address = "" -type masterServer struct { - pd.UnimplementedGreeterServer -} - -func GetAddressFromETCD(ctx context.Context, key string) (string, error) { - ETCDClient, err := clientv3.New(clientv3.Config{ - Endpoints: []string{"192.168.2.28:2379"}, - DialTimeout: 5 * time.Second, - }) - - fmt.Println(err) - kv := clientv3.NewKV(ETCDClient) - - getResp, err := kv.Get(ctx, key) - if err != nil { - return "", err - } - - address := getResp.Kvs[0].Value - - return string(address), nil -} - -func PutAddressToETCD(ctx context.Context, key string, address string) (error) { - ETCDClient, err := clientv3.New(clientv3.Config{ - Endpoints: []string{"192.168.2.28:2379"}, - DialTimeout: 5 * time.Second, - }) - - fmt.Println(err) - kv := clientv3.NewKV(ETCDClient) - - _, err = kv.Put(ctx, key, address) - return err -} - -func (s *masterServer) ReportAddress(ctx context.Context, in *pd.Request) (*pd.Reply, error) { - log.Printf("Receive a grpc server address: %v!", in.GetAddress()) - err := PutAddressToETCD(ctx, "proxyAddress", in.GetAddress()) - if err != nil{ - return &pd.Reply{Status: false}, err - } - //address = in.GetAddress() - return &pd.Reply{Status: true}, nil -} - -func (s *masterServer) GetAddress(ctx context.Context, in *pd.EmptyRequest) (*pd.Request, error) { - fmt.Println("This is test SendAddress!") - address, err := GetAddressFromETCD(ctx, "proxyAddress") - if err != nil { - return nil, err - } - return &pd.Request{Address: address}, nil -} - -func main() { - listen, err := net.Listen("tcp", port) - if err != nil { - fmt.Println(err) - } - - s := grpc.NewServer() - - pd.RegisterGreeterServer(s, &masterServer{}) - if err := s.Serve(listen); err != nil{ - log.Printf("failed to server: %v", err) - } -} \ No newline at end of file diff --git a/master/grpc_service.go b/master/grpc_service.go deleted file mode 100644 index e8a7f558cd..0000000000 --- a/master/grpc_service.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2017 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package server - -import ( - "context" - "io" - //"strconv" - "sync/atomic" - "time" - - "github.com/czs007/suvlim/pkg/pdpb" - "github.com/czs007/suvlim/errors" - "github.com/pingcap/log" - //"github.com/czs007/suvlim/util/tsoutil" - "go.uber.org/zap" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -const slowThreshold = 5 * time.Millisecond - -// gRPC errors -var ( - // ErrNotLeader is returned when current server is not the leader and not possible to process request. - // TODO: work as proxy. - ErrNotLeader = status.Errorf(codes.Unavailable, "not leader") - ErrNotStarted = status.Errorf(codes.Unavailable, "server not started") -) - -// Tso implements gRPC PDServer. -func (s *Server) Tso(stream pdpb.PD_TsoServer) error { - for { - request, err := stream.Recv() - if err == io.EOF { - return nil - } - if err != nil { - return errors.WithStack(err) - } - start := time.Now() - // TSO uses leader lease to determine validity. No need to check leader here. - if s.IsClosed() { - return status.Errorf(codes.Unknown, "server not started") - } - if request.GetHeader().GetClusterId() != s.clusterID { - return status.Errorf(codes.FailedPrecondition, "mismatch cluster id, need %d but got %d", s.clusterID, request.GetHeader().GetClusterId()) - } - count := request.GetCount() - ts, err := s.tsoAllocator.GenerateTSO(count) - if err != nil { - return status.Errorf(codes.Unknown, err.Error()) - } - - elapsed := time.Since(start) - if elapsed > slowThreshold { - log.Warn("get timestamp too slow", zap.Duration("cost", elapsed)) - } - response := &pdpb.TsoResponse{ - Header: s.header(), - Timestamp: &ts, - Count: count, - } - if err := stream.Send(response); err != nil { - return errors.WithStack(err) - } - } -} - - -// AllocID implements gRPC PDServer. -func (s *Server) AllocID(ctx context.Context, request *pdpb.AllocIDRequest) (*pdpb.AllocIDResponse, error) { - if err := s.validateRequest(request.GetHeader()); err != nil { - return nil, err - } - - // We can use an allocator for all types ID allocation. - id, err := s.idAllocator.Alloc() - if err != nil { - return nil, status.Errorf(codes.Unknown, err.Error()) - } - - return &pdpb.AllocIDResponse{ - Header: s.header(), - Id: id, - }, nil -} - - -const heartbeatSendTimeout = 5 * time.Second - -var errSendHeartbeatTimeout = errors.New("send region heartbeat timeout") - -// heartbeatServer wraps PD_RegionHeartbeatServer to ensure when any error -// occurs on Send() or Recv(), both endpoints will be closed. -type heartbeatServer struct { - stream pdpb.PD_HeartbeatServer - closed int32 -} - -func (s *heartbeatServer) Send(m *pdpb.HeartbeatResponse) error { - if atomic.LoadInt32(&s.closed) == 1 { - return io.EOF - } - done := make(chan error, 1) - go func() { done <- s.stream.Send(m) }() - select { - case err := <-done: - if err != nil { - atomic.StoreInt32(&s.closed, 1) - } - return errors.WithStack(err) - case <-time.After(heartbeatSendTimeout): - atomic.StoreInt32(&s.closed, 1) - return errors.WithStack(errSendHeartbeatTimeout) - } -} - -func (s *heartbeatServer) Recv() (*pdpb.HeartbeatRequest, error) { - if atomic.LoadInt32(&s.closed) == 1 { - return nil, io.EOF - } - req, err := s.stream.Recv() - if err != nil { - atomic.StoreInt32(&s.closed, 1) - return nil, errors.WithStack(err) - } - return req, nil -} - -// RegionHeartbeat implements gRPC PDServer. -func (s *Server) Heartbeat(stream pdpb.PD_HeartbeatServer) error { - server := &heartbeatServer{stream: stream} - - for { - request, err := server.Recv() - if err == io.EOF { - return nil - } - if err != nil { - return errors.WithStack(err) - } - - if err = s.validateRequest(request.GetHeader()); err != nil { - return err - } - //msg:= "OK" - //s.hbStreams.SendMsg(msg) - } -} - -// validateRequest checks if Server is leader and clusterID is matched. -// TODO: Call it in gRPC interceptor. -func (s *Server) validateRequest(header *pdpb.RequestHeader) error { - if s.IsClosed() { - return errors.WithStack(ErrNotLeader) - } - if header.GetClusterId() != s.clusterID { - return status.Errorf(codes.FailedPrecondition, "mismatch cluster id, need %d but got %d", s.clusterID, header.GetClusterId()) - } - return nil -} - -func (s *Server) header() *pdpb.ResponseHeader { - return &pdpb.ResponseHeader{ClusterId: s.clusterID} -} - -func (s *Server) errorHeader(err *pdpb.Error) *pdpb.ResponseHeader { - return &pdpb.ResponseHeader{ - ClusterId: s.clusterID, - Error: err, - } -} - -func (s *Server) notBootstrappedHeader() *pdpb.ResponseHeader { - return s.errorHeader(&pdpb.Error{ - Type: pdpb.ErrorType_NOT_BOOTSTRAPPED, - Message: "cluster is not bootstrapped", - }) -} - - diff --git a/master/heartbeat_streams.go b/master/heartbeat_streams.go deleted file mode 100644 index 24961f6b9b..0000000000 --- a/master/heartbeat_streams.go +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright 2017 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package server - -import ( - "context" - "sync" - "time" - - "github.com/czs007/suvlim/util/logutil" - "github.com/czs007/suvlim/pkg/pdpb" -) - -// HeartbeatStream is an interface. -type HeartbeatStream interface { - Send(*pdpb.HeartbeatResponse) error -} - -// HeartbeatStreams is an interface of async region heartbeat. -type HeartbeatStreams interface { - SendMsg(msg *pdpb.HeartbeatResponse) - BindStream(peerID uint64, stream HeartbeatStream) -} - -const ( - heartbeatStreamKeepAliveInterval = time.Minute - heartbeatChanCapacity = 1024 -) - -type streamUpdate struct { - peerID uint64 - stream HeartbeatStream -} - -type heartbeatStreams struct { - wg sync.WaitGroup - hbStreamCtx context.Context - hbStreamCancel context.CancelFunc - clusterID uint64 - streams map[uint64]HeartbeatStream - msgCh chan *pdpb.HeartbeatResponse - streamCh chan streamUpdate -} - -func newHeartbeatStreams(ctx context.Context, clusterID uint64) *heartbeatStreams { - hbStreamCtx, hbStreamCancel := context.WithCancel(ctx) - hs := &heartbeatStreams{ - hbStreamCtx: hbStreamCtx, - hbStreamCancel: hbStreamCancel, - clusterID: clusterID, - streams: make(map[uint64]HeartbeatStream), - msgCh: make(chan *pdpb.HeartbeatResponse, heartbeatChanCapacity), - streamCh: make(chan streamUpdate, 1), - } - hs.wg.Add(1) - go hs.run() - return hs -} - -func (s *heartbeatStreams) run() { - defer logutil.LogPanic() - - defer s.wg.Done() - - keepAliveTicker := time.NewTicker(heartbeatStreamKeepAliveInterval) - defer keepAliveTicker.Stop() - - //keepAlive := &pdpb.HeartbeatResponse{Header: &pdpb.ResponseHeader{ClusterId: s.clusterID}} - - for { - select { - case update := <-s.streamCh: - s.streams[update.peerID] = update.stream - case msg := <-s.msgCh: - println("msgCh", msg) - case <-keepAliveTicker.C: - println("keepAlive") - case <-s.hbStreamCtx.Done(): - return - } - } -} - -func (s *heartbeatStreams) Close() { - s.hbStreamCancel() - s.wg.Wait() -} - -func (s *heartbeatStreams) BindStream(peerID uint64, stream HeartbeatStream) { - update := streamUpdate{ - peerID: peerID, - stream: stream, - } - select { - case s.streamCh <- update: - case <-s.hbStreamCtx.Done(): - } -} - -func (s *heartbeatStreams) SendMsg(msg *pdpb.HeartbeatResponse) { - msg.Header = &pdpb.ResponseHeader{ClusterId: s.clusterID} - select { - case s.msgCh <- msg: - case <-s.hbStreamCtx.Done(): - } -} - -func (s *heartbeatStreams) sendErr(errType pdpb.ErrorType, errMsg string) { - - msg := &pdpb.HeartbeatResponse{ - Header: &pdpb.ResponseHeader{ - ClusterId: s.clusterID, - Error: &pdpb.Error{ - Type: errType, - Message: errMsg, - }, - }, - } - - select { - case s.msgCh <- msg: - case <-s.hbStreamCtx.Done(): - } -} diff --git a/master/id/id.go b/master/id/id.go deleted file mode 100644 index 772e4384f7..0000000000 --- a/master/id/id.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2016 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package id - -import ( - "path" - "sync" - - "github.com/czs007/suvlim/errors" - "github.com/czs007/suvlim/master/kv" - "github.com/czs007/suvlim/util/etcdutil" - "github.com/czs007/suvlim/util/typeutil" - "github.com/pingcap/log" - "go.etcd.io/etcd/clientv3" - "go.uber.org/zap" -) - -// Allocator is the allocator to generate unique ID. -type Allocator interface { - Alloc() (uint64, error) -} - -const allocStep = uint64(1000) - -// AllocatorImpl is used to allocate ID. -type AllocatorImpl struct { - mu sync.Mutex - base uint64 - end uint64 - - client *clientv3.Client - rootPath string - member string -} - -// NewAllocatorImpl creates a new IDAllocator. -func NewAllocatorImpl(client *clientv3.Client, rootPath string, member string) *AllocatorImpl { - return &AllocatorImpl{client: client, rootPath: rootPath, member: member} -} - -// Alloc returns a new id. -func (alloc *AllocatorImpl) Alloc() (uint64, error) { - alloc.mu.Lock() - defer alloc.mu.Unlock() - - if alloc.base == alloc.end { - end, err := alloc.generate() - if err != nil { - return 0, err - } - - alloc.end = end - alloc.base = alloc.end - allocStep - } - - alloc.base++ - - return alloc.base, nil -} - -func (alloc *AllocatorImpl) generate() (uint64, error) { - key := alloc.getAllocIDPath() - value, err := etcdutil.GetValue(alloc.client, key) - if err != nil { - return 0, err - } - - var ( - cmp clientv3.Cmp - end uint64 - ) - - if value == nil { - // create the key - cmp = clientv3.Compare(clientv3.CreateRevision(key), "=", 0) - } else { - // update the key - end, err = typeutil.BytesToUint64(value) - if err != nil { - return 0, err - } - - cmp = clientv3.Compare(clientv3.Value(key), "=", string(value)) - } - - end += allocStep - value = typeutil.Uint64ToBytes(end) - txn := kv.NewSlowLogTxn(alloc.client) - leaderPath := path.Join(alloc.rootPath, "leader") - t := txn.If(append([]clientv3.Cmp{cmp}, clientv3.Compare(clientv3.Value(leaderPath), "=", alloc.member))...) - resp, err := t.Then(clientv3.OpPut(key, string(value))).Commit() - if err != nil { - return 0, err - } - if !resp.Succeeded { - return 0, errors.New("generate id failed, we may not leader") - } - - log.Info("idAllocator allocates a new id", zap.Uint64("alloc-id", end)) - return end, nil -} - -func (alloc *AllocatorImpl) getAllocIDPath() string { - return path.Join(alloc.rootPath, "alloc_id") -} diff --git a/master/kv/etcd_kv.go b/master/kv/etcd_kv.go deleted file mode 100644 index 7cfa5bf78f..0000000000 --- a/master/kv/etcd_kv.go +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2016 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package kv - -import ( - "context" - "path" - "time" - "github.com/czs007/suvlim/util/etcdutil" - "github.com/czs007/suvlim/errors" - "github.com/pingcap/log" - "go.etcd.io/etcd/clientv3" - "go.uber.org/zap" -) - -const ( - requestTimeout = 10 * time.Second - slowRequestTime = 1 * time.Second -) - -var ( - errTxnFailed = errors.New("failed to commit transaction") -) - -type etcdKVBase struct { - client *clientv3.Client - rootPath string -} - -// NewEtcdKVBase creates a new etcd kv. -func NewEtcdKVBase(client *clientv3.Client, rootPath string) *etcdKVBase { - return &etcdKVBase{ - client: client, - rootPath: rootPath, - } -} - -func (kv *etcdKVBase) Load(key string) (string, error) { - key = path.Join(kv.rootPath, key) - - resp, err := etcdutil.EtcdKVGet(kv.client, key) - if err != nil { - return "", err - } - if n := len(resp.Kvs); n == 0 { - return "", nil - } else if n > 1 { - return "", errors.Errorf("load more than one kvs: key %v kvs %v", key, n) - } - return string(resp.Kvs[0].Value), nil -} - -func (kv *etcdKVBase) Save(key, value string) error { - key = path.Join(kv.rootPath, key) - - txn := NewSlowLogTxn(kv.client) - resp, err := txn.Then(clientv3.OpPut(key, value)).Commit() - if err != nil { - log.Error("save to etcd meet error", zap.String("key", key), zap.String("value", value)) - return errors.WithStack(err) - } - if !resp.Succeeded { - return errors.WithStack(errTxnFailed) - } - return nil -} - -func (kv *etcdKVBase) Remove(key string) error { - key = path.Join(kv.rootPath, key) - - txn := NewSlowLogTxn(kv.client) - resp, err := txn.Then(clientv3.OpDelete(key)).Commit() - if err != nil { - log.Error("remove from etcd meet error", zap.String("key", key)) - return errors.WithStack(err) - } - if !resp.Succeeded { - return errors.WithStack(errTxnFailed) - } - return nil -} - -// SlowLogTxn wraps etcd transaction and log slow one. -type SlowLogTxn struct { - clientv3.Txn - cancel context.CancelFunc -} - -// NewSlowLogTxn create a SlowLogTxn. -func NewSlowLogTxn(client *clientv3.Client) clientv3.Txn { - ctx, cancel := context.WithTimeout(client.Ctx(), requestTimeout) - return &SlowLogTxn{ - Txn: client.Txn(ctx), - cancel: cancel, - } -} - -// If takes a list of comparison. If all comparisons passed in succeed, -// the operations passed into Then() will be executed. Or the operations -// passed into Else() will be executed. -func (t *SlowLogTxn) If(cs ...clientv3.Cmp) clientv3.Txn { - return &SlowLogTxn{ - Txn: t.Txn.If(cs...), - cancel: t.cancel, - } -} - -// Then takes a list of operations. The Ops list will be executed, if the -// comparisons passed in If() succeed. -func (t *SlowLogTxn) Then(ops ...clientv3.Op) clientv3.Txn { - return &SlowLogTxn{ - Txn: t.Txn.Then(ops...), - cancel: t.cancel, - } -} - -// Commit implements Txn Commit interface. -func (t *SlowLogTxn) Commit() (*clientv3.TxnResponse, error) { - start := time.Now() - resp, err := t.Txn.Commit() - t.cancel() - - cost := time.Since(start) - if cost > slowRequestTime { - log.Warn("txn runs too slow", - zap.Error(err), - zap.Reflect("response", resp), - zap.Duration("cost", cost)) - } - //label := "success" - //if err != nil { - // label = "failed" - //} - //txnCounter.WithLabelValues(label).Inc() - //txnDuration.WithLabelValues(label).Observe(cost.Seconds()) - return resp, errors.WithStack(err) -} diff --git a/master/kv/kv.go b/master/kv/kv.go deleted file mode 100644 index b967b67110..0000000000 --- a/master/kv/kv.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package kv - -// Base is an abstract interface for load/save pd cluster data. -type Base interface { - Load(key string) (string, error) - Save(key, value string) error - Remove(key string) error -} diff --git a/master/kv/mem_kv.go b/master/kv/mem_kv.go deleted file mode 100644 index 954f3d7ad3..0000000000 --- a/master/kv/mem_kv.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2017 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package kv - -import ( - "sync" - - "github.com/google/btree" -) - -type memoryKV struct { - sync.RWMutex - tree *btree.BTree -} - -// NewMemoryKV returns an in-memory kvBase for testing. -func NewMemoryKV() Base { - return &memoryKV{ - tree: btree.New(2), - } -} - -type memoryKVItem struct { - key, value string -} - -func (s memoryKVItem) Less(than btree.Item) bool { - return s.key < than.(memoryKVItem).key -} - -func (kv *memoryKV) Load(key string) (string, error) { - kv.RLock() - defer kv.RUnlock() - item := kv.tree.Get(memoryKVItem{key, ""}) - if item == nil { - return "", nil - } - return item.(memoryKVItem).value, nil -} - -func (kv *memoryKV) LoadRange(key, endKey string, limit int) ([]string, []string, error) { - kv.RLock() - defer kv.RUnlock() - keys := make([]string, 0, limit) - values := make([]string, 0, limit) - kv.tree.AscendRange(memoryKVItem{key, ""}, memoryKVItem{endKey, ""}, func(item btree.Item) bool { - keys = append(keys, item.(memoryKVItem).key) - values = append(values, item.(memoryKVItem).value) - if limit > 0 { - return len(keys) < limit - } - return true - }) - return keys, values, nil -} - -func (kv *memoryKV) Save(key, value string) error { - kv.Lock() - defer kv.Unlock() - kv.tree.ReplaceOrInsert(memoryKVItem{key, value}) - return nil -} - -func (kv *memoryKV) Remove(key string) error { - kv.Lock() - defer kv.Unlock() - - kv.tree.Delete(memoryKVItem{key, ""}) - return nil -} diff --git a/master/member/member.go b/master/member/member.go deleted file mode 100644 index 8798b7623d..0000000000 --- a/master/member/member.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2016 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package member - -import ( - "strings" - "time" - - "github.com/czs007/suvlim/master/election" - - "github.com/czs007/suvlim/pkg/pdpb" - - "github.com/czs007/suvlim/master/config" - - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/embed" -) - -const ( - // The timeout to wait transfer etcd leader to complete. - moveLeaderTimeout = 5 * time.Second -) - -// Member is used for the election related logic. -type Member struct { - // etcd and cluster information. - leadership *election.Leadership - etcd *embed.Etcd - client *clientv3.Client - id uint64 // etcd server id. - member *pdpb.Member // current PD's info. - // memberValue is the serialized string of `member`. It will be save in - // etcd leader key when the PD node is successfully elected as the PD leader - // of the cluster. Every write will use it to check PD leadership. - memberValue string -} - -// NewMember create a new Member. -func NewMember(etcd *embed.Etcd, client *clientv3.Client, id uint64) *Member { - return &Member{ - etcd: etcd, - client: client, - id: id, - } -} - -// ID returns the unique etcd ID for this server in etcd cluster. -func (m *Member) ID() uint64 { - return m.id -} - -// MemberValue returns the member value. -func (m *Member) MemberValue() string { - return m.memberValue -} - -// Member returns the member. -func (m *Member) Member() *pdpb.Member { - return m.member -} - -// Etcd returns etcd related information. -func (m *Member) Etcd() *embed.Etcd { - return m.etcd -} - -// GetEtcdLeader returns the etcd leader ID. -func (m *Member) GetEtcdLeader() uint64 { - return m.etcd.Server.Lead() -} - -// GetLeadership returns the leadership of the PD member. -func (m *Member) GetLeadership() *election.Leadership { - return m.leadership -} - -// MemberInfo initializes the member info. -func (m *Member) MemberInfo(cfg *config.Config, name string) { - leader := &pdpb.Member{ - Name: name, - MemberId: m.ID(), - ClientUrls: strings.Split(cfg.AdvertiseClientUrls, ","), - PeerUrls: strings.Split(cfg.AdvertisePeerUrls, ","), - } - m.member = leader -} - -// Close gracefully shuts down all servers/listeners. -func (m *Member) Close() { - m.Etcd().Close() -} diff --git a/master/meta/storage.go b/master/meta/storage.go deleted file mode 100644 index c14e8009e1..0000000000 --- a/master/meta/storage.go +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2017 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package meta - -import ( - "encoding/json" - "path" - "sync" - "github.com/gogo/protobuf/proto" - "github.com/czs007/suvlim/errors" - "github.com/czs007/suvlim/pkg/metapb" - "github.com/czs007/suvlim/master/kv" -) - -const ( - clusterPath = "raft" - configPath = "config" -) - - -// Storage wraps all kv operations, keep it stateless. -type Storage struct { - kv.Base - mu sync.Mutex -} - -// NewStorage creates Storage instance with Base. -func NewStorage(base kv.Base) *Storage { - return &Storage{ - Base: base, - } -} - -// LoadMeta loads cluster meta from storage. -func (s *Storage) LoadMeta(meta *metapb.Cluster) (bool, error) { - return loadProto(s.Base, clusterPath, meta) -} - -// SaveMeta save cluster meta to storage. -func (s *Storage) SaveMeta(meta *metapb.Cluster) error { - return saveProto(s.Base, clusterPath, meta) -} - -func (s *Storage) SaveConfig(cfg interface{}) error { - value, err := json.Marshal(cfg) - if err != nil { - return errors.WithStack(err) - } - return s.Save(configPath, string(value)) -} - -// LoadConfig loads config from configPath then unmarshal it to cfg. -func (s *Storage) LoadConfig(cfg interface{}) (bool, error) { - value, err := s.Load(configPath) - if err != nil { - return false, err - } - if value == "" { - return false, nil - } - err = json.Unmarshal([]byte(value), cfg) - if err != nil { - return false, errors.WithStack(err) - } - return true, nil -} - -// SaveJSON saves json format data to storage. -func (s *Storage) SaveJSON(prefix, key string, data interface{}) error { - value, err := json.Marshal(data) - if err != nil { - return err - } - return s.Save(path.Join(prefix, key), string(value)) -} - - -// Close closes the s. -func (s *Storage) Close() error { - return nil -} - -func loadProto(s kv.Base, key string, msg proto.Message) (bool, error) { - value, err := s.Load(key) - if err != nil { - return false, err - } - if value == "" { - return false, nil - } - err = proto.Unmarshal([]byte(value), msg) - return true, errors.WithStack(err) -} - -func saveProto(s kv.Base, key string, msg proto.Message) error { - value, err := proto.Marshal(msg) - if err != nil { - return errors.WithStack(err) - } - return s.Save(key, string(value)) -} diff --git a/master/server.go b/master/server.go deleted file mode 100644 index af075a9b0e..0000000000 --- a/master/server.go +++ /dev/null @@ -1,456 +0,0 @@ -// Copyright 2016 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package server - -import ( - "context" - - "github.com/czs007/suvlim/master/kv" - - //"fmt" - "math/rand" - - "github.com/czs007/suvlim/master/member" - - "strings" - "sync" - "sync/atomic" - "time" - - "github.com/czs007/suvlim/errors" - - //"github.com/czs007/suvlim/pkg/" - "github.com/czs007/suvlim/pkg/pdpb" - "github.com/czs007/suvlim/util/etcdutil" - "github.com/pingcap/log" - - "github.com/czs007/suvlim/master/config" - "github.com/czs007/suvlim/master/id" - "github.com/czs007/suvlim/master/meta" - "github.com/czs007/suvlim/util/logutil" - "github.com/czs007/suvlim/util/typeutil" - - //"github.com/czs007/suvlim/master/kv" - "github.com/czs007/suvlim/master/tso" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/embed" - - //"go.etcd.io/etcd/pkg/types" - "go.uber.org/zap" - "google.golang.org/grpc" -) - -const ( - etcdTimeout = time.Second * 3 - pdRootPath = "/pd" - pdAPIPrefix = "/pd/" - pdClusterIDPath = "/pd/cluster_id" -) - -var ( - // EnableZap enable the zap logger in embed etcd. - EnableZap = true - // EtcdStartTimeout the timeout of the startup etcd. - EtcdStartTimeout = time.Minute * 5 -) - -// Server is the pd server. -type Server struct { - // Server state. - isServing int64 - - // Server start timestamp - startTimestamp int64 - - // Configs and initial fields. - cfg *config.Config - etcdCfg *embed.Config - persistOptions *config.PersistOptions - - // for PD leader election. - member *member.Member - - // Server services. - // for id allocator, we can use one allocator for - // store, region and peer, because we just need - // a unique ID. - - // handler *Handler - - ctx context.Context - serverLoopCtx context.Context - serverLoopCancel func() - serverLoopWg sync.WaitGroup - - // etcd client - client *clientv3.Client - clusterID uint64 // pd cluster id. - rootPath string - - // Server services. - // for id allocator, we can use one allocator for - // store, region and peer, because we just need - // a unique ID. - idAllocator *id.AllocatorImpl - storage *meta.Storage - - // for tso. - tsoAllocator tso.Allocator - // - - hbStreams *heartbeatStreams - - // Zap logger - lg *zap.Logger - logProps *log.ZapProperties - - // Add callback functions at different stages - startCallbacks []func() - closeCallbacks []func() -} - -// CreateServer creates the UNINITIALIZED pd server with given configuration. -func CreateServer(ctx context.Context, cfg *config.Config) (*Server, error) { - log.Info("PD Config", zap.Reflect("config", cfg)) - rand.Seed(time.Now().UnixNano()) - s := &Server{ - cfg: cfg, - persistOptions: config.NewPersistOptions(cfg), - member: &member.Member{}, - ctx: ctx, - startTimestamp: time.Now().Unix(), - } - - // s.handler = newHandler(s) - - // Adjust etcd config. - etcdCfg, err := s.cfg.GenEmbedEtcdConfig() - if err != nil { - return nil, err - } - etcdCfg.ServiceRegister = func(gs *grpc.Server) { - pdpb.RegisterPDServer(gs, s) - //diagnosticspb.RegisterDiagnosticsServer(gs, s) - } - s.etcdCfg = etcdCfg - - s.lg = cfg.GetZapLogger() - s.logProps = cfg.GetZapLogProperties() - s.lg = cfg.GetZapLogger() - s.logProps = cfg.GetZapLogProperties() - return s, nil -} - -func (s *Server) startEtcd(ctx context.Context) error { - newCtx, cancel := context.WithTimeout(ctx, EtcdStartTimeout) - defer cancel() - - etcd, err := embed.StartEtcd(s.etcdCfg) - if err != nil { - return errors.WithStack(err) - } - - // Check cluster ID - //urlMap, err := types.NewURLsMap(s.cfg.InitialCluster) - //if err != nil { - // return errors.WithStack(err) - //} - tlsConfig, err := s.cfg.Security.ToTLSConfig() - if err != nil { - return err - } - - //if err = etcdutil.CheckClusterID(etcd.Server.Cluster().ID(), urlMap, tlsConfig); err != nil { - // return err - //} - select { - // Wait etcd until it is ready to use - case <-etcd.Server.ReadyNotify(): - case <-newCtx.Done(): - return errors.Errorf("canceled when waiting embed etcd to be ready") - } - - endpoints := []string{s.etcdCfg.ACUrls[0].String()} - log.Info("create etcd v3 client", zap.Strings("endpoints", endpoints), zap.Reflect("cert", s.cfg.Security)) - - client, err := clientv3.New(clientv3.Config{ - Endpoints: endpoints, - DialTimeout: etcdTimeout, - TLS: tlsConfig, - }) - if err != nil { - return errors.WithStack(err) - } - - etcdServerID := uint64(etcd.Server.ID()) - - // update advertise peer urls. - etcdMembers, err := etcdutil.ListEtcdMembers(client) - if err != nil { - return err - } - for _, m := range etcdMembers.Members { - if etcdServerID == m.ID { - etcdPeerURLs := strings.Join(m.PeerURLs, ",") - if s.cfg.AdvertisePeerUrls != etcdPeerURLs { - log.Info("update advertise peer urls", zap.String("from", s.cfg.AdvertisePeerUrls), zap.String("to", etcdPeerURLs)) - s.cfg.AdvertisePeerUrls = etcdPeerURLs - } - } - } - s.client = client - - return nil -} - -// AddStartCallback adds a callback in the startServer phase. -func (s *Server) AddStartCallback(callbacks ...func()) { - s.startCallbacks = append(s.startCallbacks, callbacks...) -} - -func (s *Server) startServer(ctx context.Context) error { - var err error - if err = s.initClusterID(); err != nil { - return err - } - log.Info("init cluster id", zap.Uint64("cluster-id", s.clusterID)) - // It may lose accuracy if use float64 to store uint64. So we store the - // cluster id in label. - //metadataGauge.WithLabelValues(fmt.Sprintf("cluster%d", s.clusterID)).Set(0) - kvBase := kv.NewEtcdKVBase(s.client, s.rootPath) - // path := filepath.Join(s.cfg.DataDir, "region-meta") - - // regionStorage, err := core.NewRegionStorage(ctx, path) - // if err != nil { - // return err - // } - s.storage = meta.NewStorage(kvBase) - // s.basicCluster = core.NewBasicCluster() - // s.cluster = cluster.NewRaftCluster(ctx, s.GetClusterRootPath(), s.clusterID, syncer.NewRegionSyncer(s), s.client, s.httpClient) - s.hbStreams = newHeartbeatStreams(ctx, s.clusterID) - - // Run callbacks - for _, cb := range s.startCallbacks { - cb() - } - - // Server has started. - atomic.StoreInt64(&s.isServing, 1) - return nil -} - -func (s *Server) initClusterID() error { - // Get any cluster key to parse the cluster ID. - resp, err := etcdutil.EtcdKVGet(s.client, pdClusterIDPath) - if err != nil { - return err - } - - // If no key exist, generate a random cluster ID. - if len(resp.Kvs) == 0 { - s.clusterID, err = initOrGetClusterID(s.client, pdClusterIDPath) - return err - } - s.clusterID, err = typeutil.BytesToUint64(resp.Kvs[0].Value) - return err -} - -// AddCloseCallback adds a callback in the Close phase. -func (s *Server) AddCloseCallback(callbacks ...func()) { - s.closeCallbacks = append(s.closeCallbacks, callbacks...) -} - -// Close closes the server. -func (s *Server) Close() { - if !atomic.CompareAndSwapInt64(&s.isServing, 1, 0) { - // server is already closed - return - } - - log.Info("closing server") - - s.stopServerLoop() - - if s.client != nil { - s.client.Close() - } - - if s.member.Etcd() != nil { - s.member.Close() - } - - if s.hbStreams != nil { - s.hbStreams.Close() - } - if err := s.storage.Close(); err != nil { - log.Error("close storage meet error", zap.Error(err)) - } - - // Run callbacks - for _, cb := range s.closeCallbacks { - cb() - } - - log.Info("close server") -} - -// IsClosed checks whether server is closed or not. -func (s *Server) IsClosed() bool { - return atomic.LoadInt64(&s.isServing) == 0 -} - -// Run runs the pd server. -func (s *Server) Run() error { - //go StartMonitor(s.ctx, time.Now, func() { - // log.Error("system time jumps backward") - // timeJumpBackCounter.Inc() - //}) - if err := s.startEtcd(s.ctx); err != nil { - return err - } - if err := s.startServer(s.ctx); err != nil { - return err - } - - s.startServerLoop(s.ctx) - - return nil -} - -// Context returns the context of server. -func (s *Server) Context() context.Context { - return s.ctx -} - -// LoopContext returns the loop context of server. -func (s *Server) LoopContext() context.Context { - return s.serverLoopCtx -} - -func (s *Server) startServerLoop(ctx context.Context) { - s.serverLoopCtx, s.serverLoopCancel = context.WithCancel(ctx) - s.serverLoopWg.Add(1) - go s.etcdLeaderLoop() -} - -func (s *Server) stopServerLoop() { - s.serverLoopCancel() - s.serverLoopWg.Wait() -} - -// GetAddr returns the server urls for clients. -func (s *Server) GetAddr() string { - return s.cfg.AdvertiseClientUrls -} - -// GetClientScheme returns the client URL scheme -func (s *Server) GetClientScheme() string { - if len(s.cfg.Security.CertPath) == 0 && len(s.cfg.Security.KeyPath) == 0 { - return "http" - } - return "https" -} - -// GetClient returns builtin etcd client. -func (s *Server) GetClient() *clientv3.Client { - return s.client -} - -// GetPersistOptions returns the schedule option. -func (s *Server) GetPersistOptions() *config.PersistOptions { - return s.persistOptions -} - -// GetStorage returns the backend storage of server. -func (s *Server) GetStorage() *meta.Storage { - return s.storage -} - -// GetHBStreams returns the heartbeat streams. -func (s *Server) GetHBStreams() HeartbeatStreams { - return s.hbStreams -} - -// GetAllocator returns the ID allocator of server. -func (s *Server) GetAllocator() *id.AllocatorImpl { - return s.idAllocator -} - -// Name returns the unique etcd Name for this server in etcd cluster. -func (s *Server) Name() string { - return s.cfg.Name -} - -// ClusterID returns the cluster ID of this server. -func (s *Server) ClusterID() uint64 { - return s.clusterID -} - -// StartTimestamp returns the start timestamp of this server -func (s *Server) StartTimestamp() int64 { - return s.startTimestamp -} - -// GetConfig gets the config information. -func (s *Server) GetConfig() *config.Config { - cfg := s.cfg.Clone() - cfg.PDServerCfg = *s.persistOptions.GetPDServerConfig() - storage := s.GetStorage() - if storage == nil { - return cfg - } - return cfg -} - -// GetServerOption gets the option of the server. -func (s *Server) GetServerOption() *config.PersistOptions { - return s.persistOptions -} - -// SetLogLevel sets log level. -func (s *Server) SetLogLevel(level string) error { - if !isLevelLegal(level) { - return errors.Errorf("log level %s is illegal", level) - } - s.cfg.Log.Level = level - log.SetLevel(logutil.StringToZapLogLevel(level)) - log.Warn("log level changed", zap.String("level", log.GetLevel().String())) - return nil -} - -func isLevelLegal(level string) bool { - switch strings.ToLower(level) { - case "fatal", "error", "warn", "warning", "debug", "info": - return true - default: - return false - } -} - -func (s *Server) etcdLeaderLoop() { - defer logutil.LogPanic() - defer s.serverLoopWg.Done() - - ctx, cancel := context.WithCancel(s.serverLoopCtx) - defer cancel() - for { - select { - // case <-time.After(s.cfg.LeaderPriorityCheckInterval.Duration): - // s.member.CheckPriority(ctx) - case <-ctx.Done(): - log.Info("server is closed, exit etcd leader loop") - return - } - } -} diff --git a/master/tso/global_allocator.go b/master/tso/global_allocator.go deleted file mode 100644 index 52f6372120..0000000000 --- a/master/tso/global_allocator.go +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright 2020 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package tso - -import ( - "sync/atomic" - "time" - - "github.com/czs007/suvlim/errors" - "github.com/czs007/suvlim/master/election" - "github.com/czs007/suvlim/pkg/pdpb" - "github.com/czs007/suvlim/util/typeutil" - "github.com/pingcap/log" - "go.uber.org/zap" -) - -// Allocator is a Timestamp Oracle allocator. -type Allocator interface { - // Initialize is used to initialize a TSO allocator. - // It will synchronize TSO with etcd and initialize the - // memory for later allocation work. - Initialize() error - // UpdateTSO is used to update the TSO in memory and the time window in etcd. - UpdateTSO() error - // SetTSO sets the physical part with given tso. It's mainly used for BR restore - // and can not forcibly set the TSO smaller than now. - SetTSO(tso uint64) error - // GenerateTSO is used to generate a given number of TSOs. - // Make sure you have initialized the TSO allocator before calling. - GenerateTSO(count uint32) (pdpb.Timestamp, error) - // Reset is used to reset the TSO allocator. - Reset() -} - -// GlobalTSOAllocator is the global single point TSO allocator. -type GlobalTSOAllocator struct { - // leadership is used to check the current PD server's leadership - // to determine whether a tso request could be processed. - leadership *election.Leadership - timestampOracle *timestampOracle -} - -// NewGlobalTSOAllocator creates a new global TSO allocator. -func NewGlobalTSOAllocator(leadership *election.Leadership, rootPath string, saveInterval time.Duration, maxResetTSGap func() time.Duration) Allocator { - return &GlobalTSOAllocator{ - leadership: leadership, - timestampOracle: ×tampOracle{ - client: leadership.GetClient(), - rootPath: rootPath, - saveInterval: saveInterval, - maxResetTSGap: maxResetTSGap, - }, - } -} - -// Initialize will initialize the created global TSO allocator. -func (gta *GlobalTSOAllocator) Initialize() error { - return gta.timestampOracle.SyncTimestamp(gta.leadership) -} - -// UpdateTSO is used to update the TSO in memory and the time window in etcd. -func (gta *GlobalTSOAllocator) UpdateTSO() error { - return gta.timestampOracle.UpdateTimestamp(gta.leadership) -} - -// SetTSO sets the physical part with given tso. -func (gta *GlobalTSOAllocator) SetTSO(tso uint64) error { - return gta.timestampOracle.ResetUserTimestamp(gta.leadership, tso) -} - -// GenerateTSO is used to generate a given number of TSOs. -// Make sure you have initialized the TSO allocator before calling. -func (gta *GlobalTSOAllocator) GenerateTSO(count uint32) (pdpb.Timestamp, error) { - var resp pdpb.Timestamp - - if count == 0 { - return resp, errors.New("tso count should be positive") - } - - maxRetryCount := 10 - // failpoint.Inject("skipRetryGetTS", func() { - // maxRetryCount = 1 - // }) - - for i := 0; i < maxRetryCount; i++ { - current := (*atomicObject)(atomic.LoadPointer(>a.timestampOracle.TSO)) - if current == nil || current.physical == typeutil.ZeroTime { - // If it's leader, maybe SyncTimestamp hasn't completed yet - if gta.leadership.Check() { - log.Info("sync hasn't completed yet, wait for a while") - time.Sleep(200 * time.Millisecond) - continue - } - log.Error("invalid timestamp", zap.Any("timestamp", current)) - return pdpb.Timestamp{}, errors.New("can not get timestamp, may be not leader") - } - - resp.Physical = current.physical.UnixNano() / int64(time.Millisecond) - resp.Logical = atomic.AddInt64(¤t.logical, int64(count)) - if resp.Logical >= maxLogical { - log.Error("logical part outside of max logical interval, please check ntp time", - zap.Reflect("response", resp), - zap.Int("retry-count", i)) - time.Sleep(UpdateTimestampStep) - continue - } - // In case lease expired after the first check. - if !gta.leadership.Check() { - return pdpb.Timestamp{}, errors.New("alloc timestamp failed, lease expired") - } - return resp, nil - } - return resp, errors.New("can not get timestamp") -} - -// Reset is used to reset the TSO allocator. -func (gta *GlobalTSOAllocator) Reset() { - gta.timestampOracle.ResetTimestamp() -} diff --git a/master/tso/tso.go b/master/tso/tso.go deleted file mode 100644 index 9dc46764c3..0000000000 --- a/master/tso/tso.go +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2016 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package tso - -import ( - "path" - "sync/atomic" - "time" - "unsafe" - - "github.com/czs007/suvlim/errors" - "github.com/czs007/suvlim/master/election" - "github.com/czs007/suvlim/util/etcdutil" - "github.com/czs007/suvlim/util/tsoutil" - "github.com/czs007/suvlim/util/typeutil" - "github.com/pingcap/log" - "go.etcd.io/etcd/clientv3" - "go.uber.org/zap" -) - -const ( - // UpdateTimestampStep is used to update timestamp. - UpdateTimestampStep = 50 * time.Millisecond - // updateTimestampGuard is the min timestamp interval. - updateTimestampGuard = time.Millisecond - // maxLogical is the max upper limit for logical time. - // When a TSO's logical time reaches this limit, - // the physical time will be forced to increase. - maxLogical = int64(1 << 18) -) - -// atomicObject is used to store the current TSO in memory. -type atomicObject struct { - physical time.Time - logical int64 -} - -// timestampOracle is used to maintain the logic of tso. -type timestampOracle struct { - client *clientv3.Client - rootPath string - // TODO: remove saveInterval - saveInterval time.Duration - maxResetTSGap func() time.Duration - // For tso, set after the PD becomes a leader. - TSO unsafe.Pointer - lastSavedTime atomic.Value -} - -func (t *timestampOracle) getTimestampPath() string { - return path.Join(t.rootPath, "timestamp") -} - -func (t *timestampOracle) loadTimestamp() (time.Time, error) { - data, err := etcdutil.GetValue(t.client, t.getTimestampPath()) - if err != nil { - return typeutil.ZeroTime, err - } - if len(data) == 0 { - return typeutil.ZeroTime, nil - } - return typeutil.ParseTimestamp(data) -} - -// save timestamp, if lastTs is 0, we think the timestamp doesn't exist, so create it, -// otherwise, update it. -func (t *timestampOracle) saveTimestamp(leadership *election.Leadership, ts time.Time) error { - key := t.getTimestampPath() - data := typeutil.Uint64ToBytes(uint64(ts.UnixNano())) - resp, err := leadership.LeaderTxn(). - Then(clientv3.OpPut(key, string(data))). - Commit() - if err != nil { - return errors.WithStack(err) - } - if !resp.Succeeded { - return errors.New("save timestamp failed, maybe we lost leader") - } - - t.lastSavedTime.Store(ts) - - return nil -} - -// SyncTimestamp is used to synchronize the timestamp. -func (t *timestampOracle) SyncTimestamp(leadership *election.Leadership) error { - - last, err := t.loadTimestamp() - if err != nil { - return err - } - - next := time.Now() - - // If the current system time minus the saved etcd timestamp is less than `updateTimestampGuard`, - // the timestamp allocation will start from the saved etcd timestamp temporarily. - if typeutil.SubTimeByWallClock(next, last) < updateTimestampGuard { - next = last.Add(updateTimestampGuard) - } - - save := next.Add(t.saveInterval) - if err = t.saveTimestamp(leadership, save); err != nil { - return err - } - - log.Info("sync and save timestamp", zap.Time("last", last), zap.Time("save", save), zap.Time("next", next)) - - current := &atomicObject{ - physical: next, - } - atomic.StorePointer(&t.TSO, unsafe.Pointer(current)) - - return nil -} - -// ResetUserTimestamp update the physical part with specified tso. -func (t *timestampOracle) ResetUserTimestamp(leadership *election.Leadership, tso uint64) error { - if !leadership.Check() { - return errors.New("Setup timestamp failed, lease expired") - } - physical, _ := tsoutil.ParseTS(tso) - next := physical.Add(time.Millisecond) - prev := (*atomicObject)(atomic.LoadPointer(&t.TSO)) - - // do not update - if typeutil.SubTimeByWallClock(next, prev.physical) <= 3*updateTimestampGuard { - return errors.New("the specified ts too small than now") - } - - if typeutil.SubTimeByWallClock(next, prev.physical) >= t.maxResetTSGap() { - return errors.New("the specified ts too large than now") - } - - save := next.Add(t.saveInterval) - if err := t.saveTimestamp(leadership, save); err != nil { - return err - } - update := &atomicObject{ - physical: next, - } - atomic.CompareAndSwapPointer(&t.TSO, unsafe.Pointer(prev), unsafe.Pointer(update)) - return nil -} - -// UpdateTimestamp is used to update the timestamp. -// This function will do two things: -// 1. When the logical time is going to be used up, increase the current physical time. -// 2. When the time window is not big enough, which means the saved etcd time minus the next physical time -// will be less than or equal to `updateTimestampGuard`, then the time window needs to be updated and -// we also need to save the next physical time plus `TsoSaveInterval` into etcd. -// -// Here is some constraints that this function must satisfy: -// 1. The saved time is monotonically increasing. -// 2. The physical time is monotonically increasing. -// 3. The physical time is always less than the saved timestamp. -func (t *timestampOracle) UpdateTimestamp(leadership *election.Leadership) error { - prev := (*atomicObject)(atomic.LoadPointer(&t.TSO)) - now := time.Now() - - jetLag := typeutil.SubTimeByWallClock(now, prev.physical) - if jetLag > 3*UpdateTimestampStep { - log.Warn("clock offset", zap.Duration("jet-lag", jetLag), zap.Time("prev-physical", prev.physical), zap.Time("now", now)) - } - - var next time.Time - prevLogical := atomic.LoadInt64(&prev.logical) - // If the system time is greater, it will be synchronized with the system time. - if jetLag > updateTimestampGuard { - next = now - } else if prevLogical > maxLogical/2 { - // The reason choosing maxLogical/2 here is that it's big enough for common cases. - // Because there is enough timestamp can be allocated before next update. - log.Warn("the logical time may be not enough", zap.Int64("prev-logical", prevLogical)) - next = prev.physical.Add(time.Millisecond) - } else { - // It will still use the previous physical time to alloc the timestamp. - return nil - } - - // It is not safe to increase the physical time to `next`. - // The time window needs to be updated and saved to etcd. - if typeutil.SubTimeByWallClock(t.lastSavedTime.Load().(time.Time), next) <= updateTimestampGuard { - save := next.Add(t.saveInterval) - if err := t.saveTimestamp(leadership, save); err != nil { - return err - } - } - - current := &atomicObject{ - physical: next, - logical: 0, - } - - atomic.StorePointer(&t.TSO, unsafe.Pointer(current)) - - return nil -} - -// ResetTimestamp is used to reset the timestamp. -func (t *timestampOracle) ResetTimestamp() { - zero := &atomicObject{ - physical: typeutil.ZeroTime, - } - atomic.StorePointer(&t.TSO, unsafe.Pointer(zero)) -} diff --git a/master/util.go b/master/util.go deleted file mode 100644 index c1fb6eb353..0000000000 --- a/master/util.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2016 TiKV Project Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package server - -import ( - "context" - "math/rand" - "time" - - "github.com/czs007/suvlim/errors" - "github.com/czs007/suvlim/util/etcdutil" - "github.com/czs007/suvlim/util/typeutil" - "go.etcd.io/etcd/clientv3" -) - -const ( - requestTimeout = etcdutil.DefaultRequestTimeout -) - -func initOrGetClusterID(c *clientv3.Client, key string) (uint64, error) { - ctx, cancel := context.WithTimeout(c.Ctx(), requestTimeout) - defer cancel() - - // Generate a random cluster ID. - ts := uint64(time.Now().Unix()) - clusterID := (ts << 32) + uint64(rand.Uint32()) - value := typeutil.Uint64ToBytes(clusterID) - - // Multiple PDs may try to init the cluster ID at the same time. - // Only one PD can commit this transaction, then other PDs can get - // the committed cluster ID. - resp, err := c.Txn(ctx). - If(clientv3.Compare(clientv3.CreateRevision(key), "=", 0)). - Then(clientv3.OpPut(key, string(value))). - Else(clientv3.OpGet(key)). - Commit() - if err != nil { - return 0, errors.WithStack(err) - } - - // Txn commits ok, return the generated cluster ID. - if resp.Succeeded { - return clusterID, nil - } - - // Otherwise, parse the committed cluster ID. - if len(resp.Responses) == 0 { - return 0, errors.Errorf("txn returns empty response: %v", resp) - } - - response := resp.Responses[0].GetResponseRange() - if response == nil || len(response.Kvs) != 1 { - return 0, errors.Errorf("txn returns invalid range response: %v", resp) - } - - return typeutil.BytesToUint64(response.Kvs[0].Value) -} diff --git a/pkg/master/common/config.go b/pkg/master/common/config.go deleted file mode 100644 index 844b5b6e8d..0000000000 --- a/pkg/master/common/config.go +++ /dev/null @@ -1,10 +0,0 @@ -package common - -//const ( -// PULSAR_URL = "pulsar://localhost:6650" -// PULSAR_MONITER_INTERVAL = 1 * time.Second -// PULSAR_TOPIC = "monitor-topic" -// ETCD_ROOT_PATH = "by-dev" -// SEGMENT_THRESHOLE = 10000 -// DEFAULT_GRPC_PORT = ":53100" -//) diff --git a/pkg/master/grpc/master/master.proto b/pkg/master/grpc/master/master.proto deleted file mode 100644 index 63983dd126..0000000000 --- a/pkg/master/grpc/master/master.proto +++ /dev/null @@ -1,50 +0,0 @@ -syntax = "proto3"; - -package masterpb; - -option go_package="github.com/czs007/suvlim/pkg/master/grpc/master"; - -import "pkg/master/grpc/message/message.proto"; - -message Collection { - uint64 id=1; - string name=2; - milvus.grpc.Schema schema=3; - uint64 create_time=4; - repeated uint64 segment_ids=5; - repeated string partition_tags=6; - repeated milvus.grpc.IndexParam indexes=7; -} - -enum SegmentStatus { - OPENED = 0; - CLOSED = 1; - INDEXING = 2; - INDEXED = 3; -} - -message Segment { - uint64 segment_id=1; - uint64 collection_id =2; - string partition_tag=3; - int32 channel_start=4; - int32 channel_end=5; - uint64 open_timestamp=6; - uint64 close_timestamp=7; - string collection_name=8; - SegmentStatus status=9; - int64 rows=10; -} - -message SegmentStat { - uint64 segment_id=1; - uint64 memory_size=2; - float memory_rate=3; - SegmentStatus status=4; - int64 rows=5; -} - -service Master { - rpc CreateCollection(milvus.grpc.Mapping) returns (milvus.grpc.Status){} - rpc CreateIndex(milvus.grpc.IndexParam) returns (milvus.grpc.Status) {} -} diff --git a/pkg/master/informer/pulsar.go b/pkg/master/informer/pulsar.go deleted file mode 100644 index e22c48ee02..0000000000 --- a/pkg/master/informer/pulsar.go +++ /dev/null @@ -1,66 +0,0 @@ -package informer - -import ( - "context" - "fmt" - "github.com/czs007/suvlim/conf" - "log" - "strconv" - "time" - - "github.com/apache/pulsar-client-go/pulsar" - "github.com/czs007/suvlim/pkg/master/mock" -) - -func NewPulsarClient() PulsarClient { - pulsarAddr := "pulsar://" - pulsarAddr += conf.Config.Pulsar.Address - pulsarAddr += ":" - pulsarAddr += strconv.FormatInt(int64(conf.Config.Pulsar.Port), 10) - client, err := pulsar.NewClient(pulsar.ClientOptions{ - URL: pulsarAddr, - OperationTimeout: 30 * time.Second, - ConnectionTimeout: 30 * time.Second, - }) - if err != nil { - log.Fatalf("Could not instantiate Pulsar client: %v", err) - } - - return PulsarClient{ - Client: client, - } -} - -type PulsarClient struct { - Client pulsar.Client -} - -func (pc PulsarClient) Listener(ssChan chan mock.SegmentStats) error { - consumer, err := pc.Client.Subscribe(pulsar.ConsumerOptions{ - Topic: conf.Config.Master.PulsarTopic, - SubscriptionName: "my-sub", - Type: pulsar.Shared, - }) - if err != nil { - log.Fatal(err) - } - for { - msg, err := consumer.Receive(context.TODO()) - if err != nil { - log.Fatal(err) - } - m, err := mock.SegmentUnMarshal(msg.Payload()) - if err != nil { - log.Println("SegmentUnMarshal Failed") - } - fmt.Printf("Received message msgId: %#v -- content: '%s'\n", - msg.ID(), m.SegementID) - ssChan <- m - consumer.Ack(msg) - } - - if err := consumer.Unsubscribe(); err != nil { - log.Fatal(err) - } - return nil -} diff --git a/pkg/master/mock/collection_test.go b/pkg/master/mock/collection_test.go deleted file mode 100644 index 48177c1d25..0000000000 --- a/pkg/master/mock/collection_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package mock - -import ( - "fmt" - "testing" - "time" -) - -var s = FieldMeta{ - FieldName: "test-schema-1", - Type: 1, - DIM: int64(512), -} - -var C = Collection{ - ID: uint64(11111), - Name: "test-collection", - CreateTime: uint64(time.Now().Unix()), - SegmentIDs: []uint64{uint64(10111)}, - Schema: []FieldMeta{s}, - PartitionTags: []string{"default"}, -} - -func TestCollection2JSON(t *testing.T) { - res, err := Collection2JSON(C) - if err != nil { - t.Error(err) - } - fmt.Println(res) -} diff --git a/pkg/master/mock/grpc_client.go b/pkg/master/mock/grpc_client.go deleted file mode 100644 index 3412241214..0000000000 --- a/pkg/master/mock/grpc_client.go +++ /dev/null @@ -1,63 +0,0 @@ -package mock - -import ( - "context" - "log" - "time" - - pb "github.com/czs007/suvlim/pkg/master/grpc/master" - msgpb "github.com/czs007/suvlim/pkg/master/grpc/message" - "google.golang.org/grpc" -) - -// func main() { -// // Set up a connection to the server. -// conn, err := grpc.Dial(address, grpc.WithInsecure(), grpc.WithBlock()) -// if err != nil { -// log.Fatalf("did not connect: %v", err) -// } -// defer conn.Close() -// c := pb.NewGreeterClient(conn) - -// // Contact the server and print out its response. -// name := defaultName -// if len(os.Args) > 1 { -// name = os.Args[1] -// } -// ctx, cancel := context.WithTimeout(context.Background(), time.Second) -// defer cancel() -// r, err := c.SayHello(ctx, &pb.HelloRequest{Name: name}) -// if err != nil { -// log.Fatalf("could not greet: %v", err) -// } -// log.Printf("Greeting: %s", r.GetMessage()) -// } - -const ( - addr = "192.168.1.10:53100" -) - -func FakeCreateCollectionByGRPC() (string, uint64) { - conn, err := grpc.Dial(addr, grpc.WithInsecure(), grpc.WithBlock()) - if err != nil { - log.Fatalf("did not connect: %v", err) - } - defer conn.Close() - - c := pb.NewMasterClient(conn) - - ctx, cancel := context.WithTimeout(context.Background(), time.Second) - - defer cancel() - - r, err := c.CreateCollection(ctx, &msgpb.Mapping{ - CollectionName: "test-collection", - }) - if err != nil { - log.Fatalf("could not greet: %v", err) - } - - // log.Printf("CreateCollection: %s, id: %d", r.GetCollectionName(), r.GetCollectionId()) - // return r.GetCollectionName(), r.GetCollectionId() - return r.GetReason(), 0 -} diff --git a/pkg/master/mock/grpc_client_test.go b/pkg/master/mock/grpc_client_test.go deleted file mode 100644 index 5251ad6179..0000000000 --- a/pkg/master/mock/grpc_client_test.go +++ /dev/null @@ -1,15 +0,0 @@ - -package mock - -import ( - "fmt" - "testing" -) - -func TestFakeCreateCollectionByGRPC(t *testing.T) { - reason, segmentID := FakeCreateCollectionByGRPC() - if reason != "" { - t.Error(reason) - } - fmt.Println(segmentID) -} diff --git a/pkg/master/mock/mock.go b/pkg/master/mock/mock.go deleted file mode 100644 index ecf4ee9bd4..0000000000 --- a/pkg/master/mock/mock.go +++ /dev/null @@ -1,5 +0,0 @@ -package mock - -func MockServer() { - -} diff --git a/pkg/master/mock/pulsar.go b/pkg/master/mock/pulsar.go deleted file mode 100644 index d7f551aa3a..0000000000 --- a/pkg/master/mock/pulsar.go +++ /dev/null @@ -1,50 +0,0 @@ -package mock - -import ( - "context" - "fmt" - "github.com/czs007/suvlim/conf" - "log" - "strconv" - "time" - - "github.com/apache/pulsar-client-go/pulsar" -) - -func FakePulsarProducer() { - pulsarAddr := "pulsar://" - pulsarAddr += conf.Config.Pulsar.Address - pulsarAddr += ":" - pulsarAddr += strconv.FormatInt(int64(conf.Config.Pulsar.Port), 10) - client, err := pulsar.NewClient(pulsar.ClientOptions{ - URL: pulsarAddr, - OperationTimeout: 30 * time.Second, - ConnectionTimeout: 30 * time.Second, - }) - if err != nil { - log.Fatalf("Could not instantiate Pulsar client: %v", err) - } - - producer, err := client.CreateProducer(pulsar.ProducerOptions{ - Topic: conf.Config.Master.PulsarTopic, - }) - testSegmentStats, _ := SegmentMarshal(SegmentStats{ - SegementID: uint64(1111), - MemorySize: uint64(333322), - MemoryRate: float64(0.13), - }) - for { - _, err = producer.Send(context.Background(), &pulsar.ProducerMessage{ - Payload: testSegmentStats, - }) - time.Sleep(1 * time.Second) - } - defer producer.Close() - - if err != nil { - fmt.Println("Failed to publish message", err) - } - fmt.Println("Published message") -} - -//TODO add a mock: memory increase diff --git a/pkg/master/mock/segment_test.go b/pkg/master/mock/segment_test.go deleted file mode 100644 index c24196b6ae..0000000000 --- a/pkg/master/mock/segment_test.go +++ /dev/null @@ -1,49 +0,0 @@ -package mock - -import ( - "fmt" - "testing" - "time" -) - -func TestSegmentMarshal(t *testing.T) { - s := SegmentStats{ - SegementID: uint64(12315), - MemorySize: uint64(233113), - MemoryRate: float64(0.13), - } - - data, err := SegmentMarshal(s) - if err != nil { - t.Error(err) - } - - ss, err := SegmentUnMarshal(data) - if err != nil { - t.Error(err) - } - if ss.MemoryRate != s.MemoryRate { - fmt.Println(ss.MemoryRate) - fmt.Println(s.MemoryRate) - t.Error("Error when marshal") - } -} - -var Ts = Segment{ - SegmentID: uint64(101111), - CollectionID: uint64(12010101), - CollectionName: "collection-test", - PartitionTag: "default", - ChannelStart: 1, - ChannelEnd: 100, - OpenTimeStamp: uint64(time.Now().Unix()), - CloseTimeStamp: uint64(time.Now().Add(1 * time.Hour).Unix()), -} - -func TestSegment2JSON(t *testing.T) { - res, err := Segment2JSON(Ts) - if err != nil { - t.Error(err) - } - fmt.Println(res) -} diff --git a/pkg/master/server.go b/pkg/master/server.go deleted file mode 100644 index 9b709b1ef4..0000000000 --- a/pkg/master/server.go +++ /dev/null @@ -1,343 +0,0 @@ -package master - -import ( - "context" - "fmt" - "log" - "net" - "strconv" - "time" - - "github.com/czs007/suvlim/conf" - pb "github.com/czs007/suvlim/pkg/master/grpc/master" - "github.com/czs007/suvlim/pkg/master/grpc/message" - messagepb "github.com/czs007/suvlim/pkg/master/grpc/message" - "github.com/czs007/suvlim/pkg/master/id" - "github.com/czs007/suvlim/pkg/master/informer" - "github.com/czs007/suvlim/pkg/master/kv" - "github.com/czs007/suvlim/pkg/master/mock" - "go.etcd.io/etcd/clientv3" - "google.golang.org/grpc" -) - -func Run() { - // go mock.FakePulsarProducer() - go SegmentStatsController() - collectionChan := make(chan *messagepb.Mapping) - defer close(collectionChan) - go GRPCServer(collectionChan) - go CollectionController(collectionChan) - for { - } -} - -func SegmentStatsController() { - etcdAddr := conf.Config.Etcd.Address - etcdAddr += ":" - etcdAddr += strconv.FormatInt(int64(conf.Config.Etcd.Port), 10) - cli, _ := clientv3.New(clientv3.Config{ - Endpoints: []string{etcdAddr}, - DialTimeout: 5 * time.Second, - }) - defer cli.Close() - kvbase := kv.NewEtcdKVBase(cli, conf.Config.Etcd.Rootpath) - - ssChan := make(chan mock.SegmentStats, 10) - defer close(ssChan) - ssClient := informer.NewPulsarClient() - - segmentCloseLog := make(map[uint64]uint64, 0) - - go ssClient.Listener(ssChan) - for { - select { - case ss := <-ssChan: - ComputeCloseTime(&segmentCloseLog, ss, kvbase) - UpdateSegmentStatus(ss, kvbase) - //case <-time.After(5 * time.Second): - // fmt.Println("timeout") - // return - } - } -} - -func ComputeCloseTime(segmentCloseLog *map[uint64]uint64, ss mock.SegmentStats, kvbase kv.Base) error { - segmentID := ss.SegementID - if _, ok := (*segmentCloseLog)[segmentID]; ok { - // This segment has been closed - log.Println("Segment", segmentID, "has been closed") - return nil - } - - if int(ss.MemorySize) > int(conf.Config.Master.SegmentThreshole*0.8) { - currentTime := time.Now() - memRate := int(ss.MemoryRate) - if memRate == 0 { - //memRate = 1 - log.Println("memRate = 0") - return nil - } - sec := float64(conf.Config.Master.SegmentThreshole*0.2) / float64(memRate) - data, err := kvbase.Load("segment/" + strconv.Itoa(int(ss.SegementID))) - if err != nil { - return err - } - seg, err := mock.JSON2Segment(data) - if err != nil { - return err - } - segmentLogicTime := seg.CloseTimeStamp << 46 >> 46 - seg.CloseTimeStamp = uint64(currentTime.Add(time.Duration(sec) * time.Second).Unix()) << 18 + segmentLogicTime - fmt.Println("memRate = ", memRate, ",sec = ", sec ,",Close time = ", seg.CloseTimeStamp) - updateData, err := mock.Segment2JSON(*seg) - if err != nil { - return err - } - kvbase.Save("segment/"+strconv.Itoa(int(ss.SegementID)), updateData) - (*segmentCloseLog)[segmentID] = seg.CloseTimeStamp - //create new segment - newSegID := id.New().Uint64() - newSeg := mock.NewSegment(newSegID, seg.CollectionID, seg.CollectionName, "default", seg.ChannelStart, seg.ChannelEnd, currentTime, time.Unix(1<<36-1, 0)) - newSegData, err := mock.Segment2JSON(*&newSeg) - if err != nil { - return err - } - //save to kv store - kvbase.Save("segment/"+strconv.Itoa(int(newSegID)), newSegData) - // update collection data - c, _ := kvbase.Load("collection/" + strconv.Itoa(int(seg.CollectionID))) - collection, err := mock.JSON2Collection(c) - if err != nil { - return err - } - segIDs := collection.SegmentIDs - segIDs = append(segIDs, newSegID) - collection.SegmentIDs = segIDs - cData, err := mock.Collection2JSON(*collection) - if err != nil { - return err - } - kvbase.Save("segment/"+strconv.Itoa(int(seg.CollectionID)), cData) - } - return nil -} - -func UpdateSegmentStatus(ss mock.SegmentStats, kvbase kv.Base) error { - segmentData, err := kvbase.Load("segment/" + strconv.Itoa(int(ss.SegementID))) - if err != nil { - return err - } - seg, err := mock.JSON2Segment(segmentData) - if err != nil { - return err - } - var changed bool - changed = false - if seg.Status != ss.Status { - changed = true - seg.Status = ss.Status - } - if seg.Rows != ss.Rows { - changed = true - seg.Rows = ss.Rows - } - - if changed { - segData, err := mock.Segment2JSON(*seg) - if err != nil { - return err - } - err = kvbase.Save("segment/"+strconv.Itoa(int(seg.CollectionID)), segData) - if err != nil { - return err - } - } - return nil -} - -func GRPCServer(ch chan *messagepb.Mapping) error { - defaultGRPCPort := ":" - defaultGRPCPort += strconv.FormatInt(int64(conf.Config.Master.Port), 10) - lis, err := net.Listen("tcp", defaultGRPCPort) - if err != nil { - return err - } - s := grpc.NewServer() - pb.RegisterMasterServer(s, GRPCMasterServer{CreateRequest: ch}) - if err := s.Serve(lis); err != nil { - log.Fatalf("failed to serve: %v", err) - return err - } - return nil -} - -type GRPCMasterServer struct { - CreateRequest chan *messagepb.Mapping -} - -func (ms GRPCMasterServer) CreateCollection(ctx context.Context, in *messagepb.Mapping) (*messagepb.Status, error) { - // ms.CreateRequest <- in2 - fmt.Println("Handle a new create collection request") - err := WriteCollection2Datastore(in) - if err != nil { - return &messagepb.Status{ - ErrorCode: 100, - Reason: "", - }, err - } - return &messagepb.Status{ - ErrorCode: 0, - Reason: "", - }, nil -} - -func (ms GRPCMasterServer) CreateIndex(ctx context.Context, in *messagepb.IndexParam) (*message.Status, error) { - fmt.Println("Handle a new create index request") - err := UpdateCollectionIndex(in) - if err != nil { - return &messagepb.Status{ - ErrorCode: 100, - Reason: "", - }, err - } - return &messagepb.Status{ - ErrorCode: 0, - Reason: "", - }, nil -} - -// func (ms GRPCMasterServer) CreateCollection(ctx context.Context, in *pb.CreateCollectionRequest) (*pb.CreateCollectionResponse, error) { -// return &pb.CreateCollectionResponse{ -// CollectionName: in.CollectionName, -// }, nil -// } - -func CollectionController(ch chan *messagepb.Mapping) { - etcdAddr := conf.Config.Etcd.Address - etcdAddr += ":" - etcdAddr += strconv.FormatInt(int64(conf.Config.Etcd.Port), 10) - cli, _ := clientv3.New(clientv3.Config{ - Endpoints: []string{etcdAddr}, - DialTimeout: 5 * time.Second, - }) - defer cli.Close() - kvbase := kv.NewEtcdKVBase(cli, conf.Config.Etcd.Rootpath) - for collection := range ch { - sID := id.New().Uint64() - cID := id.New().Uint64() - s2ID := id.New().Uint64() - fieldMetas := []*messagepb.FieldMeta{} - if collection.Schema != nil { - fieldMetas = collection.Schema.FieldMetas - } - c := mock.NewCollection(cID, collection.CollectionName, - time.Now(), fieldMetas, []uint64{sID, s2ID}, - []string{"default"}) - cm := mock.GrpcMarshal(&c) - s := mock.NewSegment(sID, cID, collection.CollectionName, "default", 0, 511, time.Now(), time.Unix(1<<36-1, 0)) - s2 := mock.NewSegment(s2ID, cID, collection.CollectionName, "default", 512, 1023, time.Now(), time.Unix(1<<36-1, 0)) - collectionData, _ := mock.Collection2JSON(*cm) - segmentData, err := mock.Segment2JSON(s) - if err != nil { - log.Fatal(err) - } - s2Data, err := mock.Segment2JSON(s2) - if err != nil { - log.Fatal(err) - } - err = kvbase.Save("collection/"+strconv.FormatUint(cID, 10), collectionData) - if err != nil { - log.Fatal(err) - } - err = kvbase.Save("segment/"+strconv.FormatUint(sID, 10), segmentData) - if err != nil { - log.Fatal(err) - } - err = kvbase.Save("segment/"+strconv.FormatUint(s2ID, 10), s2Data) - if err != nil { - log.Fatal(err) - } - } -} - -func WriteCollection2Datastore(collection *messagepb.Mapping) error { - etcdAddr := conf.Config.Etcd.Address - etcdAddr += ":" - etcdAddr += strconv.FormatInt(int64(conf.Config.Etcd.Port), 10) - cli, _ := clientv3.New(clientv3.Config{ - Endpoints: []string{etcdAddr}, - DialTimeout: 5 * time.Second, - }) - defer cli.Close() - kvbase := kv.NewEtcdKVBase(cli, conf.Config.Etcd.Rootpath) - sID := id.New().Uint64() - cID := id.New().Uint64() - fieldMetas := []*messagepb.FieldMeta{} - if collection.Schema != nil { - fieldMetas = collection.Schema.FieldMetas - } - c := mock.NewCollection(cID, collection.CollectionName, - time.Now(), fieldMetas, []uint64{sID}, - []string{"default"}) - cm := mock.GrpcMarshal(&c) - s := mock.NewSegment(sID, cID, collection.CollectionName, "default", 0, conf.Config.Pulsar.TopicNum, time.Now(), time.Unix(1<<46-1, 0)) - collectionData, err := mock.Collection2JSON(*cm) - if err != nil { - log.Fatal(err) - return err - } - segmentData, err := mock.Segment2JSON(s) - if err != nil { - log.Fatal(err) - return err - } - err = kvbase.Save("collection/"+strconv.FormatUint(cID, 10), collectionData) - if err != nil { - log.Fatal(err) - return err - } - err = kvbase.Save("segment/"+strconv.FormatUint(sID, 10), segmentData) - if err != nil { - log.Fatal(err) - return err - } - return nil - -} - -func UpdateCollectionIndex(index *messagepb.IndexParam) error { - etcdAddr := conf.Config.Etcd.Address - etcdAddr += ":" - etcdAddr += strconv.FormatInt(int64(conf.Config.Etcd.Port), 10) - cli, _ := clientv3.New(clientv3.Config{ - Endpoints: []string{etcdAddr}, - DialTimeout: 5 * time.Second, - }) - defer cli.Close() - kvbase := kv.NewEtcdKVBase(cli, conf.Config.Etcd.Rootpath) - collectionName := index.CollectionName - c, err := kvbase.Load("collection/" + collectionName) - if err != nil { - return err - } - collection, err := mock.JSON2Collection(c) - if err != nil { - return err - } - for k, v := range collection.IndexParam { - if v.IndexName == index.IndexName { - collection.IndexParam[k] = v - } - } - collection.IndexParam = append(collection.IndexParam, index) - cm := mock.GrpcMarshal(collection) - collectionData, err := mock.Collection2JSON(*cm) - if err != nil { - return err - } - err = kvbase.Save("collection/"+collectionName, collectionData) - if err != nil { - return err - } - return nil -} diff --git a/pkg/message/message.pb.go b/pkg/message/message.pb.go deleted file mode 100644 index 53bf1afd39..0000000000 --- a/pkg/message/message.pb.go +++ /dev/null @@ -1,3292 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: message.proto - -package msgpb - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type ErrorCode int32 - -const ( - ErrorCode_SUCCESS ErrorCode = 0 - ErrorCode_UNEXPECTED_ERROR ErrorCode = 1 - ErrorCode_CONNECT_FAILED ErrorCode = 2 - ErrorCode_PERMISSION_DENIED ErrorCode = 3 - ErrorCode_COLLECTION_NOT_EXISTS ErrorCode = 4 - ErrorCode_ILLEGAL_ARGUMENT ErrorCode = 5 - ErrorCode_ILLEGAL_DIMENSION ErrorCode = 7 - ErrorCode_ILLEGAL_INDEX_TYPE ErrorCode = 8 - ErrorCode_ILLEGAL_COLLECTION_NAME ErrorCode = 9 - ErrorCode_ILLEGAL_TOPK ErrorCode = 10 - ErrorCode_ILLEGAL_ROWRECORD ErrorCode = 11 - ErrorCode_ILLEGAL_VECTOR_ID ErrorCode = 12 - ErrorCode_ILLEGAL_SEARCH_RESULT ErrorCode = 13 - ErrorCode_FILE_NOT_FOUND ErrorCode = 14 - ErrorCode_META_FAILED ErrorCode = 15 - ErrorCode_CACHE_FAILED ErrorCode = 16 - ErrorCode_CANNOT_CREATE_FOLDER ErrorCode = 17 - ErrorCode_CANNOT_CREATE_FILE ErrorCode = 18 - ErrorCode_CANNOT_DELETE_FOLDER ErrorCode = 19 - ErrorCode_CANNOT_DELETE_FILE ErrorCode = 20 - ErrorCode_BUILD_INDEX_ERROR ErrorCode = 21 - ErrorCode_ILLEGAL_NLIST ErrorCode = 22 - ErrorCode_ILLEGAL_METRIC_TYPE ErrorCode = 23 - ErrorCode_OUT_OF_MEMORY ErrorCode = 24 -) - -var ErrorCode_name = map[int32]string{ - 0: "SUCCESS", - 1: "UNEXPECTED_ERROR", - 2: "CONNECT_FAILED", - 3: "PERMISSION_DENIED", - 4: "COLLECTION_NOT_EXISTS", - 5: "ILLEGAL_ARGUMENT", - 7: "ILLEGAL_DIMENSION", - 8: "ILLEGAL_INDEX_TYPE", - 9: "ILLEGAL_COLLECTION_NAME", - 10: "ILLEGAL_TOPK", - 11: "ILLEGAL_ROWRECORD", - 12: "ILLEGAL_VECTOR_ID", - 13: "ILLEGAL_SEARCH_RESULT", - 14: "FILE_NOT_FOUND", - 15: "META_FAILED", - 16: "CACHE_FAILED", - 17: "CANNOT_CREATE_FOLDER", - 18: "CANNOT_CREATE_FILE", - 19: "CANNOT_DELETE_FOLDER", - 20: "CANNOT_DELETE_FILE", - 21: "BUILD_INDEX_ERROR", - 22: "ILLEGAL_NLIST", - 23: "ILLEGAL_METRIC_TYPE", - 24: "OUT_OF_MEMORY", -} - -var ErrorCode_value = map[string]int32{ - "SUCCESS": 0, - "UNEXPECTED_ERROR": 1, - "CONNECT_FAILED": 2, - "PERMISSION_DENIED": 3, - "COLLECTION_NOT_EXISTS": 4, - "ILLEGAL_ARGUMENT": 5, - "ILLEGAL_DIMENSION": 7, - "ILLEGAL_INDEX_TYPE": 8, - "ILLEGAL_COLLECTION_NAME": 9, - "ILLEGAL_TOPK": 10, - "ILLEGAL_ROWRECORD": 11, - "ILLEGAL_VECTOR_ID": 12, - "ILLEGAL_SEARCH_RESULT": 13, - "FILE_NOT_FOUND": 14, - "META_FAILED": 15, - "CACHE_FAILED": 16, - "CANNOT_CREATE_FOLDER": 17, - "CANNOT_CREATE_FILE": 18, - "CANNOT_DELETE_FOLDER": 19, - "CANNOT_DELETE_FILE": 20, - "BUILD_INDEX_ERROR": 21, - "ILLEGAL_NLIST": 22, - "ILLEGAL_METRIC_TYPE": 23, - "OUT_OF_MEMORY": 24, -} - -func (x ErrorCode) String() string { - return proto.EnumName(ErrorCode_name, int32(x)) -} - -func (ErrorCode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{0} -} - -//* -// @brief Field data type -type DataType int32 - -const ( - DataType_NONE DataType = 0 - DataType_BOOL DataType = 1 - DataType_INT8 DataType = 2 - DataType_INT16 DataType = 3 - DataType_INT32 DataType = 4 - DataType_INT64 DataType = 5 - DataType_FLOAT DataType = 10 - DataType_DOUBLE DataType = 11 - DataType_STRING DataType = 20 - DataType_VECTOR_BINARY DataType = 100 - DataType_VECTOR_FLOAT DataType = 101 -) - -var DataType_name = map[int32]string{ - 0: "NONE", - 1: "BOOL", - 2: "INT8", - 3: "INT16", - 4: "INT32", - 5: "INT64", - 10: "FLOAT", - 11: "DOUBLE", - 20: "STRING", - 100: "VECTOR_BINARY", - 101: "VECTOR_FLOAT", -} - -var DataType_value = map[string]int32{ - "NONE": 0, - "BOOL": 1, - "INT8": 2, - "INT16": 3, - "INT32": 4, - "INT64": 5, - "FLOAT": 10, - "DOUBLE": 11, - "STRING": 20, - "VECTOR_BINARY": 100, - "VECTOR_FLOAT": 101, -} - -func (x DataType) String() string { - return proto.EnumName(DataType_name, int32(x)) -} - -func (DataType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{1} -} - -type CompareOperator int32 - -const ( - CompareOperator_LT CompareOperator = 0 - CompareOperator_LTE CompareOperator = 1 - CompareOperator_EQ CompareOperator = 2 - CompareOperator_GT CompareOperator = 3 - CompareOperator_GTE CompareOperator = 4 - CompareOperator_NE CompareOperator = 5 -) - -var CompareOperator_name = map[int32]string{ - 0: "LT", - 1: "LTE", - 2: "EQ", - 3: "GT", - 4: "GTE", - 5: "NE", -} - -var CompareOperator_value = map[string]int32{ - "LT": 0, - "LTE": 1, - "EQ": 2, - "GT": 3, - "GTE": 4, - "NE": 5, -} - -func (x CompareOperator) String() string { - return proto.EnumName(CompareOperator_name, int32(x)) -} - -func (CompareOperator) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{2} -} - -type Occur int32 - -const ( - Occur_INVALID Occur = 0 - Occur_MUST Occur = 1 - Occur_SHOULD Occur = 2 - Occur_MUST_NOT Occur = 3 -) - -var Occur_name = map[int32]string{ - 0: "INVALID", - 1: "MUST", - 2: "SHOULD", - 3: "MUST_NOT", -} - -var Occur_value = map[string]int32{ - "INVALID": 0, - "MUST": 1, - "SHOULD": 2, - "MUST_NOT": 3, -} - -func (x Occur) String() string { - return proto.EnumName(Occur_name, int32(x)) -} - -func (Occur) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{3} -} - -////////////////////pulsar////////////////////////////////////// -type OpType int32 - -const ( - OpType_INSERT OpType = 0 - OpType_DELETE OpType = 1 -) - -var OpType_name = map[int32]string{ - 0: "INSERT", - 1: "DELETE", -} - -var OpType_value = map[string]int32{ - "INSERT": 0, - "DELETE": 1, -} - -func (x OpType) String() string { - return proto.EnumName(OpType_name, int32(x)) -} - -func (OpType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{4} -} - -type SyncType int32 - -const ( - SyncType_READ SyncType = 0 - SyncType_WRITE SyncType = 1 -) - -var SyncType_name = map[int32]string{ - 0: "READ", - 1: "WRITE", -} - -var SyncType_value = map[string]int32{ - "READ": 0, - "WRITE": 1, -} - -func (x SyncType) String() string { - return proto.EnumName(SyncType_name, int32(x)) -} - -func (SyncType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{5} -} - -type Status struct { - ErrorCode ErrorCode `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3,enum=milvus.grpc.ErrorCode" json:"error_code,omitempty"` - Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Status) Reset() { *m = Status{} } -func (m *Status) String() string { return proto.CompactTextString(m) } -func (*Status) ProtoMessage() {} -func (*Status) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{0} -} - -func (m *Status) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Status.Unmarshal(m, b) -} -func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Status.Marshal(b, m, deterministic) -} -func (m *Status) XXX_Merge(src proto.Message) { - xxx_messageInfo_Status.Merge(m, src) -} -func (m *Status) XXX_Size() int { - return xxx_messageInfo_Status.Size(m) -} -func (m *Status) XXX_DiscardUnknown() { - xxx_messageInfo_Status.DiscardUnknown(m) -} - -var xxx_messageInfo_Status proto.InternalMessageInfo - -func (m *Status) GetErrorCode() ErrorCode { - if m != nil { - return m.ErrorCode - } - return ErrorCode_SUCCESS -} - -func (m *Status) GetReason() string { - if m != nil { - return m.Reason - } - return "" -} - -//* -// @brief General usage -type KeyValuePair struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KeyValuePair) Reset() { *m = KeyValuePair{} } -func (m *KeyValuePair) String() string { return proto.CompactTextString(m) } -func (*KeyValuePair) ProtoMessage() {} -func (*KeyValuePair) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{1} -} - -func (m *KeyValuePair) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KeyValuePair.Unmarshal(m, b) -} -func (m *KeyValuePair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KeyValuePair.Marshal(b, m, deterministic) -} -func (m *KeyValuePair) XXX_Merge(src proto.Message) { - xxx_messageInfo_KeyValuePair.Merge(m, src) -} -func (m *KeyValuePair) XXX_Size() int { - return xxx_messageInfo_KeyValuePair.Size(m) -} -func (m *KeyValuePair) XXX_DiscardUnknown() { - xxx_messageInfo_KeyValuePair.DiscardUnknown(m) -} - -var xxx_messageInfo_KeyValuePair proto.InternalMessageInfo - -func (m *KeyValuePair) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *KeyValuePair) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - -//* -// @brief Collection name -type CollectionName struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionName) Reset() { *m = CollectionName{} } -func (m *CollectionName) String() string { return proto.CompactTextString(m) } -func (*CollectionName) ProtoMessage() {} -func (*CollectionName) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{2} -} - -func (m *CollectionName) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionName.Unmarshal(m, b) -} -func (m *CollectionName) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionName.Marshal(b, m, deterministic) -} -func (m *CollectionName) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionName.Merge(m, src) -} -func (m *CollectionName) XXX_Size() int { - return xxx_messageInfo_CollectionName.Size(m) -} -func (m *CollectionName) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionName.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionName proto.InternalMessageInfo - -func (m *CollectionName) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -//* -// @brief Collection name list -type CollectionNameList struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - CollectionNames []string `protobuf:"bytes,2,rep,name=collection_names,json=collectionNames,proto3" json:"collection_names,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionNameList) Reset() { *m = CollectionNameList{} } -func (m *CollectionNameList) String() string { return proto.CompactTextString(m) } -func (*CollectionNameList) ProtoMessage() {} -func (*CollectionNameList) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{3} -} - -func (m *CollectionNameList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionNameList.Unmarshal(m, b) -} -func (m *CollectionNameList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionNameList.Marshal(b, m, deterministic) -} -func (m *CollectionNameList) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionNameList.Merge(m, src) -} -func (m *CollectionNameList) XXX_Size() int { - return xxx_messageInfo_CollectionNameList.Size(m) -} -func (m *CollectionNameList) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionNameList.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionNameList proto.InternalMessageInfo - -func (m *CollectionNameList) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *CollectionNameList) GetCollectionNames() []string { - if m != nil { - return m.CollectionNames - } - return nil -} - -//* -// @brief Field name -type FieldName struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - FieldName string `protobuf:"bytes,2,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FieldName) Reset() { *m = FieldName{} } -func (m *FieldName) String() string { return proto.CompactTextString(m) } -func (*FieldName) ProtoMessage() {} -func (*FieldName) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{4} -} - -func (m *FieldName) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FieldName.Unmarshal(m, b) -} -func (m *FieldName) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FieldName.Marshal(b, m, deterministic) -} -func (m *FieldName) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldName.Merge(m, src) -} -func (m *FieldName) XXX_Size() int { - return xxx_messageInfo_FieldName.Size(m) -} -func (m *FieldName) XXX_DiscardUnknown() { - xxx_messageInfo_FieldName.DiscardUnknown(m) -} - -var xxx_messageInfo_FieldName proto.InternalMessageInfo - -func (m *FieldName) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *FieldName) GetFieldName() string { - if m != nil { - return m.FieldName - } - return "" -} - -//* -// @brief Collection mapping -// @extra_params: key-value pair for extra parameters of the collection -// typically usage: -// extra_params["params"] = {segment_row_count: 1000000, auto_id: true} -// Note: -// the segment_row_count specify segment row count limit for merging -// the auto_id = true means entity id is auto-generated by milvus -type Mapping struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - CollectionName string `protobuf:"bytes,2,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - Schema *Schema `protobuf:"bytes,3,opt,name=schema,proto3" json:"schema,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,4,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Mapping) Reset() { *m = Mapping{} } -func (m *Mapping) String() string { return proto.CompactTextString(m) } -func (*Mapping) ProtoMessage() {} -func (*Mapping) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{5} -} - -func (m *Mapping) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Mapping.Unmarshal(m, b) -} -func (m *Mapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Mapping.Marshal(b, m, deterministic) -} -func (m *Mapping) XXX_Merge(src proto.Message) { - xxx_messageInfo_Mapping.Merge(m, src) -} -func (m *Mapping) XXX_Size() int { - return xxx_messageInfo_Mapping.Size(m) -} -func (m *Mapping) XXX_DiscardUnknown() { - xxx_messageInfo_Mapping.DiscardUnknown(m) -} - -var xxx_messageInfo_Mapping proto.InternalMessageInfo - -func (m *Mapping) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *Mapping) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *Mapping) GetSchema() *Schema { - if m != nil { - return m.Schema - } - return nil -} - -func (m *Mapping) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -//* -// @brief Collection mapping list -type MappingList struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - MappingList []*Mapping `protobuf:"bytes,2,rep,name=mapping_list,json=mappingList,proto3" json:"mapping_list,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MappingList) Reset() { *m = MappingList{} } -func (m *MappingList) String() string { return proto.CompactTextString(m) } -func (*MappingList) ProtoMessage() {} -func (*MappingList) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{6} -} - -func (m *MappingList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MappingList.Unmarshal(m, b) -} -func (m *MappingList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MappingList.Marshal(b, m, deterministic) -} -func (m *MappingList) XXX_Merge(src proto.Message) { - xxx_messageInfo_MappingList.Merge(m, src) -} -func (m *MappingList) XXX_Size() int { - return xxx_messageInfo_MappingList.Size(m) -} -func (m *MappingList) XXX_DiscardUnknown() { - xxx_messageInfo_MappingList.DiscardUnknown(m) -} - -var xxx_messageInfo_MappingList proto.InternalMessageInfo - -func (m *MappingList) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *MappingList) GetMappingList() []*Mapping { - if m != nil { - return m.MappingList - } - return nil -} - -//* -// @brief Parameters of partition -type PartitionParam struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PartitionParam) Reset() { *m = PartitionParam{} } -func (m *PartitionParam) String() string { return proto.CompactTextString(m) } -func (*PartitionParam) ProtoMessage() {} -func (*PartitionParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{7} -} - -func (m *PartitionParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PartitionParam.Unmarshal(m, b) -} -func (m *PartitionParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PartitionParam.Marshal(b, m, deterministic) -} -func (m *PartitionParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_PartitionParam.Merge(m, src) -} -func (m *PartitionParam) XXX_Size() int { - return xxx_messageInfo_PartitionParam.Size(m) -} -func (m *PartitionParam) XXX_DiscardUnknown() { - xxx_messageInfo_PartitionParam.DiscardUnknown(m) -} - -var xxx_messageInfo_PartitionParam proto.InternalMessageInfo - -func (m *PartitionParam) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *PartitionParam) GetTag() string { - if m != nil { - return m.Tag - } - return "" -} - -//* -// @brief Partition list -type PartitionList struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - PartitionTagArray []string `protobuf:"bytes,2,rep,name=partition_tag_array,json=partitionTagArray,proto3" json:"partition_tag_array,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PartitionList) Reset() { *m = PartitionList{} } -func (m *PartitionList) String() string { return proto.CompactTextString(m) } -func (*PartitionList) ProtoMessage() {} -func (*PartitionList) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{8} -} - -func (m *PartitionList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PartitionList.Unmarshal(m, b) -} -func (m *PartitionList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PartitionList.Marshal(b, m, deterministic) -} -func (m *PartitionList) XXX_Merge(src proto.Message) { - xxx_messageInfo_PartitionList.Merge(m, src) -} -func (m *PartitionList) XXX_Size() int { - return xxx_messageInfo_PartitionList.Size(m) -} -func (m *PartitionList) XXX_DiscardUnknown() { - xxx_messageInfo_PartitionList.DiscardUnknown(m) -} - -var xxx_messageInfo_PartitionList proto.InternalMessageInfo - -func (m *PartitionList) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *PartitionList) GetPartitionTagArray() []string { - if m != nil { - return m.PartitionTagArray - } - return nil -} - -//* -// @brief Vector row record -type VectorRowRecord struct { - FloatData []float32 `protobuf:"fixed32,1,rep,packed,name=float_data,json=floatData,proto3" json:"float_data,omitempty"` - BinaryData []byte `protobuf:"bytes,2,opt,name=binary_data,json=binaryData,proto3" json:"binary_data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VectorRowRecord) Reset() { *m = VectorRowRecord{} } -func (m *VectorRowRecord) String() string { return proto.CompactTextString(m) } -func (*VectorRowRecord) ProtoMessage() {} -func (*VectorRowRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{9} -} - -func (m *VectorRowRecord) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VectorRowRecord.Unmarshal(m, b) -} -func (m *VectorRowRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VectorRowRecord.Marshal(b, m, deterministic) -} -func (m *VectorRowRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_VectorRowRecord.Merge(m, src) -} -func (m *VectorRowRecord) XXX_Size() int { - return xxx_messageInfo_VectorRowRecord.Size(m) -} -func (m *VectorRowRecord) XXX_DiscardUnknown() { - xxx_messageInfo_VectorRowRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_VectorRowRecord proto.InternalMessageInfo - -func (m *VectorRowRecord) GetFloatData() []float32 { - if m != nil { - return m.FloatData - } - return nil -} - -func (m *VectorRowRecord) GetBinaryData() []byte { - if m != nil { - return m.BinaryData - } - return nil -} - -type EntityIds struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - EntityIdArray []int64 `protobuf:"varint,2,rep,packed,name=entity_id_array,json=entityIdArray,proto3" json:"entity_id_array,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EntityIds) Reset() { *m = EntityIds{} } -func (m *EntityIds) String() string { return proto.CompactTextString(m) } -func (*EntityIds) ProtoMessage() {} -func (*EntityIds) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{10} -} - -func (m *EntityIds) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EntityIds.Unmarshal(m, b) -} -func (m *EntityIds) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EntityIds.Marshal(b, m, deterministic) -} -func (m *EntityIds) XXX_Merge(src proto.Message) { - xxx_messageInfo_EntityIds.Merge(m, src) -} -func (m *EntityIds) XXX_Size() int { - return xxx_messageInfo_EntityIds.Size(m) -} -func (m *EntityIds) XXX_DiscardUnknown() { - xxx_messageInfo_EntityIds.DiscardUnknown(m) -} - -var xxx_messageInfo_EntityIds proto.InternalMessageInfo - -func (m *EntityIds) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *EntityIds) GetEntityIdArray() []int64 { - if m != nil { - return m.EntityIdArray - } - return nil -} - -type VectorRecord struct { - Records []*VectorRowRecord `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VectorRecord) Reset() { *m = VectorRecord{} } -func (m *VectorRecord) String() string { return proto.CompactTextString(m) } -func (*VectorRecord) ProtoMessage() {} -func (*VectorRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{11} -} - -func (m *VectorRecord) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VectorRecord.Unmarshal(m, b) -} -func (m *VectorRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VectorRecord.Marshal(b, m, deterministic) -} -func (m *VectorRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_VectorRecord.Merge(m, src) -} -func (m *VectorRecord) XXX_Size() int { - return xxx_messageInfo_VectorRecord.Size(m) -} -func (m *VectorRecord) XXX_DiscardUnknown() { - xxx_messageInfo_VectorRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_VectorRecord proto.InternalMessageInfo - -func (m *VectorRecord) GetRecords() []*VectorRowRecord { - if m != nil { - return m.Records - } - return nil -} - -type VectorParam struct { - Json string `protobuf:"bytes,1,opt,name=json,proto3" json:"json,omitempty"` - RowRecord *VectorRecord `protobuf:"bytes,2,opt,name=row_record,json=rowRecord,proto3" json:"row_record,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VectorParam) Reset() { *m = VectorParam{} } -func (m *VectorParam) String() string { return proto.CompactTextString(m) } -func (*VectorParam) ProtoMessage() {} -func (*VectorParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{12} -} - -func (m *VectorParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VectorParam.Unmarshal(m, b) -} -func (m *VectorParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VectorParam.Marshal(b, m, deterministic) -} -func (m *VectorParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_VectorParam.Merge(m, src) -} -func (m *VectorParam) XXX_Size() int { - return xxx_messageInfo_VectorParam.Size(m) -} -func (m *VectorParam) XXX_DiscardUnknown() { - xxx_messageInfo_VectorParam.DiscardUnknown(m) -} - -var xxx_messageInfo_VectorParam proto.InternalMessageInfo - -func (m *VectorParam) GetJson() string { - if m != nil { - return m.Json - } - return "" -} - -func (m *VectorParam) GetRowRecord() *VectorRecord { - if m != nil { - return m.RowRecord - } - return nil -} - -//* -// @brief schema -type FieldMeta struct { - FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` - Type DataType `protobuf:"varint,2,opt,name=type,proto3,enum=milvus.grpc.DataType" json:"type,omitempty"` - Dim int64 `protobuf:"varint,3,opt,name=dim,proto3" json:"dim,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FieldMeta) Reset() { *m = FieldMeta{} } -func (m *FieldMeta) String() string { return proto.CompactTextString(m) } -func (*FieldMeta) ProtoMessage() {} -func (*FieldMeta) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{13} -} - -func (m *FieldMeta) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FieldMeta.Unmarshal(m, b) -} -func (m *FieldMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FieldMeta.Marshal(b, m, deterministic) -} -func (m *FieldMeta) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldMeta.Merge(m, src) -} -func (m *FieldMeta) XXX_Size() int { - return xxx_messageInfo_FieldMeta.Size(m) -} -func (m *FieldMeta) XXX_DiscardUnknown() { - xxx_messageInfo_FieldMeta.DiscardUnknown(m) -} - -var xxx_messageInfo_FieldMeta proto.InternalMessageInfo - -func (m *FieldMeta) GetFieldName() string { - if m != nil { - return m.FieldName - } - return "" -} - -func (m *FieldMeta) GetType() DataType { - if m != nil { - return m.Type - } - return DataType_NONE -} - -func (m *FieldMeta) GetDim() int64 { - if m != nil { - return m.Dim - } - return 0 -} - -type Schema struct { - FieldMetas []*FieldMeta `protobuf:"bytes,1,rep,name=field_metas,json=fieldMetas,proto3" json:"field_metas,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Schema) Reset() { *m = Schema{} } -func (m *Schema) String() string { return proto.CompactTextString(m) } -func (*Schema) ProtoMessage() {} -func (*Schema) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{14} -} - -func (m *Schema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Schema.Unmarshal(m, b) -} -func (m *Schema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Schema.Marshal(b, m, deterministic) -} -func (m *Schema) XXX_Merge(src proto.Message) { - xxx_messageInfo_Schema.Merge(m, src) -} -func (m *Schema) XXX_Size() int { - return xxx_messageInfo_Schema.Size(m) -} -func (m *Schema) XXX_DiscardUnknown() { - xxx_messageInfo_Schema.DiscardUnknown(m) -} - -var xxx_messageInfo_Schema proto.InternalMessageInfo - -func (m *Schema) GetFieldMetas() []*FieldMeta { - if m != nil { - return m.FieldMetas - } - return nil -} - -type RowData struct { - Blob []byte `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RowData) Reset() { *m = RowData{} } -func (m *RowData) String() string { return proto.CompactTextString(m) } -func (*RowData) ProtoMessage() {} -func (*RowData) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{15} -} - -func (m *RowData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RowData.Unmarshal(m, b) -} -func (m *RowData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RowData.Marshal(b, m, deterministic) -} -func (m *RowData) XXX_Merge(src proto.Message) { - xxx_messageInfo_RowData.Merge(m, src) -} -func (m *RowData) XXX_Size() int { - return xxx_messageInfo_RowData.Size(m) -} -func (m *RowData) XXX_DiscardUnknown() { - xxx_messageInfo_RowData.DiscardUnknown(m) -} - -var xxx_messageInfo_RowData proto.InternalMessageInfo - -func (m *RowData) GetBlob() []byte { - if m != nil { - return m.Blob - } - return nil -} - -//////////////////////suvlim-proxy/////////////////////////////////// -type InsertParam struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - Schema *Schema `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` - RowsData []*RowData `protobuf:"bytes,3,rep,name=rows_data,json=rowsData,proto3" json:"rows_data,omitempty"` - EntityIdArray []int64 `protobuf:"varint,4,rep,packed,name=entity_id_array,json=entityIdArray,proto3" json:"entity_id_array,omitempty"` - PartitionTag string `protobuf:"bytes,5,opt,name=partition_tag,json=partitionTag,proto3" json:"partition_tag,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,6,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InsertParam) Reset() { *m = InsertParam{} } -func (m *InsertParam) String() string { return proto.CompactTextString(m) } -func (*InsertParam) ProtoMessage() {} -func (*InsertParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{16} -} - -func (m *InsertParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_InsertParam.Unmarshal(m, b) -} -func (m *InsertParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_InsertParam.Marshal(b, m, deterministic) -} -func (m *InsertParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_InsertParam.Merge(m, src) -} -func (m *InsertParam) XXX_Size() int { - return xxx_messageInfo_InsertParam.Size(m) -} -func (m *InsertParam) XXX_DiscardUnknown() { - xxx_messageInfo_InsertParam.DiscardUnknown(m) -} - -var xxx_messageInfo_InsertParam proto.InternalMessageInfo - -func (m *InsertParam) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *InsertParam) GetSchema() *Schema { - if m != nil { - return m.Schema - } - return nil -} - -func (m *InsertParam) GetRowsData() []*RowData { - if m != nil { - return m.RowsData - } - return nil -} - -func (m *InsertParam) GetEntityIdArray() []int64 { - if m != nil { - return m.EntityIdArray - } - return nil -} - -func (m *InsertParam) GetPartitionTag() string { - if m != nil { - return m.PartitionTag - } - return "" -} - -func (m *InsertParam) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -type SearchParam struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - VectorParam []*VectorParam `protobuf:"bytes,2,rep,name=vector_param,json=vectorParam,proto3" json:"vector_param,omitempty"` - Dsl string `protobuf:"bytes,3,opt,name=dsl,proto3" json:"dsl,omitempty"` - PartitionTag []string `protobuf:"bytes,4,rep,name=partition_tag,json=partitionTag,proto3" json:"partition_tag,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,5,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SearchParam) Reset() { *m = SearchParam{} } -func (m *SearchParam) String() string { return proto.CompactTextString(m) } -func (*SearchParam) ProtoMessage() {} -func (*SearchParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{17} -} - -func (m *SearchParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SearchParam.Unmarshal(m, b) -} -func (m *SearchParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SearchParam.Marshal(b, m, deterministic) -} -func (m *SearchParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_SearchParam.Merge(m, src) -} -func (m *SearchParam) XXX_Size() int { - return xxx_messageInfo_SearchParam.Size(m) -} -func (m *SearchParam) XXX_DiscardUnknown() { - xxx_messageInfo_SearchParam.DiscardUnknown(m) -} - -var xxx_messageInfo_SearchParam proto.InternalMessageInfo - -func (m *SearchParam) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *SearchParam) GetVectorParam() []*VectorParam { - if m != nil { - return m.VectorParam - } - return nil -} - -func (m *SearchParam) GetDsl() string { - if m != nil { - return m.Dsl - } - return "" -} - -func (m *SearchParam) GetPartitionTag() []string { - if m != nil { - return m.PartitionTag - } - return nil -} - -func (m *SearchParam) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -type SearchInSegmentParam struct { - FileIdArray []string `protobuf:"bytes,1,rep,name=file_id_array,json=fileIdArray,proto3" json:"file_id_array,omitempty"` - SearchParam *SearchParam `protobuf:"bytes,2,opt,name=search_param,json=searchParam,proto3" json:"search_param,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SearchInSegmentParam) Reset() { *m = SearchInSegmentParam{} } -func (m *SearchInSegmentParam) String() string { return proto.CompactTextString(m) } -func (*SearchInSegmentParam) ProtoMessage() {} -func (*SearchInSegmentParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{18} -} - -func (m *SearchInSegmentParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SearchInSegmentParam.Unmarshal(m, b) -} -func (m *SearchInSegmentParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SearchInSegmentParam.Marshal(b, m, deterministic) -} -func (m *SearchInSegmentParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_SearchInSegmentParam.Merge(m, src) -} -func (m *SearchInSegmentParam) XXX_Size() int { - return xxx_messageInfo_SearchInSegmentParam.Size(m) -} -func (m *SearchInSegmentParam) XXX_DiscardUnknown() { - xxx_messageInfo_SearchInSegmentParam.DiscardUnknown(m) -} - -var xxx_messageInfo_SearchInSegmentParam proto.InternalMessageInfo - -func (m *SearchInSegmentParam) GetFileIdArray() []string { - if m != nil { - return m.FileIdArray - } - return nil -} - -func (m *SearchInSegmentParam) GetSearchParam() *SearchParam { - if m != nil { - return m.SearchParam - } - return nil -} - -type Entities struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - Ids []int64 `protobuf:"varint,2,rep,packed,name=ids,proto3" json:"ids,omitempty"` - ValidRow []bool `protobuf:"varint,3,rep,packed,name=valid_row,json=validRow,proto3" json:"valid_row,omitempty"` - RowsData []*RowData `protobuf:"bytes,4,rep,name=rows_data,json=rowsData,proto3" json:"rows_data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Entities) Reset() { *m = Entities{} } -func (m *Entities) String() string { return proto.CompactTextString(m) } -func (*Entities) ProtoMessage() {} -func (*Entities) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{19} -} - -func (m *Entities) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Entities.Unmarshal(m, b) -} -func (m *Entities) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Entities.Marshal(b, m, deterministic) -} -func (m *Entities) XXX_Merge(src proto.Message) { - xxx_messageInfo_Entities.Merge(m, src) -} -func (m *Entities) XXX_Size() int { - return xxx_messageInfo_Entities.Size(m) -} -func (m *Entities) XXX_DiscardUnknown() { - xxx_messageInfo_Entities.DiscardUnknown(m) -} - -var xxx_messageInfo_Entities proto.InternalMessageInfo - -func (m *Entities) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *Entities) GetIds() []int64 { - if m != nil { - return m.Ids - } - return nil -} - -func (m *Entities) GetValidRow() []bool { - if m != nil { - return m.ValidRow - } - return nil -} - -func (m *Entities) GetRowsData() []*RowData { - if m != nil { - return m.RowsData - } - return nil -} - -//* -// @brief Query result -type QueryResult struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - Entities *Entities `protobuf:"bytes,2,opt,name=entities,proto3" json:"entities,omitempty"` - RowNum int64 `protobuf:"varint,3,opt,name=row_num,json=rowNum,proto3" json:"row_num,omitempty"` - Scores []float32 `protobuf:"fixed32,4,rep,packed,name=scores,proto3" json:"scores,omitempty"` - Distances []float32 `protobuf:"fixed32,5,rep,packed,name=distances,proto3" json:"distances,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,6,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - QueryId int64 `protobuf:"varint,7,opt,name=query_id,json=queryId,proto3" json:"query_id,omitempty"` - ClientId int64 `protobuf:"varint,8,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryResult) Reset() { *m = QueryResult{} } -func (m *QueryResult) String() string { return proto.CompactTextString(m) } -func (*QueryResult) ProtoMessage() {} -func (*QueryResult) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{20} -} - -func (m *QueryResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryResult.Unmarshal(m, b) -} -func (m *QueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryResult.Marshal(b, m, deterministic) -} -func (m *QueryResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResult.Merge(m, src) -} -func (m *QueryResult) XXX_Size() int { - return xxx_messageInfo_QueryResult.Size(m) -} -func (m *QueryResult) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResult.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryResult proto.InternalMessageInfo - -func (m *QueryResult) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *QueryResult) GetEntities() *Entities { - if m != nil { - return m.Entities - } - return nil -} - -func (m *QueryResult) GetRowNum() int64 { - if m != nil { - return m.RowNum - } - return 0 -} - -func (m *QueryResult) GetScores() []float32 { - if m != nil { - return m.Scores - } - return nil -} - -func (m *QueryResult) GetDistances() []float32 { - if m != nil { - return m.Distances - } - return nil -} - -func (m *QueryResult) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -func (m *QueryResult) GetQueryId() int64 { - if m != nil { - return m.QueryId - } - return 0 -} - -func (m *QueryResult) GetClientId() int64 { - if m != nil { - return m.ClientId - } - return 0 -} - -//* -// @brief Server string Reply -type StringReply struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - StringReply string `protobuf:"bytes,2,opt,name=string_reply,json=stringReply,proto3" json:"string_reply,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StringReply) Reset() { *m = StringReply{} } -func (m *StringReply) String() string { return proto.CompactTextString(m) } -func (*StringReply) ProtoMessage() {} -func (*StringReply) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{21} -} - -func (m *StringReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StringReply.Unmarshal(m, b) -} -func (m *StringReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StringReply.Marshal(b, m, deterministic) -} -func (m *StringReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_StringReply.Merge(m, src) -} -func (m *StringReply) XXX_Size() int { - return xxx_messageInfo_StringReply.Size(m) -} -func (m *StringReply) XXX_DiscardUnknown() { - xxx_messageInfo_StringReply.DiscardUnknown(m) -} - -var xxx_messageInfo_StringReply proto.InternalMessageInfo - -func (m *StringReply) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *StringReply) GetStringReply() string { - if m != nil { - return m.StringReply - } - return "" -} - -//* -// @brief Server bool Reply -type BoolReply struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - BoolReply bool `protobuf:"varint,2,opt,name=bool_reply,json=boolReply,proto3" json:"bool_reply,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BoolReply) Reset() { *m = BoolReply{} } -func (m *BoolReply) String() string { return proto.CompactTextString(m) } -func (*BoolReply) ProtoMessage() {} -func (*BoolReply) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{22} -} - -func (m *BoolReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BoolReply.Unmarshal(m, b) -} -func (m *BoolReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BoolReply.Marshal(b, m, deterministic) -} -func (m *BoolReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_BoolReply.Merge(m, src) -} -func (m *BoolReply) XXX_Size() int { - return xxx_messageInfo_BoolReply.Size(m) -} -func (m *BoolReply) XXX_DiscardUnknown() { - xxx_messageInfo_BoolReply.DiscardUnknown(m) -} - -var xxx_messageInfo_BoolReply proto.InternalMessageInfo - -func (m *BoolReply) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *BoolReply) GetBoolReply() bool { - if m != nil { - return m.BoolReply - } - return false -} - -//* -// @brief Return collection row count -type CollectionRowCount struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - CollectionRowCount int64 `protobuf:"varint,2,opt,name=collection_row_count,json=collectionRowCount,proto3" json:"collection_row_count,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionRowCount) Reset() { *m = CollectionRowCount{} } -func (m *CollectionRowCount) String() string { return proto.CompactTextString(m) } -func (*CollectionRowCount) ProtoMessage() {} -func (*CollectionRowCount) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{23} -} - -func (m *CollectionRowCount) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionRowCount.Unmarshal(m, b) -} -func (m *CollectionRowCount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionRowCount.Marshal(b, m, deterministic) -} -func (m *CollectionRowCount) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionRowCount.Merge(m, src) -} -func (m *CollectionRowCount) XXX_Size() int { - return xxx_messageInfo_CollectionRowCount.Size(m) -} -func (m *CollectionRowCount) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionRowCount.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionRowCount proto.InternalMessageInfo - -func (m *CollectionRowCount) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *CollectionRowCount) GetCollectionRowCount() int64 { - if m != nil { - return m.CollectionRowCount - } - return 0 -} - -//* -// @brief Server command parameters -type Command struct { - Cmd string `protobuf:"bytes,1,opt,name=cmd,proto3" json:"cmd,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Command) Reset() { *m = Command{} } -func (m *Command) String() string { return proto.CompactTextString(m) } -func (*Command) ProtoMessage() {} -func (*Command) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{24} -} - -func (m *Command) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Command.Unmarshal(m, b) -} -func (m *Command) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Command.Marshal(b, m, deterministic) -} -func (m *Command) XXX_Merge(src proto.Message) { - xxx_messageInfo_Command.Merge(m, src) -} -func (m *Command) XXX_Size() int { - return xxx_messageInfo_Command.Size(m) -} -func (m *Command) XXX_DiscardUnknown() { - xxx_messageInfo_Command.DiscardUnknown(m) -} - -var xxx_messageInfo_Command proto.InternalMessageInfo - -func (m *Command) GetCmd() string { - if m != nil { - return m.Cmd - } - return "" -} - -//* -// @brief Index params -// @collection_name: target collection -// @field_name: target field -// @index_name: a name for index provided by user, unique within this field -// @extra_params: index parameters in json format -// for vector field: -// extra_params["index_type"] = one of the values: FLAT, IVF_LAT, IVF_SQ8, NSGMIX, IVFSQ8H, -// PQ, HNSW, HNSW_SQ8NM, ANNOY -// extra_params["metric_type"] = one of the values: L2, IP, HAMMING, JACCARD, TANIMOTO -// SUBSTRUCTURE, SUPERSTRUCTURE -// extra_params["params"] = extra parameters for index, for example ivflat: {nlist: 2048} -// for structured field: -// extra_params["index_type"] = one of the values: SORTED -type IndexParam struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - CollectionName string `protobuf:"bytes,2,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - FieldName string `protobuf:"bytes,3,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` - IndexName string `protobuf:"bytes,4,opt,name=index_name,json=indexName,proto3" json:"index_name,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,5,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *IndexParam) Reset() { *m = IndexParam{} } -func (m *IndexParam) String() string { return proto.CompactTextString(m) } -func (*IndexParam) ProtoMessage() {} -func (*IndexParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{25} -} - -func (m *IndexParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IndexParam.Unmarshal(m, b) -} -func (m *IndexParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IndexParam.Marshal(b, m, deterministic) -} -func (m *IndexParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_IndexParam.Merge(m, src) -} -func (m *IndexParam) XXX_Size() int { - return xxx_messageInfo_IndexParam.Size(m) -} -func (m *IndexParam) XXX_DiscardUnknown() { - xxx_messageInfo_IndexParam.DiscardUnknown(m) -} - -var xxx_messageInfo_IndexParam proto.InternalMessageInfo - -func (m *IndexParam) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *IndexParam) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *IndexParam) GetFieldName() string { - if m != nil { - return m.FieldName - } - return "" -} - -func (m *IndexParam) GetIndexName() string { - if m != nil { - return m.IndexName - } - return "" -} - -func (m *IndexParam) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -//* -// @brief Parameters for flush action -type FlushParam struct { - CollectionNameArray []string `protobuf:"bytes,1,rep,name=collection_name_array,json=collectionNameArray,proto3" json:"collection_name_array,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FlushParam) Reset() { *m = FlushParam{} } -func (m *FlushParam) String() string { return proto.CompactTextString(m) } -func (*FlushParam) ProtoMessage() {} -func (*FlushParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{26} -} - -func (m *FlushParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FlushParam.Unmarshal(m, b) -} -func (m *FlushParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FlushParam.Marshal(b, m, deterministic) -} -func (m *FlushParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_FlushParam.Merge(m, src) -} -func (m *FlushParam) XXX_Size() int { - return xxx_messageInfo_FlushParam.Size(m) -} -func (m *FlushParam) XXX_DiscardUnknown() { - xxx_messageInfo_FlushParam.DiscardUnknown(m) -} - -var xxx_messageInfo_FlushParam proto.InternalMessageInfo - -func (m *FlushParam) GetCollectionNameArray() []string { - if m != nil { - return m.CollectionNameArray - } - return nil -} - -//* -// @brief Parameters for flush action -type CompactParam struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - Threshold float64 `protobuf:"fixed64,2,opt,name=threshold,proto3" json:"threshold,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CompactParam) Reset() { *m = CompactParam{} } -func (m *CompactParam) String() string { return proto.CompactTextString(m) } -func (*CompactParam) ProtoMessage() {} -func (*CompactParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{27} -} - -func (m *CompactParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CompactParam.Unmarshal(m, b) -} -func (m *CompactParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CompactParam.Marshal(b, m, deterministic) -} -func (m *CompactParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_CompactParam.Merge(m, src) -} -func (m *CompactParam) XXX_Size() int { - return xxx_messageInfo_CompactParam.Size(m) -} -func (m *CompactParam) XXX_DiscardUnknown() { - xxx_messageInfo_CompactParam.DiscardUnknown(m) -} - -var xxx_messageInfo_CompactParam proto.InternalMessageInfo - -func (m *CompactParam) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *CompactParam) GetThreshold() float64 { - if m != nil { - return m.Threshold - } - return 0 -} - -//* -// @brief Parameters for deleting entities by id -type DeleteByIDParam struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - IdArray []int64 `protobuf:"varint,2,rep,packed,name=id_array,json=idArray,proto3" json:"id_array,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteByIDParam) Reset() { *m = DeleteByIDParam{} } -func (m *DeleteByIDParam) String() string { return proto.CompactTextString(m) } -func (*DeleteByIDParam) ProtoMessage() {} -func (*DeleteByIDParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{28} -} - -func (m *DeleteByIDParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteByIDParam.Unmarshal(m, b) -} -func (m *DeleteByIDParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteByIDParam.Marshal(b, m, deterministic) -} -func (m *DeleteByIDParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteByIDParam.Merge(m, src) -} -func (m *DeleteByIDParam) XXX_Size() int { - return xxx_messageInfo_DeleteByIDParam.Size(m) -} -func (m *DeleteByIDParam) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteByIDParam.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteByIDParam proto.InternalMessageInfo - -func (m *DeleteByIDParam) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *DeleteByIDParam) GetIdArray() []int64 { - if m != nil { - return m.IdArray - } - return nil -} - -//* -// @brief Return collection stats -// @json_info: collection stats in json format, typically, the format is like: -// { -// row_count: xxx, -// data_size: xxx, -// partitions: [ -// { -// tag: xxx, -// id: xxx, -// row_count: xxx, -// data_size: xxx, -// segments: [ -// { -// id: xxx, -// row_count: xxx, -// data_size: xxx, -// files: [ -// { -// field: xxx, -// name: xxx, -// index_type: xxx, -// path: xxx, -// data_size: xxx, -// } -// ] -// } -// ] -// } -// ] -// } -type CollectionInfo struct { - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - JsonInfo string `protobuf:"bytes,2,opt,name=json_info,json=jsonInfo,proto3" json:"json_info,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionInfo) Reset() { *m = CollectionInfo{} } -func (m *CollectionInfo) String() string { return proto.CompactTextString(m) } -func (*CollectionInfo) ProtoMessage() {} -func (*CollectionInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{29} -} - -func (m *CollectionInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionInfo.Unmarshal(m, b) -} -func (m *CollectionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionInfo.Marshal(b, m, deterministic) -} -func (m *CollectionInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionInfo.Merge(m, src) -} -func (m *CollectionInfo) XXX_Size() int { - return xxx_messageInfo_CollectionInfo.Size(m) -} -func (m *CollectionInfo) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionInfo proto.InternalMessageInfo - -func (m *CollectionInfo) GetStatus() *Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *CollectionInfo) GetJsonInfo() string { - if m != nil { - return m.JsonInfo - } - return "" -} - -//* -// @brief Parameters for returning entities id of a segment -type GetEntityIDsParam struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - SegmentId int64 `protobuf:"varint,2,opt,name=segment_id,json=segmentId,proto3" json:"segment_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetEntityIDsParam) Reset() { *m = GetEntityIDsParam{} } -func (m *GetEntityIDsParam) String() string { return proto.CompactTextString(m) } -func (*GetEntityIDsParam) ProtoMessage() {} -func (*GetEntityIDsParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{30} -} - -func (m *GetEntityIDsParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetEntityIDsParam.Unmarshal(m, b) -} -func (m *GetEntityIDsParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetEntityIDsParam.Marshal(b, m, deterministic) -} -func (m *GetEntityIDsParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetEntityIDsParam.Merge(m, src) -} -func (m *GetEntityIDsParam) XXX_Size() int { - return xxx_messageInfo_GetEntityIDsParam.Size(m) -} -func (m *GetEntityIDsParam) XXX_DiscardUnknown() { - xxx_messageInfo_GetEntityIDsParam.DiscardUnknown(m) -} - -var xxx_messageInfo_GetEntityIDsParam proto.InternalMessageInfo - -func (m *GetEntityIDsParam) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *GetEntityIDsParam) GetSegmentId() int64 { - if m != nil { - return m.SegmentId - } - return 0 -} - -//* -// @brief Entities identity -type EntityIdentity struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - IdArray []int64 `protobuf:"varint,2,rep,packed,name=id_array,json=idArray,proto3" json:"id_array,omitempty"` - FieldNames []string `protobuf:"bytes,3,rep,name=field_names,json=fieldNames,proto3" json:"field_names,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EntityIdentity) Reset() { *m = EntityIdentity{} } -func (m *EntityIdentity) String() string { return proto.CompactTextString(m) } -func (*EntityIdentity) ProtoMessage() {} -func (*EntityIdentity) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{31} -} - -func (m *EntityIdentity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EntityIdentity.Unmarshal(m, b) -} -func (m *EntityIdentity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EntityIdentity.Marshal(b, m, deterministic) -} -func (m *EntityIdentity) XXX_Merge(src proto.Message) { - xxx_messageInfo_EntityIdentity.Merge(m, src) -} -func (m *EntityIdentity) XXX_Size() int { - return xxx_messageInfo_EntityIdentity.Size(m) -} -func (m *EntityIdentity) XXX_DiscardUnknown() { - xxx_messageInfo_EntityIdentity.DiscardUnknown(m) -} - -var xxx_messageInfo_EntityIdentity proto.InternalMessageInfo - -func (m *EntityIdentity) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *EntityIdentity) GetIdArray() []int64 { - if m != nil { - return m.IdArray - } - return nil -} - -func (m *EntityIdentity) GetFieldNames() []string { - if m != nil { - return m.FieldNames - } - return nil -} - -//* -// @brief Vector field parameters -type VectorFieldParam struct { - Dimension int64 `protobuf:"varint,1,opt,name=dimension,proto3" json:"dimension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VectorFieldParam) Reset() { *m = VectorFieldParam{} } -func (m *VectorFieldParam) String() string { return proto.CompactTextString(m) } -func (*VectorFieldParam) ProtoMessage() {} -func (*VectorFieldParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{32} -} - -func (m *VectorFieldParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VectorFieldParam.Unmarshal(m, b) -} -func (m *VectorFieldParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VectorFieldParam.Marshal(b, m, deterministic) -} -func (m *VectorFieldParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_VectorFieldParam.Merge(m, src) -} -func (m *VectorFieldParam) XXX_Size() int { - return xxx_messageInfo_VectorFieldParam.Size(m) -} -func (m *VectorFieldParam) XXX_DiscardUnknown() { - xxx_messageInfo_VectorFieldParam.DiscardUnknown(m) -} - -var xxx_messageInfo_VectorFieldParam proto.InternalMessageInfo - -func (m *VectorFieldParam) GetDimension() int64 { - if m != nil { - return m.Dimension - } - return 0 -} - -//* -// @brief Field type -type FieldType struct { - // Types that are valid to be assigned to Value: - // *FieldType_DataType - // *FieldType_VectorParam - Value isFieldType_Value `protobuf_oneof:"value"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FieldType) Reset() { *m = FieldType{} } -func (m *FieldType) String() string { return proto.CompactTextString(m) } -func (*FieldType) ProtoMessage() {} -func (*FieldType) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{33} -} - -func (m *FieldType) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FieldType.Unmarshal(m, b) -} -func (m *FieldType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FieldType.Marshal(b, m, deterministic) -} -func (m *FieldType) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldType.Merge(m, src) -} -func (m *FieldType) XXX_Size() int { - return xxx_messageInfo_FieldType.Size(m) -} -func (m *FieldType) XXX_DiscardUnknown() { - xxx_messageInfo_FieldType.DiscardUnknown(m) -} - -var xxx_messageInfo_FieldType proto.InternalMessageInfo - -type isFieldType_Value interface { - isFieldType_Value() -} - -type FieldType_DataType struct { - DataType DataType `protobuf:"varint,1,opt,name=data_type,json=dataType,proto3,enum=milvus.grpc.DataType,oneof"` -} - -type FieldType_VectorParam struct { - VectorParam *VectorFieldParam `protobuf:"bytes,2,opt,name=vector_param,json=vectorParam,proto3,oneof"` -} - -func (*FieldType_DataType) isFieldType_Value() {} - -func (*FieldType_VectorParam) isFieldType_Value() {} - -func (m *FieldType) GetValue() isFieldType_Value { - if m != nil { - return m.Value - } - return nil -} - -func (m *FieldType) GetDataType() DataType { - if x, ok := m.GetValue().(*FieldType_DataType); ok { - return x.DataType - } - return DataType_NONE -} - -func (m *FieldType) GetVectorParam() *VectorFieldParam { - if x, ok := m.GetValue().(*FieldType_VectorParam); ok { - return x.VectorParam - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*FieldType) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*FieldType_DataType)(nil), - (*FieldType_VectorParam)(nil), - } -} - -//* -// @brief Field parameters -type FieldParam struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Type DataType `protobuf:"varint,3,opt,name=type,proto3,enum=milvus.grpc.DataType" json:"type,omitempty"` - IndexParams []*KeyValuePair `protobuf:"bytes,4,rep,name=index_params,json=indexParams,proto3" json:"index_params,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,5,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FieldParam) Reset() { *m = FieldParam{} } -func (m *FieldParam) String() string { return proto.CompactTextString(m) } -func (*FieldParam) ProtoMessage() {} -func (*FieldParam) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{34} -} - -func (m *FieldParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FieldParam.Unmarshal(m, b) -} -func (m *FieldParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FieldParam.Marshal(b, m, deterministic) -} -func (m *FieldParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldParam.Merge(m, src) -} -func (m *FieldParam) XXX_Size() int { - return xxx_messageInfo_FieldParam.Size(m) -} -func (m *FieldParam) XXX_DiscardUnknown() { - xxx_messageInfo_FieldParam.DiscardUnknown(m) -} - -var xxx_messageInfo_FieldParam proto.InternalMessageInfo - -func (m *FieldParam) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *FieldParam) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *FieldParam) GetType() DataType { - if m != nil { - return m.Type - } - return DataType_NONE -} - -func (m *FieldParam) GetIndexParams() []*KeyValuePair { - if m != nil { - return m.IndexParams - } - return nil -} - -func (m *FieldParam) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -//* -// @brief Vector field record -type VectorFieldRecord struct { - Value []*VectorRowRecord `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VectorFieldRecord) Reset() { *m = VectorFieldRecord{} } -func (m *VectorFieldRecord) String() string { return proto.CompactTextString(m) } -func (*VectorFieldRecord) ProtoMessage() {} -func (*VectorFieldRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{35} -} - -func (m *VectorFieldRecord) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VectorFieldRecord.Unmarshal(m, b) -} -func (m *VectorFieldRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VectorFieldRecord.Marshal(b, m, deterministic) -} -func (m *VectorFieldRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_VectorFieldRecord.Merge(m, src) -} -func (m *VectorFieldRecord) XXX_Size() int { - return xxx_messageInfo_VectorFieldRecord.Size(m) -} -func (m *VectorFieldRecord) XXX_DiscardUnknown() { - xxx_messageInfo_VectorFieldRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_VectorFieldRecord proto.InternalMessageInfo - -func (m *VectorFieldRecord) GetValue() []*VectorRowRecord { - if m != nil { - return m.Value - } - return nil -} - -type TermQuery struct { - FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` - IntValue []int64 `protobuf:"varint,2,rep,packed,name=int_value,json=intValue,proto3" json:"int_value,omitempty"` - DoubleValue []float64 `protobuf:"fixed64,3,rep,packed,name=double_value,json=doubleValue,proto3" json:"double_value,omitempty"` - ValueNum int64 `protobuf:"varint,4,opt,name=value_num,json=valueNum,proto3" json:"value_num,omitempty"` - Boost float32 `protobuf:"fixed32,5,opt,name=boost,proto3" json:"boost,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,6,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TermQuery) Reset() { *m = TermQuery{} } -func (m *TermQuery) String() string { return proto.CompactTextString(m) } -func (*TermQuery) ProtoMessage() {} -func (*TermQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{36} -} - -func (m *TermQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TermQuery.Unmarshal(m, b) -} -func (m *TermQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TermQuery.Marshal(b, m, deterministic) -} -func (m *TermQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_TermQuery.Merge(m, src) -} -func (m *TermQuery) XXX_Size() int { - return xxx_messageInfo_TermQuery.Size(m) -} -func (m *TermQuery) XXX_DiscardUnknown() { - xxx_messageInfo_TermQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_TermQuery proto.InternalMessageInfo - -func (m *TermQuery) GetFieldName() string { - if m != nil { - return m.FieldName - } - return "" -} - -func (m *TermQuery) GetIntValue() []int64 { - if m != nil { - return m.IntValue - } - return nil -} - -func (m *TermQuery) GetDoubleValue() []float64 { - if m != nil { - return m.DoubleValue - } - return nil -} - -func (m *TermQuery) GetValueNum() int64 { - if m != nil { - return m.ValueNum - } - return 0 -} - -func (m *TermQuery) GetBoost() float32 { - if m != nil { - return m.Boost - } - return 0 -} - -func (m *TermQuery) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -type CompareExpr struct { - Operator CompareOperator `protobuf:"varint,1,opt,name=operator,proto3,enum=milvus.grpc.CompareOperator" json:"operator,omitempty"` - Operand string `protobuf:"bytes,2,opt,name=operand,proto3" json:"operand,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CompareExpr) Reset() { *m = CompareExpr{} } -func (m *CompareExpr) String() string { return proto.CompactTextString(m) } -func (*CompareExpr) ProtoMessage() {} -func (*CompareExpr) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{37} -} - -func (m *CompareExpr) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CompareExpr.Unmarshal(m, b) -} -func (m *CompareExpr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CompareExpr.Marshal(b, m, deterministic) -} -func (m *CompareExpr) XXX_Merge(src proto.Message) { - xxx_messageInfo_CompareExpr.Merge(m, src) -} -func (m *CompareExpr) XXX_Size() int { - return xxx_messageInfo_CompareExpr.Size(m) -} -func (m *CompareExpr) XXX_DiscardUnknown() { - xxx_messageInfo_CompareExpr.DiscardUnknown(m) -} - -var xxx_messageInfo_CompareExpr proto.InternalMessageInfo - -func (m *CompareExpr) GetOperator() CompareOperator { - if m != nil { - return m.Operator - } - return CompareOperator_LT -} - -func (m *CompareExpr) GetOperand() string { - if m != nil { - return m.Operand - } - return "" -} - -type RangeQuery struct { - FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` - Operand []*CompareExpr `protobuf:"bytes,2,rep,name=operand,proto3" json:"operand,omitempty"` - Boost float32 `protobuf:"fixed32,3,opt,name=boost,proto3" json:"boost,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,4,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RangeQuery) Reset() { *m = RangeQuery{} } -func (m *RangeQuery) String() string { return proto.CompactTextString(m) } -func (*RangeQuery) ProtoMessage() {} -func (*RangeQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{38} -} - -func (m *RangeQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RangeQuery.Unmarshal(m, b) -} -func (m *RangeQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RangeQuery.Marshal(b, m, deterministic) -} -func (m *RangeQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_RangeQuery.Merge(m, src) -} -func (m *RangeQuery) XXX_Size() int { - return xxx_messageInfo_RangeQuery.Size(m) -} -func (m *RangeQuery) XXX_DiscardUnknown() { - xxx_messageInfo_RangeQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_RangeQuery proto.InternalMessageInfo - -func (m *RangeQuery) GetFieldName() string { - if m != nil { - return m.FieldName - } - return "" -} - -func (m *RangeQuery) GetOperand() []*CompareExpr { - if m != nil { - return m.Operand - } - return nil -} - -func (m *RangeQuery) GetBoost() float32 { - if m != nil { - return m.Boost - } - return 0 -} - -func (m *RangeQuery) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -type VectorQuery struct { - FieldName string `protobuf:"bytes,1,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` - QueryBoost float32 `protobuf:"fixed32,2,opt,name=query_boost,json=queryBoost,proto3" json:"query_boost,omitempty"` - Records []*VectorRowRecord `protobuf:"bytes,3,rep,name=records,proto3" json:"records,omitempty"` - Topk int64 `protobuf:"varint,4,opt,name=topk,proto3" json:"topk,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,5,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VectorQuery) Reset() { *m = VectorQuery{} } -func (m *VectorQuery) String() string { return proto.CompactTextString(m) } -func (*VectorQuery) ProtoMessage() {} -func (*VectorQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{39} -} - -func (m *VectorQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VectorQuery.Unmarshal(m, b) -} -func (m *VectorQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VectorQuery.Marshal(b, m, deterministic) -} -func (m *VectorQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_VectorQuery.Merge(m, src) -} -func (m *VectorQuery) XXX_Size() int { - return xxx_messageInfo_VectorQuery.Size(m) -} -func (m *VectorQuery) XXX_DiscardUnknown() { - xxx_messageInfo_VectorQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_VectorQuery proto.InternalMessageInfo - -func (m *VectorQuery) GetFieldName() string { - if m != nil { - return m.FieldName - } - return "" -} - -func (m *VectorQuery) GetQueryBoost() float32 { - if m != nil { - return m.QueryBoost - } - return 0 -} - -func (m *VectorQuery) GetRecords() []*VectorRowRecord { - if m != nil { - return m.Records - } - return nil -} - -func (m *VectorQuery) GetTopk() int64 { - if m != nil { - return m.Topk - } - return 0 -} - -func (m *VectorQuery) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -type BooleanQuery struct { - Occur Occur `protobuf:"varint,1,opt,name=occur,proto3,enum=milvus.grpc.Occur" json:"occur,omitempty"` - GeneralQuery []*GeneralQuery `protobuf:"bytes,2,rep,name=general_query,json=generalQuery,proto3" json:"general_query,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BooleanQuery) Reset() { *m = BooleanQuery{} } -func (m *BooleanQuery) String() string { return proto.CompactTextString(m) } -func (*BooleanQuery) ProtoMessage() {} -func (*BooleanQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{40} -} - -func (m *BooleanQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BooleanQuery.Unmarshal(m, b) -} -func (m *BooleanQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BooleanQuery.Marshal(b, m, deterministic) -} -func (m *BooleanQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_BooleanQuery.Merge(m, src) -} -func (m *BooleanQuery) XXX_Size() int { - return xxx_messageInfo_BooleanQuery.Size(m) -} -func (m *BooleanQuery) XXX_DiscardUnknown() { - xxx_messageInfo_BooleanQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_BooleanQuery proto.InternalMessageInfo - -func (m *BooleanQuery) GetOccur() Occur { - if m != nil { - return m.Occur - } - return Occur_INVALID -} - -func (m *BooleanQuery) GetGeneralQuery() []*GeneralQuery { - if m != nil { - return m.GeneralQuery - } - return nil -} - -type GeneralQuery struct { - // Types that are valid to be assigned to Query: - // *GeneralQuery_BooleanQuery - // *GeneralQuery_TermQuery - // *GeneralQuery_RangeQuery - // *GeneralQuery_VectorQuery - Query isGeneralQuery_Query `protobuf_oneof:"query"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GeneralQuery) Reset() { *m = GeneralQuery{} } -func (m *GeneralQuery) String() string { return proto.CompactTextString(m) } -func (*GeneralQuery) ProtoMessage() {} -func (*GeneralQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{41} -} - -func (m *GeneralQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GeneralQuery.Unmarshal(m, b) -} -func (m *GeneralQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GeneralQuery.Marshal(b, m, deterministic) -} -func (m *GeneralQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_GeneralQuery.Merge(m, src) -} -func (m *GeneralQuery) XXX_Size() int { - return xxx_messageInfo_GeneralQuery.Size(m) -} -func (m *GeneralQuery) XXX_DiscardUnknown() { - xxx_messageInfo_GeneralQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_GeneralQuery proto.InternalMessageInfo - -type isGeneralQuery_Query interface { - isGeneralQuery_Query() -} - -type GeneralQuery_BooleanQuery struct { - BooleanQuery *BooleanQuery `protobuf:"bytes,1,opt,name=boolean_query,json=booleanQuery,proto3,oneof"` -} - -type GeneralQuery_TermQuery struct { - TermQuery *TermQuery `protobuf:"bytes,2,opt,name=term_query,json=termQuery,proto3,oneof"` -} - -type GeneralQuery_RangeQuery struct { - RangeQuery *RangeQuery `protobuf:"bytes,3,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -type GeneralQuery_VectorQuery struct { - VectorQuery *VectorQuery `protobuf:"bytes,4,opt,name=vector_query,json=vectorQuery,proto3,oneof"` -} - -func (*GeneralQuery_BooleanQuery) isGeneralQuery_Query() {} - -func (*GeneralQuery_TermQuery) isGeneralQuery_Query() {} - -func (*GeneralQuery_RangeQuery) isGeneralQuery_Query() {} - -func (*GeneralQuery_VectorQuery) isGeneralQuery_Query() {} - -func (m *GeneralQuery) GetQuery() isGeneralQuery_Query { - if m != nil { - return m.Query - } - return nil -} - -func (m *GeneralQuery) GetBooleanQuery() *BooleanQuery { - if x, ok := m.GetQuery().(*GeneralQuery_BooleanQuery); ok { - return x.BooleanQuery - } - return nil -} - -func (m *GeneralQuery) GetTermQuery() *TermQuery { - if x, ok := m.GetQuery().(*GeneralQuery_TermQuery); ok { - return x.TermQuery - } - return nil -} - -func (m *GeneralQuery) GetRangeQuery() *RangeQuery { - if x, ok := m.GetQuery().(*GeneralQuery_RangeQuery); ok { - return x.RangeQuery - } - return nil -} - -func (m *GeneralQuery) GetVectorQuery() *VectorQuery { - if x, ok := m.GetQuery().(*GeneralQuery_VectorQuery); ok { - return x.VectorQuery - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*GeneralQuery) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*GeneralQuery_BooleanQuery)(nil), - (*GeneralQuery_TermQuery)(nil), - (*GeneralQuery_RangeQuery)(nil), - (*GeneralQuery_VectorQuery)(nil), - } -} - -type SearchParamPB struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - PartitionTagArray []string `protobuf:"bytes,2,rep,name=partition_tag_array,json=partitionTagArray,proto3" json:"partition_tag_array,omitempty"` - GeneralQuery *GeneralQuery `protobuf:"bytes,3,opt,name=general_query,json=generalQuery,proto3" json:"general_query,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,4,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SearchParamPB) Reset() { *m = SearchParamPB{} } -func (m *SearchParamPB) String() string { return proto.CompactTextString(m) } -func (*SearchParamPB) ProtoMessage() {} -func (*SearchParamPB) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{42} -} - -func (m *SearchParamPB) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SearchParamPB.Unmarshal(m, b) -} -func (m *SearchParamPB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SearchParamPB.Marshal(b, m, deterministic) -} -func (m *SearchParamPB) XXX_Merge(src proto.Message) { - xxx_messageInfo_SearchParamPB.Merge(m, src) -} -func (m *SearchParamPB) XXX_Size() int { - return xxx_messageInfo_SearchParamPB.Size(m) -} -func (m *SearchParamPB) XXX_DiscardUnknown() { - xxx_messageInfo_SearchParamPB.DiscardUnknown(m) -} - -var xxx_messageInfo_SearchParamPB proto.InternalMessageInfo - -func (m *SearchParamPB) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *SearchParamPB) GetPartitionTagArray() []string { - if m != nil { - return m.PartitionTagArray - } - return nil -} - -func (m *SearchParamPB) GetGeneralQuery() *GeneralQuery { - if m != nil { - return m.GeneralQuery - } - return nil -} - -func (m *SearchParamPB) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -type InsertOrDeleteMsg struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - RowsData *RowData `protobuf:"bytes,2,opt,name=rows_data,json=rowsData,proto3" json:"rows_data,omitempty"` - Uid int64 `protobuf:"varint,3,opt,name=uid,proto3" json:"uid,omitempty"` - PartitionTag string `protobuf:"bytes,4,opt,name=partition_tag,json=partitionTag,proto3" json:"partition_tag,omitempty"` - Timestamp uint64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - SegmentId int64 `protobuf:"varint,6,opt,name=segment_id,json=segmentId,proto3" json:"segment_id,omitempty"` - ChannelId int64 `protobuf:"varint,7,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - Op OpType `protobuf:"varint,8,opt,name=op,proto3,enum=milvus.grpc.OpType" json:"op,omitempty"` - ClientId int64 `protobuf:"varint,9,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,10,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InsertOrDeleteMsg) Reset() { *m = InsertOrDeleteMsg{} } -func (m *InsertOrDeleteMsg) String() string { return proto.CompactTextString(m) } -func (*InsertOrDeleteMsg) ProtoMessage() {} -func (*InsertOrDeleteMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{43} -} - -func (m *InsertOrDeleteMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_InsertOrDeleteMsg.Unmarshal(m, b) -} -func (m *InsertOrDeleteMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_InsertOrDeleteMsg.Marshal(b, m, deterministic) -} -func (m *InsertOrDeleteMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_InsertOrDeleteMsg.Merge(m, src) -} -func (m *InsertOrDeleteMsg) XXX_Size() int { - return xxx_messageInfo_InsertOrDeleteMsg.Size(m) -} -func (m *InsertOrDeleteMsg) XXX_DiscardUnknown() { - xxx_messageInfo_InsertOrDeleteMsg.DiscardUnknown(m) -} - -var xxx_messageInfo_InsertOrDeleteMsg proto.InternalMessageInfo - -func (m *InsertOrDeleteMsg) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *InsertOrDeleteMsg) GetRowsData() *RowData { - if m != nil { - return m.RowsData - } - return nil -} - -func (m *InsertOrDeleteMsg) GetUid() int64 { - if m != nil { - return m.Uid - } - return 0 -} - -func (m *InsertOrDeleteMsg) GetPartitionTag() string { - if m != nil { - return m.PartitionTag - } - return "" -} - -func (m *InsertOrDeleteMsg) GetTimestamp() uint64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *InsertOrDeleteMsg) GetSegmentId() int64 { - if m != nil { - return m.SegmentId - } - return 0 -} - -func (m *InsertOrDeleteMsg) GetChannelId() int64 { - if m != nil { - return m.ChannelId - } - return 0 -} - -func (m *InsertOrDeleteMsg) GetOp() OpType { - if m != nil { - return m.Op - } - return OpType_INSERT -} - -func (m *InsertOrDeleteMsg) GetClientId() int64 { - if m != nil { - return m.ClientId - } - return 0 -} - -func (m *InsertOrDeleteMsg) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -type SearchMsg struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - Records *VectorRowRecord `protobuf:"bytes,2,opt,name=records,proto3" json:"records,omitempty"` - PartitionTag []string `protobuf:"bytes,3,rep,name=partition_tag,json=partitionTag,proto3" json:"partition_tag,omitempty"` - Uid int64 `protobuf:"varint,4,opt,name=uid,proto3" json:"uid,omitempty"` - Timestamp uint64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - ClientId int64 `protobuf:"varint,6,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - ExtraParams []*KeyValuePair `protobuf:"bytes,7,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` - Json []string `protobuf:"bytes,8,rep,name=json,proto3" json:"json,omitempty"` - Dsl string `protobuf:"bytes,9,opt,name=dsl,proto3" json:"dsl,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SearchMsg) Reset() { *m = SearchMsg{} } -func (m *SearchMsg) String() string { return proto.CompactTextString(m) } -func (*SearchMsg) ProtoMessage() {} -func (*SearchMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{44} -} - -func (m *SearchMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SearchMsg.Unmarshal(m, b) -} -func (m *SearchMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SearchMsg.Marshal(b, m, deterministic) -} -func (m *SearchMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_SearchMsg.Merge(m, src) -} -func (m *SearchMsg) XXX_Size() int { - return xxx_messageInfo_SearchMsg.Size(m) -} -func (m *SearchMsg) XXX_DiscardUnknown() { - xxx_messageInfo_SearchMsg.DiscardUnknown(m) -} - -var xxx_messageInfo_SearchMsg proto.InternalMessageInfo - -func (m *SearchMsg) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *SearchMsg) GetRecords() *VectorRowRecord { - if m != nil { - return m.Records - } - return nil -} - -func (m *SearchMsg) GetPartitionTag() []string { - if m != nil { - return m.PartitionTag - } - return nil -} - -func (m *SearchMsg) GetUid() int64 { - if m != nil { - return m.Uid - } - return 0 -} - -func (m *SearchMsg) GetTimestamp() uint64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *SearchMsg) GetClientId() int64 { - if m != nil { - return m.ClientId - } - return 0 -} - -func (m *SearchMsg) GetExtraParams() []*KeyValuePair { - if m != nil { - return m.ExtraParams - } - return nil -} - -func (m *SearchMsg) GetJson() []string { - if m != nil { - return m.Json - } - return nil -} - -func (m *SearchMsg) GetDsl() string { - if m != nil { - return m.Dsl - } - return "" -} - -type TimeSyncMsg struct { - Peer_Id int64 `protobuf:"varint,1,opt,name=peer_Id,json=peerId,proto3" json:"peer_Id,omitempty"` - Timestamp uint64 `protobuf:"varint,2,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"` - SyncType SyncType `protobuf:"varint,3,opt,name=sync_type,json=syncType,proto3,enum=milvus.grpc.SyncType" json:"sync_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TimeSyncMsg) Reset() { *m = TimeSyncMsg{} } -func (m *TimeSyncMsg) String() string { return proto.CompactTextString(m) } -func (*TimeSyncMsg) ProtoMessage() {} -func (*TimeSyncMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{45} -} - -func (m *TimeSyncMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TimeSyncMsg.Unmarshal(m, b) -} -func (m *TimeSyncMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TimeSyncMsg.Marshal(b, m, deterministic) -} -func (m *TimeSyncMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_TimeSyncMsg.Merge(m, src) -} -func (m *TimeSyncMsg) XXX_Size() int { - return xxx_messageInfo_TimeSyncMsg.Size(m) -} -func (m *TimeSyncMsg) XXX_DiscardUnknown() { - xxx_messageInfo_TimeSyncMsg.DiscardUnknown(m) -} - -var xxx_messageInfo_TimeSyncMsg proto.InternalMessageInfo - -func (m *TimeSyncMsg) GetPeer_Id() int64 { - if m != nil { - return m.Peer_Id - } - return 0 -} - -func (m *TimeSyncMsg) GetTimestamp() uint64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *TimeSyncMsg) GetSyncType() SyncType { - if m != nil { - return m.SyncType - } - return SyncType_READ -} - -type Key2SegMsg struct { - Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` - Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - SegmentId []int64 `protobuf:"varint,3,rep,packed,name=segment_id,json=segmentId,proto3" json:"segment_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Key2SegMsg) Reset() { *m = Key2SegMsg{} } -func (m *Key2SegMsg) String() string { return proto.CompactTextString(m) } -func (*Key2SegMsg) ProtoMessage() {} -func (*Key2SegMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{46} -} - -func (m *Key2SegMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Key2SegMsg.Unmarshal(m, b) -} -func (m *Key2SegMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Key2SegMsg.Marshal(b, m, deterministic) -} -func (m *Key2SegMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_Key2SegMsg.Merge(m, src) -} -func (m *Key2SegMsg) XXX_Size() int { - return xxx_messageInfo_Key2SegMsg.Size(m) -} -func (m *Key2SegMsg) XXX_DiscardUnknown() { - xxx_messageInfo_Key2SegMsg.DiscardUnknown(m) -} - -var xxx_messageInfo_Key2SegMsg proto.InternalMessageInfo - -func (m *Key2SegMsg) GetUid() int64 { - if m != nil { - return m.Uid - } - return 0 -} - -func (m *Key2SegMsg) GetTimestamp() uint64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *Key2SegMsg) GetSegmentId() []int64 { - if m != nil { - return m.SegmentId - } - return nil -} - -func init() { - proto.RegisterEnum("milvus.grpc.ErrorCode", ErrorCode_name, ErrorCode_value) - proto.RegisterEnum("milvus.grpc.DataType", DataType_name, DataType_value) - proto.RegisterEnum("milvus.grpc.CompareOperator", CompareOperator_name, CompareOperator_value) - proto.RegisterEnum("milvus.grpc.Occur", Occur_name, Occur_value) - proto.RegisterEnum("milvus.grpc.OpType", OpType_name, OpType_value) - proto.RegisterEnum("milvus.grpc.SyncType", SyncType_name, SyncType_value) - proto.RegisterType((*Status)(nil), "milvus.grpc.Status") - proto.RegisterType((*KeyValuePair)(nil), "milvus.grpc.KeyValuePair") - proto.RegisterType((*CollectionName)(nil), "milvus.grpc.CollectionName") - proto.RegisterType((*CollectionNameList)(nil), "milvus.grpc.CollectionNameList") - proto.RegisterType((*FieldName)(nil), "milvus.grpc.FieldName") - proto.RegisterType((*Mapping)(nil), "milvus.grpc.Mapping") - proto.RegisterType((*MappingList)(nil), "milvus.grpc.MappingList") - proto.RegisterType((*PartitionParam)(nil), "milvus.grpc.PartitionParam") - proto.RegisterType((*PartitionList)(nil), "milvus.grpc.PartitionList") - proto.RegisterType((*VectorRowRecord)(nil), "milvus.grpc.VectorRowRecord") - proto.RegisterType((*EntityIds)(nil), "milvus.grpc.EntityIds") - proto.RegisterType((*VectorRecord)(nil), "milvus.grpc.VectorRecord") - proto.RegisterType((*VectorParam)(nil), "milvus.grpc.VectorParam") - proto.RegisterType((*FieldMeta)(nil), "milvus.grpc.FieldMeta") - proto.RegisterType((*Schema)(nil), "milvus.grpc.Schema") - proto.RegisterType((*RowData)(nil), "milvus.grpc.RowData") - proto.RegisterType((*InsertParam)(nil), "milvus.grpc.InsertParam") - proto.RegisterType((*SearchParam)(nil), "milvus.grpc.SearchParam") - proto.RegisterType((*SearchInSegmentParam)(nil), "milvus.grpc.SearchInSegmentParam") - proto.RegisterType((*Entities)(nil), "milvus.grpc.Entities") - proto.RegisterType((*QueryResult)(nil), "milvus.grpc.QueryResult") - proto.RegisterType((*StringReply)(nil), "milvus.grpc.StringReply") - proto.RegisterType((*BoolReply)(nil), "milvus.grpc.BoolReply") - proto.RegisterType((*CollectionRowCount)(nil), "milvus.grpc.CollectionRowCount") - proto.RegisterType((*Command)(nil), "milvus.grpc.Command") - proto.RegisterType((*IndexParam)(nil), "milvus.grpc.IndexParam") - proto.RegisterType((*FlushParam)(nil), "milvus.grpc.FlushParam") - proto.RegisterType((*CompactParam)(nil), "milvus.grpc.CompactParam") - proto.RegisterType((*DeleteByIDParam)(nil), "milvus.grpc.DeleteByIDParam") - proto.RegisterType((*CollectionInfo)(nil), "milvus.grpc.CollectionInfo") - proto.RegisterType((*GetEntityIDsParam)(nil), "milvus.grpc.GetEntityIDsParam") - proto.RegisterType((*EntityIdentity)(nil), "milvus.grpc.EntityIdentity") - proto.RegisterType((*VectorFieldParam)(nil), "milvus.grpc.VectorFieldParam") - proto.RegisterType((*FieldType)(nil), "milvus.grpc.FieldType") - proto.RegisterType((*FieldParam)(nil), "milvus.grpc.FieldParam") - proto.RegisterType((*VectorFieldRecord)(nil), "milvus.grpc.VectorFieldRecord") - proto.RegisterType((*TermQuery)(nil), "milvus.grpc.TermQuery") - proto.RegisterType((*CompareExpr)(nil), "milvus.grpc.CompareExpr") - proto.RegisterType((*RangeQuery)(nil), "milvus.grpc.RangeQuery") - proto.RegisterType((*VectorQuery)(nil), "milvus.grpc.VectorQuery") - proto.RegisterType((*BooleanQuery)(nil), "milvus.grpc.BooleanQuery") - proto.RegisterType((*GeneralQuery)(nil), "milvus.grpc.GeneralQuery") - proto.RegisterType((*SearchParamPB)(nil), "milvus.grpc.SearchParamPB") - proto.RegisterType((*InsertOrDeleteMsg)(nil), "milvus.grpc.InsertOrDeleteMsg") - proto.RegisterType((*SearchMsg)(nil), "milvus.grpc.SearchMsg") - proto.RegisterType((*TimeSyncMsg)(nil), "milvus.grpc.TimeSyncMsg") - proto.RegisterType((*Key2SegMsg)(nil), "milvus.grpc.Key2SegMsg") -} - -func init() { proto.RegisterFile("message.proto", fileDescriptor_33c57e4bae7b9afd) } - -var fileDescriptor_33c57e4bae7b9afd = []byte{ - // 2878 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x3a, 0xdd, 0x72, 0xdb, 0xc6, - 0xd5, 0x04, 0x41, 0x91, 0xc4, 0x01, 0x29, 0x41, 0x6b, 0xd9, 0x96, 0xed, 0xf8, 0xb3, 0x83, 0x6f, - 0xa6, 0x75, 0xdc, 0x19, 0x4f, 0xa2, 0xa4, 0xb6, 0x5b, 0x27, 0x69, 0xf8, 0x03, 0x49, 0xa8, 0x29, - 0x52, 0x5e, 0x42, 0x76, 0x7e, 0xa6, 0x83, 0x42, 0xc4, 0x9a, 0x46, 0x43, 0x02, 0x2c, 0x00, 0x5a, - 0xe6, 0x6d, 0xef, 0xdb, 0x99, 0x5e, 0xf6, 0xb2, 0x7d, 0x84, 0xf6, 0x0d, 0x7a, 0xd9, 0x17, 0xc8, - 0x45, 0x66, 0x7a, 0xd9, 0xe9, 0x63, 0x74, 0xf6, 0x07, 0x24, 0x40, 0x91, 0x12, 0x19, 0xb5, 0x57, - 0x5a, 0x9e, 0xdd, 0x73, 0xf6, 0xfc, 0xef, 0x39, 0x07, 0x82, 0xea, 0x90, 0x44, 0x91, 0xd3, 0x27, - 0x8f, 0x46, 0x61, 0x10, 0x07, 0x48, 0x1d, 0x7a, 0x83, 0xb7, 0xe3, 0xe8, 0x51, 0x3f, 0x1c, 0xf5, - 0xf4, 0x57, 0x50, 0xec, 0xc6, 0x4e, 0x3c, 0x8e, 0xd0, 0x4f, 0x01, 0x48, 0x18, 0x06, 0xa1, 0xdd, - 0x0b, 0x5c, 0xb2, 0x2b, 0xdd, 0x97, 0x1e, 0x6c, 0xee, 0xdd, 0x78, 0x94, 0x3a, 0xfb, 0xc8, 0xa0, - 0xdb, 0x8d, 0xc0, 0x25, 0x58, 0x21, 0xc9, 0x12, 0xdd, 0x80, 0x62, 0x48, 0x9c, 0x28, 0xf0, 0x77, - 0xf3, 0xf7, 0xa5, 0x07, 0x0a, 0x16, 0xbf, 0xf4, 0xc7, 0x50, 0x79, 0x4e, 0x26, 0x2f, 0x9d, 0xc1, - 0x98, 0x1c, 0x3b, 0x5e, 0x88, 0x34, 0x90, 0xbf, 0x25, 0x13, 0x46, 0x57, 0xc1, 0x74, 0x89, 0x76, - 0x60, 0xe3, 0x2d, 0xdd, 0x16, 0x88, 0xfc, 0x87, 0xfe, 0x33, 0xd8, 0x6c, 0x04, 0x83, 0x01, 0xe9, - 0xc5, 0x5e, 0xe0, 0xb7, 0x9d, 0x21, 0x41, 0x3f, 0x86, 0xad, 0xde, 0x14, 0x62, 0xfb, 0xce, 0x90, - 0x08, 0x2a, 0x9b, 0xbd, 0xcc, 0x41, 0x7d, 0x00, 0x28, 0x8b, 0xda, 0xf2, 0xa2, 0x18, 0xfd, 0x04, - 0x8a, 0x11, 0x93, 0x90, 0x61, 0xa9, 0x7b, 0xd7, 0x32, 0x32, 0x71, 0xe1, 0xb1, 0x38, 0x82, 0x3e, - 0x00, 0x6d, 0xee, 0xae, 0x68, 0x37, 0x7f, 0x5f, 0x7e, 0xa0, 0xe0, 0xad, 0xec, 0x65, 0x91, 0xde, - 0x05, 0x65, 0xdf, 0x23, 0x03, 0x77, 0x2d, 0x1e, 0xd1, 0x5d, 0x80, 0xd7, 0x14, 0x8b, 0x9f, 0xe1, - 0x92, 0x2b, 0xaf, 0x13, 0x3a, 0xfa, 0x3f, 0x24, 0x28, 0x1d, 0x39, 0xa3, 0x91, 0xe7, 0xf7, 0xd7, - 0x63, 0x7c, 0x01, 0x03, 0xf9, 0x85, 0x0c, 0x50, 0xaa, 0xbd, 0x37, 0x64, 0xe8, 0xec, 0xca, 0x8b, - 0xa8, 0xb2, 0x2d, 0x2c, 0x8e, 0xa0, 0x4f, 0xa1, 0x42, 0xde, 0xc5, 0xa1, 0x63, 0x8f, 0x9c, 0xd0, - 0x19, 0x46, 0xbb, 0x85, 0xfb, 0xf2, 0x03, 0x75, 0xef, 0x56, 0x06, 0x25, 0x6d, 0x65, 0xac, 0xb2, - 0xe3, 0xc7, 0xec, 0xb4, 0x1e, 0x81, 0x2a, 0x64, 0x59, 0xdf, 0x10, 0x4f, 0xa0, 0x32, 0xe4, 0xb8, - 0xf6, 0xc0, 0x8b, 0x62, 0x66, 0x04, 0x75, 0x6f, 0x27, 0x83, 0x22, 0x88, 0x63, 0x75, 0x38, 0xbb, - 0x45, 0x7f, 0x0e, 0x9b, 0xc7, 0x4e, 0x18, 0x7b, 0x54, 0x60, 0xc6, 0xc7, 0xea, 0xb6, 0xd1, 0x40, - 0x8e, 0x9d, 0xbe, 0xd0, 0x1b, 0x5d, 0xea, 0x03, 0xa8, 0x4e, 0x89, 0xad, 0x2f, 0xc3, 0x23, 0xb8, - 0x36, 0x4a, 0xb0, 0xed, 0xd8, 0xe9, 0xdb, 0x4e, 0x18, 0x3a, 0x13, 0xe1, 0x4f, 0xdb, 0xd3, 0x2d, - 0xcb, 0xe9, 0xd7, 0xe8, 0x86, 0xfe, 0x02, 0xb6, 0x5e, 0x92, 0x5e, 0x1c, 0x84, 0x38, 0x38, 0xc3, - 0xa4, 0x17, 0x84, 0x2e, 0x73, 0x97, 0x41, 0xe0, 0xc4, 0xb6, 0xeb, 0xc4, 0xce, 0xae, 0x74, 0x5f, - 0x7e, 0x90, 0xc7, 0x0a, 0x83, 0x34, 0x9d, 0xd8, 0x41, 0xf7, 0x40, 0x3d, 0xf5, 0x7c, 0x27, 0x9c, - 0xf0, 0x7d, 0xca, 0x79, 0x05, 0x03, 0x07, 0xd1, 0x03, 0xfa, 0xaf, 0x41, 0x31, 0xfc, 0xd8, 0x8b, - 0x27, 0xa6, 0x1b, 0xad, 0xc7, 0xfc, 0x8f, 0x60, 0x8b, 0x30, 0x4c, 0xdb, 0x73, 0x53, 0x8c, 0xcb, - 0xb8, 0x4a, 0x04, 0x41, 0xce, 0xf4, 0x3e, 0x54, 0x04, 0xd3, 0x9c, 0xe3, 0xc7, 0x50, 0x0a, 0xd9, - 0x2a, 0x62, 0xec, 0xaa, 0x7b, 0xef, 0x65, 0x6e, 0x99, 0x13, 0x10, 0x27, 0x87, 0xf5, 0x6f, 0x40, - 0xe5, 0x7b, 0xdc, 0x68, 0x08, 0x0a, 0xbf, 0xa1, 0x49, 0x85, 0x5b, 0x8a, 0xad, 0xd1, 0x53, 0x80, - 0x30, 0x38, 0xb3, 0x39, 0x06, 0x13, 0x76, 0xde, 0x17, 0xd3, 0x9c, 0x60, 0x25, 0x4c, 0x6e, 0xd1, - 0xfb, 0x22, 0x56, 0x8f, 0x48, 0xec, 0xcc, 0x85, 0xa0, 0x34, 0x17, 0x82, 0xe8, 0x03, 0x28, 0xc4, - 0x93, 0x11, 0x0f, 0x9f, 0xcd, 0xbd, 0xeb, 0x19, 0xfa, 0x54, 0xa7, 0xd6, 0x64, 0x44, 0x30, 0x3b, - 0x42, 0x1d, 0xc6, 0xf5, 0x86, 0x2c, 0x90, 0x64, 0x4c, 0x97, 0x7a, 0x0d, 0x8a, 0x3c, 0x84, 0xd0, - 0x13, 0x50, 0xf9, 0x2d, 0x43, 0x12, 0x3b, 0x89, 0x2e, 0xb2, 0xf9, 0x74, 0xca, 0x12, 0xe6, 0x0c, - 0xd1, 0x65, 0xa4, 0xdf, 0x85, 0x12, 0x0e, 0xce, 0x98, 0x79, 0x11, 0x14, 0x4e, 0x07, 0xc1, 0x29, - 0xe3, 0xb1, 0x82, 0xd9, 0x5a, 0xff, 0x73, 0x1e, 0x54, 0xd3, 0x8f, 0x48, 0x18, 0xaf, 0xe9, 0xdd, - 0xb3, 0xc0, 0xcf, 0x5f, 0x1e, 0xf8, 0x1f, 0x01, 0xd5, 0x5e, 0xc4, 0xdd, 0x4a, 0x5e, 0x10, 0x7b, - 0x82, 0x45, 0x5c, 0xa6, 0xc7, 0x18, 0xb3, 0x0b, 0x1c, 0xa6, 0xb0, 0xc0, 0x61, 0xd0, 0xff, 0x43, - 0x35, 0x13, 0x15, 0xbb, 0x1b, 0x8c, 0xdd, 0x4a, 0x3a, 0x1e, 0xce, 0x25, 0x9e, 0xe2, 0x5a, 0x89, - 0xe7, 0xdf, 0x12, 0xa8, 0x5d, 0xe2, 0x84, 0xbd, 0x37, 0x6b, 0xea, 0xe8, 0x19, 0x54, 0xde, 0x32, - 0x17, 0xe2, 0xf7, 0x8a, 0xac, 0xb3, 0xbb, 0xc0, 0xc7, 0x18, 0x61, 0xac, 0xbe, 0x4d, 0xb9, 0x2c, - 0xf5, 0x86, 0x68, 0xc0, 0xbc, 0x41, 0xc1, 0x74, 0x79, 0x5e, 0xd4, 0x02, 0x0b, 0xfd, 0x8b, 0x45, - 0xdd, 0x58, 0x4b, 0xd4, 0x33, 0xd8, 0xe1, 0x92, 0x9a, 0x7e, 0x97, 0xf4, 0x87, 0xc4, 0x17, 0x6e, - 0xa1, 0x43, 0xf5, 0xb5, 0x37, 0x20, 0x33, 0x5b, 0x48, 0xec, 0x6a, 0x95, 0x02, 0x13, 0x4b, 0x3c, - 0x83, 0x4a, 0xc4, 0x70, 0xa7, 0xd2, 0x4a, 0xe7, 0xa4, 0x4d, 0xa9, 0x11, 0xab, 0xd1, 0xec, 0x87, - 0xfe, 0x27, 0x09, 0xca, 0x2c, 0xb5, 0x78, 0x64, 0xcd, 0xcc, 0xa2, 0x81, 0xec, 0xb9, 0x91, 0xc8, - 0x26, 0x74, 0x89, 0xee, 0x80, 0xf2, 0xd6, 0x19, 0x78, 0xae, 0x1d, 0x06, 0x67, 0xcc, 0xdb, 0xca, - 0xb8, 0xcc, 0x00, 0x38, 0x38, 0xcb, 0xba, 0x62, 0x61, 0x15, 0x57, 0xd4, 0xff, 0x9a, 0x07, 0xf5, - 0xc5, 0x98, 0x84, 0x13, 0x4c, 0xa2, 0xf1, 0x60, 0xcd, 0xac, 0xfd, 0x11, 0x94, 0x89, 0x90, 0x4b, - 0x68, 0x24, 0x9b, 0x03, 0x12, 0xa1, 0xf1, 0xf4, 0x18, 0xba, 0x09, 0x25, 0x9a, 0x98, 0xfc, 0x71, - 0x92, 0x0b, 0x8a, 0x61, 0x70, 0xd6, 0x1e, 0x0f, 0x69, 0x71, 0x14, 0xf5, 0x82, 0x90, 0xf0, 0x97, - 0x33, 0x8f, 0xc5, 0x2f, 0xf4, 0x1e, 0x28, 0xae, 0x17, 0xc5, 0x8e, 0xdf, 0x23, 0xdc, 0xe0, 0x79, - 0x3c, 0x03, 0x5c, 0xcd, 0xf9, 0xd1, 0x2d, 0x28, 0xff, 0x96, 0xca, 0x6e, 0x7b, 0xee, 0x6e, 0x89, - 0x71, 0x53, 0x62, 0xbf, 0x4d, 0x97, 0xea, 0xb9, 0x37, 0xf0, 0x88, 0x1f, 0xd3, 0xbd, 0x32, 0xdb, - 0x2b, 0x73, 0x80, 0xe9, 0xea, 0xbf, 0x02, 0xb5, 0x1b, 0x87, 0xf4, 0x3d, 0x25, 0xa3, 0xc1, 0x64, - 0x3d, 0x9d, 0xbd, 0x0f, 0x95, 0x88, 0xe1, 0xda, 0x21, 0x45, 0x16, 0x4f, 0xa8, 0x1a, 0xcd, 0xe8, - 0xe9, 0xaf, 0x40, 0xa9, 0x07, 0xc1, 0xe0, 0x07, 0x10, 0xbf, 0x0b, 0x70, 0x1a, 0x04, 0x83, 0x14, - 0xe9, 0x32, 0x56, 0x4e, 0x13, 0x5a, 0x7a, 0x94, 0xae, 0xfa, 0x70, 0x70, 0xd6, 0x08, 0xc6, 0xfe, - 0x9a, 0x26, 0xff, 0x10, 0x76, 0x52, 0xf9, 0x81, 0x9a, 0xb2, 0x47, 0x89, 0xb0, 0xbb, 0x64, 0x8c, - 0x7a, 0xe7, 0xc8, 0xeb, 0x77, 0xa0, 0xd4, 0x08, 0x86, 0x43, 0xc7, 0x77, 0xa9, 0x3b, 0xf7, 0x86, - 0x6e, 0x52, 0xd8, 0xf6, 0x86, 0xae, 0xfe, 0x4f, 0x09, 0xc0, 0xf4, 0x5d, 0xf2, 0x8e, 0x87, 0xe2, - 0xff, 0xa6, 0x8e, 0xcb, 0xbe, 0x62, 0xf2, 0xfc, 0x2b, 0x76, 0x17, 0xc0, 0xa3, 0x2c, 0xf0, 0xed, - 0x02, 0xdf, 0x66, 0x10, 0xb6, 0x7d, 0xb5, 0xa4, 0xf3, 0x05, 0xc0, 0xfe, 0x60, 0x1c, 0x89, 0xec, - 0xba, 0x07, 0xd7, 0xe7, 0x58, 0xce, 0xa4, 0x9c, 0x6b, 0x59, 0xc6, 0x79, 0xd5, 0x70, 0x02, 0x95, - 0x46, 0x30, 0x1c, 0x39, 0xbd, 0x75, 0x5f, 0xb1, 0xf7, 0x40, 0x89, 0xdf, 0x84, 0x24, 0x7a, 0x13, - 0x0c, 0x78, 0x09, 0x20, 0xe1, 0x19, 0x40, 0x3f, 0x81, 0xad, 0x26, 0x19, 0x90, 0x98, 0xd4, 0x27, - 0x66, 0x73, 0x4d, 0xca, 0xb7, 0xa0, 0x3c, 0x57, 0xe9, 0x94, 0x3c, 0x51, 0xe3, 0x7c, 0x9d, 0xee, - 0x49, 0x4c, 0xff, 0x75, 0xb0, 0x9e, 0x4d, 0xef, 0x80, 0x42, 0xeb, 0x17, 0xdb, 0xf3, 0x5f, 0x07, - 0xc2, 0x9a, 0x65, 0x0a, 0xa0, 0x94, 0xf4, 0x6f, 0x60, 0xfb, 0x80, 0xc4, 0xa2, 0x48, 0x6b, 0x46, - 0x6b, 0x32, 0x7d, 0x17, 0x20, 0xe2, 0x69, 0x9f, 0x86, 0x34, 0xf7, 0x57, 0x45, 0x40, 0x4c, 0x57, - 0x1f, 0xc3, 0x66, 0x52, 0xfe, 0xf1, 0x47, 0xf8, 0xbf, 0xa1, 0x0e, 0x5a, 0x75, 0xce, 0x5c, 0x2f, - 0x62, 0x09, 0x5b, 0x11, 0x25, 0x0c, 0x6f, 0x8d, 0x3e, 0x04, 0x8d, 0xbf, 0x92, 0xac, 0xc2, 0xe1, - 0x22, 0xb1, 0x94, 0x37, 0x24, 0x7e, 0xe4, 0x89, 0xaa, 0x4e, 0xc6, 0x33, 0x80, 0xfe, 0x07, 0x49, - 0x54, 0x68, 0xb4, 0xba, 0x42, 0x9f, 0x80, 0x42, 0xb3, 0xbd, 0xcd, 0xea, 0x30, 0xe9, 0x82, 0x3a, - 0xec, 0x30, 0x87, 0xcb, 0xae, 0x58, 0xa3, 0xfa, 0xb9, 0xc7, 0x9b, 0x5a, 0xe6, 0xee, 0x82, 0xc7, - 0x7b, 0xc6, 0xd6, 0x61, 0x2e, 0xf3, 0x86, 0xd7, 0x4b, 0xa2, 0x27, 0xd5, 0xbf, 0x93, 0x00, 0x52, - 0xdc, 0x6f, 0x42, 0xde, 0xe3, 0x31, 0x5e, 0xc0, 0x79, 0xcf, 0xa5, 0x95, 0x59, 0x2a, 0x36, 0xd9, - 0x7a, 0x5a, 0x38, 0xca, 0x97, 0x17, 0x8e, 0x9f, 0x42, 0x85, 0x47, 0xe7, 0xca, 0x7d, 0x95, 0x37, - 0xcd, 0x27, 0xd1, 0x15, 0x83, 0xf7, 0x00, 0xb6, 0x53, 0x5a, 0x10, 0x55, 0xfb, 0x5e, 0xd2, 0x8b, - 0xaf, 0x52, 0xb3, 0x0b, 0x15, 0x7d, 0x2f, 0x81, 0x62, 0x91, 0x70, 0xc8, 0x5e, 0xda, 0xcb, 0xaa, - 0xea, 0x3b, 0xa0, 0x78, 0x7e, 0x6c, 0x27, 0x0d, 0x3f, 0xf5, 0xa7, 0xb2, 0xe7, 0xc7, 0x8c, 0x47, - 0xfa, 0x7c, 0xb8, 0xc1, 0xf8, 0x74, 0x40, 0xc4, 0x3e, 0xf5, 0x28, 0x09, 0xab, 0x1c, 0xc6, 0x8f, - 0xf0, 0x12, 0x61, 0x4c, 0xd8, 0x23, 0x5b, 0xe0, 0x4f, 0x17, 0x03, 0xd0, 0x67, 0x76, 0x07, 0x36, - 0x4e, 0x83, 0x20, 0x8a, 0x59, 0x29, 0x99, 0xc7, 0xfc, 0xc7, 0x15, 0x6b, 0x48, 0x07, 0x54, 0x96, - 0xa1, 0x42, 0x62, 0xbc, 0x1b, 0x85, 0xe8, 0x29, 0x94, 0x83, 0x11, 0x09, 0x9d, 0x38, 0x08, 0x85, - 0x47, 0x66, 0x75, 0x24, 0xce, 0x76, 0xc4, 0x19, 0x3c, 0x3d, 0x8d, 0x76, 0xa1, 0xc4, 0xd6, 0xbe, - 0x2b, 0xbc, 0x25, 0xf9, 0xa9, 0xff, 0x4d, 0x02, 0xc0, 0x8e, 0xdf, 0x27, 0x2b, 0x69, 0x70, 0x2f, - 0x4d, 0xe7, 0x7c, 0x59, 0x9a, 0x62, 0x76, 0x7a, 0xc3, 0x4c, 0x31, 0xf2, 0x45, 0x8a, 0x59, 0xaf, - 0xab, 0xff, 0x4e, 0x4a, 0x3a, 0xb5, 0x95, 0xd8, 0xbe, 0x07, 0x2a, 0x2f, 0x47, 0x38, 0x23, 0x79, - 0xc6, 0x08, 0x30, 0x50, 0x9d, 0x71, 0x93, 0x6a, 0x18, 0xe5, 0x35, 0x1a, 0x46, 0x1a, 0x82, 0x71, - 0x30, 0xfa, 0x56, 0x38, 0x03, 0x5b, 0x5f, 0x31, 0x32, 0xde, 0x41, 0x85, 0x96, 0x28, 0xc4, 0xf1, - 0xb9, 0x64, 0x0f, 0x60, 0x23, 0xe8, 0xf5, 0xc6, 0x89, 0xc1, 0x51, 0x86, 0x4c, 0x87, 0xee, 0x60, - 0x7e, 0x00, 0x7d, 0x0e, 0xd5, 0x3e, 0xf1, 0x49, 0xe8, 0x0c, 0x6c, 0x26, 0x99, 0xb0, 0x50, 0xf6, - 0xe2, 0x03, 0x7e, 0x82, 0x17, 0xa6, 0x95, 0x7e, 0xea, 0x97, 0xfe, 0xfb, 0x3c, 0x54, 0xd2, 0xdb, - 0xe8, 0x0b, 0xa8, 0x9e, 0x72, 0x56, 0x04, 0x41, 0x69, 0x41, 0xb7, 0x9b, 0x66, 0xf6, 0x30, 0x87, - 0x2b, 0xa7, 0x69, 0xe6, 0x9f, 0x00, 0xc4, 0x24, 0x1c, 0x4e, 0xf9, 0x91, 0xce, 0xb5, 0x9f, 0xd3, - 0xd8, 0x3d, 0xcc, 0x61, 0x25, 0x9e, 0x06, 0xf2, 0xcf, 0x41, 0x0d, 0xa9, 0x53, 0x0a, 0x4c, 0x3e, - 0x25, 0xba, 0x99, 0xad, 0xb8, 0xa7, 0x4e, 0x7b, 0x98, 0xc3, 0x10, 0xce, 0x5c, 0xf8, 0xb3, 0x69, - 0x0a, 0xe6, 0xc8, 0x85, 0x05, 0x1d, 0x45, 0xca, 0x77, 0x66, 0xd9, 0x97, 0xfd, 0xa4, 0xd9, 0x97, - 0xe1, 0xe9, 0xff, 0x92, 0xa0, 0x9a, 0xea, 0x3c, 0x8e, 0xeb, 0xab, 0xbf, 0x5b, 0x6b, 0x0e, 0x5d, - 0xce, 0x9b, 0x4e, 0x5e, 0xa0, 0xe9, 0xe5, 0xa6, 0xbb, 0x62, 0x30, 0xfd, 0x4e, 0x86, 0x6d, 0xde, - 0xcd, 0x77, 0x42, 0x5e, 0xb9, 0x1c, 0x45, 0xfd, 0xd5, 0x85, 0xcd, 0xf4, 0x46, 0xdc, 0xc6, 0x97, - 0xb5, 0xe9, 0x1a, 0xc8, 0x63, 0xcf, 0x4d, 0x66, 0x16, 0x63, 0xcf, 0x5d, 0xd4, 0xa5, 0x9e, 0x6f, - 0xc8, 0x69, 0xdd, 0xe5, 0x0d, 0x49, 0x14, 0x3b, 0xc3, 0x11, 0x4b, 0xb3, 0x05, 0x3c, 0x03, 0xcc, - 0x95, 0x21, 0xc5, 0xb9, 0x32, 0x84, 0x6e, 0xf7, 0xde, 0x38, 0xbe, 0x4f, 0x06, 0xb3, 0xa6, 0x44, - 0x11, 0x10, 0x93, 0x32, 0x90, 0x0f, 0x46, 0xac, 0x1f, 0xd9, 0x9c, 0x2b, 0xa4, 0x3a, 0x23, 0xf6, - 0x68, 0xe6, 0x83, 0x51, 0xb6, 0x77, 0x51, 0xb2, 0xbd, 0xcb, 0x39, 0x23, 0xc0, 0x5a, 0x46, 0xf8, - 0x7b, 0x1e, 0x14, 0xee, 0x6d, 0x6b, 0x29, 0x3f, 0x95, 0xb8, 0xb8, 0xea, 0x57, 0x4c, 0x5c, 0xe7, - 0xf4, 0x2d, 0x2f, 0x98, 0x0a, 0x08, 0x33, 0x15, 0x66, 0x66, 0xba, 0xd8, 0x02, 0x19, 0xf5, 0x14, - 0x2f, 0x51, 0x4f, 0x69, 0xad, 0x86, 0x32, 0x19, 0xc5, 0x95, 0x19, 0x9b, 0x7c, 0x14, 0x27, 0x66, - 0x1d, 0xca, 0x74, 0xd6, 0xa1, 0xbf, 0x03, 0xd5, 0xf2, 0x86, 0xa4, 0x3b, 0xf1, 0x7b, 0x54, 0x8b, - 0x37, 0xa1, 0x34, 0x22, 0x24, 0xb4, 0x4d, 0x57, 0x14, 0x7b, 0x45, 0xfa, 0xd3, 0x64, 0x62, 0x58, - 0x53, 0x31, 0xf2, 0x5c, 0x8c, 0x29, 0x00, 0xed, 0x81, 0x12, 0x4d, 0xfc, 0x9e, 0xbd, 0xb4, 0x90, - 0xa2, 0xf4, 0x99, 0x4f, 0x94, 0x23, 0xb1, 0xd2, 0xbf, 0x01, 0x78, 0x4e, 0x26, 0x7b, 0x5d, 0xd2, - 0xa7, 0x17, 0x0b, 0xc5, 0x49, 0x4b, 0x14, 0x97, 0xbf, 0xd8, 0x75, 0x65, 0x56, 0x99, 0xcc, 0x5c, - 0xf7, 0xe1, 0x5f, 0x0a, 0xa0, 0x4c, 0xbf, 0x7b, 0x20, 0x15, 0x4a, 0xdd, 0x93, 0x46, 0xc3, 0xe8, - 0x76, 0xb5, 0x1c, 0xda, 0x01, 0xed, 0xa4, 0x6d, 0x7c, 0x79, 0x6c, 0x34, 0x2c, 0xa3, 0x69, 0x1b, - 0x18, 0x77, 0xb0, 0x26, 0x21, 0x04, 0x9b, 0x8d, 0x4e, 0xbb, 0x6d, 0x34, 0x2c, 0x7b, 0xbf, 0x66, - 0xb6, 0x8c, 0xa6, 0x96, 0x47, 0xd7, 0x61, 0xfb, 0xd8, 0xc0, 0x47, 0x66, 0xb7, 0x6b, 0x76, 0xda, - 0x76, 0xd3, 0x68, 0x9b, 0x46, 0x53, 0x93, 0xd1, 0x2d, 0xb8, 0xde, 0xe8, 0xb4, 0x5a, 0x46, 0xc3, - 0xa2, 0xe0, 0x76, 0xc7, 0xb2, 0x8d, 0x2f, 0xcd, 0xae, 0xd5, 0xd5, 0x0a, 0x94, 0xb6, 0xd9, 0x6a, - 0x19, 0x07, 0xb5, 0x96, 0x5d, 0xc3, 0x07, 0x27, 0x47, 0x46, 0xdb, 0xd2, 0x36, 0x28, 0x9d, 0x04, - 0xda, 0x34, 0x8f, 0x8c, 0x36, 0x25, 0xa7, 0x95, 0xd0, 0x0d, 0x40, 0x09, 0xd8, 0x6c, 0x37, 0x8d, - 0x2f, 0x6d, 0xeb, 0xab, 0x63, 0x43, 0x2b, 0xa3, 0x3b, 0x70, 0x33, 0x81, 0xa7, 0xef, 0xa9, 0x1d, - 0x19, 0x9a, 0x82, 0x34, 0xa8, 0x24, 0x9b, 0x56, 0xe7, 0xf8, 0xb9, 0x06, 0x69, 0xea, 0xb8, 0xf3, - 0x0a, 0x1b, 0x8d, 0x0e, 0x6e, 0x6a, 0x6a, 0x1a, 0xfc, 0xd2, 0x68, 0x58, 0x1d, 0x6c, 0x9b, 0x4d, - 0xad, 0x42, 0x99, 0x4f, 0xc0, 0x5d, 0xa3, 0x86, 0x1b, 0x87, 0x36, 0x36, 0xba, 0x27, 0x2d, 0x4b, - 0xab, 0x52, 0x15, 0xec, 0x9b, 0x2d, 0x83, 0x49, 0xb4, 0xdf, 0x39, 0x69, 0x37, 0xb5, 0x4d, 0xb4, - 0x05, 0xea, 0x91, 0x61, 0xd5, 0x12, 0x9d, 0x6c, 0xd1, 0xfb, 0x1b, 0xb5, 0xc6, 0xa1, 0x91, 0x40, - 0x34, 0xb4, 0x0b, 0x3b, 0x8d, 0x5a, 0x9b, 0x22, 0x35, 0xb0, 0x51, 0xb3, 0x0c, 0x7b, 0xbf, 0xd3, - 0x6a, 0x1a, 0x58, 0xdb, 0xa6, 0x02, 0xce, 0xed, 0x98, 0x2d, 0x43, 0x43, 0x29, 0x8c, 0xa6, 0xd1, - 0x32, 0x66, 0x18, 0xd7, 0x52, 0x18, 0xc9, 0x0e, 0xc5, 0xd8, 0xa1, 0xc2, 0xd4, 0x4f, 0xcc, 0x56, - 0x53, 0x28, 0x8a, 0x1b, 0xed, 0x3a, 0xda, 0x86, 0x6a, 0x22, 0x4c, 0xbb, 0x65, 0x76, 0x2d, 0xed, - 0x06, 0xba, 0x09, 0xd7, 0x12, 0xd0, 0x91, 0x61, 0x61, 0xb3, 0xc1, 0xb5, 0x7a, 0x93, 0x9e, 0xed, - 0x9c, 0x58, 0x76, 0x67, 0xdf, 0x3e, 0x32, 0x8e, 0x3a, 0xf8, 0x2b, 0x6d, 0xf7, 0xe1, 0x1f, 0x25, - 0x28, 0x27, 0x15, 0x3e, 0x2a, 0x43, 0xa1, 0xdd, 0x69, 0x1b, 0x5a, 0x8e, 0xae, 0xea, 0x9d, 0x4e, - 0x4b, 0x93, 0xe8, 0xca, 0x6c, 0x5b, 0x4f, 0xb5, 0x3c, 0x52, 0x60, 0xc3, 0x6c, 0x5b, 0x1f, 0x3d, - 0xd6, 0x64, 0xb1, 0xfc, 0x78, 0x4f, 0x2b, 0x88, 0xe5, 0xe3, 0x4f, 0xb4, 0x0d, 0xba, 0xdc, 0x6f, - 0x75, 0x6a, 0x96, 0x06, 0x08, 0xa0, 0xd8, 0xec, 0x9c, 0xd4, 0x5b, 0x86, 0xa6, 0xd2, 0x75, 0xd7, - 0xc2, 0x66, 0xfb, 0x40, 0xdb, 0xa1, 0x1c, 0x08, 0x4b, 0xd4, 0xcd, 0x76, 0x0d, 0x7f, 0xa5, 0xb9, - 0x54, 0x9b, 0x02, 0xc4, 0x91, 0xc9, 0xc3, 0x06, 0x6c, 0xcd, 0xd5, 0xa4, 0xa8, 0x08, 0xf9, 0x96, - 0xa5, 0xe5, 0x50, 0x09, 0xe4, 0x96, 0x65, 0x68, 0x12, 0x05, 0x18, 0x2f, 0xb4, 0x3c, 0xfd, 0x7b, - 0x60, 0x69, 0x32, 0xdd, 0x38, 0xb0, 0x0c, 0xad, 0x40, 0x01, 0x6d, 0x43, 0xdb, 0x78, 0xf8, 0x14, - 0x36, 0x58, 0x9d, 0x43, 0x1d, 0xdf, 0x6c, 0xbf, 0xac, 0xb5, 0xcc, 0x26, 0x97, 0xeb, 0xe8, 0xa4, - 0x6b, 0x69, 0x12, 0xe3, 0xea, 0xb0, 0x73, 0xd2, 0xa2, 0x4e, 0x5e, 0x81, 0x32, 0x85, 0x52, 0xab, - 0x6b, 0xf2, 0xc3, 0xfb, 0x50, 0xe4, 0xc9, 0x9b, 0x9e, 0x31, 0xdb, 0x5d, 0x03, 0xd3, 0x9b, 0xa9, - 0x44, 0xcc, 0x1e, 0x9a, 0xf4, 0xf0, 0x1e, 0x94, 0x93, 0x60, 0xa6, 0x14, 0xb1, 0x51, 0xa3, 0xb4, - 0x15, 0xd8, 0x78, 0x85, 0x4d, 0x7a, 0x60, 0xef, 0xfb, 0x2a, 0x54, 0x8f, 0x58, 0xe8, 0x77, 0x49, - 0xf8, 0xd6, 0xeb, 0x11, 0xf4, 0x0b, 0xd0, 0x1a, 0x21, 0x71, 0x62, 0x32, 0xeb, 0xc6, 0xd1, 0xc2, - 0x4f, 0x42, 0xb7, 0x17, 0xf5, 0xe3, 0x7a, 0x0e, 0xed, 0x43, 0xf5, 0xd0, 0x89, 0x52, 0xd8, 0x77, - 0xe6, 0x6a, 0xe8, 0x74, 0x82, 0xbf, 0x7d, 0xe3, 0x5c, 0xb5, 0xc5, 0x27, 0x4e, 0x39, 0x64, 0x02, - 0x6a, 0x92, 0xa8, 0x17, 0x7a, 0xa7, 0x64, 0x55, 0x62, 0x0b, 0xf9, 0xd4, 0x73, 0xe8, 0x05, 0xb5, - 0xd3, 0xd8, 0x8f, 0x57, 0xa5, 0x73, 0x6f, 0xc9, 0xe6, 0x74, 0x34, 0x95, 0x43, 0xbf, 0x84, 0xad, - 0xee, 0x1b, 0xfa, 0x33, 0xd9, 0x8b, 0xe6, 0xb4, 0x24, 0x46, 0x57, 0x4b, 0x69, 0x25, 0xdf, 0x4e, - 0xf5, 0x1c, 0x3a, 0x06, 0x94, 0xa5, 0xc5, 0xc6, 0x1f, 0x17, 0x72, 0xb8, 0x6c, 0x93, 0x8d, 0x3b, - 0x72, 0xa8, 0x09, 0x9b, 0xcd, 0x30, 0x18, 0xad, 0x2a, 0xef, 0x12, 0x4b, 0x7e, 0x06, 0x2a, 0x77, - 0x05, 0x36, 0x68, 0x43, 0xd9, 0xfa, 0x74, 0x36, 0x7c, 0x5b, 0x86, 0xde, 0x80, 0x6a, 0x62, 0xc0, - 0x4b, 0x08, 0x2c, 0xdb, 0xd0, 0x73, 0xe8, 0x19, 0x28, 0x54, 0x92, 0x1f, 0xc6, 0x81, 0x01, 0x5b, - 0x5c, 0x80, 0xe9, 0x07, 0xc6, 0x39, 0x3d, 0x64, 0xbf, 0x62, 0x2e, 0x27, 0x53, 0x39, 0x74, 0xa2, - 0x15, 0x69, 0x2c, 0x77, 0xe8, 0xe7, 0xb0, 0x49, 0xcd, 0x3c, 0x3d, 0x1f, 0x5d, 0x6c, 0x94, 0xdb, - 0x8b, 0x6f, 0x11, 0x3e, 0x43, 0x95, 0x1b, 0x06, 0xa3, 0xab, 0x09, 0xf6, 0x29, 0x14, 0x79, 0x61, - 0x8c, 0x76, 0xe7, 0x34, 0x3b, 0xfd, 0xf6, 0x35, 0x27, 0xcf, 0xf4, 0x43, 0x27, 0x53, 0x4b, 0x75, - 0x3a, 0x55, 0xab, 0x4f, 0xcc, 0xe6, 0x1c, 0x0b, 0xd9, 0xa1, 0xd8, 0xed, 0xc5, 0x03, 0x7e, 0x3d, - 0x87, 0x0e, 0x69, 0x5b, 0x36, 0x1b, 0xce, 0xa1, 0xff, 0x9b, 0xeb, 0x0a, 0xe6, 0xe6, 0x76, 0x17, - 0x30, 0xf4, 0x39, 0x14, 0x79, 0x89, 0x89, 0x96, 0x7e, 0x5f, 0xb9, 0x9d, 0xdd, 0x49, 0x7d, 0xc0, - 0x60, 0x71, 0xb8, 0x35, 0xf7, 0x9d, 0x07, 0xbd, 0xbf, 0x80, 0x50, 0xf6, 0x2b, 0xd0, 0x85, 0x14, - 0x9f, 0x80, 0xdc, 0x18, 0xba, 0x4b, 0x32, 0xc3, 0x1c, 0x93, 0xa9, 0x39, 0x7e, 0x0e, 0xd5, 0x00, - 0x66, 0x43, 0x56, 0x94, 0x2d, 0x7a, 0xe7, 0xa6, 0xaf, 0xcb, 0x8c, 0x7b, 0x00, 0xdb, 0xc7, 0x21, - 0x19, 0x04, 0x8e, 0x7b, 0xc5, 0x34, 0xf0, 0x04, 0x36, 0xd8, 0x24, 0x7a, 0x2e, 0xfc, 0x66, 0xd3, - 0xe9, 0x65, 0x88, 0xcf, 0xd8, 0x00, 0x7f, 0xe4, 0xf4, 0x62, 0x74, 0xeb, 0xfc, 0x1c, 0x45, 0x8c, - 0xa5, 0x97, 0x21, 0xd7, 0xa1, 0x2c, 0xec, 0x56, 0x47, 0xb7, 0x97, 0x99, 0xf3, 0xb8, 0x7e, 0x91, - 0xfa, 0xeb, 0xa5, 0xaf, 0x37, 0x86, 0x51, 0x7f, 0x74, 0x7a, 0x5a, 0x64, 0xff, 0x95, 0xf3, 0xf1, - 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xef, 0x73, 0xf9, 0x2c, 0xa6, 0x23, 0x00, 0x00, -} diff --git a/pkg/metapb/metapb.pb.go b/pkg/metapb/metapb.pb.go deleted file mode 100644 index 003825617f..0000000000 --- a/pkg/metapb/metapb.pb.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: metapb.proto - -package metapb - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type PeerRole int32 - -const ( - PeerRole_Master PeerRole = 0 - PeerRole_Reader PeerRole = 1 - PeerRole_Write PeerRole = 2 - PeerRole_Proxyer PeerRole = 3 -) - -var PeerRole_name = map[int32]string{ - 0: "Master", - 1: "Reader", - 2: "Write", - 3: "Proxyer", -} - -var PeerRole_value = map[string]int32{ - "Master": 0, - "Reader": 1, - "Write": 2, - "Proxyer": 3, -} - -func (x PeerRole) String() string { - return proto.EnumName(PeerRole_name, int32(x)) -} - -func (PeerRole) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_77b4d575d5a68dda, []int{0} -} - -type Cluster struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // max peer count for a region. - // pd will do the auto-balance if region peer count mismatches. - MaxPeerCount uint32 `protobuf:"varint,1024,opt,name=max_peer_count,json=maxPeerCount,proto3" json:"max_peer_count,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Cluster) Reset() { *m = Cluster{} } -func (m *Cluster) String() string { return proto.CompactTextString(m) } -func (*Cluster) ProtoMessage() {} -func (*Cluster) Descriptor() ([]byte, []int) { - return fileDescriptor_77b4d575d5a68dda, []int{0} -} - -func (m *Cluster) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Cluster.Unmarshal(m, b) -} -func (m *Cluster) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Cluster.Marshal(b, m, deterministic) -} -func (m *Cluster) XXX_Merge(src proto.Message) { - xxx_messageInfo_Cluster.Merge(m, src) -} -func (m *Cluster) XXX_Size() int { - return xxx_messageInfo_Cluster.Size(m) -} -func (m *Cluster) XXX_DiscardUnknown() { - xxx_messageInfo_Cluster.DiscardUnknown(m) -} - -var xxx_messageInfo_Cluster proto.InternalMessageInfo - -func (m *Cluster) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Cluster) GetMaxPeerCount() uint32 { - if m != nil { - return m.MaxPeerCount - } - return 0 -} - -type Peer struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - PeerId uint64 `protobuf:"varint,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` - Role PeerRole `protobuf:"varint,3,opt,name=role,proto3,enum=metapb.PeerRole" json:"role,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Peer) Reset() { *m = Peer{} } -func (m *Peer) String() string { return proto.CompactTextString(m) } -func (*Peer) ProtoMessage() {} -func (*Peer) Descriptor() ([]byte, []int) { - return fileDescriptor_77b4d575d5a68dda, []int{1} -} - -func (m *Peer) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Peer.Unmarshal(m, b) -} -func (m *Peer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Peer.Marshal(b, m, deterministic) -} -func (m *Peer) XXX_Merge(src proto.Message) { - xxx_messageInfo_Peer.Merge(m, src) -} -func (m *Peer) XXX_Size() int { - return xxx_messageInfo_Peer.Size(m) -} -func (m *Peer) XXX_DiscardUnknown() { - xxx_messageInfo_Peer.DiscardUnknown(m) -} - -var xxx_messageInfo_Peer proto.InternalMessageInfo - -func (m *Peer) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Peer) GetPeerId() uint64 { - if m != nil { - return m.PeerId - } - return 0 -} - -func (m *Peer) GetRole() PeerRole { - if m != nil { - return m.Role - } - return PeerRole_Master -} - -func init() { - proto.RegisterEnum("metapb.PeerRole", PeerRole_name, PeerRole_value) - proto.RegisterType((*Cluster)(nil), "metapb.Cluster") - proto.RegisterType((*Peer)(nil), "metapb.Peer") -} - -func init() { proto.RegisterFile("metapb.proto", fileDescriptor_77b4d575d5a68dda) } - -var fileDescriptor_77b4d575d5a68dda = []byte{ - // 210 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x8f, 0xb1, 0x4b, 0xc5, 0x30, - 0x10, 0xc6, 0x4d, 0x5e, 0x4d, 0x9f, 0xe7, 0xb3, 0x84, 0x2c, 0x66, 0x2c, 0x0f, 0x85, 0xe2, 0xd0, - 0x41, 0x37, 0x27, 0xa1, 0x93, 0x83, 0x50, 0x02, 0xe2, 0x58, 0x52, 0x73, 0x43, 0xa0, 0x35, 0xe5, - 0x4c, 0xa1, 0x6e, 0xfe, 0xe9, 0x92, 0xa8, 0xd3, 0xdb, 0xee, 0xf7, 0x3b, 0xbe, 0xe3, 0x3b, 0x38, - 0xcc, 0x18, 0xed, 0x32, 0xb6, 0x0b, 0x85, 0x18, 0x94, 0xf8, 0xa5, 0xe3, 0x13, 0x94, 0xdd, 0xb4, - 0x7e, 0x46, 0x24, 0x55, 0x01, 0xf7, 0x4e, 0xb3, 0x9a, 0x35, 0x85, 0xe1, 0xde, 0xa9, 0x5b, 0xa8, - 0x66, 0xbb, 0x0d, 0x0b, 0x22, 0x0d, 0xef, 0x61, 0xfd, 0x88, 0xfa, 0x7b, 0x5f, 0xb3, 0xe6, 0xca, - 0x1c, 0x66, 0xbb, 0xf5, 0x88, 0xd4, 0x25, 0x79, 0x7c, 0x85, 0x22, 0xc1, 0x49, 0xfc, 0x1a, 0xca, - 0x1c, 0xf5, 0x4e, 0xf3, 0x2c, 0x45, 0xc2, 0x67, 0xa7, 0x6e, 0xa0, 0xa0, 0x30, 0xa1, 0xde, 0xd5, - 0xac, 0xa9, 0xee, 0x65, 0xfb, 0xd7, 0x2b, 0x1d, 0x31, 0x61, 0x42, 0x93, 0xb7, 0x77, 0x8f, 0xb0, - 0xff, 0x37, 0x0a, 0x40, 0xbc, 0xd8, 0xd4, 0x51, 0x9e, 0xa5, 0xd9, 0xa0, 0x75, 0x48, 0x92, 0xa9, - 0x0b, 0x38, 0x7f, 0x23, 0x1f, 0x51, 0x72, 0x75, 0x09, 0x65, 0x4f, 0x61, 0xfb, 0x42, 0x92, 0xbb, - 0x51, 0xe4, 0x1f, 0x1f, 0x7e, 0x02, 0x00, 0x00, 0xff, 0xff, 0x03, 0x47, 0x25, 0x66, 0xf3, 0x00, - 0x00, 0x00, -} diff --git a/pkg/pdpb/pdpb.pb.go b/pkg/pdpb/pdpb.pb.go deleted file mode 100644 index 04576c90db..0000000000 --- a/pkg/pdpb/pdpb.pb.go +++ /dev/null @@ -1,863 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: pdpb.proto - -package pdpb - -import ( - context "context" - fmt "fmt" - metapb "github.com/czs007/suvlim/pkg/metapb" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type ErrorType int32 - -const ( - ErrorType_OK ErrorType = 0 - ErrorType_UNKNOWN ErrorType = 1 - ErrorType_NOT_BOOTSTRAPPED ErrorType = 2 - ErrorType_STORE_TOMBSTONE ErrorType = 3 - ErrorType_ALREADY_BOOTSTRAPPED ErrorType = 4 - ErrorType_INCOMPATIBLE_VERSION ErrorType = 5 - ErrorType_REGION_NOT_FOUND ErrorType = 6 -) - -var ErrorType_name = map[int32]string{ - 0: "OK", - 1: "UNKNOWN", - 2: "NOT_BOOTSTRAPPED", - 3: "STORE_TOMBSTONE", - 4: "ALREADY_BOOTSTRAPPED", - 5: "INCOMPATIBLE_VERSION", - 6: "REGION_NOT_FOUND", -} - -var ErrorType_value = map[string]int32{ - "OK": 0, - "UNKNOWN": 1, - "NOT_BOOTSTRAPPED": 2, - "STORE_TOMBSTONE": 3, - "ALREADY_BOOTSTRAPPED": 4, - "INCOMPATIBLE_VERSION": 5, - "REGION_NOT_FOUND": 6, -} - -func (x ErrorType) String() string { - return proto.EnumName(ErrorType_name, int32(x)) -} - -func (ErrorType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_78b27e6f04f44c6e, []int{0} -} - -type Member struct { - // name is the name of the PD member. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // member_id is the unique id of the PD member. - MemberId uint64 `protobuf:"varint,2,opt,name=member_id,json=memberId,proto3" json:"member_id,omitempty"` - PeerUrls []string `protobuf:"bytes,3,rep,name=peer_urls,json=peerUrls,proto3" json:"peer_urls,omitempty"` - ClientUrls []string `protobuf:"bytes,4,rep,name=client_urls,json=clientUrls,proto3" json:"client_urls,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Member) Reset() { *m = Member{} } -func (m *Member) String() string { return proto.CompactTextString(m) } -func (*Member) ProtoMessage() {} -func (*Member) Descriptor() ([]byte, []int) { - return fileDescriptor_78b27e6f04f44c6e, []int{0} -} - -func (m *Member) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Member.Unmarshal(m, b) -} -func (m *Member) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Member.Marshal(b, m, deterministic) -} -func (m *Member) XXX_Merge(src proto.Message) { - xxx_messageInfo_Member.Merge(m, src) -} -func (m *Member) XXX_Size() int { - return xxx_messageInfo_Member.Size(m) -} -func (m *Member) XXX_DiscardUnknown() { - xxx_messageInfo_Member.DiscardUnknown(m) -} - -var xxx_messageInfo_Member proto.InternalMessageInfo - -func (m *Member) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Member) GetMemberId() uint64 { - if m != nil { - return m.MemberId - } - return 0 -} - -func (m *Member) GetPeerUrls() []string { - if m != nil { - return m.PeerUrls - } - return nil -} - -func (m *Member) GetClientUrls() []string { - if m != nil { - return m.ClientUrls - } - return nil -} - -type RequestHeader struct { - // cluster_id is the ID of the cluster which be sent to. - ClusterId uint64 `protobuf:"varint,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RequestHeader) Reset() { *m = RequestHeader{} } -func (m *RequestHeader) String() string { return proto.CompactTextString(m) } -func (*RequestHeader) ProtoMessage() {} -func (*RequestHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_78b27e6f04f44c6e, []int{1} -} - -func (m *RequestHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RequestHeader.Unmarshal(m, b) -} -func (m *RequestHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RequestHeader.Marshal(b, m, deterministic) -} -func (m *RequestHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestHeader.Merge(m, src) -} -func (m *RequestHeader) XXX_Size() int { - return xxx_messageInfo_RequestHeader.Size(m) -} -func (m *RequestHeader) XXX_DiscardUnknown() { - xxx_messageInfo_RequestHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestHeader proto.InternalMessageInfo - -func (m *RequestHeader) GetClusterId() uint64 { - if m != nil { - return m.ClusterId - } - return 0 -} - -type ResponseHeader struct { - // cluster_id is the ID of the cluster which sent the response. - ClusterId uint64 `protobuf:"varint,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - Error *Error `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ResponseHeader) Reset() { *m = ResponseHeader{} } -func (m *ResponseHeader) String() string { return proto.CompactTextString(m) } -func (*ResponseHeader) ProtoMessage() {} -func (*ResponseHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_78b27e6f04f44c6e, []int{2} -} - -func (m *ResponseHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ResponseHeader.Unmarshal(m, b) -} -func (m *ResponseHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ResponseHeader.Marshal(b, m, deterministic) -} -func (m *ResponseHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseHeader.Merge(m, src) -} -func (m *ResponseHeader) XXX_Size() int { - return xxx_messageInfo_ResponseHeader.Size(m) -} -func (m *ResponseHeader) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseHeader proto.InternalMessageInfo - -func (m *ResponseHeader) GetClusterId() uint64 { - if m != nil { - return m.ClusterId - } - return 0 -} - -func (m *ResponseHeader) GetError() *Error { - if m != nil { - return m.Error - } - return nil -} - -type Error struct { - Type ErrorType `protobuf:"varint,1,opt,name=type,proto3,enum=pdpb.ErrorType" json:"type,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Error) Reset() { *m = Error{} } -func (m *Error) String() string { return proto.CompactTextString(m) } -func (*Error) ProtoMessage() {} -func (*Error) Descriptor() ([]byte, []int) { - return fileDescriptor_78b27e6f04f44c6e, []int{3} -} - -func (m *Error) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Error.Unmarshal(m, b) -} -func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Error.Marshal(b, m, deterministic) -} -func (m *Error) XXX_Merge(src proto.Message) { - xxx_messageInfo_Error.Merge(m, src) -} -func (m *Error) XXX_Size() int { - return xxx_messageInfo_Error.Size(m) -} -func (m *Error) XXX_DiscardUnknown() { - xxx_messageInfo_Error.DiscardUnknown(m) -} - -var xxx_messageInfo_Error proto.InternalMessageInfo - -func (m *Error) GetType() ErrorType { - if m != nil { - return m.Type - } - return ErrorType_OK -} - -func (m *Error) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -type TsoRequest struct { - Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TsoRequest) Reset() { *m = TsoRequest{} } -func (m *TsoRequest) String() string { return proto.CompactTextString(m) } -func (*TsoRequest) ProtoMessage() {} -func (*TsoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_78b27e6f04f44c6e, []int{4} -} - -func (m *TsoRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TsoRequest.Unmarshal(m, b) -} -func (m *TsoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TsoRequest.Marshal(b, m, deterministic) -} -func (m *TsoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TsoRequest.Merge(m, src) -} -func (m *TsoRequest) XXX_Size() int { - return xxx_messageInfo_TsoRequest.Size(m) -} -func (m *TsoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TsoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_TsoRequest proto.InternalMessageInfo - -func (m *TsoRequest) GetHeader() *RequestHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *TsoRequest) GetCount() uint32 { - if m != nil { - return m.Count - } - return 0 -} - -type Timestamp struct { - Physical int64 `protobuf:"varint,1,opt,name=physical,proto3" json:"physical,omitempty"` - Logical int64 `protobuf:"varint,2,opt,name=logical,proto3" json:"logical,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Timestamp) Reset() { *m = Timestamp{} } -func (m *Timestamp) String() string { return proto.CompactTextString(m) } -func (*Timestamp) ProtoMessage() {} -func (*Timestamp) Descriptor() ([]byte, []int) { - return fileDescriptor_78b27e6f04f44c6e, []int{5} -} - -func (m *Timestamp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Timestamp.Unmarshal(m, b) -} -func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic) -} -func (m *Timestamp) XXX_Merge(src proto.Message) { - xxx_messageInfo_Timestamp.Merge(m, src) -} -func (m *Timestamp) XXX_Size() int { - return xxx_messageInfo_Timestamp.Size(m) -} -func (m *Timestamp) XXX_DiscardUnknown() { - xxx_messageInfo_Timestamp.DiscardUnknown(m) -} - -var xxx_messageInfo_Timestamp proto.InternalMessageInfo - -func (m *Timestamp) GetPhysical() int64 { - if m != nil { - return m.Physical - } - return 0 -} - -func (m *Timestamp) GetLogical() int64 { - if m != nil { - return m.Logical - } - return 0 -} - -type TsoResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` - Timestamp *Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TsoResponse) Reset() { *m = TsoResponse{} } -func (m *TsoResponse) String() string { return proto.CompactTextString(m) } -func (*TsoResponse) ProtoMessage() {} -func (*TsoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_78b27e6f04f44c6e, []int{6} -} - -func (m *TsoResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TsoResponse.Unmarshal(m, b) -} -func (m *TsoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TsoResponse.Marshal(b, m, deterministic) -} -func (m *TsoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TsoResponse.Merge(m, src) -} -func (m *TsoResponse) XXX_Size() int { - return xxx_messageInfo_TsoResponse.Size(m) -} -func (m *TsoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TsoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TsoResponse proto.InternalMessageInfo - -func (m *TsoResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *TsoResponse) GetCount() uint32 { - if m != nil { - return m.Count - } - return 0 -} - -func (m *TsoResponse) GetTimestamp() *Timestamp { - if m != nil { - return m.Timestamp - } - return nil -} - -type AllocIDRequest struct { - Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AllocIDRequest) Reset() { *m = AllocIDRequest{} } -func (m *AllocIDRequest) String() string { return proto.CompactTextString(m) } -func (*AllocIDRequest) ProtoMessage() {} -func (*AllocIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_78b27e6f04f44c6e, []int{7} -} - -func (m *AllocIDRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AllocIDRequest.Unmarshal(m, b) -} -func (m *AllocIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AllocIDRequest.Marshal(b, m, deterministic) -} -func (m *AllocIDRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllocIDRequest.Merge(m, src) -} -func (m *AllocIDRequest) XXX_Size() int { - return xxx_messageInfo_AllocIDRequest.Size(m) -} -func (m *AllocIDRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AllocIDRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AllocIDRequest proto.InternalMessageInfo - -func (m *AllocIDRequest) GetHeader() *RequestHeader { - if m != nil { - return m.Header - } - return nil -} - -type AllocIDResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AllocIDResponse) Reset() { *m = AllocIDResponse{} } -func (m *AllocIDResponse) String() string { return proto.CompactTextString(m) } -func (*AllocIDResponse) ProtoMessage() {} -func (*AllocIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_78b27e6f04f44c6e, []int{8} -} - -func (m *AllocIDResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AllocIDResponse.Unmarshal(m, b) -} -func (m *AllocIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AllocIDResponse.Marshal(b, m, deterministic) -} -func (m *AllocIDResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllocIDResponse.Merge(m, src) -} -func (m *AllocIDResponse) XXX_Size() int { - return xxx_messageInfo_AllocIDResponse.Size(m) -} -func (m *AllocIDResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AllocIDResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AllocIDResponse proto.InternalMessageInfo - -func (m *AllocIDResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *AllocIDResponse) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -type HeartbeatRequest struct { - Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Peer *metapb.Peer `protobuf:"bytes,2,opt,name=peer,proto3" json:"peer,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HeartbeatRequest) Reset() { *m = HeartbeatRequest{} } -func (m *HeartbeatRequest) String() string { return proto.CompactTextString(m) } -func (*HeartbeatRequest) ProtoMessage() {} -func (*HeartbeatRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_78b27e6f04f44c6e, []int{9} -} - -func (m *HeartbeatRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HeartbeatRequest.Unmarshal(m, b) -} -func (m *HeartbeatRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HeartbeatRequest.Marshal(b, m, deterministic) -} -func (m *HeartbeatRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HeartbeatRequest.Merge(m, src) -} -func (m *HeartbeatRequest) XXX_Size() int { - return xxx_messageInfo_HeartbeatRequest.Size(m) -} -func (m *HeartbeatRequest) XXX_DiscardUnknown() { - xxx_messageInfo_HeartbeatRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_HeartbeatRequest proto.InternalMessageInfo - -func (m *HeartbeatRequest) GetHeader() *RequestHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *HeartbeatRequest) GetPeer() *metapb.Peer { - if m != nil { - return m.Peer - } - return nil -} - -type HeartbeatResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HeartbeatResponse) Reset() { *m = HeartbeatResponse{} } -func (m *HeartbeatResponse) String() string { return proto.CompactTextString(m) } -func (*HeartbeatResponse) ProtoMessage() {} -func (*HeartbeatResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_78b27e6f04f44c6e, []int{10} -} - -func (m *HeartbeatResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HeartbeatResponse.Unmarshal(m, b) -} -func (m *HeartbeatResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HeartbeatResponse.Marshal(b, m, deterministic) -} -func (m *HeartbeatResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_HeartbeatResponse.Merge(m, src) -} -func (m *HeartbeatResponse) XXX_Size() int { - return xxx_messageInfo_HeartbeatResponse.Size(m) -} -func (m *HeartbeatResponse) XXX_DiscardUnknown() { - xxx_messageInfo_HeartbeatResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_HeartbeatResponse proto.InternalMessageInfo - -func (m *HeartbeatResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func init() { - proto.RegisterEnum("pdpb.ErrorType", ErrorType_name, ErrorType_value) - proto.RegisterType((*Member)(nil), "pdpb.Member") - proto.RegisterType((*RequestHeader)(nil), "pdpb.RequestHeader") - proto.RegisterType((*ResponseHeader)(nil), "pdpb.ResponseHeader") - proto.RegisterType((*Error)(nil), "pdpb.Error") - proto.RegisterType((*TsoRequest)(nil), "pdpb.TsoRequest") - proto.RegisterType((*Timestamp)(nil), "pdpb.Timestamp") - proto.RegisterType((*TsoResponse)(nil), "pdpb.TsoResponse") - proto.RegisterType((*AllocIDRequest)(nil), "pdpb.AllocIDRequest") - proto.RegisterType((*AllocIDResponse)(nil), "pdpb.AllocIDResponse") - proto.RegisterType((*HeartbeatRequest)(nil), "pdpb.HeartbeatRequest") - proto.RegisterType((*HeartbeatResponse)(nil), "pdpb.HeartbeatResponse") -} - -func init() { proto.RegisterFile("pdpb.proto", fileDescriptor_78b27e6f04f44c6e) } - -var fileDescriptor_78b27e6f04f44c6e = []byte{ - // 603 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0xad, 0x1d, 0x27, 0xad, 0x27, 0x6d, 0xea, 0x4e, 0x03, 0x44, 0x41, 0x88, 0xb0, 0x5c, 0x22, - 0x3e, 0xa2, 0x2a, 0x5c, 0xb8, 0x70, 0x70, 0x88, 0x4b, 0xad, 0xb6, 0xde, 0x68, 0xe3, 0x82, 0x38, - 0x45, 0x4e, 0xbc, 0x6a, 0x23, 0xd9, 0xb1, 0xf1, 0x3a, 0x42, 0xbd, 0xf1, 0x27, 0xf8, 0x27, 0xfc, - 0x40, 0xe4, 0xf5, 0x07, 0x69, 0x90, 0x10, 0xca, 0xcd, 0xf3, 0xde, 0xec, 0x9b, 0x37, 0x1f, 0x09, - 0x40, 0xec, 0xc7, 0xf3, 0x41, 0x9c, 0x44, 0x69, 0x84, 0x5a, 0xf6, 0xdd, 0x3d, 0x0c, 0x79, 0xea, - 0x95, 0x18, 0xf9, 0x0e, 0x8d, 0x6b, 0x1e, 0xce, 0x79, 0x82, 0x08, 0xda, 0xca, 0x0b, 0x79, 0x47, - 0xe9, 0x29, 0x7d, 0x9d, 0xc9, 0x6f, 0x7c, 0x0a, 0x7a, 0x28, 0xd9, 0xd9, 0xd2, 0xef, 0xa8, 0x3d, - 0xa5, 0xaf, 0xb1, 0x83, 0x1c, 0xb0, 0xfd, 0x8c, 0x8c, 0x39, 0x4f, 0x66, 0xeb, 0x24, 0x10, 0x9d, - 0x5a, 0xaf, 0xd6, 0xd7, 0xd9, 0x41, 0x06, 0xdc, 0x24, 0x81, 0xc0, 0xe7, 0xd0, 0x5c, 0x04, 0x4b, - 0xbe, 0x4a, 0x73, 0x5a, 0x93, 0x34, 0xe4, 0x50, 0x96, 0x40, 0x06, 0x70, 0xc4, 0xf8, 0xb7, 0x35, - 0x17, 0xe9, 0x05, 0xf7, 0x7c, 0x9e, 0xe0, 0x33, 0x80, 0x45, 0xb0, 0x16, 0x69, 0x5e, 0x4c, 0x91, - 0xc5, 0xf4, 0x02, 0xb1, 0x7d, 0xc2, 0xa0, 0xc5, 0xb8, 0x88, 0xa3, 0x95, 0xe0, 0xff, 0xf5, 0x00, - 0x5f, 0x40, 0x9d, 0x27, 0x49, 0x94, 0x48, 0xdf, 0xcd, 0x61, 0x73, 0x20, 0x27, 0x61, 0x65, 0x10, - 0xcb, 0x19, 0x72, 0x0e, 0x75, 0x19, 0xe3, 0x4b, 0xd0, 0xd2, 0xfb, 0x38, 0xef, 0xbd, 0x35, 0x3c, - 0xde, 0x48, 0x75, 0xef, 0x63, 0xce, 0x24, 0x89, 0x1d, 0xd8, 0x0f, 0xb9, 0x10, 0xde, 0x2d, 0x97, - 0x92, 0x3a, 0x2b, 0x43, 0x42, 0x01, 0x5c, 0x11, 0x15, 0xed, 0xe0, 0x6b, 0x68, 0xdc, 0x49, 0x87, - 0x52, 0xae, 0x39, 0x3c, 0xcd, 0xe5, 0x1e, 0x74, 0xcb, 0x8a, 0x14, 0x6c, 0x43, 0x7d, 0x11, 0xad, - 0x57, 0xa9, 0x94, 0x3c, 0x62, 0x79, 0x40, 0x4c, 0xd0, 0xdd, 0x65, 0xc8, 0x45, 0xea, 0x85, 0x31, - 0x76, 0xe1, 0x20, 0xbe, 0xbb, 0x17, 0xcb, 0x85, 0x17, 0x48, 0xc5, 0x1a, 0xab, 0xe2, 0xcc, 0x53, - 0x10, 0xdd, 0x4a, 0x4a, 0x95, 0x54, 0x19, 0x92, 0x1f, 0x0a, 0x34, 0xa5, 0xa9, 0x7c, 0x66, 0xf8, - 0x66, 0xcb, 0x55, 0xbb, 0x74, 0xb5, 0x39, 0xd3, 0x7f, 0xdb, 0xc2, 0xb7, 0xa0, 0xa7, 0xa5, 0xad, - 0x4e, 0x4d, 0xca, 0x14, 0xb3, 0xaa, 0xdc, 0xb2, 0x3f, 0x19, 0xe4, 0x03, 0xb4, 0xcc, 0x20, 0x88, - 0x16, 0xf6, 0x78, 0x97, 0xd1, 0x10, 0x0a, 0xc7, 0xd5, 0xf3, 0x9d, 0x9a, 0x68, 0x81, 0x5a, 0x9d, - 0xad, 0xba, 0xf4, 0x89, 0x07, 0xc6, 0x05, 0xf7, 0x92, 0x74, 0xce, 0xbd, 0x74, 0xa7, 0x65, 0xf5, - 0x40, 0xcb, 0x0e, 0xbc, 0xb8, 0xa8, 0xc3, 0x41, 0xf1, 0x4b, 0x9a, 0x70, 0x9e, 0x30, 0xc9, 0x10, - 0x13, 0x4e, 0x36, 0x4a, 0xec, 0xe2, 0xfa, 0xd5, 0x4f, 0x05, 0xf4, 0xea, 0xf4, 0xb0, 0x01, 0x2a, - 0xbd, 0x34, 0xf6, 0xb0, 0x09, 0xfb, 0x37, 0xce, 0xa5, 0x43, 0xbf, 0x38, 0x86, 0x82, 0x6d, 0x30, - 0x1c, 0xea, 0xce, 0x46, 0x94, 0xba, 0x53, 0x97, 0x99, 0x93, 0x89, 0x35, 0x36, 0x54, 0x3c, 0x85, - 0xe3, 0xa9, 0x4b, 0x99, 0x35, 0x73, 0xe9, 0xf5, 0x68, 0xea, 0x52, 0xc7, 0x32, 0x6a, 0xd8, 0x81, - 0xb6, 0x79, 0xc5, 0x2c, 0x73, 0xfc, 0xf5, 0x61, 0xba, 0x96, 0x31, 0xb6, 0xf3, 0x91, 0x5e, 0x4f, - 0x4c, 0xd7, 0x1e, 0x5d, 0x59, 0xb3, 0xcf, 0x16, 0x9b, 0xda, 0xd4, 0x31, 0xea, 0x99, 0x3c, 0xb3, - 0x3e, 0xd9, 0xd4, 0x99, 0x65, 0x55, 0xce, 0xe9, 0x8d, 0x33, 0x36, 0x1a, 0xc3, 0x5f, 0x0a, 0xa8, - 0x93, 0x31, 0x9e, 0x41, 0xcd, 0x15, 0x11, 0x1a, 0xc5, 0xde, 0xab, 0xb3, 0xef, 0x9e, 0x6c, 0x20, - 0x79, 0x63, 0x64, 0xaf, 0xaf, 0x9c, 0x29, 0xf8, 0x1e, 0xf6, 0x8b, 0x3d, 0x62, 0xd1, 0xf9, 0xc3, - 0xab, 0xe8, 0x3e, 0xda, 0x42, 0xcb, 0xd7, 0x38, 0x02, 0xbd, 0x9a, 0x26, 0x3e, 0xce, 0xb3, 0xb6, - 0x37, 0xd8, 0x7d, 0xf2, 0x17, 0xbe, 0x59, 0x7d, 0xde, 0x90, 0xff, 0x73, 0xef, 0x7e, 0x07, 0x00, - 0x00, 0xff, 0xff, 0x34, 0x73, 0xe9, 0xc4, 0x09, 0x05, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// PDClient is the client API for PD service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type PDClient interface { - Tso(ctx context.Context, opts ...grpc.CallOption) (PD_TsoClient, error) - AllocID(ctx context.Context, in *AllocIDRequest, opts ...grpc.CallOption) (*AllocIDResponse, error) - Heartbeat(ctx context.Context, opts ...grpc.CallOption) (PD_HeartbeatClient, error) -} - -type pDClient struct { - cc grpc.ClientConnInterface -} - -func NewPDClient(cc grpc.ClientConnInterface) PDClient { - return &pDClient{cc} -} - -func (c *pDClient) Tso(ctx context.Context, opts ...grpc.CallOption) (PD_TsoClient, error) { - stream, err := c.cc.NewStream(ctx, &_PD_serviceDesc.Streams[0], "/pdpb.PD/Tso", opts...) - if err != nil { - return nil, err - } - x := &pDTsoClient{stream} - return x, nil -} - -type PD_TsoClient interface { - Send(*TsoRequest) error - Recv() (*TsoResponse, error) - grpc.ClientStream -} - -type pDTsoClient struct { - grpc.ClientStream -} - -func (x *pDTsoClient) Send(m *TsoRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *pDTsoClient) Recv() (*TsoResponse, error) { - m := new(TsoResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *pDClient) AllocID(ctx context.Context, in *AllocIDRequest, opts ...grpc.CallOption) (*AllocIDResponse, error) { - out := new(AllocIDResponse) - err := c.cc.Invoke(ctx, "/pdpb.PD/AllocID", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *pDClient) Heartbeat(ctx context.Context, opts ...grpc.CallOption) (PD_HeartbeatClient, error) { - stream, err := c.cc.NewStream(ctx, &_PD_serviceDesc.Streams[1], "/pdpb.PD/Heartbeat", opts...) - if err != nil { - return nil, err - } - x := &pDHeartbeatClient{stream} - return x, nil -} - -type PD_HeartbeatClient interface { - Send(*HeartbeatRequest) error - Recv() (*HeartbeatResponse, error) - grpc.ClientStream -} - -type pDHeartbeatClient struct { - grpc.ClientStream -} - -func (x *pDHeartbeatClient) Send(m *HeartbeatRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *pDHeartbeatClient) Recv() (*HeartbeatResponse, error) { - m := new(HeartbeatResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// PDServer is the server API for PD service. -type PDServer interface { - Tso(PD_TsoServer) error - AllocID(context.Context, *AllocIDRequest) (*AllocIDResponse, error) - Heartbeat(PD_HeartbeatServer) error -} - -// UnimplementedPDServer can be embedded to have forward compatible implementations. -type UnimplementedPDServer struct { -} - -func (*UnimplementedPDServer) Tso(srv PD_TsoServer) error { - return status.Errorf(codes.Unimplemented, "method Tso not implemented") -} -func (*UnimplementedPDServer) AllocID(ctx context.Context, req *AllocIDRequest) (*AllocIDResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllocID not implemented") -} -func (*UnimplementedPDServer) Heartbeat(srv PD_HeartbeatServer) error { - return status.Errorf(codes.Unimplemented, "method Heartbeat not implemented") -} - -func RegisterPDServer(s *grpc.Server, srv PDServer) { - s.RegisterService(&_PD_serviceDesc, srv) -} - -func _PD_Tso_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(PDServer).Tso(&pDTsoServer{stream}) -} - -type PD_TsoServer interface { - Send(*TsoResponse) error - Recv() (*TsoRequest, error) - grpc.ServerStream -} - -type pDTsoServer struct { - grpc.ServerStream -} - -func (x *pDTsoServer) Send(m *TsoResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *pDTsoServer) Recv() (*TsoRequest, error) { - m := new(TsoRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _PD_AllocID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AllocIDRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PDServer).AllocID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pdpb.PD/AllocID", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PDServer).AllocID(ctx, req.(*AllocIDRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PD_Heartbeat_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(PDServer).Heartbeat(&pDHeartbeatServer{stream}) -} - -type PD_HeartbeatServer interface { - Send(*HeartbeatResponse) error - Recv() (*HeartbeatRequest, error) - grpc.ServerStream -} - -type pDHeartbeatServer struct { - grpc.ServerStream -} - -func (x *pDHeartbeatServer) Send(m *HeartbeatResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *pDHeartbeatServer) Recv() (*HeartbeatRequest, error) { - m := new(HeartbeatRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _PD_serviceDesc = grpc.ServiceDesc{ - ServiceName: "pdpb.PD", - HandlerType: (*PDServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "AllocID", - Handler: _PD_AllocID_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Tso", - Handler: _PD_Tso_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "Heartbeat", - Handler: _PD_Heartbeat_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "pdpb.proto", -} diff --git a/proto/message.proto b/proto/message.proto deleted file mode 100644 index 5e3b016e55..0000000000 --- a/proto/message.proto +++ /dev/null @@ -1,779 +0,0 @@ -syntax = "proto3"; - -package milvus.grpc; -option go_package="master/grpc/message"; - -enum ErrorCode { - SUCCESS = 0; - UNEXPECTED_ERROR = 1; - CONNECT_FAILED = 2; - PERMISSION_DENIED = 3; - COLLECTION_NOT_EXISTS = 4; - ILLEGAL_ARGUMENT = 5; - ILLEGAL_DIMENSION = 7; - ILLEGAL_INDEX_TYPE = 8; - ILLEGAL_COLLECTION_NAME = 9; - ILLEGAL_TOPK = 10; - ILLEGAL_ROWRECORD = 11; - ILLEGAL_VECTOR_ID = 12; - ILLEGAL_SEARCH_RESULT = 13; - FILE_NOT_FOUND = 14; - META_FAILED = 15; - CACHE_FAILED = 16; - CANNOT_CREATE_FOLDER = 17; - CANNOT_CREATE_FILE = 18; - CANNOT_DELETE_FOLDER = 19; - CANNOT_DELETE_FILE = 20; - BUILD_INDEX_ERROR = 21; - ILLEGAL_NLIST = 22; - ILLEGAL_METRIC_TYPE = 23; - OUT_OF_MEMORY = 24; -} - -message Status { - ErrorCode error_code = 1; - string reason = 2; -} - -/** - * @brief Field data type - */ -enum DataType { - NONE = 0; - BOOL = 1; - INT8 = 2; - INT16 = 3; - INT32 = 4; - INT64 = 5; - - FLOAT = 10; - DOUBLE = 11; - - STRING = 20; - - VECTOR_BINARY = 100; - VECTOR_FLOAT = 101; -} - -/** - * @brief General usage - */ -message KeyValuePair { - string key = 1; - string value = 2; -} - -/** - * @brief Collection name - */ -message CollectionName { - string collection_name = 1; -} - -/** - * @brief Collection name list - */ -message CollectionNameList { - Status status = 1; - repeated string collection_names = 2; -} - -/** - * @brief Field name - */ -message FieldName { - string collection_name = 1; - string field_name = 2; -} - -/** - * @brief Collection mapping - * @extra_params: key-value pair for extra parameters of the collection - * typically usage: - * extra_params["params"] = {segment_row_count: 1000000, auto_id: true} - * Note: - * the segment_row_count specify segment row count limit for merging - * the auto_id = true means entity id is auto-generated by milvus - */ -message Mapping { - Status status = 1; - string collection_name = 2; - Schema schema = 3; - repeated KeyValuePair extra_params = 4; -} - -/** - * @brief Collection mapping list - */ -message MappingList { - Status status = 1; - repeated Mapping mapping_list = 2; -} - -/** - * @brief Parameters of partition - */ -message PartitionParam { - string collection_name = 1; - string tag = 2; -} - -/** - * @brief Partition list - */ -message PartitionList { - Status status = 1; - repeated string partition_tag_array = 2; -} - -/** - * @brief Vector row record - */ -message VectorRowRecord { - repeated float float_data = 1; //float vector data - bytes binary_data = 2; //binary vector data -} - -message EntityIds { - Status status = 1; - repeated int64 entity_id_array = 2; -} - -message VectorRecord { - repeated VectorRowRecord records = 1; -} - -message VectorParam { - string json = 1; - VectorRecord row_record = 2; -} - -//////////////////////////row schema and data/////////////////////////////////// -/** - * @brief schema - */ -message FieldMeta { - string field_name = 1; - DataType type = 2; - int64 dim = 3; -} - -message Schema { - repeated FieldMeta field_metas = 1; -} - -message RowData { - bytes blob = 1; -} - -//////////////////////suvlim-proxy/////////////////////////////////// -message InsertParam { - string collection_name = 1; - Schema schema = 2; - repeated RowData rows_data = 3; - repeated int64 entity_id_array = 4; //optional - string partition_tag = 5; - repeated KeyValuePair extra_params = 6; -} - -message SearchParam { - string collection_name = 1; - repeated VectorParam vector_param = 2; - string dsl = 3; //optional - repeated string partition_tag = 4; //why - repeated KeyValuePair extra_params = 5; -} - -message SearchInSegmentParam { - repeated string file_id_array = 1; - SearchParam search_param = 2; -} - -message Entities { - Status status = 1; - repeated int64 ids = 2; - repeated bool valid_row = 3; - repeated RowData rows_data = 4; -} - - -///////////////////////////milvus-server/////////////////////////// -/** - * @brief Query result - */ -message QueryResult { - Status status = 1; - Entities entities = 2; - int64 row_num = 3; - repeated float scores = 4; - repeated float distances = 5; - repeated KeyValuePair extra_params = 6; - uint64 query_id = 7; - int64 proxy_id = 8; -} - -/** - * @brief Server string Reply - */ -message StringReply { - Status status = 1; - string string_reply = 2; -} - -/** - * @brief Server bool Reply - */ -message BoolReply { - Status status = 1; - bool bool_reply = 2; -} - -/** - * @brief Return collection row count - */ -message CollectionRowCount { - Status status = 1; - int64 collection_row_count = 2; -} - -/** - * @brief Server command parameters - */ -message Command { - string cmd = 1; -} - -/** - * @brief Index params - * @collection_name: target collection - * @field_name: target field - * @index_name: a name for index provided by user, unique within this field - * @extra_params: index parameters in json format - * for vector field: - * extra_params["index_type"] = one of the values: FLAT, IVF_LAT, IVF_SQ8, NSGMIX, IVFSQ8H, - * PQ, HNSW, HNSW_SQ8NM, ANNOY - * extra_params["metric_type"] = one of the values: L2, IP, HAMMING, JACCARD, TANIMOTO - * SUBSTRUCTURE, SUPERSTRUCTURE - * extra_params["params"] = extra parameters for index, for example ivflat: {nlist: 2048} - * for structured field: - * extra_params["index_type"] = one of the values: SORTED - */ -message IndexParam { - Status status = 1; - string collection_name = 2; - string field_name = 3; - string index_name = 4; - repeated KeyValuePair extra_params = 5; -} - -/** - * @brief Parameters for flush action - */ -message FlushParam { - repeated string collection_name_array = 1; -} - -/** - * @brief Parameters for flush action - */ -message CompactParam { - string collection_name = 1; - double threshold = 2; -} - -/** - * @brief Parameters for deleting entities by id - */ -message DeleteByIDParam { - string collection_name = 1; - repeated int64 id_array = 2; -} - -/** - * @brief Return collection stats - * @json_info: collection stats in json format, typically, the format is like: - * { - * row_count: xxx, - * data_size: xxx, - * partitions: [ - * { - * tag: xxx, - * id: xxx, - * row_count: xxx, - * data_size: xxx, - * segments: [ - * { - * id: xxx, - * row_count: xxx, - * data_size: xxx, - * files: [ - * { - * field: xxx, - * name: xxx, - * index_type: xxx, - * path: xxx, - * data_size: xxx, - * } - * ] - * } - * ] - * } - * ] - * } - */ -message CollectionInfo { - Status status = 1; - string json_info = 2; -} - -/** - * @brief Parameters for returning entities id of a segment - */ -message GetEntityIDsParam { - string collection_name = 1; - int64 segment_id = 2; -} - -/** - * @brief Entities identity - */ -message EntityIdentity { - string collection_name = 1; - repeated int64 id_array = 2; - repeated string field_names = 3; -} - -/********************************************SearchPB interface***************************************************/ -/** - * @brief Vector field parameters - */ -message VectorFieldParam { - int64 dimension = 1; -} - -/** - * @brief Field type - */ -message FieldType { - oneof value { - DataType data_type = 1; - VectorFieldParam vector_param = 2; - } -} - -/** - * @brief Field parameters - */ -message FieldParam { - uint64 id = 1; - string name = 2; - DataType type = 3; - repeated KeyValuePair index_params = 4; - repeated KeyValuePair extra_params = 5; -} - -/** - * @brief Vector field record - */ -message VectorFieldRecord { - repeated VectorRowRecord value = 1; -} - -/////////////////////////////////////////////////////////////////// - -message TermQuery { - string field_name = 1; - repeated int64 int_value = 2; - repeated double double_value = 3; - int64 value_num = 4; - float boost = 5; - repeated KeyValuePair extra_params = 6; -} - -enum CompareOperator { - LT = 0; - LTE = 1; - EQ = 2; - GT = 3; - GTE = 4; - NE = 5; -} - -message CompareExpr { - CompareOperator operator = 1; - string operand = 2; -} - -message RangeQuery { - string field_name = 1; - repeated CompareExpr operand = 2; - float boost = 3; - repeated KeyValuePair extra_params = 4; -} - -message VectorQuery { - string field_name = 1; - float query_boost = 2; - repeated VectorRowRecord records = 3; - int64 topk = 4; - repeated KeyValuePair extra_params = 5; -} - -enum Occur { - INVALID = 0; - MUST = 1; - SHOULD = 2; - MUST_NOT = 3; -} - -message BooleanQuery { - Occur occur = 1; - repeated GeneralQuery general_query = 2; -} - -message GeneralQuery { - oneof query { - BooleanQuery boolean_query = 1; - TermQuery term_query = 2; - RangeQuery range_query = 3; - VectorQuery vector_query = 4; - } -} - -message SearchParamPB { - string collection_name = 1; - repeated string partition_tag_array = 2; - GeneralQuery general_query = 3; - repeated KeyValuePair extra_params = 4; -} - -service MilvusService { - /** - * @brief This method is used to create collection - * - * @param CollectionSchema, use to provide collection information to be created. - * - * @return Status - */ - rpc CreateCollection(Mapping) returns (Status){} - - /** - * @brief This method is used to test collection existence. - * - * @param CollectionName, collection name is going to be tested. - * - * @return BoolReply - */ - rpc HasCollection(CollectionName) returns (BoolReply) {} - - /** - * @brief This method is used to get collection schema. - * - * @param CollectionName, target collection name. - * - * @return CollectionSchema - */ - rpc DescribeCollection(CollectionName) returns (Mapping) {} - - /** - * @brief This method is used to get collection schema. - * - * @param CollectionName, target collection name. - * - * @return CollectionRowCount - */ - rpc CountCollection(CollectionName) returns (CollectionRowCount) {} - - /** - * @brief This method is used to list all collections. - * - * @param Command, dummy parameter. - * - * @return CollectionNameList - */ - rpc ShowCollections(Command) returns (CollectionNameList) {} - - /** - * @brief This method is used to get collection detail information. - * - * @param CollectionName, target collection name. - * - * @return CollectionInfo - */ - rpc ShowCollectionInfo(CollectionName) returns (CollectionInfo) {} - - /** - * @brief This method is used to delete collection. - * - * @param CollectionName, collection name is going to be deleted. - * - * @return Status - */ - rpc DropCollection(CollectionName) returns (Status) {} - - /** - * @brief This method is used to build index by collection in sync mode. - * - * @param IndexParam, index paramters. - * - * @return Status - */ - rpc CreateIndex(IndexParam) returns (Status) {} - - /** - * @brief This method is used to describe index - * - * @param IndexParam, target index. - * - * @return IndexParam - */ - rpc DescribeIndex(IndexParam) returns (IndexParam) {} - - /** - * @brief This method is used to drop index - * - * @param IndexParam, target field. if the IndexParam.field_name is empty, will drop all index of the collection - * - * @return Status - */ - rpc DropIndex(IndexParam) returns (Status) {} - - /** - * @brief This method is used to create partition - * - * @param PartitionParam, partition parameters. - * - * @return Status - */ - rpc CreatePartition(PartitionParam) returns (Status) {} - - /** - * @brief This method is used to test partition existence. - * - * @param PartitionParam, target partition. - * - * @return BoolReply - */ - rpc HasPartition(PartitionParam) returns (BoolReply) {} - - /** - * @brief This method is used to show partition information - * - * @param CollectionName, target collection name. - * - * @return PartitionList - */ - rpc ShowPartitions(CollectionName) returns (PartitionList) {} - - /** - * @brief This method is used to drop partition - * - * @param PartitionParam, target partition. - * - * @return Status - */ - rpc DropPartition(PartitionParam) returns (Status) {} - - /** - * @brief This method is used to add vector array to collection. - * - * @param InsertParam, insert parameters. - * - * @return VectorIds - */ - rpc Insert(InsertParam) returns (EntityIds) {} - - /** - * @brief This method is used to get entities data by id array. - * - * @param EntitiesIdentity, target entity id array. - * - * @return EntitiesData - */ - rpc GetEntityByID(EntityIdentity) returns (Entities) {} - - /** - * @brief This method is used to get vector ids from a segment - * - * @param GetVectorIDsParam, target collection and segment - * - * @return VectorIds - */ - rpc GetEntityIDs(GetEntityIDsParam) returns (EntityIds) {} - - /** - * @brief This method is used to query vector in collection. - * - * @param SearchParam, search parameters. - * - * @return KQueryResult - */ - rpc Search(SearchParam) returns (QueryResult) {} - - /** - * @brief This method is used to query vector in specified files. - * - * @param SearchInSegmentParam, target segments to search. - * - * @return TopKQueryResult - */ - rpc SearchInSegment(SearchInSegmentParam) returns (QueryResult) {} - - /** - * @brief This method is used to give the server status. - * - * @param Command, command string - * - * @return StringReply - */ - rpc Cmd(Command) returns (StringReply) {} - - /** - * @brief This method is used to delete vector by id - * - * @param DeleteByIDParam, delete parameters. - * - * @return status - */ - rpc DeleteByID(DeleteByIDParam) returns (Status) {} - - /** - * @brief This method is used to preload collection - * - * @param CollectionName, target collection name. - * - * @return Status - */ - rpc PreloadCollection(CollectionName) returns (Status) {} - - /** - * @brief This method is used to flush buffer into storage. - * - * @param FlushParam, flush parameters - * - * @return Status - */ - rpc Flush(FlushParam) returns (Status) {} - - /** - * @brief This method is used to compact collection - * - * @param CompactParam, compact parameters - * - * @return Status - */ - rpc Compact(CompactParam) returns (Status) {} - - /********************************New Interface********************************************/ - - rpc SearchPB(SearchParamPB) returns (QueryResult) {} -} - -////////////////////pulsar////////////////////////////////////// -enum OpType { - INSERT = 0; - DELETE = 1; -} - -enum ReqType { - // general operations - kCmd = 0; - - /* collection operations */ - kCreateCollection = 100; - kDropCollection = 101; - kHasCollection = 102; - kListCollections = 103; - kGetCollectionInfo = 104; - kGetCollectionStats = 105; - kCountEntities = 106; - - /* partition operations */ - kCreatePartition = 200; - kDropPartition = 201; - kHasPartition = 202; - kListPartitions = 203; - - /* index operations */ - kCreateIndex = 300; - kDropIndex = 301; - kDescribeIndex = 302; - - /* data operations */ - kInsert = 400; - kGetEntityByID = 401; - kDeleteEntityByID = 402; - kSearch = 403; - kListIDInSegment = 404; - - /* other operations */ - kLoadCollection = 500; - kFlush = 501; - kCompact = 502; -} - -message QueryReqMsg { - string collection_name = 1; - repeated VectorParam vector_param = 2; - repeated string partition_tags = 3; - string dsl = 4; - repeated KeyValuePair extra_params = 5; - uint64 timestamp =6; - int64 proxy_id = 7; - uint64 query_id = 8; - ReqType req_type = 9; -} - -message ManipulationReqMsg { - string collection_name = 1; - string partition_tag = 2; - repeated uint64 primary_keys = 3; - repeated RowData rows_data = 4; - uint64 timestamp =5; - uint64 segment_id = 6; - uint64 channel_id = 7; - ReqType req_type = 8; - int64 proxy_id = 9; - repeated KeyValuePair extra_params = 10; -} - -message InsertOrDeleteMsg { - string collection_name = 1; - RowData rows_data = 2; - int64 uid = 3; //optional - string partition_tag = 4; - uint64 timestamp =5; - int64 segment_id = 6; - int64 channel_id = 7; - OpType op = 8; - int64 client_id = 9; - repeated KeyValuePair extra_params = 10; -} - -message SearchMsg { - string collection_name = 1; - VectorRowRecord records = 2; - repeated string partition_tag = 3; - int64 uid = 4; - uint64 timestamp =5; - int64 client_id = 6; - repeated KeyValuePair extra_params = 7; - repeated string json = 8; - string dsl = 9; -} - -enum SyncType { - READ = 0; - WRITE = 1; -} -message TimeSyncMsg{ - int64 peer_Id = 1; - uint64 Timestamp = 2; - SyncType sync_type = 3; -} - -message Key2SegMsg { - int64 uid = 1; - uint64 timestamp = 2; - repeated int64 segment_id = 3; -} diff --git a/proto/metapb.proto b/proto/metapb.proto deleted file mode 100644 index 5f4c4e2a40..0000000000 --- a/proto/metapb.proto +++ /dev/null @@ -1,29 +0,0 @@ -syntax = "proto3"; -package metapb; - - -message Cluster { - uint64 id = 1; - // max peer count for a region. - // pd will do the auto-balance if region peer count mismatches. - uint32 max_peer_count = 1024; - // more attributes...... -} - -enum PeerRole { - - Master = 0; - - Reader = 1; - - Write = 2; - - Proxyer = 3; - -} - -message Peer { - uint64 id = 1; - uint64 peer_id = 2; - PeerRole role = 3; -} diff --git a/proto/pdpb.proto b/proto/pdpb.proto deleted file mode 100644 index d48567dfaa..0000000000 --- a/proto/pdpb.proto +++ /dev/null @@ -1,82 +0,0 @@ -syntax = "proto3"; -package pdpb; - -import "metapb.proto"; - -service PD { - rpc Tso(stream TsoRequest) returns (stream TsoResponse) {} - rpc AllocID(AllocIDRequest) returns (AllocIDResponse) {} - rpc Heartbeat(stream HeartbeatRequest) returns (stream HeartbeatResponse) {} -} - -message Member { - // name is the name of the PD member. - string name = 1; - // member_id is the unique id of the PD member. - uint64 member_id = 2; - repeated string peer_urls = 3; - repeated string client_urls = 4; -} - -message RequestHeader { - // cluster_id is the ID of the cluster which be sent to. - uint64 cluster_id = 1; -} - -message ResponseHeader { - // cluster_id is the ID of the cluster which sent the response. - uint64 cluster_id = 1; - Error error = 2; -} - -enum ErrorType { - OK = 0; - UNKNOWN = 1; - NOT_BOOTSTRAPPED = 2; - STORE_TOMBSTONE = 3; - ALREADY_BOOTSTRAPPED = 4; - INCOMPATIBLE_VERSION = 5; - REGION_NOT_FOUND = 6; -} - -message Error { - ErrorType type = 1; - string message = 2; -} - -message TsoRequest { - RequestHeader header = 1; - - uint32 count = 2; -} - -message Timestamp { - int64 physical = 1; - int64 logical = 2; -} - -message TsoResponse { - ResponseHeader header = 1; - - uint32 count = 2; - Timestamp timestamp = 3; -} - -message AllocIDRequest { - RequestHeader header = 1; -} - -message AllocIDResponse { - ResponseHeader header = 1; - uint64 id = 2; -} - -message HeartbeatRequest { - RequestHeader header = 1; - metapb.Peer peer = 2; - -} - -message HeartbeatResponse { - ResponseHeader header = 1; -} diff --git a/proxy/CMakeLists.txt b/proxy/CMakeLists.txt deleted file mode 100644 index 027e7a3dca..0000000000 --- a/proxy/CMakeLists.txt +++ /dev/null @@ -1,203 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. -#------------------------------------------------------------------------------- - -cmake_minimum_required( VERSION 3.14 ) -message( STATUS "Building using CMake version: ${CMAKE_VERSION}" ) - -set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ) -include( Utils ) - -# **************************** Build time, type and code version **************************** -get_current_time( BUILD_TIME ) -message( STATUS "Build time = ${BUILD_TIME}" ) - -get_build_type( TARGET BUILD_TYPE - DEFAULT "Release" ) -message( STATUS "Build type = ${BUILD_TYPE}" ) - -get_milvus_version( TARGET MILVUS_VERSION - DEFAULT "0.10.0" ) -message( STATUS "Build version = ${MILVUS_VERSION}" ) - -get_last_commit_id( LAST_COMMIT_ID ) -message( STATUS "LAST_COMMIT_ID = ${LAST_COMMIT_ID}" ) - -#configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/src/version.h.in -# ${CMAKE_CURRENT_SOURCE_DIR}/src/version.h @ONLY ) - -# unset(CMAKE_EXPORT_COMPILE_COMMANDS CACHE) -set( CMAKE_EXPORT_COMPILE_COMMANDS ON ) - -# **************************** Project **************************** -project( milvus VERSION "${MILVUS_VERSION}" ) - -set( CMAKE_CXX_STANDARD 17 ) -set( CMAKE_CXX_STANDARD_REQUIRED on ) - -set( MILVUS_SOURCE_DIR ${PROJECT_SOURCE_DIR} ) -set( MILVUS_BINARY_DIR ${PROJECT_BINARY_DIR} ) -set( MILVUS_ENGINE_SRC ${PROJECT_SOURCE_DIR}/src ) -set( MILVUS_THIRDPARTY_SRC ${PROJECT_SOURCE_DIR}/thirdparty ) - -# This will set RPATH to all excutable TARGET -# self-installed dynamic libraries will be correctly linked by excutable -set( CMAKE_INSTALL_RPATH "/usr/lib" "${CMAKE_INSTALL_PREFIX}/lib" ) -set( CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE ) -# **************************** Dependencies **************************** -include( CTest ) -include( BuildUtils ) -include( DefineOptions ) - -include( ExternalProject ) -include( FetchContent ) -set( FETCHCONTENT_BASE_DIR ${MILVUS_BINARY_DIR}/3rdparty_download ) -set(FETCHCONTENT_QUIET OFF) -include( ThirdPartyPackages ) -find_package(OpenMP REQUIRED) -# **************************** Compiler arguments **************************** -message( STATUS "Building Milvus CPU version" ) - -append_flags( CMAKE_CXX_FLAGS FLAGS "-O3" ) - -append_flags( CMAKE_CXX_FLAGS - FLAGS - "-fPIC" - "-DELPP_THREAD_SAFE" - "-fopenmp" - "-Werror" - ) - -# **************************** Coding style check tools **************************** -find_package( ClangTools ) -set( BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build-support" ) -message(STATUS "CMAKE_SOURCE_DIR is at ${CMAKE_SOURCE_DIR}" ) - -if("$ENV{CMAKE_EXPORT_COMPILE_COMMANDS}" STREQUAL "1" OR CLANG_TIDY_FOUND) - # Generate a Clang compile_commands.json "compilation database" file for use - # with various development tools, such as Vim's YouCompleteMe plugin. - # See http://clang.llvm.org/docs/JSONCompilationDatabase.html - set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -endif() - -# -# "make lint" target -# -if ( NOT MILVUS_VERBOSE_LINT ) - set( MILVUS_LINT_QUIET "--quiet" ) -endif () - -if ( NOT LINT_EXCLUSIONS_FILE ) - # source files matching a glob from a line in this file - # will be excluded from linting (cpplint, clang-tidy, clang-format) - set( LINT_EXCLUSIONS_FILE ${BUILD_SUPPORT_DIR}/lint_exclusions.txt ) -endif () - -find_program( CPPLINT_BIN NAMES cpplint cpplint.py HINTS ${BUILD_SUPPORT_DIR} ) -message( STATUS "Found cpplint executable at ${CPPLINT_BIN}" ) - -# -# "make lint" targets -# -add_custom_target( lint - ${PYTHON_EXECUTABLE} ${BUILD_SUPPORT_DIR}/run_cpplint.py - --cpplint_binary ${CPPLINT_BIN} - --exclude_globs ${LINT_EXCLUSIONS_FILE} - --source_dir ${CMAKE_CURRENT_SOURCE_DIR} - ${MILVUS_LINT_QUIET} - ) - -# -# "make clang-format" and "make check-clang-format" targets -# -if ( ${CLANG_FORMAT_FOUND} ) - # runs clang format and updates files in place. - add_custom_target( clang-format - ${PYTHON_EXECUTABLE} ${BUILD_SUPPORT_DIR}/run_clang_format.py - --clang_format_binary ${CLANG_FORMAT_BIN} - --exclude_globs ${LINT_EXCLUSIONS_FILE} - --source_dir ${CMAKE_CURRENT_SOURCE_DIR}/src - --fix - ${MILVUS_LINT_QUIET} ) - - # runs clang format and exits with a non-zero exit code if any files need to be reformatted - add_custom_target( check-clang-format - ${PYTHON_EXECUTABLE} ${BUILD_SUPPORT_DIR}/run_clang_format.py - --clang_format_binary ${CLANG_FORMAT_BIN} - --exclude_globs ${LINT_EXCLUSIONS_FILE} - --source_dir ${CMAKE_CURRENT_SOURCE_DIR}/src - ${MILVUS_LINT_QUIET} ) -endif () - -# -# "make clang-tidy" and "make check-clang-tidy" targets -# -if ( ${CLANG_TIDY_FOUND} ) - # runs clang-tidy and attempts to fix any warning automatically - add_custom_target( clang-tidy - ${PYTHON_EXECUTABLE} ${BUILD_SUPPORT_DIR}/run_clang_tidy.py - --clang_tidy_binary ${CLANG_TIDY_BIN} - --exclude_globs ${LINT_EXCLUSIONS_FILE} - --compile_commands ${CMAKE_BINARY_DIR}/compile_commands.json - --source_dir ${CMAKE_CURRENT_SOURCE_DIR}/src - --fix - ${MILVUS_LINT_QUIET} ) - - # runs clang-tidy and exits with a non-zero exit code if any errors are found. - add_custom_target( check-clang-tidy - ${PYTHON_EXECUTABLE} ${BUILD_SUPPORT_DIR}/run_clang_tidy.py - --clang_tidy_binary ${CLANG_TIDY_BIN} - --exclude_globs ${LINT_EXCLUSIONS_FILE} - --compile_commands ${CMAKE_BINARY_DIR}/compile_commands.json - --source_dir ${CMAKE_CURRENT_SOURCE_DIR}/src - ${MILVUS_LINT_QUIET} ) -endif () - -# -# Validate and print out Milvus configuration options -# - -config_summary() - -# **************************** Source files **************************** - -add_subdirectory( thirdparty ) -add_subdirectory( src ) - -# Unittest lib -if ( BUILD_UNIT_TEST STREQUAL "ON" ) - if ( BUILD_COVERAGE STREQUAL "ON" ) - append_flags( CMAKE_CXX_FLAGS - FLAGS - "-fprofile-arcs" - "-ftest-coverage" - ) - endif () - append_flags( CMAKE_CXX_FLAGS FLAGS "-DELPP_DISABLE_LOGS") - - add_subdirectory( ${CMAKE_CURRENT_SOURCE_DIR}/unittest ) -endif () - - -add_custom_target( Clean-All COMMAND ${CMAKE_BUILD_TOOL} clean ) - -# **************************** Install **************************** - -if ( NOT MILVUS_DB_PATH ) - set( MILVUS_DB_PATH "${CMAKE_INSTALL_PREFIX}" ) -endif () - -if ( MILVUS_GPU_VERSION ) - set( GPU_ENABLE "true" ) -else () - set( GPU_ENABLE "false" ) -endif () diff --git a/proxy/build-support/code_style_clion.xml b/proxy/build-support/code_style_clion.xml deleted file mode 100644 index f2edeec3b6..0000000000 --- a/proxy/build-support/code_style_clion.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/proxy/build-support/cpplint.py b/proxy/build-support/cpplint.py deleted file mode 100755 index 8437d8cbaf..0000000000 --- a/proxy/build-support/cpplint.py +++ /dev/null @@ -1,6476 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2009 Google Inc. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -"""Does google-lint on c++ files. - -The goal of this script is to identify places in the code that *may* -be in non-compliance with google style. It does not attempt to fix -up these problems -- the point is to educate. It does also not -attempt to find all problems, or to ensure that everything it does -find is legitimately a problem. - -In particular, we can get very confused by /* and // inside strings! -We do a small hack, which is to ignore //'s with "'s after them on the -same line, but it is far from perfect (in either direction). -""" - -import codecs -import copy -import getopt -import glob -import itertools -import math # for log -import os -import re -import sre_compile -import string -import sys -import unicodedata -import xml.etree.ElementTree - -# if empty, use defaults -_header_extensions = set([]) - -# if empty, use defaults -_valid_extensions = set([]) - - -# Files with any of these extensions are considered to be -# header files (and will undergo different style checks). -# This set can be extended by using the --headers -# option (also supported in CPPLINT.cfg) -def GetHeaderExtensions(): - if not _header_extensions: - return set(['h', 'hpp', 'hxx', 'h++', 'cuh']) - return _header_extensions - -# The allowed extensions for file names -# This is set by --extensions flag -def GetAllExtensions(): - if not _valid_extensions: - return GetHeaderExtensions().union(set(['c', 'cc', 'cpp', 'cxx', 'c++', 'cu'])) - return _valid_extensions - -def GetNonHeaderExtensions(): - return GetAllExtensions().difference(GetHeaderExtensions()) - - -_USAGE = """ -Syntax: cpplint.py [--verbose=#] [--output=emacs|eclipse|vs7|junit] - [--filter=-x,+y,...] - [--counting=total|toplevel|detailed] [--repository=path] - [--root=subdir] [--linelength=digits] [--recursive] - [--exclude=path] - [--headers=ext1,ext2] - [--extensions=hpp,cpp,...] - [file] ... - - The style guidelines this tries to follow are those in - https://google.github.io/styleguide/cppguide.html - - Every problem is given a confidence score from 1-5, with 5 meaning we are - certain of the problem, and 1 meaning it could be a legitimate construct. - This will miss some errors, and is not a substitute for a code review. - - To suppress false-positive errors of a certain category, add a - 'NOLINT(category)' comment to the line. NOLINT or NOLINT(*) - suppresses errors of all categories on that line. - - The files passed in will be linted; at least one file must be provided. - Default linted extensions are %s. - Other file types will be ignored. - Change the extensions with the --extensions flag. - - Flags: - - output=emacs|eclipse|vs7|junit - By default, the output is formatted to ease emacs parsing. Output - compatible with eclipse (eclipse), Visual Studio (vs7), and JUnit - XML parsers such as those used in Jenkins and Bamboo may also be - used. Other formats are unsupported. - - verbose=# - Specify a number 0-5 to restrict errors to certain verbosity levels. - Errors with lower verbosity levels have lower confidence and are more - likely to be false positives. - - quiet - Supress output other than linting errors, such as information about - which files have been processed and excluded. - - filter=-x,+y,... - Specify a comma-separated list of category-filters to apply: only - error messages whose category names pass the filters will be printed. - (Category names are printed with the message and look like - "[whitespace/indent]".) Filters are evaluated left to right. - "-FOO" and "FOO" means "do not print categories that start with FOO". - "+FOO" means "do print categories that start with FOO". - - Examples: --filter=-whitespace,+whitespace/braces - --filter=whitespace,runtime/printf,+runtime/printf_format - --filter=-,+build/include_what_you_use - - To see a list of all the categories used in cpplint, pass no arg: - --filter= - - counting=total|toplevel|detailed - The total number of errors found is always printed. If - 'toplevel' is provided, then the count of errors in each of - the top-level categories like 'build' and 'whitespace' will - also be printed. If 'detailed' is provided, then a count - is provided for each category like 'build/class'. - - repository=path - The top level directory of the repository, used to derive the header - guard CPP variable. By default, this is determined by searching for a - path that contains .git, .hg, or .svn. When this flag is specified, the - given path is used instead. This option allows the header guard CPP - variable to remain consistent even if members of a team have different - repository root directories (such as when checking out a subdirectory - with SVN). In addition, users of non-mainstream version control systems - can use this flag to ensure readable header guard CPP variables. - - Examples: - Assuming that Alice checks out ProjectName and Bob checks out - ProjectName/trunk and trunk contains src/chrome/ui/browser.h, then - with no --repository flag, the header guard CPP variable will be: - - Alice => TRUNK_SRC_CHROME_BROWSER_UI_BROWSER_H_ - Bob => SRC_CHROME_BROWSER_UI_BROWSER_H_ - - If Alice uses the --repository=trunk flag and Bob omits the flag or - uses --repository=. then the header guard CPP variable will be: - - Alice => SRC_CHROME_BROWSER_UI_BROWSER_H_ - Bob => SRC_CHROME_BROWSER_UI_BROWSER_H_ - - root=subdir - The root directory used for deriving header guard CPP variables. This - directory is relative to the top level directory of the repository which - by default is determined by searching for a directory that contains .git, - .hg, or .svn but can also be controlled with the --repository flag. If - the specified directory does not exist, this flag is ignored. - - Examples: - Assuming that src is the top level directory of the repository, the - header guard CPP variables for src/chrome/browser/ui/browser.h are: - - No flag => CHROME_BROWSER_UI_BROWSER_H_ - --root=chrome => BROWSER_UI_BROWSER_H_ - --root=chrome/browser => UI_BROWSER_H_ - - linelength=digits - This is the allowed line length for the project. The default value is - 80 characters. - - Examples: - --linelength=120 - - recursive - Search for files to lint recursively. Each directory given in the list - of files to be linted is replaced by all files that descend from that - directory. Files with extensions not in the valid extensions list are - excluded. - - exclude=path - Exclude the given path from the list of files to be linted. Relative - paths are evaluated relative to the current directory and shell globbing - is performed. This flag can be provided multiple times to exclude - multiple files. - - Examples: - --exclude=one.cc - --exclude=src/*.cc - --exclude=src/*.cc --exclude=test/*.cc - - extensions=extension,extension,... - The allowed file extensions that cpplint will check - - Examples: - --extensions=%s - - headers=extension,extension,... - The allowed header extensions that cpplint will consider to be header files - (by default, only files with extensions %s - will be assumed to be headers) - - Examples: - --headers=%s - - cpplint.py supports per-directory configurations specified in CPPLINT.cfg - files. CPPLINT.cfg file can contain a number of key=value pairs. - Currently the following options are supported: - - set noparent - filter=+filter1,-filter2,... - exclude_files=regex - linelength=80 - root=subdir - - "set noparent" option prevents cpplint from traversing directory tree - upwards looking for more .cfg files in parent directories. This option - is usually placed in the top-level project directory. - - The "filter" option is similar in function to --filter flag. It specifies - message filters in addition to the |_DEFAULT_FILTERS| and those specified - through --filter command-line flag. - - "exclude_files" allows to specify a regular expression to be matched against - a file name. If the expression matches, the file is skipped and not run - through the linter. - - "linelength" specifies the allowed line length for the project. - - The "root" option is similar in function to the --root flag (see example - above). - - CPPLINT.cfg has an effect on files in the same directory and all - subdirectories, unless overridden by a nested configuration file. - - Example file: - filter=-build/include_order,+build/include_alpha - exclude_files=.*\\.cc - - The above example disables build/include_order warning and enables - build/include_alpha as well as excludes all .cc from being - processed by linter, in the current directory (where the .cfg - file is located) and all subdirectories. -""" % (list(GetAllExtensions()), - ','.join(list(GetAllExtensions())), - GetHeaderExtensions(), - ','.join(GetHeaderExtensions())) - -# We categorize each error message we print. Here are the categories. -# We want an explicit list so we can list them all in cpplint --filter=. -# If you add a new error message with a new category, add it to the list -# here! cpplint_unittest.py should tell you if you forget to do this. -_ERROR_CATEGORIES = [ - 'build/class', - 'build/c++11', - 'build/c++14', - 'build/c++tr1', - 'build/deprecated', - 'build/endif_comment', - 'build/explicit_make_pair', - 'build/forward_decl', - 'build/header_guard', - 'build/include', - 'build/include_subdir', - 'build/include_alpha', - 'build/include_order', - 'build/include_what_you_use', - 'build/namespaces_literals', - 'build/namespaces', - 'build/printf_format', - 'build/storage_class', - 'legal/copyright', - 'readability/alt_tokens', - 'readability/braces', - 'readability/casting', - 'readability/check', - 'readability/constructors', - 'readability/fn_size', - 'readability/inheritance', - 'readability/multiline_comment', - 'readability/multiline_string', - 'readability/namespace', - 'readability/nolint', - 'readability/nul', - 'readability/strings', - 'readability/todo', - 'readability/utf8', - 'runtime/arrays', - 'runtime/casting', - 'runtime/explicit', - 'runtime/int', - 'runtime/init', - 'runtime/invalid_increment', - 'runtime/member_string_references', - 'runtime/memset', - 'runtime/indentation_namespace', - 'runtime/operator', - 'runtime/printf', - 'runtime/printf_format', - 'runtime/references', - 'runtime/string', - 'runtime/threadsafe_fn', - 'runtime/vlog', - 'whitespace/blank_line', - 'whitespace/braces', - 'whitespace/comma', - 'whitespace/comments', - 'whitespace/empty_conditional_body', - 'whitespace/empty_if_body', - 'whitespace/empty_loop_body', - 'whitespace/end_of_line', - 'whitespace/ending_newline', - 'whitespace/forcolon', - 'whitespace/indent', - 'whitespace/line_length', - 'whitespace/newline', - 'whitespace/operators', - 'whitespace/parens', - 'whitespace/semicolon', - 'whitespace/tab', - 'whitespace/todo', - ] - -# These error categories are no longer enforced by cpplint, but for backwards- -# compatibility they may still appear in NOLINT comments. -_LEGACY_ERROR_CATEGORIES = [ - 'readability/streams', - 'readability/function', - ] - -# The default state of the category filter. This is overridden by the --filter= -# flag. By default all errors are on, so only add here categories that should be -# off by default (i.e., categories that must be enabled by the --filter= flags). -# All entries here should start with a '-' or '+', as in the --filter= flag. -_DEFAULT_FILTERS = ['-build/include_alpha'] - -# The default list of categories suppressed for C (not C++) files. -_DEFAULT_C_SUPPRESSED_CATEGORIES = [ - 'readability/casting', - ] - -# The default list of categories suppressed for Linux Kernel files. -_DEFAULT_KERNEL_SUPPRESSED_CATEGORIES = [ - 'whitespace/tab', - ] - -# We used to check for high-bit characters, but after much discussion we -# decided those were OK, as long as they were in UTF-8 and didn't represent -# hard-coded international strings, which belong in a separate i18n file. - -# C++ headers -_CPP_HEADERS = frozenset([ - # Legacy - 'algobase.h', - 'algo.h', - 'alloc.h', - 'builtinbuf.h', - 'bvector.h', - 'complex.h', - 'defalloc.h', - 'deque.h', - 'editbuf.h', - 'fstream.h', - 'function.h', - 'hash_map', - 'hash_map.h', - 'hash_set', - 'hash_set.h', - 'hashtable.h', - 'heap.h', - 'indstream.h', - 'iomanip.h', - 'iostream.h', - 'istream.h', - 'iterator.h', - 'list.h', - 'map.h', - 'multimap.h', - 'multiset.h', - 'ostream.h', - 'pair.h', - 'parsestream.h', - 'pfstream.h', - 'procbuf.h', - 'pthread_alloc', - 'pthread_alloc.h', - 'rope', - 'rope.h', - 'ropeimpl.h', - 'set.h', - 'slist', - 'slist.h', - 'stack.h', - 'stdiostream.h', - 'stl_alloc.h', - 'stl_relops.h', - 'streambuf.h', - 'stream.h', - 'strfile.h', - 'strstream.h', - 'tempbuf.h', - 'tree.h', - 'type_traits.h', - 'vector.h', - # 17.6.1.2 C++ library headers - 'algorithm', - 'array', - 'atomic', - 'bitset', - 'chrono', - 'codecvt', - 'complex', - 'condition_variable', - 'deque', - 'exception', - 'forward_list', - 'fstream', - 'functional', - 'future', - 'initializer_list', - 'iomanip', - 'ios', - 'iosfwd', - 'iostream', - 'istream', - 'iterator', - 'limits', - 'list', - 'locale', - 'map', - 'memory', - 'mutex', - 'new', - 'numeric', - 'ostream', - 'queue', - 'random', - 'ratio', - 'regex', - 'scoped_allocator', - 'set', - 'sstream', - 'stack', - 'stdexcept', - 'streambuf', - 'string', - 'strstream', - 'system_error', - 'thread', - 'tuple', - 'typeindex', - 'typeinfo', - 'type_traits', - 'unordered_map', - 'unordered_set', - 'utility', - 'valarray', - 'vector', - # 17.6.1.2 C++ headers for C library facilities - 'cassert', - 'ccomplex', - 'cctype', - 'cerrno', - 'cfenv', - 'cfloat', - 'cinttypes', - 'ciso646', - 'climits', - 'clocale', - 'cmath', - 'csetjmp', - 'csignal', - 'cstdalign', - 'cstdarg', - 'cstdbool', - 'cstddef', - 'cstdint', - 'cstdio', - 'cstdlib', - 'cstring', - 'ctgmath', - 'ctime', - 'cuchar', - 'cwchar', - 'cwctype', - ]) - -# Type names -_TYPES = re.compile( - r'^(?:' - # [dcl.type.simple] - r'(char(16_t|32_t)?)|wchar_t|' - r'bool|short|int|long|signed|unsigned|float|double|' - # [support.types] - r'(ptrdiff_t|size_t|max_align_t|nullptr_t)|' - # [cstdint.syn] - r'(u?int(_fast|_least)?(8|16|32|64)_t)|' - r'(u?int(max|ptr)_t)|' - r')$') - - -# These headers are excluded from [build/include] and [build/include_order] -# checks: -# - Anything not following google file name conventions (containing an -# uppercase character, such as Python.h or nsStringAPI.h, for example). -# - Lua headers. -_THIRD_PARTY_HEADERS_PATTERN = re.compile( - r'^(?:[^/]*[A-Z][^/]*\.h|lua\.h|lauxlib\.h|lualib\.h)$') - -# Pattern for matching FileInfo.BaseName() against test file name -_test_suffixes = ['_test', '_regtest', '_unittest'] -_TEST_FILE_SUFFIX = '(' + '|'.join(_test_suffixes) + r')$' - -# Pattern that matches only complete whitespace, possibly across multiple lines. -_EMPTY_CONDITIONAL_BODY_PATTERN = re.compile(r'^\s*$', re.DOTALL) - -# Assertion macros. These are defined in base/logging.h and -# testing/base/public/gunit.h. -_CHECK_MACROS = [ - 'DCHECK', 'CHECK', - 'EXPECT_TRUE', 'ASSERT_TRUE', - 'EXPECT_FALSE', 'ASSERT_FALSE', - ] - -# Replacement macros for CHECK/DCHECK/EXPECT_TRUE/EXPECT_FALSE -_CHECK_REPLACEMENT = dict([(macro_var, {}) for macro_var in _CHECK_MACROS]) - -for op, replacement in [('==', 'EQ'), ('!=', 'NE'), - ('>=', 'GE'), ('>', 'GT'), - ('<=', 'LE'), ('<', 'LT')]: - _CHECK_REPLACEMENT['DCHECK'][op] = 'DCHECK_%s' % replacement - _CHECK_REPLACEMENT['CHECK'][op] = 'CHECK_%s' % replacement - _CHECK_REPLACEMENT['EXPECT_TRUE'][op] = 'EXPECT_%s' % replacement - _CHECK_REPLACEMENT['ASSERT_TRUE'][op] = 'ASSERT_%s' % replacement - -for op, inv_replacement in [('==', 'NE'), ('!=', 'EQ'), - ('>=', 'LT'), ('>', 'LE'), - ('<=', 'GT'), ('<', 'GE')]: - _CHECK_REPLACEMENT['EXPECT_FALSE'][op] = 'EXPECT_%s' % inv_replacement - _CHECK_REPLACEMENT['ASSERT_FALSE'][op] = 'ASSERT_%s' % inv_replacement - -# Alternative tokens and their replacements. For full list, see section 2.5 -# Alternative tokens [lex.digraph] in the C++ standard. -# -# Digraphs (such as '%:') are not included here since it's a mess to -# match those on a word boundary. -_ALT_TOKEN_REPLACEMENT = { - 'and': '&&', - 'bitor': '|', - 'or': '||', - 'xor': '^', - 'compl': '~', - 'bitand': '&', - 'and_eq': '&=', - 'or_eq': '|=', - 'xor_eq': '^=', - 'not': '!', - 'not_eq': '!=' - } - -# Compile regular expression that matches all the above keywords. The "[ =()]" -# bit is meant to avoid matching these keywords outside of boolean expressions. -# -# False positives include C-style multi-line comments and multi-line strings -# but those have always been troublesome for cpplint. -_ALT_TOKEN_REPLACEMENT_PATTERN = re.compile( - r'[ =()](' + ('|'.join(_ALT_TOKEN_REPLACEMENT.keys())) + r')(?=[ (]|$)') - - -# These constants define types of headers for use with -# _IncludeState.CheckNextIncludeOrder(). -_C_SYS_HEADER = 1 -_CPP_SYS_HEADER = 2 -_LIKELY_MY_HEADER = 3 -_POSSIBLE_MY_HEADER = 4 -_OTHER_HEADER = 5 - -# These constants define the current inline assembly state -_NO_ASM = 0 # Outside of inline assembly block -_INSIDE_ASM = 1 # Inside inline assembly block -_END_ASM = 2 # Last line of inline assembly block -_BLOCK_ASM = 3 # The whole block is an inline assembly block - -# Match start of assembly blocks -_MATCH_ASM = re.compile(r'^\s*(?:asm|_asm|__asm|__asm__)' - r'(?:\s+(volatile|__volatile__))?' - r'\s*[{(]') - -# Match strings that indicate we're working on a C (not C++) file. -_SEARCH_C_FILE = re.compile(r'\b(?:LINT_C_FILE|' - r'vim?:\s*.*(\s*|:)filetype=c(\s*|:|$))') - -# Match string that indicates we're working on a Linux Kernel file. -_SEARCH_KERNEL_FILE = re.compile(r'\b(?:LINT_KERNEL_FILE)') - -_regexp_compile_cache = {} - -# {str, set(int)}: a map from error categories to sets of linenumbers -# on which those errors are expected and should be suppressed. -_error_suppressions = {} - -# The root directory used for deriving header guard CPP variable. -# This is set by --root flag. -_root = None - -# The top level repository directory. If set, _root is calculated relative to -# this directory instead of the directory containing version control artifacts. -# This is set by the --repository flag. -_repository = None - -# Files to exclude from linting. This is set by the --exclude flag. -_excludes = None - -# Whether to supress PrintInfo messages -_quiet = False - -# The allowed line length of files. -# This is set by --linelength flag. -_line_length = 80 - -try: - xrange(1, 0) -except NameError: - # -- pylint: disable=redefined-builtin - xrange = range - -try: - unicode -except NameError: - # -- pylint: disable=redefined-builtin - basestring = unicode = str - -try: - long(2) -except NameError: - # -- pylint: disable=redefined-builtin - long = int - -if sys.version_info < (3,): - # -- pylint: disable=no-member - # BINARY_TYPE = str - itervalues = dict.itervalues - iteritems = dict.iteritems -else: - # BINARY_TYPE = bytes - itervalues = dict.values - iteritems = dict.items - -def unicode_escape_decode(x): - if sys.version_info < (3,): - return codecs.unicode_escape_decode(x)[0] - else: - return x - -# {str, bool}: a map from error categories to booleans which indicate if the -# category should be suppressed for every line. -_global_error_suppressions = {} - - - - -def ParseNolintSuppressions(filename, raw_line, linenum, error): - """Updates the global list of line error-suppressions. - - Parses any NOLINT comments on the current line, updating the global - error_suppressions store. Reports an error if the NOLINT comment - was malformed. - - Args: - filename: str, the name of the input file. - raw_line: str, the line of input text, with comments. - linenum: int, the number of the current line. - error: function, an error handler. - """ - matched = Search(r'\bNOLINT(NEXTLINE)?\b(\([^)]+\))?', raw_line) - if matched: - if matched.group(1): - suppressed_line = linenum + 1 - else: - suppressed_line = linenum - category = matched.group(2) - if category in (None, '(*)'): # => "suppress all" - _error_suppressions.setdefault(None, set()).add(suppressed_line) - else: - if category.startswith('(') and category.endswith(')'): - category = category[1:-1] - if category in _ERROR_CATEGORIES: - _error_suppressions.setdefault(category, set()).add(suppressed_line) - elif category not in _LEGACY_ERROR_CATEGORIES: - error(filename, linenum, 'readability/nolint', 5, - 'Unknown NOLINT error category: %s' % category) - - -def ProcessGlobalSuppresions(lines): - """Updates the list of global error suppressions. - - Parses any lint directives in the file that have global effect. - - Args: - lines: An array of strings, each representing a line of the file, with the - last element being empty if the file is terminated with a newline. - """ - for line in lines: - if _SEARCH_C_FILE.search(line): - for category in _DEFAULT_C_SUPPRESSED_CATEGORIES: - _global_error_suppressions[category] = True - if _SEARCH_KERNEL_FILE.search(line): - for category in _DEFAULT_KERNEL_SUPPRESSED_CATEGORIES: - _global_error_suppressions[category] = True - - -def ResetNolintSuppressions(): - """Resets the set of NOLINT suppressions to empty.""" - _error_suppressions.clear() - _global_error_suppressions.clear() - - -def IsErrorSuppressedByNolint(category, linenum): - """Returns true if the specified error category is suppressed on this line. - - Consults the global error_suppressions map populated by - ParseNolintSuppressions/ProcessGlobalSuppresions/ResetNolintSuppressions. - - Args: - category: str, the category of the error. - linenum: int, the current line number. - Returns: - bool, True iff the error should be suppressed due to a NOLINT comment or - global suppression. - """ - return (_global_error_suppressions.get(category, False) or - linenum in _error_suppressions.get(category, set()) or - linenum in _error_suppressions.get(None, set())) - - -def Match(pattern, s): - """Matches the string with the pattern, caching the compiled regexp.""" - # The regexp compilation caching is inlined in both Match and Search for - # performance reasons; factoring it out into a separate function turns out - # to be noticeably expensive. - if pattern not in _regexp_compile_cache: - _regexp_compile_cache[pattern] = sre_compile.compile(pattern) - return _regexp_compile_cache[pattern].match(s) - - -def ReplaceAll(pattern, rep, s): - """Replaces instances of pattern in a string with a replacement. - - The compiled regex is kept in a cache shared by Match and Search. - - Args: - pattern: regex pattern - rep: replacement text - s: search string - - Returns: - string with replacements made (or original string if no replacements) - """ - if pattern not in _regexp_compile_cache: - _regexp_compile_cache[pattern] = sre_compile.compile(pattern) - return _regexp_compile_cache[pattern].sub(rep, s) - - -def Search(pattern, s): - """Searches the string for the pattern, caching the compiled regexp.""" - if pattern not in _regexp_compile_cache: - _regexp_compile_cache[pattern] = sre_compile.compile(pattern) - return _regexp_compile_cache[pattern].search(s) - - -def _IsSourceExtension(s): - """File extension (excluding dot) matches a source file extension.""" - return s in GetNonHeaderExtensions() - - -class _IncludeState(object): - """Tracks line numbers for includes, and the order in which includes appear. - - include_list contains list of lists of (header, line number) pairs. - It's a lists of lists rather than just one flat list to make it - easier to update across preprocessor boundaries. - - Call CheckNextIncludeOrder() once for each header in the file, passing - in the type constants defined above. Calls in an illegal order will - raise an _IncludeError with an appropriate error message. - - """ - # self._section will move monotonically through this set. If it ever - # needs to move backwards, CheckNextIncludeOrder will raise an error. - _INITIAL_SECTION = 0 - _MY_H_SECTION = 1 - _C_SECTION = 2 - _CPP_SECTION = 3 - _OTHER_H_SECTION = 4 - - _TYPE_NAMES = { - _C_SYS_HEADER: 'C system header', - _CPP_SYS_HEADER: 'C++ system header', - _LIKELY_MY_HEADER: 'header this file implements', - _POSSIBLE_MY_HEADER: 'header this file may implement', - _OTHER_HEADER: 'other header', - } - _SECTION_NAMES = { - _INITIAL_SECTION: "... nothing. (This can't be an error.)", - _MY_H_SECTION: 'a header this file implements', - _C_SECTION: 'C system header', - _CPP_SECTION: 'C++ system header', - _OTHER_H_SECTION: 'other header', - } - - def __init__(self): - self.include_list = [[]] - self._section = None - self._last_header = None - self.ResetSection('') - - def FindHeader(self, header): - """Check if a header has already been included. - - Args: - header: header to check. - Returns: - Line number of previous occurrence, or -1 if the header has not - been seen before. - """ - for section_list in self.include_list: - for f in section_list: - if f[0] == header: - return f[1] - return -1 - - def ResetSection(self, directive): - """Reset section checking for preprocessor directive. - - Args: - directive: preprocessor directive (e.g. "if", "else"). - """ - # The name of the current section. - self._section = self._INITIAL_SECTION - # The path of last found header. - self._last_header = '' - - # Update list of includes. Note that we never pop from the - # include list. - if directive in ('if', 'ifdef', 'ifndef'): - self.include_list.append([]) - elif directive in ('else', 'elif'): - self.include_list[-1] = [] - - def SetLastHeader(self, header_path): - self._last_header = header_path - - def CanonicalizeAlphabeticalOrder(self, header_path): - """Returns a path canonicalized for alphabetical comparison. - - - replaces "-" with "_" so they both cmp the same. - - removes '-inl' since we don't require them to be after the main header. - - lowercase everything, just in case. - - Args: - header_path: Path to be canonicalized. - - Returns: - Canonicalized path. - """ - return header_path.replace('-inl.h', '.h').replace('-', '_').lower() - - def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path): - """Check if a header is in alphabetical order with the previous header. - - Args: - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - header_path: Canonicalized header to be checked. - - Returns: - Returns true if the header is in alphabetical order. - """ - # If previous section is different from current section, _last_header will - # be reset to empty string, so it's always less than current header. - # - # If previous line was a blank line, assume that the headers are - # intentionally sorted the way they are. - if (self._last_header > header_path and - Match(r'^\s*#\s*include\b', clean_lines.elided[linenum - 1])): - return False - return True - - def CheckNextIncludeOrder(self, header_type): - """Returns a non-empty error message if the next header is out of order. - - This function also updates the internal state to be ready to check - the next include. - - Args: - header_type: One of the _XXX_HEADER constants defined above. - - Returns: - The empty string if the header is in the right order, or an - error message describing what's wrong. - - """ - error_message = ('Found %s after %s' % - (self._TYPE_NAMES[header_type], - self._SECTION_NAMES[self._section])) - - last_section = self._section - - if header_type == _C_SYS_HEADER: - if self._section <= self._C_SECTION: - self._section = self._C_SECTION - else: - self._last_header = '' - return error_message - elif header_type == _CPP_SYS_HEADER: - if self._section <= self._CPP_SECTION: - self._section = self._CPP_SECTION - else: - self._last_header = '' - return error_message - elif header_type == _LIKELY_MY_HEADER: - if self._section <= self._MY_H_SECTION: - self._section = self._MY_H_SECTION - else: - self._section = self._OTHER_H_SECTION - elif header_type == _POSSIBLE_MY_HEADER: - if self._section <= self._MY_H_SECTION: - self._section = self._MY_H_SECTION - else: - # This will always be the fallback because we're not sure - # enough that the header is associated with this file. - self._section = self._OTHER_H_SECTION - else: - assert header_type == _OTHER_HEADER - self._section = self._OTHER_H_SECTION - - if last_section != self._section: - self._last_header = '' - - return '' - - -class _CppLintState(object): - """Maintains module-wide state..""" - - def __init__(self): - self.verbose_level = 1 # global setting. - self.error_count = 0 # global count of reported errors - # filters to apply when emitting error messages - self.filters = _DEFAULT_FILTERS[:] - # backup of filter list. Used to restore the state after each file. - self._filters_backup = self.filters[:] - self.counting = 'total' # In what way are we counting errors? - self.errors_by_category = {} # string to int dict storing error counts - - # output format: - # "emacs" - format that emacs can parse (default) - # "eclipse" - format that eclipse can parse - # "vs7" - format that Microsoft Visual Studio 7 can parse - # "junit" - format that Jenkins, Bamboo, etc can parse - self.output_format = 'emacs' - - # For JUnit output, save errors and failures until the end so that they - # can be written into the XML - self._junit_errors = [] - self._junit_failures = [] - - def SetOutputFormat(self, output_format): - """Sets the output format for errors.""" - self.output_format = output_format - - def SetVerboseLevel(self, level): - """Sets the module's verbosity, and returns the previous setting.""" - last_verbose_level = self.verbose_level - self.verbose_level = level - return last_verbose_level - - def SetCountingStyle(self, counting_style): - """Sets the module's counting options.""" - self.counting = counting_style - - def SetFilters(self, filters): - """Sets the error-message filters. - - These filters are applied when deciding whether to emit a given - error message. - - Args: - filters: A string of comma-separated filters (eg "+whitespace/indent"). - Each filter should start with + or -; else we die. - - Raises: - ValueError: The comma-separated filters did not all start with '+' or '-'. - E.g. "-,+whitespace,-whitespace/indent,whitespace/badfilter" - """ - # Default filters always have less priority than the flag ones. - self.filters = _DEFAULT_FILTERS[:] - self.AddFilters(filters) - - def AddFilters(self, filters): - """ Adds more filters to the existing list of error-message filters. """ - for filt in filters.split(','): - clean_filt = filt.strip() - if clean_filt: - self.filters.append(clean_filt) - for filt in self.filters: - if not (filt.startswith('+') or filt.startswith('-')): - raise ValueError('Every filter in --filters must start with + or -' - ' (%s does not)' % filt) - - def BackupFilters(self): - """ Saves the current filter list to backup storage.""" - self._filters_backup = self.filters[:] - - def RestoreFilters(self): - """ Restores filters previously backed up.""" - self.filters = self._filters_backup[:] - - def ResetErrorCounts(self): - """Sets the module's error statistic back to zero.""" - self.error_count = 0 - self.errors_by_category = {} - - def IncrementErrorCount(self, category): - """Bumps the module's error statistic.""" - self.error_count += 1 - if self.counting in ('toplevel', 'detailed'): - if self.counting != 'detailed': - category = category.split('/')[0] - if category not in self.errors_by_category: - self.errors_by_category[category] = 0 - self.errors_by_category[category] += 1 - - def PrintErrorCounts(self): - """Print a summary of errors by category, and the total.""" - for category, count in sorted(iteritems(self.errors_by_category)): - self.PrintInfo('Category \'%s\' errors found: %d\n' % - (category, count)) - if self.error_count > 0: - self.PrintInfo('Total errors found: %d\n' % self.error_count) - - def PrintInfo(self, message): - if not _quiet and self.output_format != 'junit': - sys.stderr.write(message) - - def PrintError(self, message): - if self.output_format == 'junit': - self._junit_errors.append(message) - else: - sys.stderr.write(message) - - def AddJUnitFailure(self, filename, linenum, message, category, confidence): - self._junit_failures.append((filename, linenum, message, category, - confidence)) - - def FormatJUnitXML(self): - num_errors = len(self._junit_errors) - num_failures = len(self._junit_failures) - - testsuite = xml.etree.ElementTree.Element('testsuite') - testsuite.attrib['name'] = 'cpplint' - testsuite.attrib['errors'] = str(num_errors) - testsuite.attrib['failures'] = str(num_failures) - - if num_errors == 0 and num_failures == 0: - testsuite.attrib['tests'] = str(1) - xml.etree.ElementTree.SubElement(testsuite, 'testcase', name='passed') - - else: - testsuite.attrib['tests'] = str(num_errors + num_failures) - if num_errors > 0: - testcase = xml.etree.ElementTree.SubElement(testsuite, 'testcase') - testcase.attrib['name'] = 'errors' - error = xml.etree.ElementTree.SubElement(testcase, 'error') - error.text = '\n'.join(self._junit_errors) - if num_failures > 0: - # Group failures by file - failed_file_order = [] - failures_by_file = {} - for failure in self._junit_failures: - failed_file = failure[0] - if failed_file not in failed_file_order: - failed_file_order.append(failed_file) - failures_by_file[failed_file] = [] - failures_by_file[failed_file].append(failure) - # Create a testcase for each file - for failed_file in failed_file_order: - failures = failures_by_file[failed_file] - testcase = xml.etree.ElementTree.SubElement(testsuite, 'testcase') - testcase.attrib['name'] = failed_file - failure = xml.etree.ElementTree.SubElement(testcase, 'failure') - template = '{0}: {1} [{2}] [{3}]' - texts = [template.format(f[1], f[2], f[3], f[4]) for f in failures] - failure.text = '\n'.join(texts) - - xml_decl = '\n' - return xml_decl + xml.etree.ElementTree.tostring(testsuite, 'utf-8').decode('utf-8') - - -_cpplint_state = _CppLintState() - - -def _OutputFormat(): - """Gets the module's output format.""" - return _cpplint_state.output_format - - -def _SetOutputFormat(output_format): - """Sets the module's output format.""" - _cpplint_state.SetOutputFormat(output_format) - - -def _VerboseLevel(): - """Returns the module's verbosity setting.""" - return _cpplint_state.verbose_level - - -def _SetVerboseLevel(level): - """Sets the module's verbosity, and returns the previous setting.""" - return _cpplint_state.SetVerboseLevel(level) - - -def _SetCountingStyle(level): - """Sets the module's counting options.""" - _cpplint_state.SetCountingStyle(level) - - -def _Filters(): - """Returns the module's list of output filters, as a list.""" - return _cpplint_state.filters - - -def _SetFilters(filters): - """Sets the module's error-message filters. - - These filters are applied when deciding whether to emit a given - error message. - - Args: - filters: A string of comma-separated filters (eg "whitespace/indent"). - Each filter should start with + or -; else we die. - """ - _cpplint_state.SetFilters(filters) - -def _AddFilters(filters): - """Adds more filter overrides. - - Unlike _SetFilters, this function does not reset the current list of filters - available. - - Args: - filters: A string of comma-separated filters (eg "whitespace/indent"). - Each filter should start with + or -; else we die. - """ - _cpplint_state.AddFilters(filters) - -def _BackupFilters(): - """ Saves the current filter list to backup storage.""" - _cpplint_state.BackupFilters() - -def _RestoreFilters(): - """ Restores filters previously backed up.""" - _cpplint_state.RestoreFilters() - -class _FunctionState(object): - """Tracks current function name and the number of lines in its body.""" - - _NORMAL_TRIGGER = 250 # for --v=0, 500 for --v=1, etc. - _TEST_TRIGGER = 400 # about 50% more than _NORMAL_TRIGGER. - - def __init__(self): - self.in_a_function = False - self.lines_in_function = 0 - self.current_function = '' - - def Begin(self, function_name): - """Start analyzing function body. - - Args: - function_name: The name of the function being tracked. - """ - self.in_a_function = True - self.lines_in_function = 0 - self.current_function = function_name - - def Count(self): - """Count line in current function body.""" - if self.in_a_function: - self.lines_in_function += 1 - - def Check(self, error, filename, linenum): - """Report if too many lines in function body. - - Args: - error: The function to call with any errors found. - filename: The name of the current file. - linenum: The number of the line to check. - """ - if not self.in_a_function: - return - - if Match(r'T(EST|est)', self.current_function): - base_trigger = self._TEST_TRIGGER - else: - base_trigger = self._NORMAL_TRIGGER - trigger = base_trigger * 2**_VerboseLevel() - - if self.lines_in_function > trigger: - error_level = int(math.log(self.lines_in_function / base_trigger, 2)) - # 50 => 0, 100 => 1, 200 => 2, 400 => 3, 800 => 4, 1600 => 5, ... - if error_level > 5: - error_level = 5 - error(filename, linenum, 'readability/fn_size', error_level, - 'Small and focused functions are preferred:' - ' %s has %d non-comment lines' - ' (error triggered by exceeding %d lines).' % ( - self.current_function, self.lines_in_function, trigger)) - - def End(self): - """Stop analyzing function body.""" - self.in_a_function = False - - -class _IncludeError(Exception): - """Indicates a problem with the include order in a file.""" - pass - - -class FileInfo(object): - """Provides utility functions for filenames. - - FileInfo provides easy access to the components of a file's path - relative to the project root. - """ - - def __init__(self, filename): - self._filename = filename - - def FullName(self): - """Make Windows paths like Unix.""" - return os.path.abspath(self._filename).replace('\\', '/') - - def RepositoryName(self): - r"""FullName after removing the local path to the repository. - - If we have a real absolute path name here we can try to do something smart: - detecting the root of the checkout and truncating /path/to/checkout from - the name so that we get header guards that don't include things like - "C:\Documents and Settings\..." or "/home/username/..." in them and thus - people on different computers who have checked the source out to different - locations won't see bogus errors. - """ - fullname = self.FullName() - - if os.path.exists(fullname): - project_dir = os.path.dirname(fullname) - - # If the user specified a repository path, it exists, and the file is - # contained in it, use the specified repository path - if _repository: - repo = FileInfo(_repository).FullName() - root_dir = project_dir - while os.path.exists(root_dir): - # allow case insensitive compare on Windows - if os.path.normcase(root_dir) == os.path.normcase(repo): - return os.path.relpath(fullname, root_dir).replace('\\', '/') - one_up_dir = os.path.dirname(root_dir) - if one_up_dir == root_dir: - break - root_dir = one_up_dir - - if os.path.exists(os.path.join(project_dir, ".svn")): - # If there's a .svn file in the current directory, we recursively look - # up the directory tree for the top of the SVN checkout - root_dir = project_dir - one_up_dir = os.path.dirname(root_dir) - while os.path.exists(os.path.join(one_up_dir, ".svn")): - root_dir = os.path.dirname(root_dir) - one_up_dir = os.path.dirname(one_up_dir) - - prefix = os.path.commonprefix([root_dir, project_dir]) - return fullname[len(prefix) + 1:] - - # Not SVN <= 1.6? Try to find a git, hg, or svn top level directory by - # searching up from the current path. - root_dir = current_dir = os.path.dirname(fullname) - while current_dir != os.path.dirname(current_dir): - if (os.path.exists(os.path.join(current_dir, ".git")) or - os.path.exists(os.path.join(current_dir, ".hg")) or - os.path.exists(os.path.join(current_dir, ".svn"))): - root_dir = current_dir - current_dir = os.path.dirname(current_dir) - - if (os.path.exists(os.path.join(root_dir, ".git")) or - os.path.exists(os.path.join(root_dir, ".hg")) or - os.path.exists(os.path.join(root_dir, ".svn"))): - prefix = os.path.commonprefix([root_dir, project_dir]) - return fullname[len(prefix) + 1:] - - # Don't know what to do; header guard warnings may be wrong... - return fullname - - def Split(self): - """Splits the file into the directory, basename, and extension. - - For 'chrome/browser/browser.cc', Split() would - return ('chrome/browser', 'browser', '.cc') - - Returns: - A tuple of (directory, basename, extension). - """ - - googlename = self.RepositoryName() - project, rest = os.path.split(googlename) - return (project,) + os.path.splitext(rest) - - def BaseName(self): - """File base name - text after the final slash, before the final period.""" - return self.Split()[1] - - def Extension(self): - """File extension - text following the final period, includes that period.""" - return self.Split()[2] - - def NoExtension(self): - """File has no source file extension.""" - return '/'.join(self.Split()[0:2]) - - def IsSource(self): - """File has a source file extension.""" - return _IsSourceExtension(self.Extension()[1:]) - - -def _ShouldPrintError(category, confidence, linenum): - """If confidence >= verbose, category passes filter and is not suppressed.""" - - # There are three ways we might decide not to print an error message: - # a "NOLINT(category)" comment appears in the source, - # the verbosity level isn't high enough, or the filters filter it out. - if IsErrorSuppressedByNolint(category, linenum): - return False - - if confidence < _cpplint_state.verbose_level: - return False - - is_filtered = False - for one_filter in _Filters(): - if one_filter.startswith('-'): - if category.startswith(one_filter[1:]): - is_filtered = True - elif one_filter.startswith('+'): - if category.startswith(one_filter[1:]): - is_filtered = False - else: - assert False # should have been checked for in SetFilter. - if is_filtered: - return False - - return True - - -def Error(filename, linenum, category, confidence, message): - """Logs the fact we've found a lint error. - - We log where the error was found, and also our confidence in the error, - that is, how certain we are this is a legitimate style regression, and - not a misidentification or a use that's sometimes justified. - - False positives can be suppressed by the use of - "cpplint(category)" comments on the offending line. These are - parsed into _error_suppressions. - - Args: - filename: The name of the file containing the error. - linenum: The number of the line containing the error. - category: A string used to describe the "category" this bug - falls under: "whitespace", say, or "runtime". Categories - may have a hierarchy separated by slashes: "whitespace/indent". - confidence: A number from 1-5 representing a confidence score for - the error, with 5 meaning that we are certain of the problem, - and 1 meaning that it could be a legitimate construct. - message: The error message. - """ - if _ShouldPrintError(category, confidence, linenum): - _cpplint_state.IncrementErrorCount(category) - if _cpplint_state.output_format == 'vs7': - _cpplint_state.PrintError('%s(%s): warning: %s [%s] [%d]\n' % ( - filename, linenum, message, category, confidence)) - elif _cpplint_state.output_format == 'eclipse': - sys.stderr.write('%s:%s: warning: %s [%s] [%d]\n' % ( - filename, linenum, message, category, confidence)) - elif _cpplint_state.output_format == 'junit': - _cpplint_state.AddJUnitFailure(filename, linenum, message, category, - confidence) - else: - final_message = '%s:%s: %s [%s] [%d]\n' % ( - filename, linenum, message, category, confidence) - sys.stderr.write(final_message) - -# Matches standard C++ escape sequences per 2.13.2.3 of the C++ standard. -_RE_PATTERN_CLEANSE_LINE_ESCAPES = re.compile( - r'\\([abfnrtv?"\\\']|\d+|x[0-9a-fA-F]+)') -# Match a single C style comment on the same line. -_RE_PATTERN_C_COMMENTS = r'/\*(?:[^*]|\*(?!/))*\*/' -# Matches multi-line C style comments. -# This RE is a little bit more complicated than one might expect, because we -# have to take care of space removals tools so we can handle comments inside -# statements better. -# The current rule is: We only clear spaces from both sides when we're at the -# end of the line. Otherwise, we try to remove spaces from the right side, -# if this doesn't work we try on left side but only if there's a non-character -# on the right. -_RE_PATTERN_CLEANSE_LINE_C_COMMENTS = re.compile( - r'(\s*' + _RE_PATTERN_C_COMMENTS + r'\s*$|' + - _RE_PATTERN_C_COMMENTS + r'\s+|' + - r'\s+' + _RE_PATTERN_C_COMMENTS + r'(?=\W)|' + - _RE_PATTERN_C_COMMENTS + r')') - - -def IsCppString(line): - """Does line terminate so, that the next symbol is in string constant. - - This function does not consider single-line nor multi-line comments. - - Args: - line: is a partial line of code starting from the 0..n. - - Returns: - True, if next character appended to 'line' is inside a - string constant. - """ - - line = line.replace(r'\\', 'XX') # after this, \\" does not match to \" - return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1 - - -def CleanseRawStrings(raw_lines): - """Removes C++11 raw strings from lines. - - Before: - static const char kData[] = R"( - multi-line string - )"; - - After: - static const char kData[] = "" - (replaced by blank line) - ""; - - Args: - raw_lines: list of raw lines. - - Returns: - list of lines with C++11 raw strings replaced by empty strings. - """ - - delimiter = None - lines_without_raw_strings = [] - for line in raw_lines: - if delimiter: - # Inside a raw string, look for the end - end = line.find(delimiter) - if end >= 0: - # Found the end of the string, match leading space for this - # line and resume copying the original lines, and also insert - # a "" on the last line. - leading_space = Match(r'^(\s*)\S', line) - line = leading_space.group(1) + '""' + line[end + len(delimiter):] - delimiter = None - else: - # Haven't found the end yet, append a blank line. - line = '""' - - # Look for beginning of a raw string, and replace them with - # empty strings. This is done in a loop to handle multiple raw - # strings on the same line. - while delimiter is None: - # Look for beginning of a raw string. - # See 2.14.15 [lex.string] for syntax. - # - # Once we have matched a raw string, we check the prefix of the - # line to make sure that the line is not part of a single line - # comment. It's done this way because we remove raw strings - # before removing comments as opposed to removing comments - # before removing raw strings. This is because there are some - # cpplint checks that requires the comments to be preserved, but - # we don't want to check comments that are inside raw strings. - matched = Match(r'^(.*?)\b(?:R|u8R|uR|UR|LR)"([^\s\\()]*)\((.*)$', line) - if (matched and - not Match(r'^([^\'"]|\'(\\.|[^\'])*\'|"(\\.|[^"])*")*//', - matched.group(1))): - delimiter = ')' + matched.group(2) + '"' - - end = matched.group(3).find(delimiter) - if end >= 0: - # Raw string ended on same line - line = (matched.group(1) + '""' + - matched.group(3)[end + len(delimiter):]) - delimiter = None - else: - # Start of a multi-line raw string - line = matched.group(1) + '""' - else: - break - - lines_without_raw_strings.append(line) - - # TODO(unknown): if delimiter is not None here, we might want to - # emit a warning for unterminated string. - return lines_without_raw_strings - - -def FindNextMultiLineCommentStart(lines, lineix): - """Find the beginning marker for a multiline comment.""" - while lineix < len(lines): - if lines[lineix].strip().startswith('/*'): - # Only return this marker if the comment goes beyond this line - if lines[lineix].strip().find('*/', 2) < 0: - return lineix - lineix += 1 - return len(lines) - - -def FindNextMultiLineCommentEnd(lines, lineix): - """We are inside a comment, find the end marker.""" - while lineix < len(lines): - if lines[lineix].strip().endswith('*/'): - return lineix - lineix += 1 - return len(lines) - - -def RemoveMultiLineCommentsFromRange(lines, begin, end): - """Clears a range of lines for multi-line comments.""" - # Having // dummy comments makes the lines non-empty, so we will not get - # unnecessary blank line warnings later in the code. - for i in range(begin, end): - lines[i] = '/**/' - - -def RemoveMultiLineComments(filename, lines, error): - """Removes multiline (c-style) comments from lines.""" - lineix = 0 - while lineix < len(lines): - lineix_begin = FindNextMultiLineCommentStart(lines, lineix) - if lineix_begin >= len(lines): - return - lineix_end = FindNextMultiLineCommentEnd(lines, lineix_begin) - if lineix_end >= len(lines): - error(filename, lineix_begin + 1, 'readability/multiline_comment', 5, - 'Could not find end of multi-line comment') - return - RemoveMultiLineCommentsFromRange(lines, lineix_begin, lineix_end + 1) - lineix = lineix_end + 1 - - -def CleanseComments(line): - """Removes //-comments and single-line C-style /* */ comments. - - Args: - line: A line of C++ source. - - Returns: - The line with single-line comments removed. - """ - commentpos = line.find('//') - if commentpos != -1 and not IsCppString(line[:commentpos]): - line = line[:commentpos].rstrip() - # get rid of /* ... */ - return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line) - - -class CleansedLines(object): - """Holds 4 copies of all lines with different preprocessing applied to them. - - 1) elided member contains lines without strings and comments. - 2) lines member contains lines without comments. - 3) raw_lines member contains all the lines without processing. - 4) lines_without_raw_strings member is same as raw_lines, but with C++11 raw - strings removed. - All these members are of , and of the same length. - """ - - def __init__(self, lines): - self.elided = [] - self.lines = [] - self.raw_lines = lines - self.num_lines = len(lines) - self.lines_without_raw_strings = CleanseRawStrings(lines) - for linenum in range(len(self.lines_without_raw_strings)): - self.lines.append(CleanseComments( - self.lines_without_raw_strings[linenum])) - elided = self._CollapseStrings(self.lines_without_raw_strings[linenum]) - self.elided.append(CleanseComments(elided)) - - def NumLines(self): - """Returns the number of lines represented.""" - return self.num_lines - - @staticmethod - def _CollapseStrings(elided): - """Collapses strings and chars on a line to simple "" or '' blocks. - - We nix strings first so we're not fooled by text like '"http://"' - - Args: - elided: The line being processed. - - Returns: - The line with collapsed strings. - """ - if _RE_PATTERN_INCLUDE.match(elided): - return elided - - # Remove escaped characters first to make quote/single quote collapsing - # basic. Things that look like escaped characters shouldn't occur - # outside of strings and chars. - elided = _RE_PATTERN_CLEANSE_LINE_ESCAPES.sub('', elided) - - # Replace quoted strings and digit separators. Both single quotes - # and double quotes are processed in the same loop, otherwise - # nested quotes wouldn't work. - collapsed = '' - while True: - # Find the first quote character - match = Match(r'^([^\'"]*)([\'"])(.*)$', elided) - if not match: - collapsed += elided - break - head, quote, tail = match.groups() - - if quote == '"': - # Collapse double quoted strings - second_quote = tail.find('"') - if second_quote >= 0: - collapsed += head + '""' - elided = tail[second_quote + 1:] - else: - # Unmatched double quote, don't bother processing the rest - # of the line since this is probably a multiline string. - collapsed += elided - break - else: - # Found single quote, check nearby text to eliminate digit separators. - # - # There is no special handling for floating point here, because - # the integer/fractional/exponent parts would all be parsed - # correctly as long as there are digits on both sides of the - # separator. So we are fine as long as we don't see something - # like "0.'3" (gcc 4.9.0 will not allow this literal). - if Search(r'\b(?:0[bBxX]?|[1-9])[0-9a-fA-F]*$', head): - match_literal = Match(r'^((?:\'?[0-9a-zA-Z_])*)(.*)$', "'" + tail) - collapsed += head + match_literal.group(1).replace("'", '') - elided = match_literal.group(2) - else: - second_quote = tail.find('\'') - if second_quote >= 0: - collapsed += head + "''" - elided = tail[second_quote + 1:] - else: - # Unmatched single quote - collapsed += elided - break - - return collapsed - - -def FindEndOfExpressionInLine(line, startpos, stack): - """Find the position just after the end of current parenthesized expression. - - Args: - line: a CleansedLines line. - startpos: start searching at this position. - stack: nesting stack at startpos. - - Returns: - On finding matching end: (index just after matching end, None) - On finding an unclosed expression: (-1, None) - Otherwise: (-1, new stack at end of this line) - """ - for i in xrange(startpos, len(line)): - char = line[i] - if char in '([{': - # Found start of parenthesized expression, push to expression stack - stack.append(char) - elif char == '<': - # Found potential start of template argument list - if i > 0 and line[i - 1] == '<': - # Left shift operator - if stack and stack[-1] == '<': - stack.pop() - if not stack: - return (-1, None) - elif i > 0 and Search(r'\boperator\s*$', line[0:i]): - # operator<, don't add to stack - continue - else: - # Tentative start of template argument list - stack.append('<') - elif char in ')]}': - # Found end of parenthesized expression. - # - # If we are currently expecting a matching '>', the pending '<' - # must have been an operator. Remove them from expression stack. - while stack and stack[-1] == '<': - stack.pop() - if not stack: - return (-1, None) - if ((stack[-1] == '(' and char == ')') or - (stack[-1] == '[' and char == ']') or - (stack[-1] == '{' and char == '}')): - stack.pop() - if not stack: - return (i + 1, None) - else: - # Mismatched parentheses - return (-1, None) - elif char == '>': - # Found potential end of template argument list. - - # Ignore "->" and operator functions - if (i > 0 and - (line[i - 1] == '-' or Search(r'\boperator\s*$', line[0:i - 1]))): - continue - - # Pop the stack if there is a matching '<'. Otherwise, ignore - # this '>' since it must be an operator. - if stack: - if stack[-1] == '<': - stack.pop() - if not stack: - return (i + 1, None) - elif char == ';': - # Found something that look like end of statements. If we are currently - # expecting a '>', the matching '<' must have been an operator, since - # template argument list should not contain statements. - while stack and stack[-1] == '<': - stack.pop() - if not stack: - return (-1, None) - - # Did not find end of expression or unbalanced parentheses on this line - return (-1, stack) - - -def CloseExpression(clean_lines, linenum, pos): - """If input points to ( or { or [ or <, finds the position that closes it. - - If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the - linenum/pos that correspond to the closing of the expression. - - TODO(unknown): cpplint spends a fair bit of time matching parentheses. - Ideally we would want to index all opening and closing parentheses once - and have CloseExpression be just a simple lookup, but due to preprocessor - tricks, this is not so easy. - - Args: - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - pos: A position on the line. - - Returns: - A tuple (line, linenum, pos) pointer *past* the closing brace, or - (line, len(lines), -1) if we never find a close. Note we ignore - strings and comments when matching; and the line we return is the - 'cleansed' line at linenum. - """ - - line = clean_lines.elided[linenum] - if (line[pos] not in '({[<') or Match(r'<[<=]', line[pos:]): - return (line, clean_lines.NumLines(), -1) - - # Check first line - (end_pos, stack) = FindEndOfExpressionInLine(line, pos, []) - if end_pos > -1: - return (line, linenum, end_pos) - - # Continue scanning forward - while stack and linenum < clean_lines.NumLines() - 1: - linenum += 1 - line = clean_lines.elided[linenum] - (end_pos, stack) = FindEndOfExpressionInLine(line, 0, stack) - if end_pos > -1: - return (line, linenum, end_pos) - - # Did not find end of expression before end of file, give up - return (line, clean_lines.NumLines(), -1) - - -def FindStartOfExpressionInLine(line, endpos, stack): - """Find position at the matching start of current expression. - - This is almost the reverse of FindEndOfExpressionInLine, but note - that the input position and returned position differs by 1. - - Args: - line: a CleansedLines line. - endpos: start searching at this position. - stack: nesting stack at endpos. - - Returns: - On finding matching start: (index at matching start, None) - On finding an unclosed expression: (-1, None) - Otherwise: (-1, new stack at beginning of this line) - """ - i = endpos - while i >= 0: - char = line[i] - if char in ')]}': - # Found end of expression, push to expression stack - stack.append(char) - elif char == '>': - # Found potential end of template argument list. - # - # Ignore it if it's a "->" or ">=" or "operator>" - if (i > 0 and - (line[i - 1] == '-' or - Match(r'\s>=\s', line[i - 1:]) or - Search(r'\boperator\s*$', line[0:i]))): - i -= 1 - else: - stack.append('>') - elif char == '<': - # Found potential start of template argument list - if i > 0 and line[i - 1] == '<': - # Left shift operator - i -= 1 - else: - # If there is a matching '>', we can pop the expression stack. - # Otherwise, ignore this '<' since it must be an operator. - if stack and stack[-1] == '>': - stack.pop() - if not stack: - return (i, None) - elif char in '([{': - # Found start of expression. - # - # If there are any unmatched '>' on the stack, they must be - # operators. Remove those. - while stack and stack[-1] == '>': - stack.pop() - if not stack: - return (-1, None) - if ((char == '(' and stack[-1] == ')') or - (char == '[' and stack[-1] == ']') or - (char == '{' and stack[-1] == '}')): - stack.pop() - if not stack: - return (i, None) - else: - # Mismatched parentheses - return (-1, None) - elif char == ';': - # Found something that look like end of statements. If we are currently - # expecting a '<', the matching '>' must have been an operator, since - # template argument list should not contain statements. - while stack and stack[-1] == '>': - stack.pop() - if not stack: - return (-1, None) - - i -= 1 - - return (-1, stack) - - -def ReverseCloseExpression(clean_lines, linenum, pos): - """If input points to ) or } or ] or >, finds the position that opens it. - - If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the - linenum/pos that correspond to the opening of the expression. - - Args: - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - pos: A position on the line. - - Returns: - A tuple (line, linenum, pos) pointer *at* the opening brace, or - (line, 0, -1) if we never find the matching opening brace. Note - we ignore strings and comments when matching; and the line we - return is the 'cleansed' line at linenum. - """ - line = clean_lines.elided[linenum] - if line[pos] not in ')}]>': - return (line, 0, -1) - - # Check last line - (start_pos, stack) = FindStartOfExpressionInLine(line, pos, []) - if start_pos > -1: - return (line, linenum, start_pos) - - # Continue scanning backward - while stack and linenum > 0: - linenum -= 1 - line = clean_lines.elided[linenum] - (start_pos, stack) = FindStartOfExpressionInLine(line, len(line) - 1, stack) - if start_pos > -1: - return (line, linenum, start_pos) - - # Did not find start of expression before beginning of file, give up - return (line, 0, -1) - - -def CheckForCopyright(filename, lines, error): - """Logs an error if no Copyright message appears at the top of the file.""" - - # We'll say it should occur by line 10. Don't forget there's a - # dummy line at the front. - for line in range(1, min(len(lines), 11)): - if re.search(r'Copyright', lines[line], re.I): break - else: # means no copyright line was found - error(filename, 0, 'legal/copyright', 5, - 'No copyright message found. ' - 'You should have a line: "Copyright [year] "') - - -def GetIndentLevel(line): - """Return the number of leading spaces in line. - - Args: - line: A string to check. - - Returns: - An integer count of leading spaces, possibly zero. - """ - indent = Match(r'^( *)\S', line) - if indent: - return len(indent.group(1)) - else: - return 0 - - -def GetHeaderGuardCPPVariable(filename): - """Returns the CPP variable that should be used as a header guard. - - Args: - filename: The name of a C++ header file. - - Returns: - The CPP variable that should be used as a header guard in the - named file. - - """ - - # Restores original filename in case that cpplint is invoked from Emacs's - # flymake. - filename = re.sub(r'_flymake\.h$', '.h', filename) - filename = re.sub(r'/\.flymake/([^/]*)$', r'/\1', filename) - # Replace 'c++' with 'cpp'. - filename = filename.replace('C++', 'cpp').replace('c++', 'cpp') - - fileinfo = FileInfo(filename) - file_path_from_root = fileinfo.RepositoryName() - if _root: - suffix = os.sep - # On Windows using directory separator will leave us with - # "bogus escape error" unless we properly escape regex. - if suffix == '\\': - suffix += '\\' - file_path_from_root = re.sub('^' + _root + suffix, '', file_path_from_root) - return re.sub(r'[^a-zA-Z0-9]', '_', file_path_from_root).upper() + '_' - - -def CheckForHeaderGuard(filename, clean_lines, error): - """Checks that the file contains a header guard. - - Logs an error if no #ifndef header guard is present. For other - headers, checks that the full pathname is used. - - Args: - filename: The name of the C++ header file. - clean_lines: A CleansedLines instance containing the file. - error: The function to call with any errors found. - """ - - # Don't check for header guards if there are error suppression - # comments somewhere in this file. - # - # Because this is silencing a warning for a nonexistent line, we - # only support the very specific NOLINT(build/header_guard) syntax, - # and not the general NOLINT or NOLINT(*) syntax. - raw_lines = clean_lines.lines_without_raw_strings - for i in raw_lines: - if Search(r'//\s*NOLINT\(build/header_guard\)', i): - return - - # Allow pragma once instead of header guards - for i in raw_lines: - if Search(r'^\s*#pragma\s+once', i): - return - - cppvar = GetHeaderGuardCPPVariable(filename) - - ifndef = '' - ifndef_linenum = 0 - define = '' - endif = '' - endif_linenum = 0 - for linenum, line in enumerate(raw_lines): - linesplit = line.split() - if len(linesplit) >= 2: - # find the first occurrence of #ifndef and #define, save arg - if not ifndef and linesplit[0] == '#ifndef': - # set ifndef to the header guard presented on the #ifndef line. - ifndef = linesplit[1] - ifndef_linenum = linenum - if not define and linesplit[0] == '#define': - define = linesplit[1] - # find the last occurrence of #endif, save entire line - if line.startswith('#endif'): - endif = line - endif_linenum = linenum - - if not ifndef or not define or ifndef != define: - error(filename, 0, 'build/header_guard', 5, - 'No #ifndef header guard found, suggested CPP variable is: %s' % - cppvar) - return - - # The guard should be PATH_FILE_H_, but we also allow PATH_FILE_H__ - # for backward compatibility. - if ifndef != cppvar: - error_level = 0 - if ifndef != cppvar + '_': - error_level = 5 - - ParseNolintSuppressions(filename, raw_lines[ifndef_linenum], ifndef_linenum, - error) - error(filename, ifndef_linenum, 'build/header_guard', error_level, - '#ifndef header guard has wrong style, please use: %s' % cppvar) - - # Check for "//" comments on endif line. - ParseNolintSuppressions(filename, raw_lines[endif_linenum], endif_linenum, - error) - match = Match(r'#endif\s*//\s*' + cppvar + r'(_)?\b', endif) - if match: - if match.group(1) == '_': - # Issue low severity warning for deprecated double trailing underscore - error(filename, endif_linenum, 'build/header_guard', 0, - '#endif line should be "#endif // %s"' % cppvar) - return - - # Didn't find the corresponding "//" comment. If this file does not - # contain any "//" comments at all, it could be that the compiler - # only wants "/**/" comments, look for those instead. - no_single_line_comments = True - for i in xrange(1, len(raw_lines) - 1): - line = raw_lines[i] - if Match(r'^(?:(?:\'(?:\.|[^\'])*\')|(?:"(?:\.|[^"])*")|[^\'"])*//', line): - no_single_line_comments = False - break - - if no_single_line_comments: - match = Match(r'#endif\s*/\*\s*' + cppvar + r'(_)?\s*\*/', endif) - if match: - if match.group(1) == '_': - # Low severity warning for double trailing underscore - error(filename, endif_linenum, 'build/header_guard', 0, - '#endif line should be "#endif /* %s */"' % cppvar) - return - - # Didn't find anything - error(filename, endif_linenum, 'build/header_guard', 5, - '#endif line should be "#endif // %s"' % cppvar) - - -def CheckHeaderFileIncluded(filename, include_state, error): - """Logs an error if a source file does not include its header.""" - - # Do not check test files - fileinfo = FileInfo(filename) - if Search(_TEST_FILE_SUFFIX, fileinfo.BaseName()): - return - - for ext in GetHeaderExtensions(): - basefilename = filename[0:len(filename) - len(fileinfo.Extension())] - headerfile = basefilename + '.' + ext - if not os.path.exists(headerfile): - continue - headername = FileInfo(headerfile).RepositoryName() - first_include = None - for section_list in include_state.include_list: - for f in section_list: - if headername in f[0] or f[0] in headername: - return - if not first_include: - first_include = f[1] - - error(filename, first_include, 'build/include', 5, - '%s should include its header file %s' % (fileinfo.RepositoryName(), - headername)) - - -def CheckForBadCharacters(filename, lines, error): - """Logs an error for each line containing bad characters. - - Two kinds of bad characters: - - 1. Unicode replacement characters: These indicate that either the file - contained invalid UTF-8 (likely) or Unicode replacement characters (which - it shouldn't). Note that it's possible for this to throw off line - numbering if the invalid UTF-8 occurred adjacent to a newline. - - 2. NUL bytes. These are problematic for some tools. - - Args: - filename: The name of the current file. - lines: An array of strings, each representing a line of the file. - error: The function to call with any errors found. - """ - for linenum, line in enumerate(lines): - if unicode_escape_decode('\ufffd') in line: - error(filename, linenum, 'readability/utf8', 5, - 'Line contains invalid UTF-8 (or Unicode replacement character).') - if '\0' in line: - error(filename, linenum, 'readability/nul', 5, 'Line contains NUL byte.') - - -def CheckForNewlineAtEOF(filename, lines, error): - """Logs an error if there is no newline char at the end of the file. - - Args: - filename: The name of the current file. - lines: An array of strings, each representing a line of the file. - error: The function to call with any errors found. - """ - - # The array lines() was created by adding two newlines to the - # original file (go figure), then splitting on \n. - # To verify that the file ends in \n, we just have to make sure the - # last-but-two element of lines() exists and is empty. - if len(lines) < 3 or lines[-2]: - error(filename, len(lines) - 2, 'whitespace/ending_newline', 5, - 'Could not find a newline character at the end of the file.') - - -def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error): - """Logs an error if we see /* ... */ or "..." that extend past one line. - - /* ... */ comments are legit inside macros, for one line. - Otherwise, we prefer // comments, so it's ok to warn about the - other. Likewise, it's ok for strings to extend across multiple - lines, as long as a line continuation character (backslash) - terminates each line. Although not currently prohibited by the C++ - style guide, it's ugly and unnecessary. We don't do well with either - in this lint program, so we warn about both. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - - # Remove all \\ (escaped backslashes) from the line. They are OK, and the - # second (escaped) slash may trigger later \" detection erroneously. - line = line.replace('\\\\', '') - - if line.count('/*') > line.count('*/'): - error(filename, linenum, 'readability/multiline_comment', 5, - 'Complex multi-line /*...*/-style comment found. ' - 'Lint may give bogus warnings. ' - 'Consider replacing these with //-style comments, ' - 'with #if 0...#endif, ' - 'or with more clearly structured multi-line comments.') - - if (line.count('"') - line.count('\\"')) % 2: - error(filename, linenum, 'readability/multiline_string', 5, - 'Multi-line string ("...") found. This lint script doesn\'t ' - 'do well with such strings, and may give bogus warnings. ' - 'Use C++11 raw strings or concatenation instead.') - - -# (non-threadsafe name, thread-safe alternative, validation pattern) -# -# The validation pattern is used to eliminate false positives such as: -# _rand(); // false positive due to substring match. -# ->rand(); // some member function rand(). -# ACMRandom rand(seed); // some variable named rand. -# ISAACRandom rand(); // another variable named rand. -# -# Basically we require the return value of these functions to be used -# in some expression context on the same line by matching on some -# operator before the function name. This eliminates constructors and -# member function calls. -_UNSAFE_FUNC_PREFIX = r'(?:[-+*/=%^&|(<]\s*|>\s+)' -_THREADING_LIST = ( - ('asctime(', 'asctime_r(', _UNSAFE_FUNC_PREFIX + r'asctime\([^)]+\)'), - ('ctime(', 'ctime_r(', _UNSAFE_FUNC_PREFIX + r'ctime\([^)]+\)'), - ('getgrgid(', 'getgrgid_r(', _UNSAFE_FUNC_PREFIX + r'getgrgid\([^)]+\)'), - ('getgrnam(', 'getgrnam_r(', _UNSAFE_FUNC_PREFIX + r'getgrnam\([^)]+\)'), - ('getlogin(', 'getlogin_r(', _UNSAFE_FUNC_PREFIX + r'getlogin\(\)'), - ('getpwnam(', 'getpwnam_r(', _UNSAFE_FUNC_PREFIX + r'getpwnam\([^)]+\)'), - ('getpwuid(', 'getpwuid_r(', _UNSAFE_FUNC_PREFIX + r'getpwuid\([^)]+\)'), - ('gmtime(', 'gmtime_r(', _UNSAFE_FUNC_PREFIX + r'gmtime\([^)]+\)'), - ('localtime(', 'localtime_r(', _UNSAFE_FUNC_PREFIX + r'localtime\([^)]+\)'), - ('rand(', 'rand_r(', _UNSAFE_FUNC_PREFIX + r'rand\(\)'), - ('strtok(', 'strtok_r(', - _UNSAFE_FUNC_PREFIX + r'strtok\([^)]+\)'), - ('ttyname(', 'ttyname_r(', _UNSAFE_FUNC_PREFIX + r'ttyname\([^)]+\)'), - ) - - -def CheckPosixThreading(filename, clean_lines, linenum, error): - """Checks for calls to thread-unsafe functions. - - Much code has been originally written without consideration of - multi-threading. Also, engineers are relying on their old experience; - they have learned posix before threading extensions were added. These - tests guide the engineers to use thread-safe functions (when using - posix directly). - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - for single_thread_func, multithread_safe_func, pattern in _THREADING_LIST: - # Additional pattern matching check to confirm that this is the - # function we are looking for - if Search(pattern, line): - error(filename, linenum, 'runtime/threadsafe_fn', 2, - 'Consider using ' + multithread_safe_func + - '...) instead of ' + single_thread_func + - '...) for improved thread safety.') - - -def CheckVlogArguments(filename, clean_lines, linenum, error): - """Checks that VLOG() is only used for defining a logging level. - - For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and - VLOG(FATAL) are not. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - if Search(r'\bVLOG\((INFO|ERROR|WARNING|DFATAL|FATAL)\)', line): - error(filename, linenum, 'runtime/vlog', 5, - 'VLOG() should be used with numeric verbosity level. ' - 'Use LOG() if you want symbolic severity levels.') - -# Matches invalid increment: *count++, which moves pointer instead of -# incrementing a value. -_RE_PATTERN_INVALID_INCREMENT = re.compile( - r'^\s*\*\w+(\+\+|--);') - - -def CheckInvalidIncrement(filename, clean_lines, linenum, error): - """Checks for invalid increment *count++. - - For example following function: - void increment_counter(int* count) { - *count++; - } - is invalid, because it effectively does count++, moving pointer, and should - be replaced with ++*count, (*count)++ or *count += 1. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - if _RE_PATTERN_INVALID_INCREMENT.match(line): - error(filename, linenum, 'runtime/invalid_increment', 5, - 'Changing pointer instead of value (or unused value of operator*).') - - -def IsMacroDefinition(clean_lines, linenum): - if Search(r'^#define', clean_lines[linenum]): - return True - - if linenum > 0 and Search(r'\\$', clean_lines[linenum - 1]): - return True - - return False - - -def IsForwardClassDeclaration(clean_lines, linenum): - return Match(r'^\s*(\btemplate\b)*.*class\s+\w+;\s*$', clean_lines[linenum]) - - -class _BlockInfo(object): - """Stores information about a generic block of code.""" - - def __init__(self, linenum, seen_open_brace): - self.starting_linenum = linenum - self.seen_open_brace = seen_open_brace - self.open_parentheses = 0 - self.inline_asm = _NO_ASM - self.check_namespace_indentation = False - - def CheckBegin(self, filename, clean_lines, linenum, error): - """Run checks that applies to text up to the opening brace. - - This is mostly for checking the text after the class identifier - and the "{", usually where the base class is specified. For other - blocks, there isn't much to check, so we always pass. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - pass - - def CheckEnd(self, filename, clean_lines, linenum, error): - """Run checks that applies to text after the closing brace. - - This is mostly used for checking end of namespace comments. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - pass - - def IsBlockInfo(self): - """Returns true if this block is a _BlockInfo. - - This is convenient for verifying that an object is an instance of - a _BlockInfo, but not an instance of any of the derived classes. - - Returns: - True for this class, False for derived classes. - """ - return self.__class__ == _BlockInfo - - -class _ExternCInfo(_BlockInfo): - """Stores information about an 'extern "C"' block.""" - - def __init__(self, linenum): - _BlockInfo.__init__(self, linenum, True) - - -class _ClassInfo(_BlockInfo): - """Stores information about a class.""" - - def __init__(self, name, class_or_struct, clean_lines, linenum): - _BlockInfo.__init__(self, linenum, False) - self.name = name - self.is_derived = False - self.check_namespace_indentation = True - if class_or_struct == 'struct': - self.access = 'public' - self.is_struct = True - else: - self.access = 'private' - self.is_struct = False - - # Remember initial indentation level for this class. Using raw_lines here - # instead of elided to account for leading comments. - self.class_indent = GetIndentLevel(clean_lines.raw_lines[linenum]) - - # Try to find the end of the class. This will be confused by things like: - # class A { - # } *x = { ... - # - # But it's still good enough for CheckSectionSpacing. - self.last_line = 0 - depth = 0 - for i in range(linenum, clean_lines.NumLines()): - line = clean_lines.elided[i] - depth += line.count('{') - line.count('}') - if not depth: - self.last_line = i - break - - def CheckBegin(self, filename, clean_lines, linenum, error): - # Look for a bare ':' - if Search('(^|[^:]):($|[^:])', clean_lines.elided[linenum]): - self.is_derived = True - - def CheckEnd(self, filename, clean_lines, linenum, error): - # If there is a DISALLOW macro, it should appear near the end of - # the class. - seen_last_thing_in_class = False - for i in xrange(linenum - 1, self.starting_linenum, -1): - match = Search( - r'\b(DISALLOW_COPY_AND_ASSIGN|DISALLOW_IMPLICIT_CONSTRUCTORS)\(' + - self.name + r'\)', - clean_lines.elided[i]) - if match: - if seen_last_thing_in_class: - error(filename, i, 'readability/constructors', 3, - match.group(1) + ' should be the last thing in the class') - break - - if not Match(r'^\s*$', clean_lines.elided[i]): - seen_last_thing_in_class = True - - # Check that closing brace is aligned with beginning of the class. - # Only do this if the closing brace is indented by only whitespaces. - # This means we will not check single-line class definitions. - indent = Match(r'^( *)\}', clean_lines.elided[linenum]) - if indent and len(indent.group(1)) != self.class_indent: - if self.is_struct: - parent = 'struct ' + self.name - else: - parent = 'class ' + self.name - error(filename, linenum, 'whitespace/indent', 3, - 'Closing brace should be aligned with beginning of %s' % parent) - - -class _NamespaceInfo(_BlockInfo): - """Stores information about a namespace.""" - - def __init__(self, name, linenum): - _BlockInfo.__init__(self, linenum, False) - self.name = name or '' - self.check_namespace_indentation = True - - def CheckEnd(self, filename, clean_lines, linenum, error): - """Check end of namespace comments.""" - line = clean_lines.raw_lines[linenum] - - # Check how many lines is enclosed in this namespace. Don't issue - # warning for missing namespace comments if there aren't enough - # lines. However, do apply checks if there is already an end of - # namespace comment and it's incorrect. - # - # TODO(unknown): We always want to check end of namespace comments - # if a namespace is large, but sometimes we also want to apply the - # check if a short namespace contained nontrivial things (something - # other than forward declarations). There is currently no logic on - # deciding what these nontrivial things are, so this check is - # triggered by namespace size only, which works most of the time. - if (linenum - self.starting_linenum < 10 - and not Match(r'^\s*};*\s*(//|/\*).*\bnamespace\b', line)): - return - - # Look for matching comment at end of namespace. - # - # Note that we accept C style "/* */" comments for terminating - # namespaces, so that code that terminate namespaces inside - # preprocessor macros can be cpplint clean. - # - # We also accept stuff like "// end of namespace ." with the - # period at the end. - # - # Besides these, we don't accept anything else, otherwise we might - # get false negatives when existing comment is a substring of the - # expected namespace. - if self.name: - # Named namespace - if not Match((r'^\s*};*\s*(//|/\*).*\bnamespace\s+' + - re.escape(self.name) + r'[\*/\.\\\s]*$'), - line): - error(filename, linenum, 'readability/namespace', 5, - 'Namespace should be terminated with "// namespace %s"' % - self.name) - else: - # Anonymous namespace - if not Match(r'^\s*};*\s*(//|/\*).*\bnamespace[\*/\.\\\s]*$', line): - # If "// namespace anonymous" or "// anonymous namespace (more text)", - # mention "// anonymous namespace" as an acceptable form - if Match(r'^\s*}.*\b(namespace anonymous|anonymous namespace)\b', line): - error(filename, linenum, 'readability/namespace', 5, - 'Anonymous namespace should be terminated with "// namespace"' - ' or "// anonymous namespace"') - else: - error(filename, linenum, 'readability/namespace', 5, - 'Anonymous namespace should be terminated with "// namespace"') - - -class _PreprocessorInfo(object): - """Stores checkpoints of nesting stacks when #if/#else is seen.""" - - def __init__(self, stack_before_if): - # The entire nesting stack before #if - self.stack_before_if = stack_before_if - - # The entire nesting stack up to #else - self.stack_before_else = [] - - # Whether we have already seen #else or #elif - self.seen_else = False - - -class NestingState(object): - """Holds states related to parsing braces.""" - - def __init__(self): - # Stack for tracking all braces. An object is pushed whenever we - # see a "{", and popped when we see a "}". Only 3 types of - # objects are possible: - # - _ClassInfo: a class or struct. - # - _NamespaceInfo: a namespace. - # - _BlockInfo: some other type of block. - self.stack = [] - - # Top of the previous stack before each Update(). - # - # Because the nesting_stack is updated at the end of each line, we - # had to do some convoluted checks to find out what is the current - # scope at the beginning of the line. This check is simplified by - # saving the previous top of nesting stack. - # - # We could save the full stack, but we only need the top. Copying - # the full nesting stack would slow down cpplint by ~10%. - self.previous_stack_top = [] - - # Stack of _PreprocessorInfo objects. - self.pp_stack = [] - - def SeenOpenBrace(self): - """Check if we have seen the opening brace for the innermost block. - - Returns: - True if we have seen the opening brace, False if the innermost - block is still expecting an opening brace. - """ - return (not self.stack) or self.stack[-1].seen_open_brace - - def InNamespaceBody(self): - """Check if we are currently one level inside a namespace body. - - Returns: - True if top of the stack is a namespace block, False otherwise. - """ - return self.stack and isinstance(self.stack[-1], _NamespaceInfo) - - def InExternC(self): - """Check if we are currently one level inside an 'extern "C"' block. - - Returns: - True if top of the stack is an extern block, False otherwise. - """ - return self.stack and isinstance(self.stack[-1], _ExternCInfo) - - def InClassDeclaration(self): - """Check if we are currently one level inside a class or struct declaration. - - Returns: - True if top of the stack is a class/struct, False otherwise. - """ - return self.stack and isinstance(self.stack[-1], _ClassInfo) - - def InAsmBlock(self): - """Check if we are currently one level inside an inline ASM block. - - Returns: - True if the top of the stack is a block containing inline ASM. - """ - return self.stack and self.stack[-1].inline_asm != _NO_ASM - - def InTemplateArgumentList(self, clean_lines, linenum, pos): - """Check if current position is inside template argument list. - - Args: - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - pos: position just after the suspected template argument. - Returns: - True if (linenum, pos) is inside template arguments. - """ - while linenum < clean_lines.NumLines(): - # Find the earliest character that might indicate a template argument - line = clean_lines.elided[linenum] - match = Match(r'^[^{};=\[\]\.<>]*(.)', line[pos:]) - if not match: - linenum += 1 - pos = 0 - continue - token = match.group(1) - pos += len(match.group(0)) - - # These things do not look like template argument list: - # class Suspect { - # class Suspect x; } - if token in ('{', '}', ';'): return False - - # These things look like template argument list: - # template - # template - # template - # template - if token in ('>', '=', '[', ']', '.'): return True - - # Check if token is an unmatched '<'. - # If not, move on to the next character. - if token != '<': - pos += 1 - if pos >= len(line): - linenum += 1 - pos = 0 - continue - - # We can't be sure if we just find a single '<', and need to - # find the matching '>'. - (_, end_line, end_pos) = CloseExpression(clean_lines, linenum, pos - 1) - if end_pos < 0: - # Not sure if template argument list or syntax error in file - return False - linenum = end_line - pos = end_pos - return False - - def UpdatePreprocessor(self, line): - """Update preprocessor stack. - - We need to handle preprocessors due to classes like this: - #ifdef SWIG - struct ResultDetailsPageElementExtensionPoint { - #else - struct ResultDetailsPageElementExtensionPoint : public Extension { - #endif - - We make the following assumptions (good enough for most files): - - Preprocessor condition evaluates to true from #if up to first - #else/#elif/#endif. - - - Preprocessor condition evaluates to false from #else/#elif up - to #endif. We still perform lint checks on these lines, but - these do not affect nesting stack. - - Args: - line: current line to check. - """ - if Match(r'^\s*#\s*(if|ifdef|ifndef)\b', line): - # Beginning of #if block, save the nesting stack here. The saved - # stack will allow us to restore the parsing state in the #else case. - self.pp_stack.append(_PreprocessorInfo(copy.deepcopy(self.stack))) - elif Match(r'^\s*#\s*(else|elif)\b', line): - # Beginning of #else block - if self.pp_stack: - if not self.pp_stack[-1].seen_else: - # This is the first #else or #elif block. Remember the - # whole nesting stack up to this point. This is what we - # keep after the #endif. - self.pp_stack[-1].seen_else = True - self.pp_stack[-1].stack_before_else = copy.deepcopy(self.stack) - - # Restore the stack to how it was before the #if - self.stack = copy.deepcopy(self.pp_stack[-1].stack_before_if) - else: - # TODO(unknown): unexpected #else, issue warning? - pass - elif Match(r'^\s*#\s*endif\b', line): - # End of #if or #else blocks. - if self.pp_stack: - # If we saw an #else, we will need to restore the nesting - # stack to its former state before the #else, otherwise we - # will just continue from where we left off. - if self.pp_stack[-1].seen_else: - # Here we can just use a shallow copy since we are the last - # reference to it. - self.stack = self.pp_stack[-1].stack_before_else - # Drop the corresponding #if - self.pp_stack.pop() - else: - # TODO(unknown): unexpected #endif, issue warning? - pass - - # TODO(unknown): Update() is too long, but we will refactor later. - def Update(self, filename, clean_lines, linenum, error): - """Update nesting state with current line. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - - # Remember top of the previous nesting stack. - # - # The stack is always pushed/popped and not modified in place, so - # we can just do a shallow copy instead of copy.deepcopy. Using - # deepcopy would slow down cpplint by ~28%. - if self.stack: - self.previous_stack_top = self.stack[-1] - else: - self.previous_stack_top = None - - # Update pp_stack - self.UpdatePreprocessor(line) - - # Count parentheses. This is to avoid adding struct arguments to - # the nesting stack. - if self.stack: - inner_block = self.stack[-1] - depth_change = line.count('(') - line.count(')') - inner_block.open_parentheses += depth_change - - # Also check if we are starting or ending an inline assembly block. - if inner_block.inline_asm in (_NO_ASM, _END_ASM): - if (depth_change != 0 and - inner_block.open_parentheses == 1 and - _MATCH_ASM.match(line)): - # Enter assembly block - inner_block.inline_asm = _INSIDE_ASM - else: - # Not entering assembly block. If previous line was _END_ASM, - # we will now shift to _NO_ASM state. - inner_block.inline_asm = _NO_ASM - elif (inner_block.inline_asm == _INSIDE_ASM and - inner_block.open_parentheses == 0): - # Exit assembly block - inner_block.inline_asm = _END_ASM - - # Consume namespace declaration at the beginning of the line. Do - # this in a loop so that we catch same line declarations like this: - # namespace proto2 { namespace bridge { class MessageSet; } } - while True: - # Match start of namespace. The "\b\s*" below catches namespace - # declarations even if it weren't followed by a whitespace, this - # is so that we don't confuse our namespace checker. The - # missing spaces will be flagged by CheckSpacing. - namespace_decl_match = Match(r'^\s*namespace\b\s*([:\w]+)?(.*)$', line) - if not namespace_decl_match: - break - - new_namespace = _NamespaceInfo(namespace_decl_match.group(1), linenum) - self.stack.append(new_namespace) - - line = namespace_decl_match.group(2) - if line.find('{') != -1: - new_namespace.seen_open_brace = True - line = line[line.find('{') + 1:] - - # Look for a class declaration in whatever is left of the line - # after parsing namespaces. The regexp accounts for decorated classes - # such as in: - # class LOCKABLE API Object { - # }; - class_decl_match = Match( - r'^(\s*(?:template\s*<[\w\s<>,:=]*>\s*)?' - r'(class|struct)\s+(?:[A-Z_]+\s+)*(\w+(?:::\w+)*))' - r'(.*)$', line) - if (class_decl_match and - (not self.stack or self.stack[-1].open_parentheses == 0)): - # We do not want to accept classes that are actually template arguments: - # template , - # template class Ignore3> - # void Function() {}; - # - # To avoid template argument cases, we scan forward and look for - # an unmatched '>'. If we see one, assume we are inside a - # template argument list. - end_declaration = len(class_decl_match.group(1)) - if not self.InTemplateArgumentList(clean_lines, linenum, end_declaration): - self.stack.append(_ClassInfo( - class_decl_match.group(3), class_decl_match.group(2), - clean_lines, linenum)) - line = class_decl_match.group(4) - - # If we have not yet seen the opening brace for the innermost block, - # run checks here. - if not self.SeenOpenBrace(): - self.stack[-1].CheckBegin(filename, clean_lines, linenum, error) - - # Update access control if we are inside a class/struct - if self.stack and isinstance(self.stack[-1], _ClassInfo): - classinfo = self.stack[-1] - access_match = Match( - r'^(.*)\b(public|private|protected|signals)(\s+(?:slots\s*)?)?' - r':(?:[^:]|$)', - line) - if access_match: - classinfo.access = access_match.group(2) - - # Check that access keywords are indented +1 space. Skip this - # check if the keywords are not preceded by whitespaces. - indent = access_match.group(1) - if (len(indent) != classinfo.class_indent + 1 and - Match(r'^\s*$', indent)): - if classinfo.is_struct: - parent = 'struct ' + classinfo.name - else: - parent = 'class ' + classinfo.name - slots = '' - if access_match.group(3): - slots = access_match.group(3) - error(filename, linenum, 'whitespace/indent', 3, - '%s%s: should be indented +1 space inside %s' % ( - access_match.group(2), slots, parent)) - - # Consume braces or semicolons from what's left of the line - while True: - # Match first brace, semicolon, or closed parenthesis. - matched = Match(r'^[^{;)}]*([{;)}])(.*)$', line) - if not matched: - break - - token = matched.group(1) - if token == '{': - # If namespace or class hasn't seen a opening brace yet, mark - # namespace/class head as complete. Push a new block onto the - # stack otherwise. - if not self.SeenOpenBrace(): - self.stack[-1].seen_open_brace = True - elif Match(r'^extern\s*"[^"]*"\s*\{', line): - self.stack.append(_ExternCInfo(linenum)) - else: - self.stack.append(_BlockInfo(linenum, True)) - if _MATCH_ASM.match(line): - self.stack[-1].inline_asm = _BLOCK_ASM - - elif token == ';' or token == ')': - # If we haven't seen an opening brace yet, but we already saw - # a semicolon, this is probably a forward declaration. Pop - # the stack for these. - # - # Similarly, if we haven't seen an opening brace yet, but we - # already saw a closing parenthesis, then these are probably - # function arguments with extra "class" or "struct" keywords. - # Also pop these stack for these. - if not self.SeenOpenBrace(): - self.stack.pop() - else: # token == '}' - # Perform end of block checks and pop the stack. - if self.stack: - self.stack[-1].CheckEnd(filename, clean_lines, linenum, error) - self.stack.pop() - line = matched.group(2) - - def InnermostClass(self): - """Get class info on the top of the stack. - - Returns: - A _ClassInfo object if we are inside a class, or None otherwise. - """ - for i in range(len(self.stack), 0, -1): - classinfo = self.stack[i - 1] - if isinstance(classinfo, _ClassInfo): - return classinfo - return None - - def CheckCompletedBlocks(self, filename, error): - """Checks that all classes and namespaces have been completely parsed. - - Call this when all lines in a file have been processed. - Args: - filename: The name of the current file. - error: The function to call with any errors found. - """ - # Note: This test can result in false positives if #ifdef constructs - # get in the way of brace matching. See the testBuildClass test in - # cpplint_unittest.py for an example of this. - for obj in self.stack: - if isinstance(obj, _ClassInfo): - error(filename, obj.starting_linenum, 'build/class', 5, - 'Failed to find complete declaration of class %s' % - obj.name) - elif isinstance(obj, _NamespaceInfo): - error(filename, obj.starting_linenum, 'build/namespaces', 5, - 'Failed to find complete declaration of namespace %s' % - obj.name) - - -def CheckForNonStandardConstructs(filename, clean_lines, linenum, - nesting_state, error): - r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. - - Complain about several constructs which gcc-2 accepts, but which are - not standard C++. Warning about these in lint is one way to ease the - transition to new compilers. - - put storage class first (e.g. "static const" instead of "const static"). - - "%lld" instead of %qd" in printf-type functions. - - "%1$d" is non-standard in printf-type functions. - - "\%" is an undefined character escape sequence. - - text after #endif is not allowed. - - invalid inner-style forward declaration. - - >? and ?= and )\?=?\s*(\w+|[+-]?\d+)(\.\d*)?', - line): - error(filename, linenum, 'build/deprecated', 3, - '>? and ))?' - # r'\s*const\s*' + type_name + '\s*&\s*\w+\s*;' - error(filename, linenum, 'runtime/member_string_references', 2, - 'const string& members are dangerous. It is much better to use ' - 'alternatives, such as pointers or simple constants.') - - # Everything else in this function operates on class declarations. - # Return early if the top of the nesting stack is not a class, or if - # the class head is not completed yet. - classinfo = nesting_state.InnermostClass() - if not classinfo or not classinfo.seen_open_brace: - return - - # The class may have been declared with namespace or classname qualifiers. - # The constructor and destructor will not have those qualifiers. - base_classname = classinfo.name.split('::')[-1] - - # Look for single-argument constructors that aren't marked explicit. - # Technically a valid construct, but against style. - explicit_constructor_match = Match( - r'\s+(?:inline\s+)?(explicit\s+)?(?:inline\s+)?%s\s*' - r'\(((?:[^()]|\([^()]*\))*)\)' - % re.escape(base_classname), - line) - - if explicit_constructor_match: - is_marked_explicit = explicit_constructor_match.group(1) - - if not explicit_constructor_match.group(2): - constructor_args = [] - else: - constructor_args = explicit_constructor_match.group(2).split(',') - - # collapse arguments so that commas in template parameter lists and function - # argument parameter lists don't split arguments in two - i = 0 - while i < len(constructor_args): - constructor_arg = constructor_args[i] - while (constructor_arg.count('<') > constructor_arg.count('>') or - constructor_arg.count('(') > constructor_arg.count(')')): - constructor_arg += ',' + constructor_args[i + 1] - del constructor_args[i + 1] - constructor_args[i] = constructor_arg - i += 1 - - variadic_args = [arg for arg in constructor_args if '&&...' in arg] - defaulted_args = [arg for arg in constructor_args if '=' in arg] - noarg_constructor = (not constructor_args or # empty arg list - # 'void' arg specifier - (len(constructor_args) == 1 and - constructor_args[0].strip() == 'void')) - onearg_constructor = ((len(constructor_args) == 1 and # exactly one arg - not noarg_constructor) or - # all but at most one arg defaulted - (len(constructor_args) >= 1 and - not noarg_constructor and - len(defaulted_args) >= len(constructor_args) - 1) or - # variadic arguments with zero or one argument - (len(constructor_args) <= 2 and - len(variadic_args) >= 1)) - initializer_list_constructor = bool( - onearg_constructor and - Search(r'\bstd\s*::\s*initializer_list\b', constructor_args[0])) - copy_constructor = bool( - onearg_constructor and - Match(r'(const\s+)?%s(\s*<[^>]*>)?(\s+const)?\s*(?:<\w+>\s*)?&' - % re.escape(base_classname), constructor_args[0].strip())) - - if (not is_marked_explicit and - onearg_constructor and - not initializer_list_constructor and - not copy_constructor): - if defaulted_args or variadic_args: - error(filename, linenum, 'runtime/explicit', 5, - 'Constructors callable with one argument ' - 'should be marked explicit.') - else: - error(filename, linenum, 'runtime/explicit', 5, - 'Single-parameter constructors should be marked explicit.') - elif is_marked_explicit and not onearg_constructor: - if noarg_constructor: - error(filename, linenum, 'runtime/explicit', 5, - 'Zero-parameter constructors should not be marked explicit.') - - -def CheckSpacingForFunctionCall(filename, clean_lines, linenum, error): - """Checks for the correctness of various spacing around function calls. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - - # Since function calls often occur inside if/for/while/switch - # expressions - which have their own, more liberal conventions - we - # first see if we should be looking inside such an expression for a - # function call, to which we can apply more strict standards. - fncall = line # if there's no control flow construct, look at whole line - for pattern in (r'\bif\s*\((.*)\)\s*{', - r'\bfor\s*\((.*)\)\s*{', - r'\bwhile\s*\((.*)\)\s*[{;]', - r'\bswitch\s*\((.*)\)\s*{'): - match = Search(pattern, line) - if match: - fncall = match.group(1) # look inside the parens for function calls - break - - # Except in if/for/while/switch, there should never be space - # immediately inside parens (eg "f( 3, 4 )"). We make an exception - # for nested parens ( (a+b) + c ). Likewise, there should never be - # a space before a ( when it's a function argument. I assume it's a - # function argument when the char before the whitespace is legal in - # a function name (alnum + _) and we're not starting a macro. Also ignore - # pointers and references to arrays and functions coz they're too tricky: - # we use a very simple way to recognize these: - # " (something)(maybe-something)" or - # " (something)(maybe-something," or - # " (something)[something]" - # Note that we assume the contents of [] to be short enough that - # they'll never need to wrap. - if ( # Ignore control structures. - not Search(r'\b(if|for|while|switch|return|new|delete|catch|sizeof)\b', - fncall) and - # Ignore pointers/references to functions. - not Search(r' \([^)]+\)\([^)]*(\)|,$)', fncall) and - # Ignore pointers/references to arrays. - not Search(r' \([^)]+\)\[[^\]]+\]', fncall)): - if Search(r'\w\s*\(\s(?!\s*\\$)', fncall): # a ( used for a fn call - error(filename, linenum, 'whitespace/parens', 4, - 'Extra space after ( in function call') - elif Search(r'\(\s+(?!(\s*\\)|\()', fncall): - error(filename, linenum, 'whitespace/parens', 2, - 'Extra space after (') - if (Search(r'\w\s+\(', fncall) and - not Search(r'_{0,2}asm_{0,2}\s+_{0,2}volatile_{0,2}\s+\(', fncall) and - not Search(r'#\s*define|typedef|using\s+\w+\s*=', fncall) and - not Search(r'\w\s+\((\w+::)*\*\w+\)\(', fncall) and - not Search(r'\bcase\s+\(', fncall)): - # TODO(unknown): Space after an operator function seem to be a common - # error, silence those for now by restricting them to highest verbosity. - if Search(r'\boperator_*\b', line): - error(filename, linenum, 'whitespace/parens', 0, - 'Extra space before ( in function call') - else: - error(filename, linenum, 'whitespace/parens', 4, - 'Extra space before ( in function call') - # If the ) is followed only by a newline or a { + newline, assume it's - # part of a control statement (if/while/etc), and don't complain - if Search(r'[^)]\s+\)\s*[^{\s]', fncall): - # If the closing parenthesis is preceded by only whitespaces, - # try to give a more descriptive error message. - if Search(r'^\s+\)', fncall): - error(filename, linenum, 'whitespace/parens', 2, - 'Closing ) should be moved to the previous line') - else: - error(filename, linenum, 'whitespace/parens', 2, - 'Extra space before )') - - -def IsBlankLine(line): - """Returns true if the given line is blank. - - We consider a line to be blank if the line is empty or consists of - only white spaces. - - Args: - line: A line of a string. - - Returns: - True, if the given line is blank. - """ - return not line or line.isspace() - - -def CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line, - error): - is_namespace_indent_item = ( - len(nesting_state.stack) > 1 and - nesting_state.stack[-1].check_namespace_indentation and - isinstance(nesting_state.previous_stack_top, _NamespaceInfo) and - nesting_state.previous_stack_top == nesting_state.stack[-2]) - - if ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item, - clean_lines.elided, line): - CheckItemIndentationInNamespace(filename, clean_lines.elided, - line, error) - - -def CheckForFunctionLengths(filename, clean_lines, linenum, - function_state, error): - """Reports for long function bodies. - - For an overview why this is done, see: - https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions - - Uses a simplistic algorithm assuming other style guidelines - (especially spacing) are followed. - Only checks unindented functions, so class members are unchecked. - Trivial bodies are unchecked, so constructors with huge initializer lists - may be missed. - Blank/comment lines are not counted so as to avoid encouraging the removal - of vertical space and comments just to get through a lint check. - NOLINT *on the last line of a function* disables this check. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - function_state: Current function name and lines in body so far. - error: The function to call with any errors found. - """ - lines = clean_lines.lines - line = lines[linenum] - joined_line = '' - - starting_func = False - regexp = r'(\w(\w|::|\*|\&|\s)*)\(' # decls * & space::name( ... - match_result = Match(regexp, line) - if match_result: - # If the name is all caps and underscores, figure it's a macro and - # ignore it, unless it's TEST or TEST_F. - function_name = match_result.group(1).split()[-1] - if function_name == 'TEST' or function_name == 'TEST_F' or ( - not Match(r'[A-Z_]+$', function_name)): - starting_func = True - - if starting_func: - body_found = False - for start_linenum in range(linenum, clean_lines.NumLines()): - start_line = lines[start_linenum] - joined_line += ' ' + start_line.lstrip() - if Search(r'(;|})', start_line): # Declarations and trivial functions - body_found = True - break # ... ignore - elif Search(r'{', start_line): - body_found = True - function = Search(r'((\w|:)*)\(', line).group(1) - if Match(r'TEST', function): # Handle TEST... macros - parameter_regexp = Search(r'(\(.*\))', joined_line) - if parameter_regexp: # Ignore bad syntax - function += parameter_regexp.group(1) - else: - function += '()' - function_state.Begin(function) - break - if not body_found: - # No body for the function (or evidence of a non-function) was found. - error(filename, linenum, 'readability/fn_size', 5, - 'Lint failed to find start of function body.') - elif Match(r'^\}\s*$', line): # function end - function_state.Check(error, filename, linenum) - function_state.End() - elif not Match(r'^\s*$', line): - function_state.Count() # Count non-blank/non-comment lines. - - -_RE_PATTERN_TODO = re.compile(r'^//(\s*)TODO(\(.+?\))?:?(\s|$)?') - - -def CheckComment(line, filename, linenum, next_line_start, error): - """Checks for common mistakes in comments. - - Args: - line: The line in question. - filename: The name of the current file. - linenum: The number of the line to check. - next_line_start: The first non-whitespace column of the next line. - error: The function to call with any errors found. - """ - commentpos = line.find('//') - if commentpos != -1: - # Check if the // may be in quotes. If so, ignore it - if re.sub(r'\\.', '', line[0:commentpos]).count('"') % 2 == 0: - # Allow one space for new scopes, two spaces otherwise: - if (not (Match(r'^.*{ *//', line) and next_line_start == commentpos) and - ((commentpos >= 1 and - line[commentpos-1] not in string.whitespace) or - (commentpos >= 2 and - line[commentpos-2] not in string.whitespace))): - error(filename, linenum, 'whitespace/comments', 2, - 'At least two spaces is best between code and comments') - - # Checks for common mistakes in TODO comments. - comment = line[commentpos:] - match = _RE_PATTERN_TODO.match(comment) - if match: - # One whitespace is correct; zero whitespace is handled elsewhere. - leading_whitespace = match.group(1) - if len(leading_whitespace) > 1: - error(filename, linenum, 'whitespace/todo', 2, - 'Too many spaces before TODO') - - username = match.group(2) - if not username: - error(filename, linenum, 'readability/todo', 2, - 'Missing username in TODO; it should look like ' - '"// TODO(my_username): Stuff."') - - middle_whitespace = match.group(3) - # Comparisons made explicit for correctness -- pylint: disable=g-explicit-bool-comparison - if middle_whitespace != ' ' and middle_whitespace != '': - error(filename, linenum, 'whitespace/todo', 2, - 'TODO(my_username) should be followed by a space') - - # If the comment contains an alphanumeric character, there - # should be a space somewhere between it and the // unless - # it's a /// or //! Doxygen comment. - if (Match(r'//[^ ]*\w', comment) and - not Match(r'(///|//\!)(\s+|$)', comment)): - error(filename, linenum, 'whitespace/comments', 4, - 'Should have a space between // and comment') - - -def CheckAccess(filename, clean_lines, linenum, nesting_state, error): - """Checks for improper use of DISALLOW* macros. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - nesting_state: A NestingState instance which maintains information about - the current stack of nested blocks being parsed. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] # get rid of comments and strings - - matched = Match((r'\s*(DISALLOW_COPY_AND_ASSIGN|' - r'DISALLOW_IMPLICIT_CONSTRUCTORS)'), line) - if not matched: - return - if nesting_state.stack and isinstance(nesting_state.stack[-1], _ClassInfo): - if nesting_state.stack[-1].access != 'private': - error(filename, linenum, 'readability/constructors', 3, - '%s must be in the private: section' % matched.group(1)) - - else: - # Found DISALLOW* macro outside a class declaration, or perhaps it - # was used inside a function when it should have been part of the - # class declaration. We could issue a warning here, but it - # probably resulted in a compiler error already. - pass - - -def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): - """Checks for the correctness of various spacing issues in the code. - - Things we check for: spaces around operators, spaces after - if/for/while/switch, no spaces around parens in function calls, two - spaces between code and comment, don't start a block with a blank - line, don't end a function with a blank line, don't add a blank line - after public/protected/private, don't have too many blank lines in a row. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - nesting_state: A NestingState instance which maintains information about - the current stack of nested blocks being parsed. - error: The function to call with any errors found. - """ - - # Don't use "elided" lines here, otherwise we can't check commented lines. - # Don't want to use "raw" either, because we don't want to check inside C++11 - # raw strings, - raw = clean_lines.lines_without_raw_strings - line = raw[linenum] - - # Before nixing comments, check if the line is blank for no good - # reason. This includes the first line after a block is opened, and - # blank lines at the end of a function (ie, right before a line like '}' - # - # Skip all the blank line checks if we are immediately inside a - # namespace body. In other words, don't issue blank line warnings - # for this block: - # namespace { - # - # } - # - # A warning about missing end of namespace comments will be issued instead. - # - # Also skip blank line checks for 'extern "C"' blocks, which are formatted - # like namespaces. - if (IsBlankLine(line) and - not nesting_state.InNamespaceBody() and - not nesting_state.InExternC()): - elided = clean_lines.elided - prev_line = elided[linenum - 1] - prevbrace = prev_line.rfind('{') - # TODO(unknown): Don't complain if line before blank line, and line after, - # both start with alnums and are indented the same amount. - # This ignores whitespace at the start of a namespace block - # because those are not usually indented. - if prevbrace != -1 and prev_line[prevbrace:].find('}') == -1: - # OK, we have a blank line at the start of a code block. Before we - # complain, we check if it is an exception to the rule: The previous - # non-empty line has the parameters of a function header that are indented - # 4 spaces (because they did not fit in a 80 column line when placed on - # the same line as the function name). We also check for the case where - # the previous line is indented 6 spaces, which may happen when the - # initializers of a constructor do not fit into a 80 column line. - exception = False - if Match(r' {6}\w', prev_line): # Initializer list? - # We are looking for the opening column of initializer list, which - # should be indented 4 spaces to cause 6 space indentation afterwards. - search_position = linenum-2 - while (search_position >= 0 - and Match(r' {6}\w', elided[search_position])): - search_position -= 1 - exception = (search_position >= 0 - and elided[search_position][:5] == ' :') - else: - # Search for the function arguments or an initializer list. We use a - # simple heuristic here: If the line is indented 4 spaces; and we have a - # closing paren, without the opening paren, followed by an opening brace - # or colon (for initializer lists) we assume that it is the last line of - # a function header. If we have a colon indented 4 spaces, it is an - # initializer list. - exception = (Match(r' {4}\w[^\(]*\)\s*(const\s*)?(\{\s*$|:)', - prev_line) - or Match(r' {4}:', prev_line)) - - if not exception: - error(filename, linenum, 'whitespace/blank_line', 2, - 'Redundant blank line at the start of a code block ' - 'should be deleted.') - # Ignore blank lines at the end of a block in a long if-else - # chain, like this: - # if (condition1) { - # // Something followed by a blank line - # - # } else if (condition2) { - # // Something else - # } - if linenum + 1 < clean_lines.NumLines(): - next_line = raw[linenum + 1] - if (next_line - and Match(r'\s*}', next_line) - and next_line.find('} else ') == -1): - error(filename, linenum, 'whitespace/blank_line', 3, - 'Redundant blank line at the end of a code block ' - 'should be deleted.') - - matched = Match(r'\s*(public|protected|private):', prev_line) - if matched: - error(filename, linenum, 'whitespace/blank_line', 3, - 'Do not leave a blank line after "%s:"' % matched.group(1)) - - # Next, check comments - next_line_start = 0 - if linenum + 1 < clean_lines.NumLines(): - next_line = raw[linenum + 1] - next_line_start = len(next_line) - len(next_line.lstrip()) - CheckComment(line, filename, linenum, next_line_start, error) - - # get rid of comments and strings - line = clean_lines.elided[linenum] - - # You shouldn't have spaces before your brackets, except maybe after - # 'delete []' or 'return []() {};' - if Search(r'\w\s+\[', line) and not Search(r'(?:delete|return)\s+\[', line): - error(filename, linenum, 'whitespace/braces', 5, - 'Extra space before [') - - # In range-based for, we wanted spaces before and after the colon, but - # not around "::" tokens that might appear. - if (Search(r'for *\(.*[^:]:[^: ]', line) or - Search(r'for *\(.*[^: ]:[^:]', line)): - error(filename, linenum, 'whitespace/forcolon', 2, - 'Missing space around colon in range-based for loop') - - -def CheckOperatorSpacing(filename, clean_lines, linenum, error): - """Checks for horizontal spacing around operators. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - - # Don't try to do spacing checks for operator methods. Do this by - # replacing the troublesome characters with something else, - # preserving column position for all other characters. - # - # The replacement is done repeatedly to avoid false positives from - # operators that call operators. - while True: - match = Match(r'^(.*\boperator\b)(\S+)(\s*\(.*)$', line) - if match: - line = match.group(1) + ('_' * len(match.group(2))) + match.group(3) - else: - break - - # We allow no-spaces around = within an if: "if ( (a=Foo()) == 0 )". - # Otherwise not. Note we only check for non-spaces on *both* sides; - # sometimes people put non-spaces on one side when aligning ='s among - # many lines (not that this is behavior that I approve of...) - if ((Search(r'[\w.]=', line) or - Search(r'=[\w.]', line)) - and not Search(r'\b(if|while|for) ', line) - # Operators taken from [lex.operators] in C++11 standard. - and not Search(r'(>=|<=|==|!=|&=|\^=|\|=|\+=|\*=|\/=|\%=)', line) - and not Search(r'operator=', line)): - error(filename, linenum, 'whitespace/operators', 4, - 'Missing spaces around =') - - # It's ok not to have spaces around binary operators like + - * /, but if - # there's too little whitespace, we get concerned. It's hard to tell, - # though, so we punt on this one for now. TODO. - - # You should always have whitespace around binary operators. - # - # Check <= and >= first to avoid false positives with < and >, then - # check non-include lines for spacing around < and >. - # - # If the operator is followed by a comma, assume it's be used in a - # macro context and don't do any checks. This avoids false - # positives. - # - # Note that && is not included here. This is because there are too - # many false positives due to RValue references. - match = Search(r'[^<>=!\s](==|!=|<=|>=|\|\|)[^<>=!\s,;\)]', line) - if match: - error(filename, linenum, 'whitespace/operators', 3, - 'Missing spaces around %s' % match.group(1)) - elif not Match(r'#.*include', line): - # Look for < that is not surrounded by spaces. This is only - # triggered if both sides are missing spaces, even though - # technically should should flag if at least one side is missing a - # space. This is done to avoid some false positives with shifts. - match = Match(r'^(.*[^\s<])<[^\s=<,]', line) - if match: - (_, _, end_pos) = CloseExpression( - clean_lines, linenum, len(match.group(1))) - if end_pos <= -1: - error(filename, linenum, 'whitespace/operators', 3, - 'Missing spaces around <') - - # Look for > that is not surrounded by spaces. Similar to the - # above, we only trigger if both sides are missing spaces to avoid - # false positives with shifts. - match = Match(r'^(.*[^-\s>])>[^\s=>,]', line) - if match: - (_, _, start_pos) = ReverseCloseExpression( - clean_lines, linenum, len(match.group(1))) - if start_pos <= -1: - error(filename, linenum, 'whitespace/operators', 3, - 'Missing spaces around >') - - # We allow no-spaces around << when used like this: 10<<20, but - # not otherwise (particularly, not when used as streams) - # - # We also allow operators following an opening parenthesis, since - # those tend to be macros that deal with operators. - match = Search(r'(operator|[^\s(<])(?:L|UL|LL|ULL|l|ul|ll|ull)?<<([^\s,=<])', line) - if (match and not (match.group(1).isdigit() and match.group(2).isdigit()) and - not (match.group(1) == 'operator' and match.group(2) == ';')): - error(filename, linenum, 'whitespace/operators', 3, - 'Missing spaces around <<') - - # We allow no-spaces around >> for almost anything. This is because - # C++11 allows ">>" to close nested templates, which accounts for - # most cases when ">>" is not followed by a space. - # - # We still warn on ">>" followed by alpha character, because that is - # likely due to ">>" being used for right shifts, e.g.: - # value >> alpha - # - # When ">>" is used to close templates, the alphanumeric letter that - # follows would be part of an identifier, and there should still be - # a space separating the template type and the identifier. - # type> alpha - match = Search(r'>>[a-zA-Z_]', line) - if match: - error(filename, linenum, 'whitespace/operators', 3, - 'Missing spaces around >>') - - # There shouldn't be space around unary operators - match = Search(r'(!\s|~\s|[\s]--[\s;]|[\s]\+\+[\s;])', line) - if match: - error(filename, linenum, 'whitespace/operators', 4, - 'Extra space for operator %s' % match.group(1)) - - -def CheckParenthesisSpacing(filename, clean_lines, linenum, error): - """Checks for horizontal spacing around parentheses. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - - # No spaces after an if, while, switch, or for - match = Search(r' (if\(|for\(|while\(|switch\()', line) - if match: - error(filename, linenum, 'whitespace/parens', 5, - 'Missing space before ( in %s' % match.group(1)) - - # For if/for/while/switch, the left and right parens should be - # consistent about how many spaces are inside the parens, and - # there should either be zero or one spaces inside the parens. - # We don't want: "if ( foo)" or "if ( foo )". - # Exception: "for ( ; foo; bar)" and "for (foo; bar; )" are allowed. - match = Search(r'\b(if|for|while|switch)\s*' - r'\(([ ]*)(.).*[^ ]+([ ]*)\)\s*{\s*$', - line) - if match: - if len(match.group(2)) != len(match.group(4)): - if not (match.group(3) == ';' and - len(match.group(2)) == 1 + len(match.group(4)) or - not match.group(2) and Search(r'\bfor\s*\(.*; \)', line)): - error(filename, linenum, 'whitespace/parens', 5, - 'Mismatching spaces inside () in %s' % match.group(1)) - if len(match.group(2)) not in [0, 1]: - error(filename, linenum, 'whitespace/parens', 5, - 'Should have zero or one spaces inside ( and ) in %s' % - match.group(1)) - - -def CheckCommaSpacing(filename, clean_lines, linenum, error): - """Checks for horizontal spacing near commas and semicolons. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - raw = clean_lines.lines_without_raw_strings - line = clean_lines.elided[linenum] - - # You should always have a space after a comma (either as fn arg or operator) - # - # This does not apply when the non-space character following the - # comma is another comma, since the only time when that happens is - # for empty macro arguments. - # - # We run this check in two passes: first pass on elided lines to - # verify that lines contain missing whitespaces, second pass on raw - # lines to confirm that those missing whitespaces are not due to - # elided comments. - if (Search(r',[^,\s]', ReplaceAll(r'\boperator\s*,\s*\(', 'F(', line)) and - Search(r',[^,\s]', raw[linenum])): - error(filename, linenum, 'whitespace/comma', 3, - 'Missing space after ,') - - # You should always have a space after a semicolon - # except for few corner cases - # TODO(unknown): clarify if 'if (1) { return 1;}' is requires one more - # space after ; - if Search(r';[^\s};\\)/]', line): - error(filename, linenum, 'whitespace/semicolon', 3, - 'Missing space after ;') - - -def _IsType(clean_lines, nesting_state, expr): - """Check if expression looks like a type name, returns true if so. - - Args: - clean_lines: A CleansedLines instance containing the file. - nesting_state: A NestingState instance which maintains information about - the current stack of nested blocks being parsed. - expr: The expression to check. - Returns: - True, if token looks like a type. - """ - # Keep only the last token in the expression - last_word = Match(r'^.*(\b\S+)$', expr) - if last_word: - token = last_word.group(1) - else: - token = expr - - # Match native types and stdint types - if _TYPES.match(token): - return True - - # Try a bit harder to match templated types. Walk up the nesting - # stack until we find something that resembles a typename - # declaration for what we are looking for. - typename_pattern = (r'\b(?:typename|class|struct)\s+' + re.escape(token) + - r'\b') - block_index = len(nesting_state.stack) - 1 - while block_index >= 0: - if isinstance(nesting_state.stack[block_index], _NamespaceInfo): - return False - - # Found where the opening brace is. We want to scan from this - # line up to the beginning of the function, minus a few lines. - # template - # class C - # : public ... { // start scanning here - last_line = nesting_state.stack[block_index].starting_linenum - - next_block_start = 0 - if block_index > 0: - next_block_start = nesting_state.stack[block_index - 1].starting_linenum - first_line = last_line - while first_line >= next_block_start: - if clean_lines.elided[first_line].find('template') >= 0: - break - first_line -= 1 - if first_line < next_block_start: - # Didn't find any "template" keyword before reaching the next block, - # there are probably no template things to check for this block - block_index -= 1 - continue - - # Look for typename in the specified range - for i in xrange(first_line, last_line + 1, 1): - if Search(typename_pattern, clean_lines.elided[i]): - return True - block_index -= 1 - - return False - - -def CheckBracesSpacing(filename, clean_lines, linenum, nesting_state, error): - """Checks for horizontal spacing near commas. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - nesting_state: A NestingState instance which maintains information about - the current stack of nested blocks being parsed. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - - # Except after an opening paren, or after another opening brace (in case of - # an initializer list, for instance), you should have spaces before your - # braces when they are delimiting blocks, classes, namespaces etc. - # And since you should never have braces at the beginning of a line, - # this is an easy test. Except that braces used for initialization don't - # follow the same rule; we often don't want spaces before those. - match = Match(r'^(.*[^ ({>]){', line) - - if match: - # Try a bit harder to check for brace initialization. This - # happens in one of the following forms: - # Constructor() : initializer_list_{} { ... } - # Constructor{}.MemberFunction() - # Type variable{}; - # FunctionCall(type{}, ...); - # LastArgument(..., type{}); - # LOG(INFO) << type{} << " ..."; - # map_of_type[{...}] = ...; - # ternary = expr ? new type{} : nullptr; - # OuterTemplate{}> - # - # We check for the character following the closing brace, and - # silence the warning if it's one of those listed above, i.e. - # "{.;,)<>]:". - # - # To account for nested initializer list, we allow any number of - # closing braces up to "{;,)<". We can't simply silence the - # warning on first sight of closing brace, because that would - # cause false negatives for things that are not initializer lists. - # Silence this: But not this: - # Outer{ if (...) { - # Inner{...} if (...){ // Missing space before { - # }; } - # - # There is a false negative with this approach if people inserted - # spurious semicolons, e.g. "if (cond){};", but we will catch the - # spurious semicolon with a separate check. - leading_text = match.group(1) - (endline, endlinenum, endpos) = CloseExpression( - clean_lines, linenum, len(match.group(1))) - trailing_text = '' - if endpos > -1: - trailing_text = endline[endpos:] - for offset in xrange(endlinenum + 1, - min(endlinenum + 3, clean_lines.NumLines() - 1)): - trailing_text += clean_lines.elided[offset] - # We also suppress warnings for `uint64_t{expression}` etc., as the style - # guide recommends brace initialization for integral types to avoid - # overflow/truncation. - if (not Match(r'^[\s}]*[{.;,)<>\]:]', trailing_text) - and not _IsType(clean_lines, nesting_state, leading_text)): - error(filename, linenum, 'whitespace/braces', 5, - 'Missing space before {') - - # Make sure '} else {' has spaces. - if Search(r'}else', line): - error(filename, linenum, 'whitespace/braces', 5, - 'Missing space before else') - - # You shouldn't have a space before a semicolon at the end of the line. - # There's a special case for "for" since the style guide allows space before - # the semicolon there. - if Search(r':\s*;\s*$', line): - error(filename, linenum, 'whitespace/semicolon', 5, - 'Semicolon defining empty statement. Use {} instead.') - elif Search(r'^\s*;\s*$', line): - error(filename, linenum, 'whitespace/semicolon', 5, - 'Line contains only semicolon. If this should be an empty statement, ' - 'use {} instead.') - elif (Search(r'\s+;\s*$', line) and - not Search(r'\bfor\b', line)): - error(filename, linenum, 'whitespace/semicolon', 5, - 'Extra space before last semicolon. If this should be an empty ' - 'statement, use {} instead.') - - -def IsDecltype(clean_lines, linenum, column): - """Check if the token ending on (linenum, column) is decltype(). - - Args: - clean_lines: A CleansedLines instance containing the file. - linenum: the number of the line to check. - column: end column of the token to check. - Returns: - True if this token is decltype() expression, False otherwise. - """ - (text, _, start_col) = ReverseCloseExpression(clean_lines, linenum, column) - if start_col < 0: - return False - if Search(r'\bdecltype\s*$', text[0:start_col]): - return True - return False - -def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error): - """Checks for additional blank line issues related to sections. - - Currently the only thing checked here is blank line before protected/private. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - class_info: A _ClassInfo objects. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - # Skip checks if the class is small, where small means 25 lines or less. - # 25 lines seems like a good cutoff since that's the usual height of - # terminals, and any class that can't fit in one screen can't really - # be considered "small". - # - # Also skip checks if we are on the first line. This accounts for - # classes that look like - # class Foo { public: ... }; - # - # If we didn't find the end of the class, last_line would be zero, - # and the check will be skipped by the first condition. - if (class_info.last_line - class_info.starting_linenum <= 24 or - linenum <= class_info.starting_linenum): - return - - matched = Match(r'\s*(public|protected|private):', clean_lines.lines[linenum]) - if matched: - # Issue warning if the line before public/protected/private was - # not a blank line, but don't do this if the previous line contains - # "class" or "struct". This can happen two ways: - # - We are at the beginning of the class. - # - We are forward-declaring an inner class that is semantically - # private, but needed to be public for implementation reasons. - # Also ignores cases where the previous line ends with a backslash as can be - # common when defining classes in C macros. - prev_line = clean_lines.lines[linenum - 1] - if (not IsBlankLine(prev_line) and - not Search(r'\b(class|struct)\b', prev_line) and - not Search(r'\\$', prev_line)): - # Try a bit harder to find the beginning of the class. This is to - # account for multi-line base-specifier lists, e.g.: - # class Derived - # : public Base { - end_class_head = class_info.starting_linenum - for i in range(class_info.starting_linenum, linenum): - if Search(r'\{\s*$', clean_lines.lines[i]): - end_class_head = i - break - if end_class_head < linenum - 1: - error(filename, linenum, 'whitespace/blank_line', 3, - '"%s:" should be preceded by a blank line' % matched.group(1)) - - -def GetPreviousNonBlankLine(clean_lines, linenum): - """Return the most recent non-blank line and its line number. - - Args: - clean_lines: A CleansedLines instance containing the file contents. - linenum: The number of the line to check. - - Returns: - A tuple with two elements. The first element is the contents of the last - non-blank line before the current line, or the empty string if this is the - first non-blank line. The second is the line number of that line, or -1 - if this is the first non-blank line. - """ - - prevlinenum = linenum - 1 - while prevlinenum >= 0: - prevline = clean_lines.elided[prevlinenum] - if not IsBlankLine(prevline): # if not a blank line... - return (prevline, prevlinenum) - prevlinenum -= 1 - return ('', -1) - - -def CheckBraces(filename, clean_lines, linenum, error): - """Looks for misplaced braces (e.g. at the end of line). - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - - line = clean_lines.elided[linenum] # get rid of comments and strings - - if Match(r'\s*{\s*$', line): - # We allow an open brace to start a line in the case where someone is using - # braces in a block to explicitly create a new scope, which is commonly used - # to control the lifetime of stack-allocated variables. Braces are also - # used for brace initializers inside function calls. We don't detect this - # perfectly: we just don't complain if the last non-whitespace character on - # the previous non-blank line is ',', ';', ':', '(', '{', or '}', or if the - # previous line starts a preprocessor block. We also allow a brace on the - # following line if it is part of an array initialization and would not fit - # within the 80 character limit of the preceding line. - prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0] - if (not Search(r'[,;:}{(]\s*$', prevline) and - not Match(r'\s*#', prevline) and - not (GetLineWidth(prevline) > _line_length - 2 and '[]' in prevline)): - error(filename, linenum, 'whitespace/braces', 4, - '{ should almost always be at the end of the previous line') - - # An else clause should be on the same line as the preceding closing brace. - if Match(r'\s*else\b\s*(?:if\b|\{|$)', line): - prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0] - if Match(r'\s*}\s*$', prevline): - error(filename, linenum, 'whitespace/newline', 4, - 'An else should appear on the same line as the preceding }') - - # If braces come on one side of an else, they should be on both. - # However, we have to worry about "else if" that spans multiple lines! - if Search(r'else if\s*\(', line): # could be multi-line if - brace_on_left = bool(Search(r'}\s*else if\s*\(', line)) - # find the ( after the if - pos = line.find('else if') - pos = line.find('(', pos) - if pos > 0: - (endline, _, endpos) = CloseExpression(clean_lines, linenum, pos) - brace_on_right = endline[endpos:].find('{') != -1 - if brace_on_left != brace_on_right: # must be brace after if - error(filename, linenum, 'readability/braces', 5, - 'If an else has a brace on one side, it should have it on both') - elif Search(r'}\s*else[^{]*$', line) or Match(r'[^}]*else\s*{', line): - error(filename, linenum, 'readability/braces', 5, - 'If an else has a brace on one side, it should have it on both') - - # Likewise, an else should never have the else clause on the same line - if Search(r'\belse [^\s{]', line) and not Search(r'\belse if\b', line): - error(filename, linenum, 'whitespace/newline', 4, - 'Else clause should never be on same line as else (use 2 lines)') - - # In the same way, a do/while should never be on one line - if Match(r'\s*do [^\s{]', line): - error(filename, linenum, 'whitespace/newline', 4, - 'do/while clauses should not be on a single line') - - # Check single-line if/else bodies. The style guide says 'curly braces are not - # required for single-line statements'. We additionally allow multi-line, - # single statements, but we reject anything with more than one semicolon in - # it. This means that the first semicolon after the if should be at the end of - # its line, and the line after that should have an indent level equal to or - # lower than the if. We also check for ambiguous if/else nesting without - # braces. - if_else_match = Search(r'\b(if\s*\(|else\b)', line) - if if_else_match and not Match(r'\s*#', line): - if_indent = GetIndentLevel(line) - endline, endlinenum, endpos = line, linenum, if_else_match.end() - if_match = Search(r'\bif\s*\(', line) - if if_match: - # This could be a multiline if condition, so find the end first. - pos = if_match.end() - 1 - (endline, endlinenum, endpos) = CloseExpression(clean_lines, linenum, pos) - # Check for an opening brace, either directly after the if or on the next - # line. If found, this isn't a single-statement conditional. - if (not Match(r'\s*{', endline[endpos:]) - and not (Match(r'\s*$', endline[endpos:]) - and endlinenum < (len(clean_lines.elided) - 1) - and Match(r'\s*{', clean_lines.elided[endlinenum + 1]))): - while (endlinenum < len(clean_lines.elided) - and ';' not in clean_lines.elided[endlinenum][endpos:]): - endlinenum += 1 - endpos = 0 - if endlinenum < len(clean_lines.elided): - endline = clean_lines.elided[endlinenum] - # We allow a mix of whitespace and closing braces (e.g. for one-liner - # methods) and a single \ after the semicolon (for macros) - endpos = endline.find(';') - if not Match(r';[\s}]*(\\?)$', endline[endpos:]): - # Semicolon isn't the last character, there's something trailing. - # Output a warning if the semicolon is not contained inside - # a lambda expression. - if not Match(r'^[^{};]*\[[^\[\]]*\][^{}]*\{[^{}]*\}\s*\)*[;,]\s*$', - endline): - error(filename, linenum, 'readability/braces', 4, - 'If/else bodies with multiple statements require braces') - elif endlinenum < len(clean_lines.elided) - 1: - # Make sure the next line is dedented - next_line = clean_lines.elided[endlinenum + 1] - next_indent = GetIndentLevel(next_line) - # With ambiguous nested if statements, this will error out on the - # if that *doesn't* match the else, regardless of whether it's the - # inner one or outer one. - if (if_match and Match(r'\s*else\b', next_line) - and next_indent != if_indent): - error(filename, linenum, 'readability/braces', 4, - 'Else clause should be indented at the same level as if. ' - 'Ambiguous nested if/else chains require braces.') - elif next_indent > if_indent: - error(filename, linenum, 'readability/braces', 4, - 'If/else bodies with multiple statements require braces') - - -def CheckTrailingSemicolon(filename, clean_lines, linenum, error): - """Looks for redundant trailing semicolon. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - - line = clean_lines.elided[linenum] - - # Block bodies should not be followed by a semicolon. Due to C++11 - # brace initialization, there are more places where semicolons are - # required than not, so we use a whitelist approach to check these - # rather than a blacklist. These are the places where "};" should - # be replaced by just "}": - # 1. Some flavor of block following closing parenthesis: - # for (;;) {}; - # while (...) {}; - # switch (...) {}; - # Function(...) {}; - # if (...) {}; - # if (...) else if (...) {}; - # - # 2. else block: - # if (...) else {}; - # - # 3. const member function: - # Function(...) const {}; - # - # 4. Block following some statement: - # x = 42; - # {}; - # - # 5. Block at the beginning of a function: - # Function(...) { - # {}; - # } - # - # Note that naively checking for the preceding "{" will also match - # braces inside multi-dimensional arrays, but this is fine since - # that expression will not contain semicolons. - # - # 6. Block following another block: - # while (true) {} - # {}; - # - # 7. End of namespaces: - # namespace {}; - # - # These semicolons seems far more common than other kinds of - # redundant semicolons, possibly due to people converting classes - # to namespaces. For now we do not warn for this case. - # - # Try matching case 1 first. - match = Match(r'^(.*\)\s*)\{', line) - if match: - # Matched closing parenthesis (case 1). Check the token before the - # matching opening parenthesis, and don't warn if it looks like a - # macro. This avoids these false positives: - # - macro that defines a base class - # - multi-line macro that defines a base class - # - macro that defines the whole class-head - # - # But we still issue warnings for macros that we know are safe to - # warn, specifically: - # - TEST, TEST_F, TEST_P, MATCHER, MATCHER_P - # - TYPED_TEST - # - INTERFACE_DEF - # - EXCLUSIVE_LOCKS_REQUIRED, SHARED_LOCKS_REQUIRED, LOCKS_EXCLUDED: - # - # We implement a whitelist of safe macros instead of a blacklist of - # unsafe macros, even though the latter appears less frequently in - # google code and would have been easier to implement. This is because - # the downside for getting the whitelist wrong means some extra - # semicolons, while the downside for getting the blacklist wrong - # would result in compile errors. - # - # In addition to macros, we also don't want to warn on - # - Compound literals - # - Lambdas - # - alignas specifier with anonymous structs - # - decltype - closing_brace_pos = match.group(1).rfind(')') - opening_parenthesis = ReverseCloseExpression( - clean_lines, linenum, closing_brace_pos) - if opening_parenthesis[2] > -1: - line_prefix = opening_parenthesis[0][0:opening_parenthesis[2]] - macro = Search(r'\b([A-Z_][A-Z0-9_]*)\s*$', line_prefix) - func = Match(r'^(.*\])\s*$', line_prefix) - if ((macro and - macro.group(1) not in ( - 'TEST', 'TEST_F', 'MATCHER', 'MATCHER_P', 'TYPED_TEST', - 'EXCLUSIVE_LOCKS_REQUIRED', 'SHARED_LOCKS_REQUIRED', - 'LOCKS_EXCLUDED', 'INTERFACE_DEF')) or - (func and not Search(r'\boperator\s*\[\s*\]', func.group(1))) or - Search(r'\b(?:struct|union)\s+alignas\s*$', line_prefix) or - Search(r'\bdecltype$', line_prefix) or - Search(r'\s+=\s*$', line_prefix)): - match = None - if (match and - opening_parenthesis[1] > 1 and - Search(r'\]\s*$', clean_lines.elided[opening_parenthesis[1] - 1])): - # Multi-line lambda-expression - match = None - - else: - # Try matching cases 2-3. - match = Match(r'^(.*(?:else|\)\s*const)\s*)\{', line) - if not match: - # Try matching cases 4-6. These are always matched on separate lines. - # - # Note that we can't simply concatenate the previous line to the - # current line and do a single match, otherwise we may output - # duplicate warnings for the blank line case: - # if (cond) { - # // blank line - # } - prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0] - if prevline and Search(r'[;{}]\s*$', prevline): - match = Match(r'^(\s*)\{', line) - - # Check matching closing brace - if match: - (endline, endlinenum, endpos) = CloseExpression( - clean_lines, linenum, len(match.group(1))) - if endpos > -1 and Match(r'^\s*;', endline[endpos:]): - # Current {} pair is eligible for semicolon check, and we have found - # the redundant semicolon, output warning here. - # - # Note: because we are scanning forward for opening braces, and - # outputting warnings for the matching closing brace, if there are - # nested blocks with trailing semicolons, we will get the error - # messages in reversed order. - - # We need to check the line forward for NOLINT - raw_lines = clean_lines.raw_lines - ParseNolintSuppressions(filename, raw_lines[endlinenum-1], endlinenum-1, - error) - ParseNolintSuppressions(filename, raw_lines[endlinenum], endlinenum, - error) - - error(filename, endlinenum, 'readability/braces', 4, - "You don't need a ; after a }") - - -def CheckEmptyBlockBody(filename, clean_lines, linenum, error): - """Look for empty loop/conditional body with only a single semicolon. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - - # Search for loop keywords at the beginning of the line. Because only - # whitespaces are allowed before the keywords, this will also ignore most - # do-while-loops, since those lines should start with closing brace. - # - # We also check "if" blocks here, since an empty conditional block - # is likely an error. - line = clean_lines.elided[linenum] - matched = Match(r'\s*(for|while|if)\s*\(', line) - if matched: - # Find the end of the conditional expression. - (end_line, end_linenum, end_pos) = CloseExpression( - clean_lines, linenum, line.find('(')) - - # Output warning if what follows the condition expression is a semicolon. - # No warning for all other cases, including whitespace or newline, since we - # have a separate check for semicolons preceded by whitespace. - if end_pos >= 0 and Match(r';', end_line[end_pos:]): - if matched.group(1) == 'if': - error(filename, end_linenum, 'whitespace/empty_conditional_body', 5, - 'Empty conditional bodies should use {}') - else: - error(filename, end_linenum, 'whitespace/empty_loop_body', 5, - 'Empty loop bodies should use {} or continue') - - # Check for if statements that have completely empty bodies (no comments) - # and no else clauses. - if end_pos >= 0 and matched.group(1) == 'if': - # Find the position of the opening { for the if statement. - # Return without logging an error if it has no brackets. - opening_linenum = end_linenum - opening_line_fragment = end_line[end_pos:] - # Loop until EOF or find anything that's not whitespace or opening {. - while not Search(r'^\s*\{', opening_line_fragment): - if Search(r'^(?!\s*$)', opening_line_fragment): - # Conditional has no brackets. - return - opening_linenum += 1 - if opening_linenum == len(clean_lines.elided): - # Couldn't find conditional's opening { or any code before EOF. - return - opening_line_fragment = clean_lines.elided[opening_linenum] - # Set opening_line (opening_line_fragment may not be entire opening line). - opening_line = clean_lines.elided[opening_linenum] - - # Find the position of the closing }. - opening_pos = opening_line_fragment.find('{') - if opening_linenum == end_linenum: - # We need to make opening_pos relative to the start of the entire line. - opening_pos += end_pos - (closing_line, closing_linenum, closing_pos) = CloseExpression( - clean_lines, opening_linenum, opening_pos) - if closing_pos < 0: - return - - # Now construct the body of the conditional. This consists of the portion - # of the opening line after the {, all lines until the closing line, - # and the portion of the closing line before the }. - if (clean_lines.raw_lines[opening_linenum] != - CleanseComments(clean_lines.raw_lines[opening_linenum])): - # Opening line ends with a comment, so conditional isn't empty. - return - if closing_linenum > opening_linenum: - # Opening line after the {. Ignore comments here since we checked above. - bodylist = list(opening_line[opening_pos+1:]) - # All lines until closing line, excluding closing line, with comments. - bodylist.extend(clean_lines.raw_lines[opening_linenum+1:closing_linenum]) - # Closing line before the }. Won't (and can't) have comments. - bodylist.append(clean_lines.elided[closing_linenum][:closing_pos-1]) - body = '\n'.join(bodylist) - else: - # If statement has brackets and fits on a single line. - body = opening_line[opening_pos+1:closing_pos-1] - - # Check if the body is empty - if not _EMPTY_CONDITIONAL_BODY_PATTERN.search(body): - return - # The body is empty. Now make sure there's not an else clause. - current_linenum = closing_linenum - current_line_fragment = closing_line[closing_pos:] - # Loop until EOF or find anything that's not whitespace or else clause. - while Search(r'^\s*$|^(?=\s*else)', current_line_fragment): - if Search(r'^(?=\s*else)', current_line_fragment): - # Found an else clause, so don't log an error. - return - current_linenum += 1 - if current_linenum == len(clean_lines.elided): - break - current_line_fragment = clean_lines.elided[current_linenum] - - # The body is empty and there's no else clause until EOF or other code. - error(filename, end_linenum, 'whitespace/empty_if_body', 4, - ('If statement had no body and no else clause')) - - -def FindCheckMacro(line): - """Find a replaceable CHECK-like macro. - - Args: - line: line to search on. - Returns: - (macro name, start position), or (None, -1) if no replaceable - macro is found. - """ - for macro in _CHECK_MACROS: - i = line.find(macro) - if i >= 0: - # Find opening parenthesis. Do a regular expression match here - # to make sure that we are matching the expected CHECK macro, as - # opposed to some other macro that happens to contain the CHECK - # substring. - matched = Match(r'^(.*\b' + macro + r'\s*)\(', line) - if not matched: - continue - return (macro, len(matched.group(1))) - return (None, -1) - - -def CheckCheck(filename, clean_lines, linenum, error): - """Checks the use of CHECK and EXPECT macros. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - - # Decide the set of replacement macros that should be suggested - lines = clean_lines.elided - (check_macro, start_pos) = FindCheckMacro(lines[linenum]) - if not check_macro: - return - - # Find end of the boolean expression by matching parentheses - (last_line, end_line, end_pos) = CloseExpression( - clean_lines, linenum, start_pos) - if end_pos < 0: - return - - # If the check macro is followed by something other than a - # semicolon, assume users will log their own custom error messages - # and don't suggest any replacements. - if not Match(r'\s*;', last_line[end_pos:]): - return - - if linenum == end_line: - expression = lines[linenum][start_pos + 1:end_pos - 1] - else: - expression = lines[linenum][start_pos + 1:] - for i in xrange(linenum + 1, end_line): - expression += lines[i] - expression += last_line[0:end_pos - 1] - - # Parse expression so that we can take parentheses into account. - # This avoids false positives for inputs like "CHECK((a < 4) == b)", - # which is not replaceable by CHECK_LE. - lhs = '' - rhs = '' - operator = None - while expression: - matched = Match(r'^\s*(<<|<<=|>>|>>=|->\*|->|&&|\|\||' - r'==|!=|>=|>|<=|<|\()(.*)$', expression) - if matched: - token = matched.group(1) - if token == '(': - # Parenthesized operand - expression = matched.group(2) - (end, _) = FindEndOfExpressionInLine(expression, 0, ['(']) - if end < 0: - return # Unmatched parenthesis - lhs += '(' + expression[0:end] - expression = expression[end:] - elif token in ('&&', '||'): - # Logical and/or operators. This means the expression - # contains more than one term, for example: - # CHECK(42 < a && a < b); - # - # These are not replaceable with CHECK_LE, so bail out early. - return - elif token in ('<<', '<<=', '>>', '>>=', '->*', '->'): - # Non-relational operator - lhs += token - expression = matched.group(2) - else: - # Relational operator - operator = token - rhs = matched.group(2) - break - else: - # Unparenthesized operand. Instead of appending to lhs one character - # at a time, we do another regular expression match to consume several - # characters at once if possible. Trivial benchmark shows that this - # is more efficient when the operands are longer than a single - # character, which is generally the case. - matched = Match(r'^([^-=!<>()&|]+)(.*)$', expression) - if not matched: - matched = Match(r'^(\s*\S)(.*)$', expression) - if not matched: - break - lhs += matched.group(1) - expression = matched.group(2) - - # Only apply checks if we got all parts of the boolean expression - if not (lhs and operator and rhs): - return - - # Check that rhs do not contain logical operators. We already know - # that lhs is fine since the loop above parses out && and ||. - if rhs.find('&&') > -1 or rhs.find('||') > -1: - return - - # At least one of the operands must be a constant literal. This is - # to avoid suggesting replacements for unprintable things like - # CHECK(variable != iterator) - # - # The following pattern matches decimal, hex integers, strings, and - # characters (in that order). - lhs = lhs.strip() - rhs = rhs.strip() - match_constant = r'^([-+]?(\d+|0[xX][0-9a-fA-F]+)[lLuU]{0,3}|".*"|\'.*\')$' - if Match(match_constant, lhs) or Match(match_constant, rhs): - # Note: since we know both lhs and rhs, we can provide a more - # descriptive error message like: - # Consider using CHECK_EQ(x, 42) instead of CHECK(x == 42) - # Instead of: - # Consider using CHECK_EQ instead of CHECK(a == b) - # - # We are still keeping the less descriptive message because if lhs - # or rhs gets long, the error message might become unreadable. - error(filename, linenum, 'readability/check', 2, - 'Consider using %s instead of %s(a %s b)' % ( - _CHECK_REPLACEMENT[check_macro][operator], - check_macro, operator)) - - -def CheckAltTokens(filename, clean_lines, linenum, error): - """Check alternative keywords being used in boolean expressions. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - - # Avoid preprocessor lines - if Match(r'^\s*#', line): - return - - # Last ditch effort to avoid multi-line comments. This will not help - # if the comment started before the current line or ended after the - # current line, but it catches most of the false positives. At least, - # it provides a way to workaround this warning for people who use - # multi-line comments in preprocessor macros. - # - # TODO(unknown): remove this once cpplint has better support for - # multi-line comments. - if line.find('/*') >= 0 or line.find('*/') >= 0: - return - - for match in _ALT_TOKEN_REPLACEMENT_PATTERN.finditer(line): - error(filename, linenum, 'readability/alt_tokens', 2, - 'Use operator %s instead of %s' % ( - _ALT_TOKEN_REPLACEMENT[match.group(1)], match.group(1))) - - -def GetLineWidth(line): - """Determines the width of the line in column positions. - - Args: - line: A string, which may be a Unicode string. - - Returns: - The width of the line in column positions, accounting for Unicode - combining characters and wide characters. - """ - if isinstance(line, unicode): - width = 0 - for uc in unicodedata.normalize('NFC', line): - if unicodedata.east_asian_width(uc) in ('W', 'F'): - width += 2 - elif not unicodedata.combining(uc): - width += 1 - return width - else: - return len(line) - - -def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, - error): - """Checks rules from the 'C++ style rules' section of cppguide.html. - - Most of these rules are hard to test (naming, comment style), but we - do what we can. In particular we check for 2-space indents, line lengths, - tab usage, spaces inside code, etc. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - file_extension: The extension (without the dot) of the filename. - nesting_state: A NestingState instance which maintains information about - the current stack of nested blocks being parsed. - error: The function to call with any errors found. - """ - - # Don't use "elided" lines here, otherwise we can't check commented lines. - # Don't want to use "raw" either, because we don't want to check inside C++11 - # raw strings, - raw_lines = clean_lines.lines_without_raw_strings - line = raw_lines[linenum] - prev = raw_lines[linenum - 1] if linenum > 0 else '' - - if line.find('\t') != -1: - error(filename, linenum, 'whitespace/tab', 1, - 'Tab found; better to use spaces') - - # One or three blank spaces at the beginning of the line is weird; it's - # hard to reconcile that with 2-space indents. - # NOTE: here are the conditions rob pike used for his tests. Mine aren't - # as sophisticated, but it may be worth becoming so: RLENGTH==initial_spaces - # if(RLENGTH > 20) complain = 0; - # if(match($0, " +(error|private|public|protected):")) complain = 0; - # if(match(prev, "&& *$")) complain = 0; - # if(match(prev, "\\|\\| *$")) complain = 0; - # if(match(prev, "[\",=><] *$")) complain = 0; - # if(match($0, " <<")) complain = 0; - # if(match(prev, " +for \\(")) complain = 0; - # if(prevodd && match(prevprev, " +for \\(")) complain = 0; - scope_or_label_pattern = r'\s*\w+\s*:\s*\\?$' - classinfo = nesting_state.InnermostClass() - initial_spaces = 0 - cleansed_line = clean_lines.elided[linenum] - while initial_spaces < len(line) and line[initial_spaces] == ' ': - initial_spaces += 1 - # There are certain situations we allow one space, notably for - # section labels, and also lines containing multi-line raw strings. - # We also don't check for lines that look like continuation lines - # (of lines ending in double quotes, commas, equals, or angle brackets) - # because the rules for how to indent those are non-trivial. - if (not Search(r'[",=><] *$', prev) and - (initial_spaces == 1 or initial_spaces == 3) and - not Match(scope_or_label_pattern, cleansed_line) and - not (clean_lines.raw_lines[linenum] != line and - Match(r'^\s*""', line))): - error(filename, linenum, 'whitespace/indent', 3, - 'Weird number of spaces at line-start. ' - 'Are you using a 2-space indent?') - - if line and line[-1].isspace(): - error(filename, linenum, 'whitespace/end_of_line', 4, - 'Line ends in whitespace. Consider deleting these extra spaces.') - - # Check if the line is a header guard. - is_header_guard = False - if file_extension in GetHeaderExtensions(): - cppvar = GetHeaderGuardCPPVariable(filename) - if (line.startswith('#ifndef %s' % cppvar) or - line.startswith('#define %s' % cppvar) or - line.startswith('#endif // %s' % cppvar)): - is_header_guard = True - # #include lines and header guards can be long, since there's no clean way to - # split them. - # - # URLs can be long too. It's possible to split these, but it makes them - # harder to cut&paste. - # - # The "$Id:...$" comment may also get very long without it being the - # developers fault. - # - # Doxygen documentation copying can get pretty long when using an overloaded - # function declaration - if (not line.startswith('#include') and not is_header_guard and - not Match(r'^\s*//.*http(s?)://\S*$', line) and - not Match(r'^\s*//\s*[^\s]*$', line) and - not Match(r'^// \$Id:.*#[0-9]+ \$$', line) and - not Match(r'^\s*/// [@\\](copydoc|copydetails|copybrief) .*$', line)): - line_width = GetLineWidth(line) - if line_width > _line_length: - error(filename, linenum, 'whitespace/line_length', 2, - 'Lines should be <= %i characters long' % _line_length) - - if (cleansed_line.count(';') > 1 and - # allow simple single line lambdas - not Match(r'^[^{};]*\[[^\[\]]*\][^{}]*\{[^{}\n\r]*\}', - line) and - # for loops are allowed two ;'s (and may run over two lines). - cleansed_line.find('for') == -1 and - (GetPreviousNonBlankLine(clean_lines, linenum)[0].find('for') == -1 or - GetPreviousNonBlankLine(clean_lines, linenum)[0].find(';') != -1) and - # It's ok to have many commands in a switch case that fits in 1 line - not ((cleansed_line.find('case ') != -1 or - cleansed_line.find('default:') != -1) and - cleansed_line.find('break;') != -1)): - error(filename, linenum, 'whitespace/newline', 0, - 'More than one command on the same line') - - # Some more style checks - CheckBraces(filename, clean_lines, linenum, error) - CheckTrailingSemicolon(filename, clean_lines, linenum, error) - CheckEmptyBlockBody(filename, clean_lines, linenum, error) - CheckAccess(filename, clean_lines, linenum, nesting_state, error) - CheckSpacing(filename, clean_lines, linenum, nesting_state, error) - CheckOperatorSpacing(filename, clean_lines, linenum, error) - CheckParenthesisSpacing(filename, clean_lines, linenum, error) - CheckCommaSpacing(filename, clean_lines, linenum, error) - CheckBracesSpacing(filename, clean_lines, linenum, nesting_state, error) - CheckSpacingForFunctionCall(filename, clean_lines, linenum, error) - CheckCheck(filename, clean_lines, linenum, error) - CheckAltTokens(filename, clean_lines, linenum, error) - classinfo = nesting_state.InnermostClass() - if classinfo: - CheckSectionSpacing(filename, clean_lines, classinfo, linenum, error) - - -_RE_PATTERN_INCLUDE = re.compile(r'^\s*#\s*include\s*([<"])([^>"]*)[>"].*$') -# Matches the first component of a filename delimited by -s and _s. That is: -# _RE_FIRST_COMPONENT.match('foo').group(0) == 'foo' -# _RE_FIRST_COMPONENT.match('foo.cc').group(0) == 'foo' -# _RE_FIRST_COMPONENT.match('foo-bar_baz.cc').group(0) == 'foo' -# _RE_FIRST_COMPONENT.match('foo_bar-baz.cc').group(0) == 'foo' -_RE_FIRST_COMPONENT = re.compile(r'^[^-_.]+') - - -def _DropCommonSuffixes(filename): - """Drops common suffixes like _test.cc or -inl.h from filename. - - For example: - >>> _DropCommonSuffixes('foo/foo-inl.h') - 'foo/foo' - >>> _DropCommonSuffixes('foo/bar/foo.cc') - 'foo/bar/foo' - >>> _DropCommonSuffixes('foo/foo_internal.h') - 'foo/foo' - >>> _DropCommonSuffixes('foo/foo_unusualinternal.h') - 'foo/foo_unusualinternal' - - Args: - filename: The input filename. - - Returns: - The filename with the common suffix removed. - """ - for suffix in itertools.chain( - ('%s.%s' % (test_suffix.lstrip('_'), ext) - for test_suffix, ext in itertools.product(_test_suffixes, GetNonHeaderExtensions())), - ('%s.%s' % (suffix, ext) - for suffix, ext in itertools.product(['inl', 'imp', 'internal'], GetHeaderExtensions()))): - if (filename.endswith(suffix) and len(filename) > len(suffix) and - filename[-len(suffix) - 1] in ('-', '_')): - return filename[:-len(suffix) - 1] - return os.path.splitext(filename)[0] - - -def _ClassifyInclude(fileinfo, include, is_system): - """Figures out what kind of header 'include' is. - - Args: - fileinfo: The current file cpplint is running over. A FileInfo instance. - include: The path to a #included file. - is_system: True if the #include used <> rather than "". - - Returns: - One of the _XXX_HEADER constants. - - For example: - >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'stdio.h', True) - _C_SYS_HEADER - >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'string', True) - _CPP_SYS_HEADER - >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'foo/foo.h', False) - _LIKELY_MY_HEADER - >>> _ClassifyInclude(FileInfo('foo/foo_unknown_extension.cc'), - ... 'bar/foo_other_ext.h', False) - _POSSIBLE_MY_HEADER - >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'foo/bar.h', False) - _OTHER_HEADER - """ - # This is a list of all standard c++ header files, except - # those already checked for above. - is_cpp_h = include in _CPP_HEADERS - - # Headers with C++ extensions shouldn't be considered C system headers - if is_system and os.path.splitext(include)[1] in ['.hpp', '.hxx', '.h++']: - is_system = False - - if is_system: - if is_cpp_h: - return _CPP_SYS_HEADER - else: - return _C_SYS_HEADER - - # If the target file and the include we're checking share a - # basename when we drop common extensions, and the include - # lives in . , then it's likely to be owned by the target file. - target_dir, target_base = ( - os.path.split(_DropCommonSuffixes(fileinfo.RepositoryName()))) - include_dir, include_base = os.path.split(_DropCommonSuffixes(include)) - target_dir_pub = os.path.normpath(target_dir + '/../public') - target_dir_pub = target_dir_pub.replace('\\', '/') - if target_base == include_base and ( - include_dir == target_dir or - include_dir == target_dir_pub): - return _LIKELY_MY_HEADER - - # If the target and include share some initial basename - # component, it's possible the target is implementing the - # include, so it's allowed to be first, but we'll never - # complain if it's not there. - target_first_component = _RE_FIRST_COMPONENT.match(target_base) - include_first_component = _RE_FIRST_COMPONENT.match(include_base) - if (target_first_component and include_first_component and - target_first_component.group(0) == - include_first_component.group(0)): - return _POSSIBLE_MY_HEADER - - return _OTHER_HEADER - - - -def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): - """Check rules that are applicable to #include lines. - - Strings on #include lines are NOT removed from elided line, to make - certain tasks easier. However, to prevent false positives, checks - applicable to #include lines in CheckLanguage must be put here. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - include_state: An _IncludeState instance in which the headers are inserted. - error: The function to call with any errors found. - """ - fileinfo = FileInfo(filename) - line = clean_lines.lines[linenum] - - # "include" should use the new style "foo/bar.h" instead of just "bar.h" - # Only do this check if the included header follows google naming - # conventions. If not, assume that it's a 3rd party API that - # requires special include conventions. - # - # We also make an exception for Lua headers, which follow google - # naming convention but not the include convention. - match = Match(r'#include\s*"([^/]+\.h)"', line) - if match and not _THIRD_PARTY_HEADERS_PATTERN.match(match.group(1)): - error(filename, linenum, 'build/include_subdir', 4, - 'Include the directory when naming .h files') - - # we shouldn't include a file more than once. actually, there are a - # handful of instances where doing so is okay, but in general it's - # not. - match = _RE_PATTERN_INCLUDE.search(line) - if match: - include = match.group(2) - is_system = (match.group(1) == '<') - duplicate_line = include_state.FindHeader(include) - if duplicate_line >= 0: - error(filename, linenum, 'build/include', 4, - '"%s" already included at %s:%s' % - (include, filename, duplicate_line)) - return - - for extension in GetNonHeaderExtensions(): - if (include.endswith('.' + extension) and - os.path.dirname(fileinfo.RepositoryName()) != os.path.dirname(include)): - error(filename, linenum, 'build/include', 4, - 'Do not include .' + extension + ' files from other packages') - return - - if not _THIRD_PARTY_HEADERS_PATTERN.match(include): - include_state.include_list[-1].append((include, linenum)) - - # We want to ensure that headers appear in the right order: - # 1) for foo.cc, foo.h (preferred location) - # 2) c system files - # 3) cpp system files - # 4) for foo.cc, foo.h (deprecated location) - # 5) other google headers - # - # We classify each include statement as one of those 5 types - # using a number of techniques. The include_state object keeps - # track of the highest type seen, and complains if we see a - # lower type after that. - error_message = include_state.CheckNextIncludeOrder( - _ClassifyInclude(fileinfo, include, is_system)) - if error_message: - error(filename, linenum, 'build/include_order', 4, - '%s. Should be: %s.h, c system, c++ system, other.' % - (error_message, fileinfo.BaseName())) - canonical_include = include_state.CanonicalizeAlphabeticalOrder(include) - if not include_state.IsInAlphabeticalOrder( - clean_lines, linenum, canonical_include): - error(filename, linenum, 'build/include_alpha', 4, - 'Include "%s" not in alphabetical order' % include) - include_state.SetLastHeader(canonical_include) - - - -def _GetTextInside(text, start_pattern): - r"""Retrieves all the text between matching open and close parentheses. - - Given a string of lines and a regular expression string, retrieve all the text - following the expression and between opening punctuation symbols like - (, [, or {, and the matching close-punctuation symbol. This properly nested - occurrences of the punctuations, so for the text like - printf(a(), b(c())); - a call to _GetTextInside(text, r'printf\(') will return 'a(), b(c())'. - start_pattern must match string having an open punctuation symbol at the end. - - Args: - text: The lines to extract text. Its comments and strings must be elided. - It can be single line and can span multiple lines. - start_pattern: The regexp string indicating where to start extracting - the text. - Returns: - The extracted text. - None if either the opening string or ending punctuation could not be found. - """ - # TODO(unknown): Audit cpplint.py to see what places could be profitably - # rewritten to use _GetTextInside (and use inferior regexp matching today). - - # Give opening punctuations to get the matching close-punctuations. - matching_punctuation = {'(': ')', '{': '}', '[': ']'} - closing_punctuation = set(itervalues(matching_punctuation)) - - # Find the position to start extracting text. - match = re.search(start_pattern, text, re.M) - if not match: # start_pattern not found in text. - return None - start_position = match.end(0) - - assert start_position > 0, ( - 'start_pattern must ends with an opening punctuation.') - assert text[start_position - 1] in matching_punctuation, ( - 'start_pattern must ends with an opening punctuation.') - # Stack of closing punctuations we expect to have in text after position. - punctuation_stack = [matching_punctuation[text[start_position - 1]]] - position = start_position - while punctuation_stack and position < len(text): - if text[position] == punctuation_stack[-1]: - punctuation_stack.pop() - elif text[position] in closing_punctuation: - # A closing punctuation without matching opening punctuations. - return None - elif text[position] in matching_punctuation: - punctuation_stack.append(matching_punctuation[text[position]]) - position += 1 - if punctuation_stack: - # Opening punctuations left without matching close-punctuations. - return None - # punctuations match. - return text[start_position:position - 1] - - -# Patterns for matching call-by-reference parameters. -# -# Supports nested templates up to 2 levels deep using this messy pattern: -# < (?: < (?: < [^<>]* -# > -# | [^<>] )* -# > -# | [^<>] )* -# > -_RE_PATTERN_IDENT = r'[_a-zA-Z]\w*' # =~ [[:alpha:]][[:alnum:]]* -_RE_PATTERN_TYPE = ( - r'(?:const\s+)?(?:typename\s+|class\s+|struct\s+|union\s+|enum\s+)?' - r'(?:\w|' - r'\s*<(?:<(?:<[^<>]*>|[^<>])*>|[^<>])*>|' - r'::)+') -# A call-by-reference parameter ends with '& identifier'. -_RE_PATTERN_REF_PARAM = re.compile( - r'(' + _RE_PATTERN_TYPE + r'(?:\s*(?:\bconst\b|[*]))*\s*' - r'&\s*' + _RE_PATTERN_IDENT + r')\s*(?:=[^,()]+)?[,)]') -# A call-by-const-reference parameter either ends with 'const& identifier' -# or looks like 'const type& identifier' when 'type' is atomic. -_RE_PATTERN_CONST_REF_PARAM = ( - r'(?:.*\s*\bconst\s*&\s*' + _RE_PATTERN_IDENT + - r'|const\s+' + _RE_PATTERN_TYPE + r'\s*&\s*' + _RE_PATTERN_IDENT + r')') -# Stream types. -_RE_PATTERN_REF_STREAM_PARAM = ( - r'(?:.*stream\s*&\s*' + _RE_PATTERN_IDENT + r')') - - -def CheckLanguage(filename, clean_lines, linenum, file_extension, - include_state, nesting_state, error): - """Checks rules from the 'C++ language rules' section of cppguide.html. - - Some of these rules are hard to test (function overloading, using - uint32 inappropriately), but we do the best we can. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - file_extension: The extension (without the dot) of the filename. - include_state: An _IncludeState instance in which the headers are inserted. - nesting_state: A NestingState instance which maintains information about - the current stack of nested blocks being parsed. - error: The function to call with any errors found. - """ - # If the line is empty or consists of entirely a comment, no need to - # check it. - line = clean_lines.elided[linenum] - if not line: - return - - match = _RE_PATTERN_INCLUDE.search(line) - if match: - CheckIncludeLine(filename, clean_lines, linenum, include_state, error) - return - - # Reset include state across preprocessor directives. This is meant - # to silence warnings for conditional includes. - match = Match(r'^\s*#\s*(if|ifdef|ifndef|elif|else|endif)\b', line) - if match: - include_state.ResetSection(match.group(1)) - - - # Perform other checks now that we are sure that this is not an include line - CheckCasts(filename, clean_lines, linenum, error) - CheckGlobalStatic(filename, clean_lines, linenum, error) - CheckPrintf(filename, clean_lines, linenum, error) - - if file_extension in GetHeaderExtensions(): - # TODO(unknown): check that 1-arg constructors are explicit. - # How to tell it's a constructor? - # (handled in CheckForNonStandardConstructs for now) - # TODO(unknown): check that classes declare or disable copy/assign - # (level 1 error) - pass - - # Check if people are using the verboten C basic types. The only exception - # we regularly allow is "unsigned short port" for port. - if Search(r'\bshort port\b', line): - if not Search(r'\bunsigned short port\b', line): - error(filename, linenum, 'runtime/int', 4, - 'Use "unsigned short" for ports, not "short"') - else: - match = Search(r'\b(short|long(?! +double)|long long)\b', line) - if match: - error(filename, linenum, 'runtime/int', 4, - 'Use int16/int64/etc, rather than the C type %s' % match.group(1)) - - # Check if some verboten operator overloading is going on - # TODO(unknown): catch out-of-line unary operator&: - # class X {}; - # int operator&(const X& x) { return 42; } // unary operator& - # The trick is it's hard to tell apart from binary operator&: - # class Y { int operator&(const Y& x) { return 23; } }; // binary operator& - if Search(r'\boperator\s*&\s*\(\s*\)', line): - error(filename, linenum, 'runtime/operator', 4, - 'Unary operator& is dangerous. Do not use it.') - - # Check for suspicious usage of "if" like - # } if (a == b) { - if Search(r'\}\s*if\s*\(', line): - error(filename, linenum, 'readability/braces', 4, - 'Did you mean "else if"? If not, start a new line for "if".') - - # Check for potential format string bugs like printf(foo). - # We constrain the pattern not to pick things like DocidForPrintf(foo). - # Not perfect but it can catch printf(foo.c_str()) and printf(foo->c_str()) - # TODO(unknown): Catch the following case. Need to change the calling - # convention of the whole function to process multiple line to handle it. - # printf( - # boy_this_is_a_really_long_variable_that_cannot_fit_on_the_prev_line); - printf_args = _GetTextInside(line, r'(?i)\b(string)?printf\s*\(') - if printf_args: - match = Match(r'([\w.\->()]+)$', printf_args) - if match and match.group(1) != '__VA_ARGS__': - function_name = re.search(r'\b((?:string)?printf)\s*\(', - line, re.I).group(1) - error(filename, linenum, 'runtime/printf', 4, - 'Potential format string bug. Do %s("%%s", %s) instead.' - % (function_name, match.group(1))) - - # Check for potential memset bugs like memset(buf, sizeof(buf), 0). - match = Search(r'memset\s*\(([^,]*),\s*([^,]*),\s*0\s*\)', line) - if match and not Match(r"^''|-?[0-9]+|0x[0-9A-Fa-f]$", match.group(2)): - error(filename, linenum, 'runtime/memset', 4, - 'Did you mean "memset(%s, 0, %s)"?' - % (match.group(1), match.group(2))) - - if Search(r'\busing namespace\b', line): - if Search(r'\bliterals\b', line): - error(filename, linenum, 'build/namespaces_literals', 5, - 'Do not use namespace using-directives. ' - 'Use using-declarations instead.') - else: - error(filename, linenum, 'build/namespaces', 5, - 'Do not use namespace using-directives. ' - 'Use using-declarations instead.') - - # Detect variable-length arrays. - match = Match(r'\s*(.+::)?(\w+) [a-z]\w*\[(.+)];', line) - if (match and match.group(2) != 'return' and match.group(2) != 'delete' and - match.group(3).find(']') == -1): - # Split the size using space and arithmetic operators as delimiters. - # If any of the resulting tokens are not compile time constants then - # report the error. - tokens = re.split(r'\s|\+|\-|\*|\/|<<|>>]', match.group(3)) - is_const = True - skip_next = False - for tok in tokens: - if skip_next: - skip_next = False - continue - - if Search(r'sizeof\(.+\)', tok): continue - if Search(r'arraysize\(\w+\)', tok): continue - - tok = tok.lstrip('(') - tok = tok.rstrip(')') - if not tok: continue - if Match(r'\d+', tok): continue - if Match(r'0[xX][0-9a-fA-F]+', tok): continue - if Match(r'k[A-Z0-9]\w*', tok): continue - if Match(r'(.+::)?k[A-Z0-9]\w*', tok): continue - if Match(r'(.+::)?[A-Z][A-Z0-9_]*', tok): continue - # A catch all for tricky sizeof cases, including 'sizeof expression', - # 'sizeof(*type)', 'sizeof(const type)', 'sizeof(struct StructName)' - # requires skipping the next token because we split on ' ' and '*'. - if tok.startswith('sizeof'): - skip_next = True - continue - is_const = False - break - if not is_const: - error(filename, linenum, 'runtime/arrays', 1, - 'Do not use variable-length arrays. Use an appropriately named ' - "('k' followed by CamelCase) compile-time constant for the size.") - - # Check for use of unnamed namespaces in header files. Registration - # macros are typically OK, so we allow use of "namespace {" on lines - # that end with backslashes. - if (file_extension in GetHeaderExtensions() - and Search(r'\bnamespace\s*{', line) - and line[-1] != '\\'): - error(filename, linenum, 'build/namespaces', 4, - 'Do not use unnamed namespaces in header files. See ' - 'https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces' - ' for more information.') - - -def CheckGlobalStatic(filename, clean_lines, linenum, error): - """Check for unsafe global or static objects. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - - # Match two lines at a time to support multiline declarations - if linenum + 1 < clean_lines.NumLines() and not Search(r'[;({]', line): - line += clean_lines.elided[linenum + 1].strip() - - # Check for people declaring static/global STL strings at the top level. - # This is dangerous because the C++ language does not guarantee that - # globals with constructors are initialized before the first access, and - # also because globals can be destroyed when some threads are still running. - # TODO(unknown): Generalize this to also find static unique_ptr instances. - # TODO(unknown): File bugs for clang-tidy to find these. - match = Match( - r'((?:|static +)(?:|const +))(?::*std::)?string( +const)? +' - r'([a-zA-Z0-9_:]+)\b(.*)', - line) - - # Remove false positives: - # - String pointers (as opposed to values). - # string *pointer - # const string *pointer - # string const *pointer - # string *const pointer - # - # - Functions and template specializations. - # string Function(... - # string Class::Method(... - # - # - Operators. These are matched separately because operator names - # cross non-word boundaries, and trying to match both operators - # and functions at the same time would decrease accuracy of - # matching identifiers. - # string Class::operator*() - if (match and - not Search(r'\bstring\b(\s+const)?\s*[\*\&]\s*(const\s+)?\w', line) and - not Search(r'\boperator\W', line) and - not Match(r'\s*(<.*>)?(::[a-zA-Z0-9_]+)*\s*\(([^"]|$)', match.group(4))): - if Search(r'\bconst\b', line): - error(filename, linenum, 'runtime/string', 4, - 'For a static/global string constant, use a C style string ' - 'instead: "%schar%s %s[]".' % - (match.group(1), match.group(2) or '', match.group(3))) - else: - error(filename, linenum, 'runtime/string', 4, - 'Static/global string variables are not permitted.') - - if (Search(r'\b([A-Za-z0-9_]*_)\(\1\)', line) or - Search(r'\b([A-Za-z0-9_]*_)\(CHECK_NOTNULL\(\1\)\)', line)): - error(filename, linenum, 'runtime/init', 4, - 'You seem to be initializing a member variable with itself.') - - -def CheckPrintf(filename, clean_lines, linenum, error): - """Check for printf related issues. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - - # When snprintf is used, the second argument shouldn't be a literal. - match = Search(r'snprintf\s*\(([^,]*),\s*([0-9]*)\s*,', line) - if match and match.group(2) != '0': - # If 2nd arg is zero, snprintf is used to calculate size. - error(filename, linenum, 'runtime/printf', 3, - 'If you can, use sizeof(%s) instead of %s as the 2nd arg ' - 'to snprintf.' % (match.group(1), match.group(2))) - - # Check if some verboten C functions are being used. - if Search(r'\bsprintf\s*\(', line): - error(filename, linenum, 'runtime/printf', 5, - 'Never use sprintf. Use snprintf instead.') - match = Search(r'\b(strcpy|strcat)\s*\(', line) - if match: - error(filename, linenum, 'runtime/printf', 4, - 'Almost always, snprintf is better than %s' % match.group(1)) - - -def IsDerivedFunction(clean_lines, linenum): - """Check if current line contains an inherited function. - - Args: - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - Returns: - True if current line contains a function with "override" - virt-specifier. - """ - # Scan back a few lines for start of current function - for i in xrange(linenum, max(-1, linenum - 10), -1): - match = Match(r'^([^()]*\w+)\(', clean_lines.elided[i]) - if match: - # Look for "override" after the matching closing parenthesis - line, _, closing_paren = CloseExpression( - clean_lines, i, len(match.group(1))) - return (closing_paren >= 0 and - Search(r'\boverride\b', line[closing_paren:])) - return False - - -def IsOutOfLineMethodDefinition(clean_lines, linenum): - """Check if current line contains an out-of-line method definition. - - Args: - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - Returns: - True if current line contains an out-of-line method definition. - """ - # Scan back a few lines for start of current function - for i in xrange(linenum, max(-1, linenum - 10), -1): - if Match(r'^([^()]*\w+)\(', clean_lines.elided[i]): - return Match(r'^[^()]*\w+::\w+\(', clean_lines.elided[i]) is not None - return False - - -def IsInitializerList(clean_lines, linenum): - """Check if current line is inside constructor initializer list. - - Args: - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - Returns: - True if current line appears to be inside constructor initializer - list, False otherwise. - """ - for i in xrange(linenum, 1, -1): - line = clean_lines.elided[i] - if i == linenum: - remove_function_body = Match(r'^(.*)\{\s*$', line) - if remove_function_body: - line = remove_function_body.group(1) - - if Search(r'\s:\s*\w+[({]', line): - # A lone colon tend to indicate the start of a constructor - # initializer list. It could also be a ternary operator, which - # also tend to appear in constructor initializer lists as - # opposed to parameter lists. - return True - if Search(r'\}\s*,\s*$', line): - # A closing brace followed by a comma is probably the end of a - # brace-initialized member in constructor initializer list. - return True - if Search(r'[{};]\s*$', line): - # Found one of the following: - # - A closing brace or semicolon, probably the end of the previous - # function. - # - An opening brace, probably the start of current class or namespace. - # - # Current line is probably not inside an initializer list since - # we saw one of those things without seeing the starting colon. - return False - - # Got to the beginning of the file without seeing the start of - # constructor initializer list. - return False - - -def CheckForNonConstReference(filename, clean_lines, linenum, - nesting_state, error): - """Check for non-const references. - - Separate from CheckLanguage since it scans backwards from current - line, instead of scanning forward. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - nesting_state: A NestingState instance which maintains information about - the current stack of nested blocks being parsed. - error: The function to call with any errors found. - """ - # Do nothing if there is no '&' on current line. - line = clean_lines.elided[linenum] - if '&' not in line: - return - - # If a function is inherited, current function doesn't have much of - # a choice, so any non-const references should not be blamed on - # derived function. - if IsDerivedFunction(clean_lines, linenum): - return - - # Don't warn on out-of-line method definitions, as we would warn on the - # in-line declaration, if it isn't marked with 'override'. - if IsOutOfLineMethodDefinition(clean_lines, linenum): - return - - # Long type names may be broken across multiple lines, usually in one - # of these forms: - # LongType - # ::LongTypeContinued &identifier - # LongType:: - # LongTypeContinued &identifier - # LongType< - # ...>::LongTypeContinued &identifier - # - # If we detected a type split across two lines, join the previous - # line to current line so that we can match const references - # accordingly. - # - # Note that this only scans back one line, since scanning back - # arbitrary number of lines would be expensive. If you have a type - # that spans more than 2 lines, please use a typedef. - if linenum > 1: - previous = None - if Match(r'\s*::(?:[\w<>]|::)+\s*&\s*\S', line): - # previous_line\n + ::current_line - previous = Search(r'\b((?:const\s*)?(?:[\w<>]|::)+[\w<>])\s*$', - clean_lines.elided[linenum - 1]) - elif Match(r'\s*[a-zA-Z_]([\w<>]|::)+\s*&\s*\S', line): - # previous_line::\n + current_line - previous = Search(r'\b((?:const\s*)?(?:[\w<>]|::)+::)\s*$', - clean_lines.elided[linenum - 1]) - if previous: - line = previous.group(1) + line.lstrip() - else: - # Check for templated parameter that is split across multiple lines - endpos = line.rfind('>') - if endpos > -1: - (_, startline, startpos) = ReverseCloseExpression( - clean_lines, linenum, endpos) - if startpos > -1 and startline < linenum: - # Found the matching < on an earlier line, collect all - # pieces up to current line. - line = '' - for i in xrange(startline, linenum + 1): - line += clean_lines.elided[i].strip() - - # Check for non-const references in function parameters. A single '&' may - # found in the following places: - # inside expression: binary & for bitwise AND - # inside expression: unary & for taking the address of something - # inside declarators: reference parameter - # We will exclude the first two cases by checking that we are not inside a - # function body, including one that was just introduced by a trailing '{'. - # TODO(unknown): Doesn't account for 'catch(Exception& e)' [rare]. - if (nesting_state.previous_stack_top and - not (isinstance(nesting_state.previous_stack_top, _ClassInfo) or - isinstance(nesting_state.previous_stack_top, _NamespaceInfo))): - # Not at toplevel, not within a class, and not within a namespace - return - - # Avoid initializer lists. We only need to scan back from the - # current line for something that starts with ':'. - # - # We don't need to check the current line, since the '&' would - # appear inside the second set of parentheses on the current line as - # opposed to the first set. - if linenum > 0: - for i in xrange(linenum - 1, max(0, linenum - 10), -1): - previous_line = clean_lines.elided[i] - if not Search(r'[),]\s*$', previous_line): - break - if Match(r'^\s*:\s+\S', previous_line): - return - - # Avoid preprocessors - if Search(r'\\\s*$', line): - return - - # Avoid constructor initializer lists - if IsInitializerList(clean_lines, linenum): - return - - # We allow non-const references in a few standard places, like functions - # called "swap()" or iostream operators like "<<" or ">>". Do not check - # those function parameters. - # - # We also accept & in static_assert, which looks like a function but - # it's actually a declaration expression. - whitelisted_functions = (r'(?:[sS]wap(?:<\w:+>)?|' - r'operator\s*[<>][<>]|' - r'static_assert|COMPILE_ASSERT' - r')\s*\(') - if Search(whitelisted_functions, line): - return - elif not Search(r'\S+\([^)]*$', line): - # Don't see a whitelisted function on this line. Actually we - # didn't see any function name on this line, so this is likely a - # multi-line parameter list. Try a bit harder to catch this case. - for i in xrange(2): - if (linenum > i and - Search(whitelisted_functions, clean_lines.elided[linenum - i - 1])): - return - - decls = ReplaceAll(r'{[^}]*}', ' ', line) # exclude function body - for parameter in re.findall(_RE_PATTERN_REF_PARAM, decls): - if (not Match(_RE_PATTERN_CONST_REF_PARAM, parameter) and - not Match(_RE_PATTERN_REF_STREAM_PARAM, parameter)): - error(filename, linenum, 'runtime/references', 2, - 'Is this a non-const reference? ' - 'If so, make const or use a pointer: ' + - ReplaceAll(' *<', '<', parameter)) - - -def CheckCasts(filename, clean_lines, linenum, error): - """Various cast related checks. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - - # Check to see if they're using an conversion function cast. - # I just try to capture the most common basic types, though there are more. - # Parameterless conversion functions, such as bool(), are allowed as they are - # probably a member operator declaration or default constructor. - match = Search( - r'(\bnew\s+(?:const\s+)?|\S<\s*(?:const\s+)?)?\b' - r'(int|float|double|bool|char|int32|uint32|int64|uint64)' - r'(\([^)].*)', line) - expecting_function = ExpectingFunctionArgs(clean_lines, linenum) - if match and not expecting_function: - matched_type = match.group(2) - - # matched_new_or_template is used to silence two false positives: - # - New operators - # - Template arguments with function types - # - # For template arguments, we match on types immediately following - # an opening bracket without any spaces. This is a fast way to - # silence the common case where the function type is the first - # template argument. False negative with less-than comparison is - # avoided because those operators are usually followed by a space. - # - # function // bracket + no space = false positive - # value < double(42) // bracket + space = true positive - matched_new_or_template = match.group(1) - - # Avoid arrays by looking for brackets that come after the closing - # parenthesis. - if Match(r'\([^()]+\)\s*\[', match.group(3)): - return - - # Other things to ignore: - # - Function pointers - # - Casts to pointer types - # - Placement new - # - Alias declarations - matched_funcptr = match.group(3) - if (matched_new_or_template is None and - not (matched_funcptr and - (Match(r'\((?:[^() ]+::\s*\*\s*)?[^() ]+\)\s*\(', - matched_funcptr) or - matched_funcptr.startswith('(*)'))) and - not Match(r'\s*using\s+\S+\s*=\s*' + matched_type, line) and - not Search(r'new\(\S+\)\s*' + matched_type, line)): - error(filename, linenum, 'readability/casting', 4, - 'Using deprecated casting style. ' - 'Use static_cast<%s>(...) instead' % - matched_type) - - if not expecting_function: - CheckCStyleCast(filename, clean_lines, linenum, 'static_cast', - r'\((int|float|double|bool|char|u?int(16|32|64))\)', error) - - # This doesn't catch all cases. Consider (const char * const)"hello". - # - # (char *) "foo" should always be a const_cast (reinterpret_cast won't - # compile). - if CheckCStyleCast(filename, clean_lines, linenum, 'const_cast', - r'\((char\s?\*+\s?)\)\s*"', error): - pass - else: - # Check pointer casts for other than string constants - CheckCStyleCast(filename, clean_lines, linenum, 'reinterpret_cast', - r'\((\w+\s?\*+\s?)\)', error) - - # In addition, we look for people taking the address of a cast. This - # is dangerous -- casts can assign to temporaries, so the pointer doesn't - # point where you think. - # - # Some non-identifier character is required before the '&' for the - # expression to be recognized as a cast. These are casts: - # expression = &static_cast(temporary()); - # function(&(int*)(temporary())); - # - # This is not a cast: - # reference_type&(int* function_param); - match = Search( - r'(?:[^\w]&\(([^)*][^)]*)\)[\w(])|' - r'(?:[^\w]&(static|dynamic|down|reinterpret)_cast\b)', line) - if match: - # Try a better error message when the & is bound to something - # dereferenced by the casted pointer, as opposed to the casted - # pointer itself. - parenthesis_error = False - match = Match(r'^(.*&(?:static|dynamic|down|reinterpret)_cast\b)<', line) - if match: - _, y1, x1 = CloseExpression(clean_lines, linenum, len(match.group(1))) - if x1 >= 0 and clean_lines.elided[y1][x1] == '(': - _, y2, x2 = CloseExpression(clean_lines, y1, x1) - if x2 >= 0: - extended_line = clean_lines.elided[y2][x2:] - if y2 < clean_lines.NumLines() - 1: - extended_line += clean_lines.elided[y2 + 1] - if Match(r'\s*(?:->|\[)', extended_line): - parenthesis_error = True - - if parenthesis_error: - error(filename, linenum, 'readability/casting', 4, - ('Are you taking an address of something dereferenced ' - 'from a cast? Wrapping the dereferenced expression in ' - 'parentheses will make the binding more obvious')) - else: - error(filename, linenum, 'runtime/casting', 4, - ('Are you taking an address of a cast? ' - 'This is dangerous: could be a temp var. ' - 'Take the address before doing the cast, rather than after')) - - -def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error): - """Checks for a C-style cast by looking for the pattern. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - cast_type: The string for the C++ cast to recommend. This is either - reinterpret_cast, static_cast, or const_cast, depending. - pattern: The regular expression used to find C-style casts. - error: The function to call with any errors found. - - Returns: - True if an error was emitted. - False otherwise. - """ - line = clean_lines.elided[linenum] - match = Search(pattern, line) - if not match: - return False - - # Exclude lines with keywords that tend to look like casts - context = line[0:match.start(1) - 1] - if Match(r'.*\b(?:sizeof|alignof|alignas|[_A-Z][_A-Z0-9]*)\s*$', context): - return False - - # Try expanding current context to see if we one level of - # parentheses inside a macro. - if linenum > 0: - for i in xrange(linenum - 1, max(0, linenum - 5), -1): - context = clean_lines.elided[i] + context - if Match(r'.*\b[_A-Z][_A-Z0-9]*\s*\((?:\([^()]*\)|[^()])*$', context): - return False - - # operator++(int) and operator--(int) - if context.endswith(' operator++') or context.endswith(' operator--'): - return False - - # A single unnamed argument for a function tends to look like old style cast. - # If we see those, don't issue warnings for deprecated casts. - remainder = line[match.end(0):] - if Match(r'^\s*(?:;|const\b|throw\b|final\b|override\b|[=>{),]|->)', - remainder): - return False - - # At this point, all that should be left is actual casts. - error(filename, linenum, 'readability/casting', 4, - 'Using C-style cast. Use %s<%s>(...) instead' % - (cast_type, match.group(1))) - - return True - - -def ExpectingFunctionArgs(clean_lines, linenum): - """Checks whether where function type arguments are expected. - - Args: - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - - Returns: - True if the line at 'linenum' is inside something that expects arguments - of function types. - """ - line = clean_lines.elided[linenum] - return (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or - (linenum >= 2 and - (Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$', - clean_lines.elided[linenum - 1]) or - Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$', - clean_lines.elided[linenum - 2]) or - Search(r'\bstd::m?function\s*\<\s*$', - clean_lines.elided[linenum - 1])))) - - -_HEADERS_CONTAINING_TEMPLATES = ( - ('', ('deque',)), - ('', ('unary_function', 'binary_function', - 'plus', 'minus', 'multiplies', 'divides', 'modulus', - 'negate', - 'equal_to', 'not_equal_to', 'greater', 'less', - 'greater_equal', 'less_equal', - 'logical_and', 'logical_or', 'logical_not', - 'unary_negate', 'not1', 'binary_negate', 'not2', - 'bind1st', 'bind2nd', - 'pointer_to_unary_function', - 'pointer_to_binary_function', - 'ptr_fun', - 'mem_fun_t', 'mem_fun', 'mem_fun1_t', 'mem_fun1_ref_t', - 'mem_fun_ref_t', - 'const_mem_fun_t', 'const_mem_fun1_t', - 'const_mem_fun_ref_t', 'const_mem_fun1_ref_t', - 'mem_fun_ref', - )), - ('', ('numeric_limits',)), - ('', ('list',)), - ('', ('map', 'multimap',)), - ('', ('allocator', 'make_shared', 'make_unique', 'shared_ptr', - 'unique_ptr', 'weak_ptr')), - ('', ('queue', 'priority_queue',)), - ('', ('set', 'multiset',)), - ('', ('stack',)), - ('', ('char_traits', 'basic_string',)), - ('', ('tuple',)), - ('', ('unordered_map', 'unordered_multimap')), - ('', ('unordered_set', 'unordered_multiset')), - ('', ('pair',)), - ('', ('vector',)), - - # gcc extensions. - # Note: std::hash is their hash, ::hash is our hash - ('', ('hash_map', 'hash_multimap',)), - ('', ('hash_set', 'hash_multiset',)), - ('', ('slist',)), - ) - -_HEADERS_MAYBE_TEMPLATES = ( - ('', ('copy', 'max', 'min', 'min_element', 'sort', - 'transform', - )), - ('', ('forward', 'make_pair', 'move', 'swap')), - ) - -_RE_PATTERN_STRING = re.compile(r'\bstring\b') - -_re_pattern_headers_maybe_templates = [] -for _header, _templates in _HEADERS_MAYBE_TEMPLATES: - for _template in _templates: - # Match max(..., ...), max(..., ...), but not foo->max, foo.max or - # type::max(). - _re_pattern_headers_maybe_templates.append( - (re.compile(r'[^>.]\b' + _template + r'(<.*?>)?\([^\)]'), - _template, - _header)) - -# Other scripts may reach in and modify this pattern. -_re_pattern_templates = [] -for _header, _templates in _HEADERS_CONTAINING_TEMPLATES: - for _template in _templates: - _re_pattern_templates.append( - (re.compile(r'(\<|\b)' + _template + r'\s*\<'), - _template + '<>', - _header)) - - -def FilesBelongToSameModule(filename_cc, filename_h): - """Check if these two filenames belong to the same module. - - The concept of a 'module' here is a as follows: - foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the - same 'module' if they are in the same directory. - some/path/public/xyzzy and some/path/internal/xyzzy are also considered - to belong to the same module here. - - If the filename_cc contains a longer path than the filename_h, for example, - '/absolute/path/to/base/sysinfo.cc', and this file would include - 'base/sysinfo.h', this function also produces the prefix needed to open the - header. This is used by the caller of this function to more robustly open the - header file. We don't have access to the real include paths in this context, - so we need this guesswork here. - - Known bugs: tools/base/bar.cc and base/bar.h belong to the same module - according to this implementation. Because of this, this function gives - some false positives. This should be sufficiently rare in practice. - - Args: - filename_cc: is the path for the source (e.g. .cc) file - filename_h: is the path for the header path - - Returns: - Tuple with a bool and a string: - bool: True if filename_cc and filename_h belong to the same module. - string: the additional prefix needed to open the header file. - """ - fileinfo_cc = FileInfo(filename_cc) - if not fileinfo_cc.Extension().lstrip('.') in GetNonHeaderExtensions(): - return (False, '') - - fileinfo_h = FileInfo(filename_h) - if not fileinfo_h.Extension().lstrip('.') in GetHeaderExtensions(): - return (False, '') - - filename_cc = filename_cc[:-(len(fileinfo_cc.Extension()))] - matched_test_suffix = Search(_TEST_FILE_SUFFIX, fileinfo_cc.BaseName()) - if matched_test_suffix: - filename_cc = filename_cc[:-len(matched_test_suffix.group(1))] - - filename_cc = filename_cc.replace('/public/', '/') - filename_cc = filename_cc.replace('/internal/', '/') - - filename_h = filename_h[:-(len(fileinfo_h.Extension()))] - if filename_h.endswith('-inl'): - filename_h = filename_h[:-len('-inl')] - filename_h = filename_h.replace('/public/', '/') - filename_h = filename_h.replace('/internal/', '/') - - files_belong_to_same_module = filename_cc.endswith(filename_h) - common_path = '' - if files_belong_to_same_module: - common_path = filename_cc[:-len(filename_h)] - return files_belong_to_same_module, common_path - - -def UpdateIncludeState(filename, include_dict, io=codecs): - """Fill up the include_dict with new includes found from the file. - - Args: - filename: the name of the header to read. - include_dict: a dictionary in which the headers are inserted. - io: The io factory to use to read the file. Provided for testability. - - Returns: - True if a header was successfully added. False otherwise. - """ - headerfile = None - try: - headerfile = io.open(filename, 'r', 'utf8', 'replace') - except IOError: - return False - linenum = 0 - for line in headerfile: - linenum += 1 - clean_line = CleanseComments(line) - match = _RE_PATTERN_INCLUDE.search(clean_line) - if match: - include = match.group(2) - include_dict.setdefault(include, linenum) - return True - - -def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error, - io=codecs): - """Reports for missing stl includes. - - This function will output warnings to make sure you are including the headers - necessary for the stl containers and functions that you use. We only give one - reason to include a header. For example, if you use both equal_to<> and - less<> in a .h file, only one (the latter in the file) of these will be - reported as a reason to include the . - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - include_state: An _IncludeState instance. - error: The function to call with any errors found. - io: The IO factory to use to read the header file. Provided for unittest - injection. - """ - required = {} # A map of header name to linenumber and the template entity. - # Example of required: { '': (1219, 'less<>') } - - for linenum in range(clean_lines.NumLines()): - line = clean_lines.elided[linenum] - if not line or line[0] == '#': - continue - - # String is special -- it is a non-templatized type in STL. - matched = _RE_PATTERN_STRING.search(line) - if matched: - # Don't warn about strings in non-STL namespaces: - # (We check only the first match per line; good enough.) - prefix = line[:matched.start()] - if prefix.endswith('std::') or not prefix.endswith('::'): - required[''] = (linenum, 'string') - - for pattern, template, header in _re_pattern_headers_maybe_templates: - if pattern.search(line): - required[header] = (linenum, template) - - # The following function is just a speed up, no semantics are changed. - if not '<' in line: # Reduces the cpu time usage by skipping lines. - continue - - for pattern, template, header in _re_pattern_templates: - matched = pattern.search(line) - if matched: - # Don't warn about IWYU in non-STL namespaces: - # (We check only the first match per line; good enough.) - prefix = line[:matched.start()] - if prefix.endswith('std::') or not prefix.endswith('::'): - required[header] = (linenum, template) - - # The policy is that if you #include something in foo.h you don't need to - # include it again in foo.cc. Here, we will look at possible includes. - # Let's flatten the include_state include_list and copy it into a dictionary. - include_dict = dict([item for sublist in include_state.include_list - for item in sublist]) - - # Did we find the header for this file (if any) and successfully load it? - header_found = False - - # Use the absolute path so that matching works properly. - abs_filename = FileInfo(filename).FullName() - - # For Emacs's flymake. - # If cpplint is invoked from Emacs's flymake, a temporary file is generated - # by flymake and that file name might end with '_flymake.cc'. In that case, - # restore original file name here so that the corresponding header file can be - # found. - # e.g. If the file name is 'foo_flymake.cc', we should search for 'foo.h' - # instead of 'foo_flymake.h' - abs_filename = re.sub(r'_flymake\.cc$', '.cc', abs_filename) - - # include_dict is modified during iteration, so we iterate over a copy of - # the keys. - header_keys = list(include_dict.keys()) - for header in header_keys: - (same_module, common_path) = FilesBelongToSameModule(abs_filename, header) - fullpath = common_path + header - if same_module and UpdateIncludeState(fullpath, include_dict, io): - header_found = True - - # If we can't find the header file for a .cc, assume it's because we don't - # know where to look. In that case we'll give up as we're not sure they - # didn't include it in the .h file. - # TODO(unknown): Do a better job of finding .h files so we are confident that - # not having the .h file means there isn't one. - if not header_found: - for extension in GetNonHeaderExtensions(): - if filename.endswith('.' + extension): - return - - # All the lines have been processed, report the errors found. - for required_header_unstripped in sorted(required, key=required.__getitem__): - template = required[required_header_unstripped][1] - if required_header_unstripped.strip('<>"') not in include_dict: - error(filename, required[required_header_unstripped][0], - 'build/include_what_you_use', 4, - 'Add #include ' + required_header_unstripped + ' for ' + template) - - -_RE_PATTERN_EXPLICIT_MAKEPAIR = re.compile(r'\bmake_pair\s*<') - - -def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error): - """Check that make_pair's template arguments are deduced. - - G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are - specified explicitly, and such use isn't intended in any case. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - match = _RE_PATTERN_EXPLICIT_MAKEPAIR.search(line) - if match: - error(filename, linenum, 'build/explicit_make_pair', - 4, # 4 = high confidence - 'For C++11-compatibility, omit template arguments from make_pair' - ' OR use pair directly OR if appropriate, construct a pair directly') - - -def CheckRedundantVirtual(filename, clean_lines, linenum, error): - """Check if line contains a redundant "virtual" function-specifier. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - # Look for "virtual" on current line. - line = clean_lines.elided[linenum] - virtual = Match(r'^(.*)(\bvirtual\b)(.*)$', line) - if not virtual: return - - # Ignore "virtual" keywords that are near access-specifiers. These - # are only used in class base-specifier and do not apply to member - # functions. - if (Search(r'\b(public|protected|private)\s+$', virtual.group(1)) or - Match(r'^\s+(public|protected|private)\b', virtual.group(3))): - return - - # Ignore the "virtual" keyword from virtual base classes. Usually - # there is a column on the same line in these cases (virtual base - # classes are rare in google3 because multiple inheritance is rare). - if Match(r'^.*[^:]:[^:].*$', line): return - - # Look for the next opening parenthesis. This is the start of the - # parameter list (possibly on the next line shortly after virtual). - # TODO(unknown): doesn't work if there are virtual functions with - # decltype() or other things that use parentheses, but csearch suggests - # that this is rare. - end_col = -1 - end_line = -1 - start_col = len(virtual.group(2)) - for start_line in xrange(linenum, min(linenum + 3, clean_lines.NumLines())): - line = clean_lines.elided[start_line][start_col:] - parameter_list = Match(r'^([^(]*)\(', line) - if parameter_list: - # Match parentheses to find the end of the parameter list - (_, end_line, end_col) = CloseExpression( - clean_lines, start_line, start_col + len(parameter_list.group(1))) - break - start_col = 0 - - if end_col < 0: - return # Couldn't find end of parameter list, give up - - # Look for "override" or "final" after the parameter list - # (possibly on the next few lines). - for i in xrange(end_line, min(end_line + 3, clean_lines.NumLines())): - line = clean_lines.elided[i][end_col:] - match = Search(r'\b(override|final)\b', line) - if match: - error(filename, linenum, 'readability/inheritance', 4, - ('"virtual" is redundant since function is ' - 'already declared as "%s"' % match.group(1))) - - # Set end_col to check whole lines after we are done with the - # first line. - end_col = 0 - if Search(r'[^\w]\s*$', line): - break - - -def CheckRedundantOverrideOrFinal(filename, clean_lines, linenum, error): - """Check if line contains a redundant "override" or "final" virt-specifier. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - # Look for closing parenthesis nearby. We need one to confirm where - # the declarator ends and where the virt-specifier starts to avoid - # false positives. - line = clean_lines.elided[linenum] - declarator_end = line.rfind(')') - if declarator_end >= 0: - fragment = line[declarator_end:] - else: - if linenum > 1 and clean_lines.elided[linenum - 1].rfind(')') >= 0: - fragment = line - else: - return - - # Check that at most one of "override" or "final" is present, not both - if Search(r'\boverride\b', fragment) and Search(r'\bfinal\b', fragment): - error(filename, linenum, 'readability/inheritance', 4, - ('"override" is redundant since function is ' - 'already declared as "final"')) - - - - -# Returns true if we are at a new block, and it is directly -# inside of a namespace. -def IsBlockInNameSpace(nesting_state, is_forward_declaration): - """Checks that the new block is directly in a namespace. - - Args: - nesting_state: The _NestingState object that contains info about our state. - is_forward_declaration: If the class is a forward declared class. - Returns: - Whether or not the new block is directly in a namespace. - """ - if is_forward_declaration: - return len(nesting_state.stack) >= 1 and ( - isinstance(nesting_state.stack[-1], _NamespaceInfo)) - - - return (len(nesting_state.stack) > 1 and - nesting_state.stack[-1].check_namespace_indentation and - isinstance(nesting_state.stack[-2], _NamespaceInfo)) - - -def ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item, - raw_lines_no_comments, linenum): - """This method determines if we should apply our namespace indentation check. - - Args: - nesting_state: The current nesting state. - is_namespace_indent_item: If we just put a new class on the stack, True. - If the top of the stack is not a class, or we did not recently - add the class, False. - raw_lines_no_comments: The lines without the comments. - linenum: The current line number we are processing. - - Returns: - True if we should apply our namespace indentation check. Currently, it - only works for classes and namespaces inside of a namespace. - """ - - is_forward_declaration = IsForwardClassDeclaration(raw_lines_no_comments, - linenum) - - if not (is_namespace_indent_item or is_forward_declaration): - return False - - # If we are in a macro, we do not want to check the namespace indentation. - if IsMacroDefinition(raw_lines_no_comments, linenum): - return False - - return IsBlockInNameSpace(nesting_state, is_forward_declaration) - - -# Call this method if the line is directly inside of a namespace. -# If the line above is blank (excluding comments) or the start of -# an inner namespace, it cannot be indented. -def CheckItemIndentationInNamespace(filename, raw_lines_no_comments, linenum, - error): - line = raw_lines_no_comments[linenum] - if Match(r'^\s+', line): - error(filename, linenum, 'runtime/indentation_namespace', 4, - 'Do not indent within a namespace') - - -def ProcessLine(filename, file_extension, clean_lines, line, - include_state, function_state, nesting_state, error, - extra_check_functions=None): - """Processes a single line in the file. - - Args: - filename: Filename of the file that is being processed. - file_extension: The extension (dot not included) of the file. - clean_lines: An array of strings, each representing a line of the file, - with comments stripped. - line: Number of line being processed. - include_state: An _IncludeState instance in which the headers are inserted. - function_state: A _FunctionState instance which counts function lines, etc. - nesting_state: A NestingState instance which maintains information about - the current stack of nested blocks being parsed. - error: A callable to which errors are reported, which takes 4 arguments: - filename, line number, error level, and message - extra_check_functions: An array of additional check functions that will be - run on each source line. Each function takes 4 - arguments: filename, clean_lines, line, error - """ - raw_lines = clean_lines.raw_lines - ParseNolintSuppressions(filename, raw_lines[line], line, error) - nesting_state.Update(filename, clean_lines, line, error) - CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line, - error) - if nesting_state.InAsmBlock(): return - CheckForFunctionLengths(filename, clean_lines, line, function_state, error) - CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error) - CheckStyle(filename, clean_lines, line, file_extension, nesting_state, error) - CheckLanguage(filename, clean_lines, line, file_extension, include_state, - nesting_state, error) - CheckForNonConstReference(filename, clean_lines, line, nesting_state, error) - CheckForNonStandardConstructs(filename, clean_lines, line, - nesting_state, error) - CheckVlogArguments(filename, clean_lines, line, error) - CheckPosixThreading(filename, clean_lines, line, error) - CheckInvalidIncrement(filename, clean_lines, line, error) - CheckMakePairUsesDeduction(filename, clean_lines, line, error) - CheckRedundantVirtual(filename, clean_lines, line, error) - CheckRedundantOverrideOrFinal(filename, clean_lines, line, error) - if extra_check_functions: - for check_fn in extra_check_functions: - check_fn(filename, clean_lines, line, error) - -def FlagCxx11Features(filename, clean_lines, linenum, error): - """Flag those c++11 features that we only allow in certain places. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - - include = Match(r'\s*#\s*include\s+[<"]([^<"]+)[">]', line) - - # Flag unapproved C++ TR1 headers. - if include and include.group(1).startswith('tr1/'): - error(filename, linenum, 'build/c++tr1', 5, - ('C++ TR1 headers such as <%s> are unapproved.') % include.group(1)) - - # Flag unapproved C++11 headers. - if include and include.group(1) in ('cfenv', - 'condition_variable', - 'fenv.h', - 'future', - 'mutex', - 'thread', - 'chrono', - 'ratio', - 'regex', - 'system_error', - ): - error(filename, linenum, 'build/c++11', 5, - ('<%s> is an unapproved C++11 header.') % include.group(1)) - - # The only place where we need to worry about C++11 keywords and library - # features in preprocessor directives is in macro definitions. - if Match(r'\s*#', line) and not Match(r'\s*#\s*define\b', line): return - - # These are classes and free functions. The classes are always - # mentioned as std::*, but we only catch the free functions if - # they're not found by ADL. They're alphabetical by header. - for top_name in ( - # type_traits - 'alignment_of', - 'aligned_union', - ): - if Search(r'\bstd::%s\b' % top_name, line): - error(filename, linenum, 'build/c++11', 5, - ('std::%s is an unapproved C++11 class or function. Send c-style ' - 'an example of where it would make your code more readable, and ' - 'they may let you use it.') % top_name) - - -def FlagCxx14Features(filename, clean_lines, linenum, error): - """Flag those C++14 features that we restrict. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - - include = Match(r'\s*#\s*include\s+[<"]([^<"]+)[">]', line) - - # Flag unapproved C++14 headers. - if include and include.group(1) in ('scoped_allocator', 'shared_mutex'): - error(filename, linenum, 'build/c++14', 5, - ('<%s> is an unapproved C++14 header.') % include.group(1)) - - -def ProcessFileData(filename, file_extension, lines, error, - extra_check_functions=None): - """Performs lint checks and reports any errors to the given error function. - - Args: - filename: Filename of the file that is being processed. - file_extension: The extension (dot not included) of the file. - lines: An array of strings, each representing a line of the file, with the - last element being empty if the file is terminated with a newline. - error: A callable to which errors are reported, which takes 4 arguments: - filename, line number, error level, and message - extra_check_functions: An array of additional check functions that will be - run on each source line. Each function takes 4 - arguments: filename, clean_lines, line, error - """ - lines = (['// marker so line numbers and indices both start at 1'] + lines + - ['// marker so line numbers end in a known way']) - - include_state = _IncludeState() - function_state = _FunctionState() - nesting_state = NestingState() - - ResetNolintSuppressions() - - CheckForCopyright(filename, lines, error) - ProcessGlobalSuppresions(lines) - RemoveMultiLineComments(filename, lines, error) - clean_lines = CleansedLines(lines) - - if file_extension in GetHeaderExtensions(): - CheckForHeaderGuard(filename, clean_lines, error) - - for line in range(clean_lines.NumLines()): - ProcessLine(filename, file_extension, clean_lines, line, - include_state, function_state, nesting_state, error, - extra_check_functions) - FlagCxx11Features(filename, clean_lines, line, error) - nesting_state.CheckCompletedBlocks(filename, error) - - CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error) - - # Check that the .cc file has included its header if it exists. - if _IsSourceExtension(file_extension): - CheckHeaderFileIncluded(filename, include_state, error) - - # We check here rather than inside ProcessLine so that we see raw - # lines rather than "cleaned" lines. - CheckForBadCharacters(filename, lines, error) - - CheckForNewlineAtEOF(filename, lines, error) - -def ProcessConfigOverrides(filename): - """ Loads the configuration files and processes the config overrides. - - Args: - filename: The name of the file being processed by the linter. - - Returns: - False if the current |filename| should not be processed further. - """ - - abs_filename = os.path.abspath(filename) - cfg_filters = [] - keep_looking = True - while keep_looking: - abs_path, base_name = os.path.split(abs_filename) - if not base_name: - break # Reached the root directory. - - cfg_file = os.path.join(abs_path, "CPPLINT.cfg") - abs_filename = abs_path - if not os.path.isfile(cfg_file): - continue - - try: - with open(cfg_file) as file_handle: - for line in file_handle: - line, _, _ = line.partition('#') # Remove comments. - if not line.strip(): - continue - - name, _, val = line.partition('=') - name = name.strip() - val = val.strip() - if name == 'set noparent': - keep_looking = False - elif name == 'filter': - cfg_filters.append(val) - elif name == 'exclude_files': - # When matching exclude_files pattern, use the base_name of - # the current file name or the directory name we are processing. - # For example, if we are checking for lint errors in /foo/bar/baz.cc - # and we found the .cfg file at /foo/CPPLINT.cfg, then the config - # file's "exclude_files" filter is meant to be checked against "bar" - # and not "baz" nor "bar/baz.cc". - if base_name: - pattern = re.compile(val) - if pattern.match(base_name): - _cpplint_state.PrintInfo('Ignoring "%s": file excluded by ' - '"%s". File path component "%s" matches pattern "%s"\n' % - (filename, cfg_file, base_name, val)) - return False - elif name == 'linelength': - global _line_length - try: - _line_length = int(val) - except ValueError: - _cpplint_state.PrintError('Line length must be numeric.') - elif name == 'extensions': - global _valid_extensions - try: - extensions = [ext.strip() for ext in val.split(',')] - _valid_extensions = set(extensions) - except ValueError: - sys.stderr.write('Extensions should be a comma-separated list of values;' - 'for example: extensions=hpp,cpp\n' - 'This could not be parsed: "%s"' % (val,)) - elif name == 'headers': - global _header_extensions - try: - extensions = [ext.strip() for ext in val.split(',')] - _header_extensions = set(extensions) - except ValueError: - sys.stderr.write('Extensions should be a comma-separated list of values;' - 'for example: extensions=hpp,cpp\n' - 'This could not be parsed: "%s"' % (val,)) - elif name == 'root': - global _root - _root = val - else: - _cpplint_state.PrintError( - 'Invalid configuration option (%s) in file %s\n' % - (name, cfg_file)) - - except IOError: - _cpplint_state.PrintError( - "Skipping config file '%s': Can't open for reading\n" % cfg_file) - keep_looking = False - - # Apply all the accumulated filters in reverse order (top-level directory - # config options having the least priority). - for cfg_filter in reversed(cfg_filters): - _AddFilters(cfg_filter) - - return True - - -def ProcessFile(filename, vlevel, extra_check_functions=None): - """Does google-lint on a single file. - - Args: - filename: The name of the file to parse. - - vlevel: The level of errors to report. Every error of confidence - >= verbose_level will be reported. 0 is a good default. - - extra_check_functions: An array of additional check functions that will be - run on each source line. Each function takes 4 - arguments: filename, clean_lines, line, error - """ - - _SetVerboseLevel(vlevel) - _BackupFilters() - - if not ProcessConfigOverrides(filename): - _RestoreFilters() - return - - lf_lines = [] - crlf_lines = [] - try: - # Support the UNIX convention of using "-" for stdin. Note that - # we are not opening the file with universal newline support - # (which codecs doesn't support anyway), so the resulting lines do - # contain trailing '\r' characters if we are reading a file that - # has CRLF endings. - # If after the split a trailing '\r' is present, it is removed - # below. - if filename == '-': - lines = codecs.StreamReaderWriter(sys.stdin, - codecs.getreader('utf8'), - codecs.getwriter('utf8'), - 'replace').read().split('\n') - else: - lines = codecs.open(filename, 'r', 'utf8', 'replace').read().split('\n') - - # Remove trailing '\r'. - # The -1 accounts for the extra trailing blank line we get from split() - for linenum in range(len(lines) - 1): - if lines[linenum].endswith('\r'): - lines[linenum] = lines[linenum].rstrip('\r') - crlf_lines.append(linenum + 1) - else: - lf_lines.append(linenum + 1) - - except IOError: - _cpplint_state.PrintError( - "Skipping input '%s': Can't open for reading\n" % filename) - _RestoreFilters() - return - - # Note, if no dot is found, this will give the entire filename as the ext. - file_extension = filename[filename.rfind('.') + 1:] - - # When reading from stdin, the extension is unknown, so no cpplint tests - # should rely on the extension. - if filename != '-' and file_extension not in GetAllExtensions(): - _cpplint_state.PrintError('Ignoring %s; not a valid file name ' - '(%s)\n' % (filename, ', '.join(GetAllExtensions()))) - else: - ProcessFileData(filename, file_extension, lines, Error, - extra_check_functions) - - # If end-of-line sequences are a mix of LF and CR-LF, issue - # warnings on the lines with CR. - # - # Don't issue any warnings if all lines are uniformly LF or CR-LF, - # since critique can handle these just fine, and the style guide - # doesn't dictate a particular end of line sequence. - # - # We can't depend on os.linesep to determine what the desired - # end-of-line sequence should be, since that will return the - # server-side end-of-line sequence. - if lf_lines and crlf_lines: - # Warn on every line with CR. An alternative approach might be to - # check whether the file is mostly CRLF or just LF, and warn on the - # minority, we bias toward LF here since most tools prefer LF. - for linenum in crlf_lines: - Error(filename, linenum, 'whitespace/newline', 1, - 'Unexpected \\r (^M) found; better to use only \\n') - - _cpplint_state.PrintInfo('Done processing %s\n' % filename) - _RestoreFilters() - - -def PrintUsage(message): - """Prints a brief usage string and exits, optionally with an error message. - - Args: - message: The optional error message. - """ - sys.stderr.write(_USAGE) - - if message: - sys.exit('\nFATAL ERROR: ' + message) - else: - sys.exit(0) - - -def PrintCategories(): - """Prints a list of all the error-categories used by error messages. - - These are the categories used to filter messages via --filter. - """ - sys.stderr.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES)) - sys.exit(0) - - -def ParseArguments(args): - """Parses the command line arguments. - - This may set the output format and verbosity level as side-effects. - - Args: - args: The command line arguments: - - Returns: - The list of filenames to lint. - """ - try: - (opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose=', - 'counting=', - 'filter=', - 'root=', - 'repository=', - 'linelength=', - 'extensions=', - 'exclude=', - 'headers=', - 'quiet', - 'recursive']) - except getopt.GetoptError: - PrintUsage('Invalid arguments.') - - verbosity = _VerboseLevel() - output_format = _OutputFormat() - filters = '' - counting_style = '' - recursive = False - - for (opt, val) in opts: - if opt == '--help': - PrintUsage(None) - elif opt == '--output': - if val not in ('emacs', 'vs7', 'eclipse', 'junit'): - PrintUsage('The only allowed output formats are emacs, vs7, eclipse ' - 'and junit.') - output_format = val - elif opt == '--verbose': - verbosity = int(val) - elif opt == '--filter': - filters = val - if not filters: - PrintCategories() - elif opt == '--counting': - if val not in ('total', 'toplevel', 'detailed'): - PrintUsage('Valid counting options are total, toplevel, and detailed') - counting_style = val - elif opt == '--root': - global _root - _root = val - elif opt == '--repository': - global _repository - _repository = val - elif opt == '--linelength': - global _line_length - try: - _line_length = int(val) - except ValueError: - PrintUsage('Line length must be digits.') - elif opt == '--exclude': - global _excludes - if not _excludes: - _excludes = set() - _excludes.update(glob.glob(val)) - elif opt == '--extensions': - global _valid_extensions - try: - _valid_extensions = set(val.split(',')) - except ValueError: - PrintUsage('Extensions must be comma separated list.') - elif opt == '--headers': - global _header_extensions - try: - _header_extensions = set(val.split(',')) - except ValueError: - PrintUsage('Extensions must be comma separated list.') - elif opt == '--recursive': - recursive = True - elif opt == '--quiet': - global _quiet - _quiet = True - - if not filenames: - PrintUsage('No files were specified.') - - if recursive: - filenames = _ExpandDirectories(filenames) - - if _excludes: - filenames = _FilterExcludedFiles(filenames) - - _SetOutputFormat(output_format) - _SetVerboseLevel(verbosity) - _SetFilters(filters) - _SetCountingStyle(counting_style) - - return filenames - -def _ExpandDirectories(filenames): - """Searches a list of filenames and replaces directories in the list with - all files descending from those directories. Files with extensions not in - the valid extensions list are excluded. - - Args: - filenames: A list of files or directories - - Returns: - A list of all files that are members of filenames or descended from a - directory in filenames - """ - expanded = set() - for filename in filenames: - if not os.path.isdir(filename): - expanded.add(filename) - continue - - for root, _, files in os.walk(filename): - for loopfile in files: - fullname = os.path.join(root, loopfile) - if fullname.startswith('.' + os.path.sep): - fullname = fullname[len('.' + os.path.sep):] - expanded.add(fullname) - - filtered = [] - for filename in expanded: - if os.path.splitext(filename)[1][1:] in GetAllExtensions(): - filtered.append(filename) - - return filtered - -def _FilterExcludedFiles(filenames): - """Filters out files listed in the --exclude command line switch. File paths - in the switch are evaluated relative to the current working directory - """ - exclude_paths = [os.path.abspath(f) for f in _excludes] - return [f for f in filenames if os.path.abspath(f) not in exclude_paths] - -def main(): - filenames = ParseArguments(sys.argv[1:]) - backup_err = sys.stderr - try: - # Change stderr to write with replacement characters so we don't die - # if we try to print something containing non-ASCII characters. - sys.stderr = codecs.StreamReader(sys.stderr, 'replace') - - _cpplint_state.ResetErrorCounts() - for filename in filenames: - ProcessFile(filename, _cpplint_state.verbose_level) - _cpplint_state.PrintErrorCounts() - - if _cpplint_state.output_format == 'junit': - sys.stderr.write(_cpplint_state.FormatJUnitXML()) - - finally: - sys.stderr = backup_err - - sys.exit(_cpplint_state.error_count > 0) - - -if __name__ == '__main__': - main() - diff --git a/proxy/build-support/lint_exclusions.txt b/proxy/build-support/lint_exclusions.txt deleted file mode 100644 index fe64fe833c..0000000000 --- a/proxy/build-support/lint_exclusions.txt +++ /dev/null @@ -1,7 +0,0 @@ -*cmake-build-debug* -*cmake-build-release* -*cmake_build* -*thirdparty* -*src/grpc* -*milvus/include* -*unittest* \ No newline at end of file diff --git a/proxy/build-support/lintutils.py b/proxy/build-support/lintutils.py deleted file mode 100755 index b4b01da3e9..0000000000 --- a/proxy/build-support/lintutils.py +++ /dev/null @@ -1,110 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -import multiprocessing as mp -import os -from fnmatch import fnmatch -from subprocess import Popen - - -def chunk(seq, n): - """ - divide a sequence into equal sized chunks - (the last chunk may be smaller, but won't be empty) - """ - chunks = [] - some = [] - for element in seq: - if len(some) == n: - chunks.append(some) - some = [] - some.append(element) - if len(some) > 0: - chunks.append(some) - return chunks - - -def dechunk(chunks): - "flatten chunks into a single list" - seq = [] - for chunk in chunks: - seq.extend(chunk) - return seq - - -def run_parallel(cmds, **kwargs): - """ - Run each of cmds (with shared **kwargs) using subprocess.Popen - then wait for all of them to complete. - Runs batches of multiprocessing.cpu_count() * 2 from cmds - returns a list of tuples containing each process' - returncode, stdout, stderr - """ - complete = [] - for cmds_batch in chunk(cmds, mp.cpu_count() * 2): - procs_batch = [Popen(cmd, **kwargs) for cmd in cmds_batch] - for proc in procs_batch: - stdout, stderr = proc.communicate() - complete.append((proc.returncode, stdout, stderr)) - return complete - - -_source_extensions = ''' -.h -.cc -.cpp -'''.split() - - -def get_sources(source_dir, exclude_globs=[]): - sources = [] - for directory, subdirs, basenames in os.walk(source_dir): - for path in [os.path.join(directory, basename) - for basename in basenames]: - # filter out non-source files - if os.path.splitext(path)[1] not in _source_extensions: - continue - - path = os.path.abspath(path) - - # filter out files that match the globs in the globs file - if any([fnmatch(path, glob) for glob in exclude_globs]): - continue - - sources.append(path) - return sources - - -def stdout_pathcolonline(completed_process, filenames): - """ - given a completed process which may have reported some files as problematic - by printing the path name followed by ':' then a line number, examine - stdout and return the set of actually reported file names - """ - returncode, stdout, stderr = completed_process - bfilenames = set() - for filename in filenames: - bfilenames.add(filename.encode('utf-8') + b':') - problem_files = set() - for line in stdout.splitlines(): - for filename in bfilenames: - if line.startswith(filename): - problem_files.add(filename.decode('utf-8')) - bfilenames.remove(filename) - break - return problem_files, stdout - diff --git a/proxy/build-support/run_clang_format.py b/proxy/build-support/run_clang_format.py deleted file mode 100755 index cb5afaba4a..0000000000 --- a/proxy/build-support/run_clang_format.py +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/env python2 -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -from __future__ import print_function -import lintutils -from subprocess import PIPE -import argparse -import difflib -import multiprocessing as mp -import sys -from functools import partial - - -# examine the output of clang-format and if changes are -# present assemble a (unified)patch of the difference -def _check_one_file(completed_processes, filename): - with open(filename, "rb") as reader: - original = reader.read() - - returncode, stdout, stderr = completed_processes[filename] - formatted = stdout - if formatted != original: - # Run the equivalent of diff -u - diff = list(difflib.unified_diff( - original.decode('utf8').splitlines(True), - formatted.decode('utf8').splitlines(True), - fromfile=filename, - tofile="{} (after clang format)".format( - filename))) - else: - diff = None - - return filename, diff - - -if __name__ == "__main__": - parser = argparse.ArgumentParser( - description="Runs clang-format on all of the source " - "files. If --fix is specified enforce format by " - "modifying in place, otherwise compare the output " - "with the existing file and output any necessary " - "changes as a patch in unified diff format") - parser.add_argument("--clang_format_binary", - required=True, - help="Path to the clang-format binary") - parser.add_argument("--exclude_globs", - help="Filename containing globs for files " - "that should be excluded from the checks") - parser.add_argument("--source_dir", - required=True, - help="Root directory of the source code") - parser.add_argument("--fix", default=False, - action="store_true", - help="If specified, will re-format the source " - "code instead of comparing the re-formatted " - "output, defaults to %(default)s") - parser.add_argument("--quiet", default=False, - action="store_true", - help="If specified, only print errors") - arguments = parser.parse_args() - - exclude_globs = [] - if arguments.exclude_globs: - for line in open(arguments.exclude_globs): - exclude_globs.append(line.strip()) - - formatted_filenames = [] - for path in lintutils.get_sources(arguments.source_dir, exclude_globs): - formatted_filenames.append(str(path)) - - if arguments.fix: - if not arguments.quiet: - print("\n".join(map(lambda x: "Formatting {}".format(x), - formatted_filenames))) - - # Break clang-format invocations into chunks: each invocation formats - # 16 files. Wait for all processes to complete - results = lintutils.run_parallel([ - [arguments.clang_format_binary, "-i"] + some - for some in lintutils.chunk(formatted_filenames, 16) - ]) - for returncode, stdout, stderr in results: - # if any clang-format reported a parse error, bubble it - if returncode != 0: - sys.exit(returncode) - - else: - # run an instance of clang-format for each source file in parallel, - # then wait for all processes to complete - results = lintutils.run_parallel([ - [arguments.clang_format_binary, filename] - for filename in formatted_filenames - ], stdout=PIPE, stderr=PIPE) - for returncode, stdout, stderr in results: - # if any clang-format reported a parse error, bubble it - if returncode != 0: - sys.exit(returncode) - - error = False - checker = partial(_check_one_file, { - filename: result - for filename, result in zip(formatted_filenames, results) - }) - pool = mp.Pool() - try: - # check the output from each invocation of clang-format in parallel - for filename, diff in pool.imap(checker, formatted_filenames): - if not arguments.quiet: - print("Checking {}".format(filename)) - if diff: - print("{} had clang-format style issues".format(filename)) - # Print out the diff to stderr - error = True - # pad with a newline - print(file=sys.stderr) - diff_out = [] - for diff_str in diff: - diff_out.append(diff_str.encode('raw_unicode_escape')) - sys.stderr.writelines(diff_out) - except Exception: - error = True - raise - finally: - pool.terminate() - pool.join() - sys.exit(1 if error else 0) - diff --git a/proxy/build-support/run_clang_tidy.py b/proxy/build-support/run_clang_tidy.py deleted file mode 100755 index 788e7e09c2..0000000000 --- a/proxy/build-support/run_clang_tidy.py +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/env python -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -from __future__ import print_function -import argparse -import multiprocessing as mp -import lintutils -from subprocess import PIPE -import sys -from functools import partial - - -def _get_chunk_key(filenames): - # lists are not hashable so key on the first filename in a chunk - return filenames[0] - - -# clang-tidy outputs complaints in '/path:line_number: complaint' format, -# so we can scan its output to get a list of files to fix -def _check_some_files(completed_processes, filenames): - result = completed_processes[_get_chunk_key(filenames)] - return lintutils.stdout_pathcolonline(result, filenames) - - -def _check_all(cmd, filenames): - # each clang-tidy instance will process 16 files - chunks = lintutils.chunk(filenames, 16) - cmds = [cmd + some for some in chunks] - results = lintutils.run_parallel(cmds, stderr=PIPE, stdout=PIPE) - error = False - # record completed processes (keyed by the first filename in the input - # chunk) for lookup in _check_some_files - completed_processes = { - _get_chunk_key(some): result - for some, result in zip(chunks, results) - } - checker = partial(_check_some_files, completed_processes) - pool = mp.Pool() - try: - # check output of completed clang-tidy invocations in parallel - for problem_files, stdout in pool.imap(checker, chunks): - if problem_files: - msg = "clang-tidy suggested fixes for {}" - print("\n".join(map(msg.format, problem_files))) - print(stdout.decode("utf-8")) - error = True - except Exception: - error = True - raise - finally: - pool.terminate() - pool.join() - - if error: - sys.exit(1) - - -if __name__ == "__main__": - parser = argparse.ArgumentParser( - description="Runs clang-tidy on all ") - parser.add_argument("--clang_tidy_binary", - required=True, - help="Path to the clang-tidy binary") - parser.add_argument("--exclude_globs", - help="Filename containing globs for files " - "that should be excluded from the checks") - parser.add_argument("--compile_commands", - required=True, - help="compile_commands.json to pass clang-tidy") - parser.add_argument("--source_dir", - required=True, - help="Root directory of the source code") - parser.add_argument("--fix", default=False, - action="store_true", - help="If specified, will attempt to fix the " - "source code instead of recommending fixes, " - "defaults to %(default)s") - parser.add_argument("--quiet", default=False, - action="store_true", - help="If specified, only print errors") - arguments = parser.parse_args() - - exclude_globs = [] - if arguments.exclude_globs: - for line in open(arguments.exclude_globs): - exclude_globs.append(line.strip()) - - linted_filenames = [] - for path in lintutils.get_sources(arguments.source_dir, exclude_globs): - linted_filenames.append(path) - - if not arguments.quiet: - msg = 'Tidying {}' if arguments.fix else 'Checking {}' - print("\n".join(map(msg.format, linted_filenames))) - - cmd = [ - arguments.clang_tidy_binary, - '-p', - arguments.compile_commands - ] - if arguments.fix: - cmd.append('-fix') - results = lintutils.run_parallel( - [cmd + some for some in lintutils.chunk(linted_filenames, 16)]) - for returncode, stdout, stderr in results: - if returncode != 0: - sys.exit(returncode) - - else: - _check_all(cmd, linted_filenames) diff --git a/proxy/build-support/run_cpplint.py b/proxy/build-support/run_cpplint.py deleted file mode 100755 index 98c4170858..0000000000 --- a/proxy/build-support/run_cpplint.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -from __future__ import print_function -import lintutils -from subprocess import PIPE, STDOUT -import argparse -import multiprocessing as mp -import sys -import platform -from functools import partial - - -# NOTE(wesm): -# -# * readability/casting is disabled as it aggressively warns about functions -# with names like "int32", so "int32(x)", where int32 is a function name, -# warns with -_filters = ''' --whitespace/comments --readability/casting --readability/todo --readability/alt_tokens --build/header_guard --build/c++11 --runtime/references --build/include_order -'''.split() - - -def _get_chunk_key(filenames): - # lists are not hashable so key on the first filename in a chunk - return filenames[0] - - -def _check_some_files(completed_processes, filenames): - # cpplint outputs complaints in '/path:line_number: complaint' format, - # so we can scan its output to get a list of files to fix - result = completed_processes[_get_chunk_key(filenames)] - return lintutils.stdout_pathcolonline(result, filenames) - - -if __name__ == "__main__": - parser = argparse.ArgumentParser( - description="Runs cpplint on all of the source files.") - parser.add_argument("--cpplint_binary", - required=True, - help="Path to the cpplint binary") - parser.add_argument("--exclude_globs", - help="Filename containing globs for files " - "that should be excluded from the checks") - parser.add_argument("--source_dir", - required=True, - help="Root directory of the source code") - parser.add_argument("--quiet", default=False, - action="store_true", - help="If specified, only print errors") - arguments = parser.parse_args() - - exclude_globs = [] - if arguments.exclude_globs: - for line in open(arguments.exclude_globs): - exclude_globs.append(line.strip()) - - linted_filenames = [] - for path in lintutils.get_sources(arguments.source_dir, exclude_globs): - linted_filenames.append(str(path)) - - cmd = [ - arguments.cpplint_binary, - '--verbose=2', - '--linelength=120', - '--filter=' + ','.join(_filters) - ] - if (arguments.cpplint_binary.endswith('.py') and - platform.system() == 'Windows'): - # Windows doesn't support executable scripts; execute with - # sys.executable - cmd.insert(0, sys.executable) - if arguments.quiet: - cmd.append('--quiet') - else: - print("\n".join(map(lambda x: "Linting {}".format(x), - linted_filenames))) - - # lint files in chunks: each invocation of cpplint will process 16 files - chunks = lintutils.chunk(linted_filenames, 16) - cmds = [cmd + some for some in chunks] - results = lintutils.run_parallel(cmds, stdout=PIPE, stderr=STDOUT) - - error = False - # record completed processes (keyed by the first filename in the input - # chunk) for lookup in _check_some_files - completed_processes = { - _get_chunk_key(filenames): result - for filenames, result in zip(chunks, results) - } - checker = partial(_check_some_files, completed_processes) - pool = mp.Pool() - try: - # scan the outputs of various cpplint invocations in parallel to - # distill a list of problematic files - for problem_files, stdout in pool.imap(checker, chunks): - if problem_files: - if isinstance(stdout, bytes): - stdout = stdout.decode('utf8') - print(stdout, file=sys.stderr) - error = True - except Exception: - error = True - raise - finally: - pool.terminate() - pool.join() - - sys.exit(1 if error else 0) - diff --git a/proxy/cmake/BuildUtils.cmake b/proxy/cmake/BuildUtils.cmake deleted file mode 100644 index a739ce243d..0000000000 --- a/proxy/cmake/BuildUtils.cmake +++ /dev/null @@ -1,231 +0,0 @@ -# Define a function that check last file modification -function(Check_Last_Modify cache_check_lists_file_path working_dir last_modified_commit_id) - if(EXISTS "${working_dir}") - if(EXISTS "${cache_check_lists_file_path}") - set(GIT_LOG_SKIP_NUM 0) - set(_MATCH_ALL ON CACHE BOOL "Match all") - set(_LOOP_STATUS ON CACHE BOOL "Whether out of loop") - file(STRINGS ${cache_check_lists_file_path} CACHE_IGNORE_TXT) - while(_LOOP_STATUS) - foreach(_IGNORE_ENTRY ${CACHE_IGNORE_TXT}) - if(NOT _IGNORE_ENTRY MATCHES "^[^#]+") - continue() - endif() - - set(_MATCH_ALL OFF) - execute_process(COMMAND git log --no-merges -1 --skip=${GIT_LOG_SKIP_NUM} --name-status --pretty= WORKING_DIRECTORY ${working_dir} OUTPUT_VARIABLE CHANGE_FILES) - if(NOT CHANGE_FILES STREQUAL "") - string(REPLACE "\n" ";" _CHANGE_FILES ${CHANGE_FILES}) - foreach(_FILE_ENTRY ${_CHANGE_FILES}) - string(REGEX MATCH "[^ \t]+$" _FILE_NAME ${_FILE_ENTRY}) - execute_process(COMMAND sh -c "echo ${_FILE_NAME} | grep ${_IGNORE_ENTRY}" RESULT_VARIABLE return_code) - if (return_code EQUAL 0) - execute_process(COMMAND git log --no-merges -1 --skip=${GIT_LOG_SKIP_NUM} --pretty=%H WORKING_DIRECTORY ${working_dir} OUTPUT_VARIABLE LAST_MODIFIED_COMMIT_ID) - set (${last_modified_commit_id} ${LAST_MODIFIED_COMMIT_ID} PARENT_SCOPE) - set(_LOOP_STATUS OFF) - endif() - endforeach() - else() - set(_LOOP_STATUS OFF) - endif() - endforeach() - - if(_MATCH_ALL) - execute_process(COMMAND git log --no-merges -1 --skip=${GIT_LOG_SKIP_NUM} --pretty=%H WORKING_DIRECTORY ${working_dir} OUTPUT_VARIABLE LAST_MODIFIED_COMMIT_ID) - set (${last_modified_commit_id} ${LAST_MODIFIED_COMMIT_ID} PARENT_SCOPE) - set(_LOOP_STATUS OFF) - endif() - - math(EXPR GIT_LOG_SKIP_NUM "${GIT_LOG_SKIP_NUM} + 1") - endwhile(_LOOP_STATUS) - else() - execute_process(COMMAND git log --no-merges -1 --skip=${GIT_LOG_SKIP_NUM} --pretty=%H WORKING_DIRECTORY ${working_dir} OUTPUT_VARIABLE LAST_MODIFIED_COMMIT_ID) - set (${last_modified_commit_id} ${LAST_MODIFIED_COMMIT_ID} PARENT_SCOPE) - endif() - else() - message(FATAL_ERROR "The directory ${working_dir} does not exist") - endif() -endfunction() - -# Define a function that extracts a cached package -function(ExternalProject_Use_Cache project_name package_file install_path) - message(STATUS "Will use cached package file: ${package_file}") - - ExternalProject_Add(${project_name} - DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E echo - "No download step needed (using cached package)" - CONFIGURE_COMMAND ${CMAKE_COMMAND} -E echo - "No configure step needed (using cached package)" - BUILD_COMMAND ${CMAKE_COMMAND} -E echo - "No build step needed (using cached package)" - INSTALL_COMMAND ${CMAKE_COMMAND} -E echo - "No install step needed (using cached package)" - ) - - # We want our tar files to contain the Install/ prefix (not for any - # very special reason, only for consistency and so that we can identify them - # in the extraction logs) which means that we must extract them in the - # binary (top-level build) directory to have them installed in the right - # place for subsequent ExternalProjects to pick them up. It seems that the - # only way to control the working directory is with Add_Step! - ExternalProject_Add_Step(${project_name} extract - ALWAYS 1 - COMMAND - ${CMAKE_COMMAND} -E echo - "Extracting ${package_file} to ${install_path}" - COMMAND - ${CMAKE_COMMAND} -E tar xzf ${package_file} ${install_path} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) - - ExternalProject_Add_StepTargets(${project_name} extract) -endfunction() - -# Define a function that to create a new cached package -function(ExternalProject_Create_Cache project_name package_file install_path cache_username cache_password cache_path) - if(EXISTS ${package_file}) - message(STATUS "Removing existing package file: ${package_file}") - file(REMOVE ${package_file}) - endif() - - string(REGEX REPLACE "(.+)/.+$" "\\1" package_dir ${package_file}) - if(NOT EXISTS ${package_dir}) - file(MAKE_DIRECTORY ${package_dir}) - endif() - - message(STATUS "Will create cached package file: ${package_file}") - - ExternalProject_Add_Step(${project_name} package - DEPENDEES install - BYPRODUCTS ${package_file} - COMMAND ${CMAKE_COMMAND} -E echo "Updating cached package file: ${package_file}" - COMMAND ${CMAKE_COMMAND} -E tar czvf ${package_file} ${install_path} - COMMAND ${CMAKE_COMMAND} -E echo "Uploading package file ${package_file} to ${cache_path}" - COMMAND curl -u${cache_username}:${cache_password} -T ${package_file} ${cache_path} - ) - - ExternalProject_Add_StepTargets(${project_name} package) -endfunction() - -function(ADD_THIRDPARTY_LIB LIB_NAME) - set(options) - set(one_value_args SHARED_LIB STATIC_LIB) - set(multi_value_args DEPS INCLUDE_DIRECTORIES) - cmake_parse_arguments(ARG - "${options}" - "${one_value_args}" - "${multi_value_args}" - ${ARGN}) - if(ARG_UNPARSED_ARGUMENTS) - message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}") - endif() - - if(ARG_STATIC_LIB AND ARG_SHARED_LIB) - if(NOT ARG_STATIC_LIB) - message(FATAL_ERROR "No static or shared library provided for ${LIB_NAME}") - endif() - - set(AUG_LIB_NAME "${LIB_NAME}_static") - add_library(${AUG_LIB_NAME} STATIC IMPORTED) - set_target_properties(${AUG_LIB_NAME} - PROPERTIES IMPORTED_LOCATION "${ARG_STATIC_LIB}") - if(ARG_DEPS) - set_target_properties(${AUG_LIB_NAME} - PROPERTIES INTERFACE_LINK_LIBRARIES "${ARG_DEPS}") - endif() - message(STATUS "Added static library dependency ${AUG_LIB_NAME}: ${ARG_STATIC_LIB}") - if(ARG_INCLUDE_DIRECTORIES) - set_target_properties(${AUG_LIB_NAME} - PROPERTIES INTERFACE_INCLUDE_DIRECTORIES - "${ARG_INCLUDE_DIRECTORIES}") - endif() - - set(AUG_LIB_NAME "${LIB_NAME}_shared") - add_library(${AUG_LIB_NAME} SHARED IMPORTED) - - if(WIN32) - # Mark the ".lib" location as part of a Windows DLL - set_target_properties(${AUG_LIB_NAME} - PROPERTIES IMPORTED_IMPLIB "${ARG_SHARED_LIB}") - else() - set_target_properties(${AUG_LIB_NAME} - PROPERTIES IMPORTED_LOCATION "${ARG_SHARED_LIB}") - endif() - if(ARG_DEPS) - set_target_properties(${AUG_LIB_NAME} - PROPERTIES INTERFACE_LINK_LIBRARIES "${ARG_DEPS}") - endif() - message(STATUS "Added shared library dependency ${AUG_LIB_NAME}: ${ARG_SHARED_LIB}") - if(ARG_INCLUDE_DIRECTORIES) - set_target_properties(${AUG_LIB_NAME} - PROPERTIES INTERFACE_INCLUDE_DIRECTORIES - "${ARG_INCLUDE_DIRECTORIES}") - endif() - elseif(ARG_STATIC_LIB) - set(AUG_LIB_NAME "${LIB_NAME}_static") - add_library(${AUG_LIB_NAME} STATIC IMPORTED) - set_target_properties(${AUG_LIB_NAME} - PROPERTIES IMPORTED_LOCATION "${ARG_STATIC_LIB}") - if(ARG_DEPS) - set_target_properties(${AUG_LIB_NAME} - PROPERTIES INTERFACE_LINK_LIBRARIES "${ARG_DEPS}") - endif() - message(STATUS "Added static library dependency ${AUG_LIB_NAME}: ${ARG_STATIC_LIB}") - if(ARG_INCLUDE_DIRECTORIES) - set_target_properties(${AUG_LIB_NAME} - PROPERTIES INTERFACE_INCLUDE_DIRECTORIES - "${ARG_INCLUDE_DIRECTORIES}") - endif() - elseif(ARG_SHARED_LIB) - set(AUG_LIB_NAME "${LIB_NAME}_shared") - add_library(${AUG_LIB_NAME} SHARED IMPORTED) - - if(WIN32) - # Mark the ".lib" location as part of a Windows DLL - set_target_properties(${AUG_LIB_NAME} - PROPERTIES IMPORTED_IMPLIB "${ARG_SHARED_LIB}") - else() - set_target_properties(${AUG_LIB_NAME} - PROPERTIES IMPORTED_LOCATION "${ARG_SHARED_LIB}") - endif() - message(STATUS "Added shared library dependency ${AUG_LIB_NAME}: ${ARG_SHARED_LIB}") - if(ARG_DEPS) - set_target_properties(${AUG_LIB_NAME} - PROPERTIES INTERFACE_LINK_LIBRARIES "${ARG_DEPS}") - endif() - if(ARG_INCLUDE_DIRECTORIES) - set_target_properties(${AUG_LIB_NAME} - PROPERTIES INTERFACE_INCLUDE_DIRECTORIES - "${ARG_INCLUDE_DIRECTORIES}") - endif() - else() - message(FATAL_ERROR "No static or shared library provided for ${LIB_NAME}") - endif() -endfunction() - -MACRO (import_mysql_inc) - find_path (MYSQL_INCLUDE_DIR - NAMES "mysql.h" - PATH_SUFFIXES "mysql") - - if (${MYSQL_INCLUDE_DIR} STREQUAL "MYSQL_INCLUDE_DIR-NOTFOUND") - message(FATAL_ERROR "Could not found MySQL include directory") - else () - include_directories(${MYSQL_INCLUDE_DIR}) - endif () -ENDMACRO (import_mysql_inc) - -MACRO(using_ccache_if_defined MILVUS_USE_CCACHE) - if (MILVUS_USE_CCACHE) - find_program(CCACHE_FOUND ccache) - if (CCACHE_FOUND) - message(STATUS "Using ccache: ${CCACHE_FOUND}") - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_FOUND}) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE_FOUND}) - # let ccache preserve C++ comments, because some of them may be - # meaningful to the compiler - set(ENV{CCACHE_COMMENTS} "1") - endif (CCACHE_FOUND) - endif () -ENDMACRO(using_ccache_if_defined) - diff --git a/proxy/cmake/DefineOptions.cmake b/proxy/cmake/DefineOptions.cmake deleted file mode 100644 index 32aed8fb18..0000000000 --- a/proxy/cmake/DefineOptions.cmake +++ /dev/null @@ -1,156 +0,0 @@ - -macro(set_option_category name) - set(MILVUS_OPTION_CATEGORY ${name}) - list(APPEND "MILVUS_OPTION_CATEGORIES" ${name}) -endmacro() - -macro(define_option name description default) - option(${name} ${description} ${default}) - list(APPEND "MILVUS_${MILVUS_OPTION_CATEGORY}_OPTION_NAMES" ${name}) - set("${name}_OPTION_DESCRIPTION" ${description}) - set("${name}_OPTION_DEFAULT" ${default}) - set("${name}_OPTION_TYPE" "bool") -endmacro() - -function(list_join lst glue out) - if ("${${lst}}" STREQUAL "") - set(${out} "" PARENT_SCOPE) - return() - endif () - - list(GET ${lst} 0 joined) - list(REMOVE_AT ${lst} 0) - foreach (item ${${lst}}) - set(joined "${joined}${glue}${item}") - endforeach () - set(${out} ${joined} PARENT_SCOPE) -endfunction() - -macro(define_option_string name description default) - set(${name} ${default} CACHE STRING ${description}) - list(APPEND "MILVUS_${MILVUS_OPTION_CATEGORY}_OPTION_NAMES" ${name}) - set("${name}_OPTION_DESCRIPTION" ${description}) - set("${name}_OPTION_DEFAULT" "\"${default}\"") - set("${name}_OPTION_TYPE" "string") - - set("${name}_OPTION_ENUM" ${ARGN}) - list_join("${name}_OPTION_ENUM" "|" "${name}_OPTION_ENUM") - if (NOT ("${${name}_OPTION_ENUM}" STREQUAL "")) - set_property(CACHE ${name} PROPERTY STRINGS ${ARGN}) - endif () -endmacro() - -#---------------------------------------------------------------------- -set_option_category("Milvus Build Option") - -define_option(MILVUS_GPU_VERSION "Build GPU version" OFF) - -#---------------------------------------------------------------------- -set_option_category("Thirdparty") - -set(MILVUS_DEPENDENCY_SOURCE_DEFAULT "BUNDLED") - -define_option_string(MILVUS_DEPENDENCY_SOURCE - "Method to use for acquiring MILVUS's build dependencies" - "${MILVUS_DEPENDENCY_SOURCE_DEFAULT}" - "AUTO" - "BUNDLED" - "SYSTEM") - -define_option(MILVUS_USE_CCACHE "Use ccache when compiling (if available)" ON) - -define_option(MILVUS_VERBOSE_THIRDPARTY_BUILD - "Show output from ExternalProjects rather than just logging to files" ON) - -define_option(MILVUS_WITH_EASYLOGGINGPP "Build with Easylogging++ library" ON) - -define_option(MILVUS_WITH_GRPC "Build with GRPC" ON) - -define_option(MILVUS_WITH_ZLIB "Build with zlib compression" ON) - -define_option(MILVUS_WITH_OPENTRACING "Build with Opentracing" ON) - -define_option(MILVUS_WITH_YAMLCPP "Build with yaml-cpp library" ON) - -define_option(MILVUS_WITH_PULSAR "Build with pulsar-client" ON) - -#---------------------------------------------------------------------- -set_option_category("Test and benchmark") - -unset(MILVUS_BUILD_TESTS CACHE) -if (BUILD_UNIT_TEST) - define_option(MILVUS_BUILD_TESTS "Build the MILVUS googletest unit tests" ON) -else () - define_option(MILVUS_BUILD_TESTS "Build the MILVUS googletest unit tests" OFF) -endif (BUILD_UNIT_TEST) - -#---------------------------------------------------------------------- -macro(config_summary) - message(STATUS "---------------------------------------------------------------------") - message(STATUS "MILVUS version: ${MILVUS_VERSION}") - message(STATUS) - message(STATUS "Build configuration summary:") - - message(STATUS " Generator: ${CMAKE_GENERATOR}") - message(STATUS " Build type: ${CMAKE_BUILD_TYPE}") - message(STATUS " Source directory: ${CMAKE_CURRENT_SOURCE_DIR}") - if (${CMAKE_EXPORT_COMPILE_COMMANDS}) - message( - STATUS " Compile commands: ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json") - endif () - - foreach (category ${MILVUS_OPTION_CATEGORIES}) - - message(STATUS) - message(STATUS "${category} options:") - - set(option_names ${MILVUS_${category}_OPTION_NAMES}) - - set(max_value_length 0) - foreach (name ${option_names}) - string(LENGTH "\"${${name}}\"" value_length) - if (${max_value_length} LESS ${value_length}) - set(max_value_length ${value_length}) - endif () - endforeach () - - foreach (name ${option_names}) - if ("${${name}_OPTION_TYPE}" STREQUAL "string") - set(value "\"${${name}}\"") - else () - set(value "${${name}}") - endif () - - set(default ${${name}_OPTION_DEFAULT}) - set(description ${${name}_OPTION_DESCRIPTION}) - string(LENGTH ${description} description_length) - if (${description_length} LESS 70) - string( - SUBSTRING - " " - ${description_length} -1 description_padding) - else () - set(description_padding " - ") - endif () - - set(comment "[${name}]") - - if ("${value}" STREQUAL "${default}") - set(comment "[default] ${comment}") - endif () - - if (NOT ("${${name}_OPTION_ENUM}" STREQUAL "")) - set(comment "${comment} [${${name}_OPTION_ENUM}]") - endif () - - string( - SUBSTRING "${value} " - 0 ${max_value_length} value) - - message(STATUS " ${description} ${description_padding} ${value} ${comment}") - endforeach () - - endforeach () - -endmacro() diff --git a/proxy/cmake/FindClangTools.cmake b/proxy/cmake/FindClangTools.cmake deleted file mode 100644 index 6b47327a06..0000000000 --- a/proxy/cmake/FindClangTools.cmake +++ /dev/null @@ -1,111 +0,0 @@ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Tries to find the clang-tidy and clang-format modules -# -# Usage of this module as follows: -# -# find_package(ClangTools) -# -# Variables used by this module, they can change the default behaviour and need -# to be set before calling find_package: -# -# ClangToolsBin_HOME - -# When set, this path is inspected instead of standard library binary locations -# to find clang-tidy and clang-format -# -# This module defines -# CLANG_TIDY_BIN, The path to the clang tidy binary -# CLANG_TIDY_FOUND, Whether clang tidy was found -# CLANG_FORMAT_BIN, The path to the clang format binary -# CLANG_TIDY_FOUND, Whether clang format was found - -find_program(CLANG_TIDY_BIN - NAMES - clang-tidy-7.0 - clang-tidy-7 - clang-tidy-6.0 - clang-tidy-5.0 - clang-tidy-4.0 - clang-tidy-3.9 - clang-tidy-3.8 - clang-tidy-3.7 - clang-tidy-3.6 - clang-tidy - PATHS ${ClangTools_PATH} $ENV{CLANG_TOOLS_PATH} /usr/local/bin /usr/bin - NO_DEFAULT_PATH -) - -if ( "${CLANG_TIDY_BIN}" STREQUAL "CLANG_TIDY_BIN-NOTFOUND" ) - set(CLANG_TIDY_FOUND 0) - message("clang-tidy not found") -else() - set(CLANG_TIDY_FOUND 1) - message("clang-tidy found at ${CLANG_TIDY_BIN}") -endif() - -if (CLANG_FORMAT_VERSION) - find_program(CLANG_FORMAT_BIN - NAMES clang-format-${CLANG_FORMAT_VERSION} - PATHS - ${ClangTools_PATH} - $ENV{CLANG_TOOLS_PATH} - /usr/local/bin /usr/bin - NO_DEFAULT_PATH - ) - - # If not found yet, search alternative locations - if (("${CLANG_FORMAT_BIN}" STREQUAL "CLANG_FORMAT_BIN-NOTFOUND") AND APPLE) - # Homebrew ships older LLVM versions in /usr/local/opt/llvm@version/ - STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+" "\\1" CLANG_FORMAT_MAJOR_VERSION "${CLANG_FORMAT_VERSION}") - STRING(REGEX REPLACE "^[0-9]+\\.([0-9]+)" "\\1" CLANG_FORMAT_MINOR_VERSION "${CLANG_FORMAT_VERSION}") - if ("${CLANG_FORMAT_MINOR_VERSION}" STREQUAL "0") - find_program(CLANG_FORMAT_BIN - NAMES clang-format - PATHS /usr/local/opt/llvm@${CLANG_FORMAT_MAJOR_VERSION}/bin - NO_DEFAULT_PATH - ) - else() - find_program(CLANG_FORMAT_BIN - NAMES clang-format - PATHS /usr/local/opt/llvm@${CLANG_FORMAT_VERSION}/bin - NO_DEFAULT_PATH - ) - endif() - endif() -else() - find_program(CLANG_FORMAT_BIN - NAMES - clang-format-7.0 - clang-format-7 - clang-format-6.0 - clang-format-5.0 - clang-format-4.0 - clang-format-3.9 - clang-format-3.8 - clang-format-3.7 - clang-format-3.6 - clang-format - PATHS ${ClangTools_PATH} $ENV{CLANG_TOOLS_PATH} /usr/local/bin /usr/bin - NO_DEFAULT_PATH - ) -endif() - -if ( "${CLANG_FORMAT_BIN}" STREQUAL "CLANG_FORMAT_BIN-NOTFOUND" ) - set(CLANG_FORMAT_FOUND 0) - message("clang-format not found") -else() - set(CLANG_FORMAT_FOUND 1) - message("clang-format found at ${CLANG_FORMAT_BIN}") -endif() - diff --git a/proxy/cmake/ThirdPartyPackages.cmake b/proxy/cmake/ThirdPartyPackages.cmake deleted file mode 100644 index c129b46d63..0000000000 --- a/proxy/cmake/ThirdPartyPackages.cmake +++ /dev/null @@ -1,172 +0,0 @@ -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. - - -message(STATUS "Using ${MILVUS_DEPENDENCY_SOURCE} approach to find dependencies") - -# For each dependency, set dependency source to global default, if unset -foreach (DEPENDENCY ${MILVUS_THIRDPARTY_DEPENDENCIES}) - if ("${${DEPENDENCY}_SOURCE}" STREQUAL "") - set(${DEPENDENCY}_SOURCE ${MILVUS_DEPENDENCY_SOURCE}) - endif () -endforeach () - -# ---------------------------------------------------------------------- -# Identify OS -if (UNIX) - if (APPLE) - set(CMAKE_OS_NAME "osx" CACHE STRING "Operating system name" FORCE) - else (APPLE) - ## Check for Debian GNU/Linux ________________ - find_file(DEBIAN_FOUND debian_version debconf.conf - PATHS /etc - ) - if (DEBIAN_FOUND) - set(CMAKE_OS_NAME "debian" CACHE STRING "Operating system name" FORCE) - endif (DEBIAN_FOUND) - ## Check for Fedora _________________________ - find_file(FEDORA_FOUND fedora-release - PATHS /etc - ) - if (FEDORA_FOUND) - set(CMAKE_OS_NAME "fedora" CACHE STRING "Operating system name" FORCE) - endif (FEDORA_FOUND) - ## Check for RedHat _________________________ - find_file(REDHAT_FOUND redhat-release inittab.RH - PATHS /etc - ) - if (REDHAT_FOUND) - set(CMAKE_OS_NAME "redhat" CACHE STRING "Operating system name" FORCE) - endif (REDHAT_FOUND) - ## Extra check for Ubuntu ____________________ - if (DEBIAN_FOUND) - ## At its core Ubuntu is a Debian system, with - ## a slightly altered configuration; hence from - ## a first superficial inspection a system will - ## be considered as Debian, which signifies an - ## extra check is required. - find_file(UBUNTU_EXTRA legal issue - PATHS /etc - ) - if (UBUNTU_EXTRA) - ## Scan contents of file - file(STRINGS ${UBUNTU_EXTRA} UBUNTU_FOUND - REGEX Ubuntu - ) - ## Check result of string search - if (UBUNTU_FOUND) - set(CMAKE_OS_NAME "ubuntu" CACHE STRING "Operating system name" FORCE) - set(DEBIAN_FOUND FALSE) - - find_program(LSB_RELEASE_EXEC lsb_release) - execute_process(COMMAND ${LSB_RELEASE_EXEC} -rs - OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - STRING(REGEX REPLACE "\\." "_" UBUNTU_VERSION "${LSB_RELEASE_ID_SHORT}") - endif (UBUNTU_FOUND) - endif (UBUNTU_EXTRA) - endif (DEBIAN_FOUND) - endif (APPLE) -endif (UNIX) - -# ---------------------------------------------------------------------- -# thirdparty directory -set(THIRDPARTY_DIR "${MILVUS_SOURCE_DIR}/thirdparty") - -# ---------------------------------------------------------------------- -# ExternalProject options - -string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_BUILD_TYPE) - -set(EP_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}}") -set(EP_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${UPPERCASE_BUILD_TYPE}}") - -# Set -fPIC on all external projects -set(EP_CXX_FLAGS "${EP_CXX_FLAGS} -fPIC") -set(EP_C_FLAGS "${EP_C_FLAGS} -fPIC") - -# CC/CXX environment variables are captured on the first invocation of the -# builder (e.g make or ninja) instead of when CMake is invoked into to build -# directory. This leads to issues if the variables are exported in a subshell -# and the invocation of make/ninja is in distinct subshell without the same -# environment (CC/CXX). -set(EP_COMMON_TOOLCHAIN -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}) - -if (CMAKE_AR) - set(EP_COMMON_TOOLCHAIN ${EP_COMMON_TOOLCHAIN} -DCMAKE_AR=${CMAKE_AR}) -endif () - -if (CMAKE_RANLIB) - set(EP_COMMON_TOOLCHAIN ${EP_COMMON_TOOLCHAIN} -DCMAKE_RANLIB=${CMAKE_RANLIB}) -endif () - -# External projects are still able to override the following declarations. -# cmake command line will favor the last defined variable when a duplicate is -# encountered. This requires that `EP_COMMON_CMAKE_ARGS` is always the first -# argument. -set(EP_COMMON_CMAKE_ARGS - ${EP_COMMON_TOOLCHAIN} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_C_FLAGS=${EP_C_FLAGS} - -DCMAKE_C_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_C_FLAGS} - -DCMAKE_CXX_FLAGS=${EP_CXX_FLAGS} - -DCMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_CXX_FLAGS}) - -if (NOT MILVUS_VERBOSE_THIRDPARTY_BUILD) - set(EP_LOG_OPTIONS LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 LOG_DOWNLOAD 1) -else () - set(EP_LOG_OPTIONS) -endif () - -# Ensure that a default make is set -if ("${MAKE}" STREQUAL "") - find_program(MAKE make) -endif () - -if (NOT DEFINED MAKE_BUILD_ARGS) - set(MAKE_BUILD_ARGS "-j8") -endif () -message(STATUS "Third Party MAKE_BUILD_ARGS = ${MAKE_BUILD_ARGS}") - -# ---------------------------------------------------------------------- -# Find pthreads - -set(THREADS_PREFER_PTHREAD_FLAG ON) -find_package(Threads REQUIRED) - -# ---------------------------------------------------------------------- -# Versions and URLs for toolchain builds, which also can be used to configure -# offline builds - -# Read toolchain versions from cpp/thirdparty/versions.txt -file(STRINGS "${THIRDPARTY_DIR}/versions.txt" TOOLCHAIN_VERSIONS_TXT) -foreach (_VERSION_ENTRY ${TOOLCHAIN_VERSIONS_TXT}) - # Exclude comments - if (NOT _VERSION_ENTRY MATCHES "^[^#][A-Za-z0-9-_]+_VERSION=") - continue() - endif () - - string(REGEX MATCH "^[^=]*" _LIB_NAME ${_VERSION_ENTRY}) - string(REPLACE "${_LIB_NAME}=" "" _LIB_VERSION ${_VERSION_ENTRY}) - - # Skip blank or malformed lines - if (${_LIB_VERSION} STREQUAL "") - continue() - endif () - - # For debugging - #message(STATUS "${_LIB_NAME}: ${_LIB_VERSION}") - - set(${_LIB_NAME} "${_LIB_VERSION}") -endforeach () - diff --git a/proxy/cmake/Utils.cmake b/proxy/cmake/Utils.cmake deleted file mode 100644 index f057a48457..0000000000 --- a/proxy/cmake/Utils.cmake +++ /dev/null @@ -1,102 +0,0 @@ -# get build time -MACRO(get_current_time CURRENT_TIME) - execute_process(COMMAND "date" "+%Y-%m-%d %H:%M.%S" OUTPUT_VARIABLE ${CURRENT_TIME}) - string(REGEX REPLACE "\n" "" ${CURRENT_TIME} ${${CURRENT_TIME}}) -ENDMACRO(get_current_time) - -# get build type -MACRO(get_build_type) - cmake_parse_arguments(BUILD_TYPE "" "TARGET;DEFAULT" "" ${ARGN}) - if (NOT DEFINED CMAKE_BUILD_TYPE) - set(${BUILD_TYPE_TARGET} ${BUILD_TYPE_DEFAULT}) - elseif (CMAKE_BUILD_TYPE STREQUAL "Release") - set(${BUILD_TYPE_TARGET} "Release") - elseif (CMAKE_BUILD_TYPE STREQUAL "Debug") - set(${BUILD_TYPE_TARGET} "Debug") - else () - set(${BUILD_TYPE_TARGET} ${BUILD_TYPE_DEFAULT}) - endif () -ENDMACRO(get_build_type) - -# get git branch name -MACRO(get_git_branch_name GIT_BRANCH_NAME) - set(GIT_BRANCH_NAME_REGEX "[0-9]+\\.[0-9]+\\.[0-9]") - - execute_process(COMMAND sh "-c" "git log --decorate | head -n 1 | sed 's/.*(\\(.*\\))/\\1/' | sed 's/.*, //' | sed 's=[a-zA-Z]*\/==g'" - OUTPUT_VARIABLE ${GIT_BRANCH_NAME}) - - if (NOT GIT_BRANCH_NAME MATCHES "${GIT_BRANCH_NAME_REGEX}") - execute_process(COMMAND "git" rev-parse --abbrev-ref HEAD OUTPUT_VARIABLE ${GIT_BRANCH_NAME}) - endif () - - if (NOT GIT_BRANCH_NAME MATCHES "${GIT_BRANCH_NAME_REGEX}") - execute_process(COMMAND "git" symbolic-ref -q --short HEAD OUTPUT_VARIABLE ${GIT_BRANCH_NAME}) - endif () - - message(DEBUG "GIT_BRANCH_NAME = ${GIT_BRANCH_NAME}") - - # Some unexpected case - if (NOT GIT_BRANCH_NAME STREQUAL "") - string(REGEX REPLACE "\n" "" GIT_BRANCH_NAME ${GIT_BRANCH_NAME}) - else () - set(GIT_BRANCH_NAME "#") - endif () -ENDMACRO(get_git_branch_name) - -# get last commit id -MACRO(get_last_commit_id LAST_COMMIT_ID) - execute_process(COMMAND sh "-c" "git log --decorate | head -n 1 | awk '{print $2}'" - OUTPUT_VARIABLE ${LAST_COMMIT_ID}) - - message(DEBUG "LAST_COMMIT_ID = ${${LAST_COMMIT_ID}}") - - if (NOT LAST_COMMIT_ID STREQUAL "") - string(REGEX REPLACE "\n" "" ${LAST_COMMIT_ID} ${${LAST_COMMIT_ID}}) - else () - set(LAST_COMMIT_ID "Unknown") - endif () -ENDMACRO(get_last_commit_id) - -# get milvus version -MACRO(get_milvus_version) - cmake_parse_arguments(VER "" "TARGET;DEFAULT" "" ${ARGN}) - - # Step 1: get branch name - get_git_branch_name(GIT_BRANCH_NAME) - message(DEBUG ${GIT_BRANCH_NAME}) - - # Step 2: match MAJOR.MINOR.PATCH format or set DEFAULT value - string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" ${VER_TARGET} ${GIT_BRANCH_NAME}) - if (NOT ${VER_TARGET}) - set(${VER_TARGET} ${VER_DEFAULT}) - endif() -ENDMACRO(get_milvus_version) - -# set definition -MACRO(set_milvus_definition DEF_PASS_CMAKE MILVUS_DEF) - if (${${DEF_PASS_CMAKE}}) - add_compile_definitions(${MILVUS_DEF}) - endif() -ENDMACRO(set_milvus_definition) - -MACRO(append_flags target) - cmake_parse_arguments(M "" "" "FLAGS" ${ARGN}) - foreach(FLAG IN ITEMS ${M_FLAGS}) - set(${target} "${${target}} ${FLAG}") - endforeach() -ENDMACRO(append_flags) - -macro(create_executable) - cmake_parse_arguments(E "" "TARGET" "SRCS;LIBS;DEFS" ${ARGN}) - add_executable(${E_TARGET}) - target_sources(${E_TARGET} PRIVATE ${E_SRCS}) - target_link_libraries(${E_TARGET} PRIVATE ${E_LIBS}) - target_compile_definitions(${E_TARGET} PRIVATE ${E_DEFS}) -endmacro() - -macro(create_library) - cmake_parse_arguments(L "" "TARGET" "SRCS;LIBS;DEFS" ${ARGN}) - add_library(${L_TARGET} ${L_SRCS}) - target_link_libraries(${L_TARGET} PRIVATE ${L_LIBS}) - target_compile_definitions(${L_TARGET} PRIVATE ${L_DEFS}) -endmacro() \ No newline at end of file diff --git a/proxy/generate_entity_ids/client/getIds.go b/proxy/generate_entity_ids/client/getIds.go deleted file mode 100644 index 0dc9cefa80..0000000000 --- a/proxy/generate_entity_ids/client/getIds.go +++ /dev/null @@ -1,45 +0,0 @@ -package main - -import ( - "context" - "fmt" - pb "github.com/czs007/suvlim/proxy/generate_entity_ids/proto" - "google.golang.org/grpc" - "log" - "time" -) - -const ( - address = "localhost:10087" -) - - -func getIds(length int64) { - con, err := grpc.Dial(address, grpc.WithInsecure(), grpc.WithBlock()) - if err != nil { - log.Fatalf("did not connect: %v", err) - } - - defer con.Close() - c := pb.NewGreeterClient(con) - - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - r, err := c.GetEntityID(ctx, &pb.Request{Length: length}) - if err != nil { - log.Fatalf("could not greet: %v", err) - } - fmt.Println("+++++++++++++++++++++++++++++++++++++") - fmt.Println(r.GetIds()) - -} - - -func main() { - - go getIds(100) - - go getIds(100) - - time.Sleep(3 * time.Second) -} diff --git a/proxy/generate_entity_ids/collect_result.go b/proxy/generate_entity_ids/collect_result.go deleted file mode 100644 index 7874778066..0000000000 --- a/proxy/generate_entity_ids/collect_result.go +++ /dev/null @@ -1,45 +0,0 @@ -package generate_entity_ids - -import ( - "context" - "fmt" - "github.com/apache/pulsar/pulsar-client-go/pulsar" - "log" - "time" -) - -func CollectResult(clientNum int, topicName string) [][]byte { - client, err := pulsar.NewClient(pulsar.ClientOptions{ - URL: "pulsar://localhost:6650", - }) - if err != nil { - log.Fatal(err) - } - defer client.Close() - - consumer, err := client.Subscribe(pulsar.ConsumerOptions{ - Topic: topicName + "-partition-" + string(clientNum), - SubscriptionName: "subName", - }) - if err != nil { - log.Fatal(err) - } - defer consumer.Close() - - var result [][]byte - ctx, canc := context.WithTimeout(context.Background(), 5*time.Second) - msg, err := consumer.Receive(ctx) - if err != nil { - log.Fatal(err) - } - - err = consumer.Ack(msg) - if err != nil{ - log.Fatal(err) - } - result = append(result, msg.Payload()) - fmt.Println("consumer receive the message successful!") - canc() - - return result -} \ No newline at end of file diff --git a/proxy/generate_entity_ids/proto/generate_id.pb.go b/proxy/generate_entity_ids/proto/generate_id.pb.go deleted file mode 100644 index 20cda69727..0000000000 --- a/proxy/generate_entity_ids/proto/generate_id.pb.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: generate_id.proto - -package generate_entity_ids - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// The request message containing the user's name. -type Request struct { - Length int64 `protobuf:"varint,1,opt,name=length,proto3" json:"length,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { - return fileDescriptor_72f50f761a21563e, []int{0} -} - -func (m *Request) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Request.Unmarshal(m, b) -} -func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Request.Marshal(b, m, deterministic) -} -func (m *Request) XXX_Merge(src proto.Message) { - xxx_messageInfo_Request.Merge(m, src) -} -func (m *Request) XXX_Size() int { - return xxx_messageInfo_Request.Size(m) -} -func (m *Request) XXX_DiscardUnknown() { - xxx_messageInfo_Request.DiscardUnknown(m) -} - -var xxx_messageInfo_Request proto.InternalMessageInfo - -func (m *Request) GetLength() int64 { - if m != nil { - return m.Length - } - return 0 -} - -// The response message containing the greetings -type Reply struct { - Ids []int64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Reply) Reset() { *m = Reply{} } -func (m *Reply) String() string { return proto.CompactTextString(m) } -func (*Reply) ProtoMessage() {} -func (*Reply) Descriptor() ([]byte, []int) { - return fileDescriptor_72f50f761a21563e, []int{1} -} - -func (m *Reply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Reply.Unmarshal(m, b) -} -func (m *Reply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Reply.Marshal(b, m, deterministic) -} -func (m *Reply) XXX_Merge(src proto.Message) { - xxx_messageInfo_Reply.Merge(m, src) -} -func (m *Reply) XXX_Size() int { - return xxx_messageInfo_Reply.Size(m) -} -func (m *Reply) XXX_DiscardUnknown() { - xxx_messageInfo_Reply.DiscardUnknown(m) -} - -var xxx_messageInfo_Reply proto.InternalMessageInfo - -func (m *Reply) GetIds() []int64 { - if m != nil { - return m.Ids - } - return nil -} - -func init() { - proto.RegisterType((*Request)(nil), "generate_entity_ids.Request") - proto.RegisterType((*Reply)(nil), "generate_entity_ids.Reply") -} - -func init() { proto.RegisterFile("generate_id.proto", fileDescriptor_72f50f761a21563e) } - -var fileDescriptor_72f50f761a21563e = []byte{ - // 183 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4c, 0x4f, 0xcd, 0x4b, - 0x2d, 0x4a, 0x2c, 0x49, 0x8d, 0xcf, 0x4c, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, - 0x0b, 0xa5, 0xe6, 0x95, 0x64, 0x96, 0x54, 0xc6, 0x67, 0xa6, 0x14, 0x2b, 0x29, 0x72, 0xb1, 0x07, - 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x08, 0x89, 0x71, 0xb1, 0xe5, 0xa4, 0xe6, 0xa5, 0x97, 0x64, - 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x30, 0x07, 0x41, 0x79, 0x4a, 0x92, 0x5c, 0xac, 0x41, 0xa9, 0x05, - 0x39, 0x95, 0x42, 0x02, 0x5c, 0xcc, 0x99, 0x29, 0xc5, 0x12, 0x8c, 0x0a, 0xcc, 0x1a, 0xcc, 0x41, - 0x20, 0xa6, 0x51, 0x08, 0x17, 0xbb, 0x7b, 0x51, 0x6a, 0x6a, 0x49, 0x6a, 0x91, 0x90, 0x27, 0x17, - 0xb7, 0x7b, 0x6a, 0x89, 0x2b, 0xd8, 0x64, 0x4f, 0x17, 0x21, 0x19, 0x3d, 0x2c, 0xb6, 0xe9, 0x41, - 0xad, 0x92, 0x92, 0xc2, 0x21, 0x5b, 0x90, 0x53, 0xa9, 0xc4, 0xe0, 0x64, 0xce, 0x25, 0x94, 0x99, - 0xaf, 0x97, 0x5e, 0x54, 0x90, 0x0c, 0x57, 0xe6, 0xe9, 0xe2, 0xc4, 0xe5, 0x0e, 0x67, 0x07, 0x30, - 0x46, 0x61, 0xf3, 0x4c, 0x12, 0x1b, 0xd8, 0xa3, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xeb, - 0x7c, 0x51, 0xda, 0xfd, 0x00, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// GreeterClient is the client API for Greeter service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type GreeterClient interface { - // Sends a greeting - GetEntityID(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error) -} - -type greeterClient struct { - cc *grpc.ClientConn -} - -func NewGreeterClient(cc *grpc.ClientConn) GreeterClient { - return &greeterClient{cc} -} - -func (c *greeterClient) GetEntityID(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error) { - out := new(Reply) - err := c.cc.Invoke(ctx, "/generate_entity_ids.Greeter/GetEntityID", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// GreeterServer is the server API for Greeter service. -type GreeterServer interface { - // Sends a greeting - GetEntityID(context.Context, *Request) (*Reply, error) -} - -// UnimplementedGreeterServer can be embedded to have forward compatible implementations. -type UnimplementedGreeterServer struct { -} - -func (*UnimplementedGreeterServer) GetEntityID(ctx context.Context, req *Request) (*Reply, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetEntityID not implemented") -} - -func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) { - s.RegisterService(&_Greeter_serviceDesc, srv) -} - -func _Greeter_GetEntityID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Request) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GreeterServer).GetEntityID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/generate_entity_ids.Greeter/GetEntityID", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GreeterServer).GetEntityID(ctx, req.(*Request)) - } - return interceptor(ctx, in, info, handler) -} - -var _Greeter_serviceDesc = grpc.ServiceDesc{ - ServiceName: "generate_entity_ids.Greeter", - HandlerType: (*GreeterServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetEntityID", - Handler: _Greeter_GetEntityID_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "generate_id.proto", -} diff --git a/proxy/generate_entity_ids/proto/generate_id.proto b/proxy/generate_entity_ids/proto/generate_id.proto deleted file mode 100644 index 6a43af4894..0000000000 --- a/proxy/generate_entity_ids/proto/generate_id.proto +++ /dev/null @@ -1,24 +0,0 @@ -syntax = "proto3"; - -option go_package = "generate_entity_ids"; -option java_multiple_files = true; -option java_package = "io.grpc.generateID"; -option java_outer_classname = "GenerateID"; - -package generate_entity_ids; - -// The greeting service definition. -service Greeter { - // Sends a greeting - rpc GetEntityID (Request) returns (Reply) {} -} - -// The request message containing the user's name. -message Request { - int64 length = 1; -} - -// The response message containing the greetings -message Reply { - repeated int64 ids = 1; -} diff --git a/proxy/generate_entity_ids/server/generate_entity_ids.go b/proxy/generate_entity_ids/server/generate_entity_ids.go deleted file mode 100644 index 21c7fc9831..0000000000 --- a/proxy/generate_entity_ids/server/generate_entity_ids.go +++ /dev/null @@ -1,63 +0,0 @@ -package main - -import ( - "context" - pb "github.com/czs007/suvlim/proxy/generate_entity_ids/proto" - "google.golang.org/grpc" - "log" - "net" - "sync" - "time" -) - -var ( - currentID int64 = 0 -) - - -const ( - port = ":10087" -) - -type server struct { - pb.UnimplementedGreeterServer -} - - -func (s *server) GetEntityID(ctx context.Context, in *pb.Request) (*pb.Reply, error) { - var mutex sync.Mutex - var ids []int64 - - length := in.Length - for i := int64(0); i < length; i++ { - go func() { - mutex.Lock() - ids = append(ids, currentID) - currentID++ - mutex.Unlock() - }() - - } - - for{ - if int64(len(ids)) < length { - time.Sleep(time.Second) - } else { - break - } - } - - return &pb.Reply{Ids: ids}, nil -} - -func main() { - listen, err := net.Listen("tcp", port) - if err != nil{ - log.Fatalf("failed to listen: %v", err) - } - s := grpc.NewServer() - pb.RegisterGreeterServer(s, &server{}) - if err := s.Serve(listen); err != nil{ - log.Fatalf("failed to serve: %v", err) - } -} \ No newline at end of file diff --git a/proxy/src/CMakeLists.txt b/proxy/src/CMakeLists.txt deleted file mode 100644 index f17aa341da..0000000000 --- a/proxy/src/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. -#------------------------------------------------------------------------------- - -include_directories(${MILVUS_SOURCE_DIR}) -include_directories(${MILVUS_ENGINE_SRC}) -include_directories(${MILVUS_THIRDPARTY_SRC}) - -include_directories(${MILVUS_ENGINE_SRC}/grpc) - -add_subdirectory( tracing ) -add_subdirectory( utils ) -add_subdirectory( config ) -add_subdirectory( query ) -add_subdirectory( db ) # target milvus_engine -add_subdirectory( log ) -add_subdirectory( server ) -add_subdirectory( message_client ) -add_subdirectory( meta ) - -set(link_lib - milvus_engine - config - query - utils - log - meta - ) - - -set(link_lib - ${link_lib} - curl - ) - - -set( GRPC_LIB libprotobuf - grpc++_reflection - grpc++ - ) - -set( BOOST_LIB libboost_system.a - libboost_filesystem.a - libboost_serialization.a - ) - -set( THIRD_PARTY_LIBS - yaml-cpp - ${GRPC_LIB} - ) - - -target_link_libraries( server - PUBLIC ${link_lib} - tracing - pulsarStatic - message_client_cpp - ${THIRD_PARTY_LIBS} - ${BOOST_LIB} - ) - -# **************************** Get&Print Include Directories **************************** -get_property( dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES ) - -foreach ( dir ${dirs} ) - message( STATUS "Current Include DIRS: " ${dir} ) -endforeach () - -set( SERVER_LIBS server ) - - -add_executable( milvus_server ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp - ) -target_include_directories(server PRIVATE ${PROJECT_BINARY_DIR}/thirdparty) - - -target_link_libraries( milvus_server PRIVATE ${SERVER_LIBS} ) -install( TARGETS milvus_server DESTINATION bin ) diff --git a/proxy/src/config/CMakeLists.txt b/proxy/src/config/CMakeLists.txt deleted file mode 100644 index 49c03988c9..0000000000 --- a/proxy/src/config/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. -#------------------------------------------------------------------------------- - -# library -set( CONFIG_SRCS ConfigMgr.h - ConfigMgr.cpp - ConfigType.h - ConfigType.cpp - ServerConfig.h - ServerConfig.cpp - ) - -set( CONFIG_LIBS yaml-cpp - ) - -create_library( - TARGET config - SRCS ${CONFIG_SRCS} - LIBS ${CONFIG_LIBS} -) - diff --git a/proxy/src/config/ConfigMgr.cpp b/proxy/src/config/ConfigMgr.cpp deleted file mode 100644 index 7c86a80ae0..0000000000 --- a/proxy/src/config/ConfigMgr.cpp +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include -#include -#include -#include -#include -#include "config/ConfigMgr.h" -#include "config/ServerConfig.h" - -namespace { -const int64_t MB = (1024ll * 1024); -const int64_t GB = (1024ll * 1024 * 1024); - -void -Flatten(const YAML::Node& node, std::unordered_map& target, const std::string& prefix) { - for (auto& it : node) { - auto key = prefix.empty() ? it.first.as() : prefix + "." + it.first.as(); - switch (it.second.Type()) { - case YAML::NodeType::Null: { - target[key] = ""; - break; - } - case YAML::NodeType::Scalar: { - target[key] = it.second.as(); - break; - } - case YAML::NodeType::Sequence: { - std::string value; - for (auto& sub : it.second) value += sub.as() + ","; - target[key] = value; - break; - } - case YAML::NodeType::Map: { - Flatten(it.second, target, key); - break; - } - case YAML::NodeType::Undefined: { - throw "Unexpected"; - } - default: - break; - } - } -} - -void -ThrowIfNotSuccess(const milvus::ConfigStatus& cs) { - if (cs.set_return != milvus::SetReturn::SUCCESS) { - throw cs; - } -} - -}; // namespace - -namespace milvus { - -ConfigMgr ConfigMgr::instance; - -ConfigMgr::ConfigMgr() { - config_list_ = { - - /* general */ - {"timezone", CreateStringConfig("timezone", false, &config.timezone.value, "UTC+8", nullptr, nullptr)}, - {"proxy_id", CreateIntegerConfig("proxy_id", false, 0, 1024, &config.proxy_id.value, 0, nullptr, nullptr)}, - - /* network */ - {"network.address", CreateStringConfig("network.address", false, &config.network.address.value, - "0.0.0.0", nullptr, nullptr)}, - {"network.port", CreateIntegerConfig("network.port", false, 0, 65535, &config.network.port.value, - 19530, nullptr, nullptr)}, - - - /* pulsar */ - {"pulsar.address", CreateStringConfig("pulsar.address", false, &config.pulsar.address.value, - "localhost", nullptr, nullptr)}, - {"pulsar.port", CreateIntegerConfig("pulsar.port", false, 0, 65535, &config.pulsar.port.value, - 6650, nullptr, nullptr)}, - {"pulsar.topicnum", CreateIntegerConfig("pulsar.topicnum", false, 0, 1024, &config.pulsar.topicnum.value, - 1024, nullptr, nullptr)}, - /* master */ - {"master.address", CreateStringConfig("master.address", false, &config.master.address.value, - "localhost", nullptr, nullptr)}, - {"master.port", CreateIntegerConfig("master.port", false, 0, 65535, &config.master.port.value, - 53100, nullptr, nullptr)}, - {"master.querynodenum", CreateIntegerConfig("master.querynodenum", false, 0, 1023, &config.master.query_node_num.value, - 2, nullptr, nullptr)}, - - /* etcd */ - {"etcd.address", CreateStringConfig("etcd.address", false, &config.etcd.address.value, "localhost", nullptr, - nullptr)}, - {"etcd.port", CreateIntegerConfig("etcd.port", false, 0, 65535, &config.etcd.port.value, - 6000,nullptr, nullptr)}, - {"etcd.rootpath", CreateStringConfig("etcd.rootpath", false, &config.etcd.rootpath.value, "by-dev", nullptr, - nullptr)}, - - /* time sync */ - {"timesync.interval", CreateIntegerConfig("timesync.interval", false, 0, std::numeric_limits::max(), &config.timesync.interval.value, 10, - nullptr, nullptr)}, - - /* log */ - {"logs.level", CreateStringConfig("logs.level", false, &config.logs.level.value, "debug", nullptr, nullptr)}, - {"logs.trace.enable", - CreateBoolConfig("logs.trace.enable", false, &config.logs.trace.enable.value, true, nullptr, nullptr)}, - {"logs.path", - CreateStringConfig("logs.path", false, &config.logs.path.value, "/var/lib/milvus/logs", nullptr, nullptr)}, - {"logs.max_log_file_size", CreateSizeConfig("logs.max_log_file_size", false, 512 * MB, 4096 * MB, - &config.logs.max_log_file_size.value, 1024 * MB, nullptr, nullptr)}, - {"logs.log_rotate_num", CreateIntegerConfig("logs.log_rotate_num", false, 0, 1024, - &config.logs.log_rotate_num.value, 0, nullptr, nullptr)}, - - /* tracing */ - {"tracing.json_config_path", CreateStringConfig("tracing.json_config_path", false, - &config.tracing.json_config_path.value, "", nullptr, nullptr)}, - - /* invisible */ - /* engine */ - {"engine.build_index_threshold", - CreateIntegerConfig("engine.build_index_threshold", false, 0, std::numeric_limits::max(), - &config.engine.build_index_threshold.value, 4096, nullptr, nullptr)}, - {"engine.search_combine_nq", - CreateIntegerConfig("engine.search_combine_nq", true, 0, std::numeric_limits::max(), - &config.engine.search_combine_nq.value, 64, nullptr, nullptr)}, - {"engine.use_blas_threshold", - CreateIntegerConfig("engine.use_blas_threshold", true, 0, std::numeric_limits::max(), - &config.engine.use_blas_threshold.value, 1100, nullptr, nullptr)}, - {"engine.omp_thread_num", - CreateIntegerConfig("engine.omp_thread_num", true, 0, std::numeric_limits::max(), - &config.engine.omp_thread_num.value, 0, nullptr, nullptr)}, - {"engine.simd_type", CreateEnumConfig("engine.simd_type", false, &SimdMap, &config.engine.simd_type.value, - SimdType::AUTO, nullptr, nullptr)}, - }; -} - -void -ConfigMgr::Init() { - std::lock_guard lock(GetConfigMutex()); - for (auto& kv : config_list_) { - kv.second->Init(); - } -} - -void -ConfigMgr::Load(const std::string& path) { - /* load from milvus.yaml */ - auto yaml = YAML::LoadFile(path); - /* make it flattened */ - std::unordered_map flattened; - // auto proxy_yaml = yaml["porxy"]; - auto other_yaml = YAML::Node{}; - other_yaml["pulsar"] = yaml["pulsar"]; - other_yaml["master"] = yaml["master"]; - other_yaml["etcd"] = yaml["etcd"]; - other_yaml["timesync"] = yaml["timesync"]; - Flatten(yaml["proxy"], flattened, ""); - Flatten(other_yaml, flattened, ""); - // Flatten(yaml["proxy"], flattened, ""); - /* update config */ - for (auto& it : flattened) Set(it.first, it.second, false); -} - -void -ConfigMgr::Set(const std::string& name, const std::string& value, bool update) { - std::cout<<"InSet Config "<< name < lock(GetConfigMutex()); - /* update=false when loading from config file */ - if (not update) { - ThrowIfNotSuccess(config->Set(value, update)); - } else if (config->modifiable_) { - /* set manually */ - ThrowIfNotSuccess(config->Set(value, update)); - lock.unlock(); - Notify(name); - } else { - throw ConfigStatus(SetReturn::IMMUTABLE, "Config " + name + " is not modifiable"); - } - } catch (ConfigStatus& cs) { - throw cs; - } catch (...) { - throw "Config " + name + " not found."; - } -} - -std::string -ConfigMgr::Get(const std::string& name) const { - try { - auto& config = config_list_.at(name); - std::lock_guard lock(GetConfigMutex()); - return config->Get(); - } catch (...) { - throw "Config " + name + " not found."; - } -} - -std::string -ConfigMgr::Dump() const { - std::stringstream ss; - for (auto& kv : config_list_) { - auto& config = kv.second; - ss << config->name_ << ": " << config->Get() << std::endl; - } - return ss.str(); -} - -void -ConfigMgr::Attach(const std::string& name, ConfigObserver* observer) { - std::lock_guard lock(observer_mutex_); - observers_[name].push_back(observer); -} - -void -ConfigMgr::Detach(const std::string& name, ConfigObserver* observer) { - std::lock_guard lock(observer_mutex_); - if (observers_.find(name) == observers_.end()) - return; - auto& ob_list = observers_[name]; - ob_list.remove(observer); -} - -void -ConfigMgr::Notify(const std::string& name) { - std::lock_guard lock(observer_mutex_); - if (observers_.find(name) == observers_.end()) - return; - auto& ob_list = observers_[name]; - for (auto& ob : ob_list) { - ob->ConfigUpdate(name); - } -} - -} // namespace milvus diff --git a/proxy/src/config/ConfigMgr.h b/proxy/src/config/ConfigMgr.h deleted file mode 100644 index 802ae25064..0000000000 --- a/proxy/src/config/ConfigMgr.h +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include -#include - -#include "config/ServerConfig.h" - -namespace milvus { - -class ConfigObserver { - public: - virtual ~ConfigObserver() { - } - - virtual void - ConfigUpdate(const std::string& name) = 0; -}; -using ConfigObserverPtr = std::shared_ptr; - -class ConfigMgr { - public: - static ConfigMgr& - GetInstance() { - return instance; - } - - private: - static ConfigMgr instance; - - public: - ConfigMgr(); - - ConfigMgr(const ConfigMgr&) = delete; - ConfigMgr& - operator=(const ConfigMgr&) = delete; - - ConfigMgr(ConfigMgr&&) = delete; - ConfigMgr& - operator=(ConfigMgr&&) = delete; - - public: - void - Init(); - - void - Load(const std::string& path); - - void - Set(const std::string& name, const std::string& value, bool update = true); - - std::string - Get(const std::string& name) const; - - std::string - Dump() const; - - public: - // Shared pointer should not be used here - void - Attach(const std::string& name, ConfigObserver* observer); - - void - Detach(const std::string& name, ConfigObserver* observer); - - private: - void - Notify(const std::string& name); - - private: - std::unordered_map config_list_; - std::mutex mutex_; - - std::unordered_map> observers_; - std::mutex observer_mutex_; -}; - -} // namespace milvus diff --git a/proxy/src/config/ConfigType.cpp b/proxy/src/config/ConfigType.cpp deleted file mode 100644 index 2db20175ba..0000000000 --- a/proxy/src/config/ConfigType.cpp +++ /dev/null @@ -1,528 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "config/ConfigType.h" -#include "config/ServerConfig.h" - -#include -#include -#include -#include -#include -#include - -namespace { -std::unordered_map BYTE_UNITS = { - {"b", 1}, - {"k", 1024}, - {"m", 1024 * 1024}, - {"g", 1024 * 1024 * 1024}, -}; - -bool -is_integer(const std::string& s) { - if (not s.empty() && (std::isdigit(s[0]) || s[0] == '-')) { - auto ss = s.substr(1); - return std::find_if(ss.begin(), ss.end(), [](unsigned char c) { return !std::isdigit(c); }) == ss.end(); - } - return false; -} - -bool -is_number(const std::string& s) { - return !s.empty() && std::find_if(s.begin(), s.end(), [](unsigned char c) { return !std::isdigit(c); }) == s.end(); -} - -bool -is_alpha(const std::string& s) { - return !s.empty() && std::find_if(s.begin(), s.end(), [](unsigned char c) { return !std::isalpha(c); }) == s.end(); -} - -template -bool -boundary_check(T val, T lower_bound, T upper_bound) { - return lower_bound <= val && val <= upper_bound; -} - -bool -parse_bool(const std::string& str, std::string& err) { - if (!strcasecmp(str.c_str(), "true")) - return true; - else if (!strcasecmp(str.c_str(), "false")) - return false; - else - err = "The specified value must be true or false"; - return false; -} - -std::string -str_tolower(std::string s) { - std::transform(s.begin(), s.end(), s.begin(), [](unsigned char c) { return std::tolower(c); }); - return s; -} - -int64_t -parse_bytes(const std::string& str, std::string& err) { - try { - if (str.find_first_of('-') != std::string::npos) { - std::stringstream ss; - ss << "The specified value for memory (" << str << ") should be a positive integer."; - err = ss.str(); - return 0; - } - - std::string s = str; - if (is_number(s)) - return std::stoll(s); - if (s.length() == 0) - return 0; - - auto last_two = s.substr(s.length() - 2, 2); - auto last_one = s.substr(s.length() - 1); - if (is_alpha(last_two) && is_alpha(last_one)) - if (last_one == "b" or last_one == "B") - s = s.substr(0, s.length() - 1); - auto& units = BYTE_UNITS; - auto suffix = str_tolower(s.substr(s.length() - 1)); - - std::string digits_part; - if (is_number(suffix)) { - digits_part = s; - suffix = 'b'; - } else { - digits_part = s.substr(0, s.length() - 1); - } - - if (is_number(digits_part) && (units.find(suffix) != units.end() || is_number(suffix))) { - auto digits = std::stoll(digits_part); - return digits * units[suffix]; - } else { - std::stringstream ss; - ss << "The specified value for memory (" << str << ") should specify the units." - << "The postfix should be one of the `b` `k` `m` `g` characters"; - err = ss.str(); - } - } catch (...) { - err = "Unknown error happened on parse bytes."; - } - return 0; -} - -} // namespace - -// Use (void) to silent unused warnings. -#define assertm(exp, msg) assert(((void)msg, exp)) - -namespace milvus { - -std::vector -OptionValue(const configEnum& ce) { - std::vector ret; - for (auto& e : ce) { - ret.emplace_back(e.first); - } - return ret; -} - -BaseConfig::BaseConfig(const char* name, const char* alias, bool modifiable) - : name_(name), alias_(alias), modifiable_(modifiable) { -} - -void -BaseConfig::Init() { - assertm(not inited_, "already initialized"); - inited_ = true; -} - -BoolConfig::BoolConfig(const char* name, const char* alias, bool modifiable, bool* config, bool default_value, - std::function is_valid_fn, - std::function update_fn) - : BaseConfig(name, alias, modifiable), - config_(config), - default_value_(default_value), - is_valid_fn_(std::move(is_valid_fn)), - update_fn_(std::move(update_fn)) { -} - -void -BoolConfig::Init() { - BaseConfig::Init(); - assert(config_ != nullptr); - *config_ = default_value_; -} - -ConfigStatus -BoolConfig::Set(const std::string& val, bool update) { - assertm(inited_, "uninitialized"); - try { - if (update and not modifiable_) { - std::stringstream ss; - ss << "Config " << name_ << " is immutable."; - return ConfigStatus(SetReturn::IMMUTABLE, ss.str()); - } - - std::string err; - bool value = parse_bool(val, err); - if (not err.empty()) - return ConfigStatus(SetReturn::INVALID, err); - - if (is_valid_fn_ && not is_valid_fn_(value, err)) - return ConfigStatus(SetReturn::INVALID, err); - - bool prev = *config_; - *config_ = value; - if (update && update_fn_ && not update_fn_(value, prev, err)) { - *config_ = prev; - return ConfigStatus(SetReturn::UPDATE_FAILURE, err); - } - - return ConfigStatus(SetReturn::SUCCESS, ""); - } catch (std::exception& e) { - return ConfigStatus(SetReturn::EXCEPTION, e.what()); - } catch (...) { - return ConfigStatus(SetReturn::UNEXPECTED, "unexpected"); - } -} - -std::string -BoolConfig::Get() { - assertm(inited_, "uninitialized"); - return *config_ ? "true" : "false"; -} - -StringConfig::StringConfig( - const char* name, const char* alias, bool modifiable, std::string* config, const char* default_value, - std::function is_valid_fn, - std::function update_fn) - : BaseConfig(name, alias, modifiable), - config_(config), - default_value_(default_value), - is_valid_fn_(std::move(is_valid_fn)), - update_fn_(std::move(update_fn)) { -} - -void -StringConfig::Init() { - BaseConfig::Init(); - assert(config_ != nullptr); - *config_ = default_value_; -} - -ConfigStatus -StringConfig::Set(const std::string& val, bool update) { - assertm(inited_, "uninitialized"); - try { - if (update and not modifiable_) { - std::stringstream ss; - ss << "Config " << name_ << " is immutable."; - return ConfigStatus(SetReturn::IMMUTABLE, ss.str()); - } - - std::string err; - if (is_valid_fn_ && not is_valid_fn_(val, err)) - return ConfigStatus(SetReturn::INVALID, err); - - std::string prev = *config_; - *config_ = val; - if (update && update_fn_ && not update_fn_(val, prev, err)) { - *config_ = prev; - return ConfigStatus(SetReturn::UPDATE_FAILURE, err); - } - - return ConfigStatus(SetReturn::SUCCESS, ""); - } catch (std::exception& e) { - return ConfigStatus(SetReturn::EXCEPTION, e.what()); - } catch (...) { - return ConfigStatus(SetReturn::UNEXPECTED, "unexpected"); - } -} - -std::string -StringConfig::Get() { - assertm(inited_, "uninitialized"); - return *config_; -} - -EnumConfig::EnumConfig(const char* name, const char* alias, bool modifiable, configEnum* enumd, int64_t* config, - int64_t default_value, std::function is_valid_fn, - std::function update_fn) - : BaseConfig(name, alias, modifiable), - config_(config), - enum_value_(enumd), - default_value_(default_value), - is_valid_fn_(std::move(is_valid_fn)), - update_fn_(std::move(update_fn)) { -} - -void -EnumConfig::Init() { - BaseConfig::Init(); - assert(enum_value_ != nullptr); - assertm(not enum_value_->empty(), "enum value empty"); - assert(config_ != nullptr); - *config_ = default_value_; -} - -ConfigStatus -EnumConfig::Set(const std::string& val, bool update) { - assertm(inited_, "uninitialized"); - try { - if (update and not modifiable_) { - std::stringstream ss; - ss << "Config " << name_ << " is immutable."; - return ConfigStatus(SetReturn::IMMUTABLE, ss.str()); - } - - if (enum_value_->find(val) == enum_value_->end()) { - auto option_values = OptionValue(*enum_value_); - std::stringstream ss; - ss << "Config " << name_ << "(" << val << ") must be one of following: "; - for (size_t i = 0; i < option_values.size() - 1; ++i) { - ss << option_values[i] << ", "; - } - ss << option_values.back() << "."; - return ConfigStatus(SetReturn::ENUM_VALUE_NOTFOUND, ss.str()); - } - - int64_t value = enum_value_->at(val); - std::string err; - if (is_valid_fn_ && not is_valid_fn_(value, err)) { - return ConfigStatus(SetReturn::INVALID, err); - } - - int64_t prev = *config_; - *config_ = value; - if (update && update_fn_ && not update_fn_(value, prev, err)) { - *config_ = prev; - return ConfigStatus(SetReturn::UPDATE_FAILURE, err); - } - - return ConfigStatus(SetReturn::SUCCESS, ""); - } catch (std::exception& e) { - return ConfigStatus(SetReturn::EXCEPTION, e.what()); - } catch (...) { - return ConfigStatus(SetReturn::UNEXPECTED, "unexpected"); - } -} - -std::string -EnumConfig::Get() { - assertm(inited_, "uninitialized"); - for (auto& it : *enum_value_) { - if (*config_ == it.second) { - return it.first; - } - } - return "unknown"; -} - -IntegerConfig::IntegerConfig(const char* name, const char* alias, bool modifiable, int64_t lower_bound, - int64_t upper_bound, int64_t* config, int64_t default_value, - std::function is_valid_fn, - std::function update_fn) - : BaseConfig(name, alias, modifiable), - config_(config), - lower_bound_(lower_bound), - upper_bound_(upper_bound), - default_value_(default_value), - is_valid_fn_(std::move(is_valid_fn)), - update_fn_(std::move(update_fn)) { -} - -void -IntegerConfig::Init() { - BaseConfig::Init(); - assert(config_ != nullptr); - *config_ = default_value_; -} - -ConfigStatus -IntegerConfig::Set(const std::string& val, bool update) { - assertm(inited_, "uninitialized"); - try { - if (update and not modifiable_) { - std::stringstream ss; - ss << "Config " << name_ << " is immutable."; - return ConfigStatus(SetReturn::IMMUTABLE, ss.str()); - } - - if (not is_integer(val)) { - std::stringstream ss; - ss << "Config " << name_ << "(" << val << ") must be a integer."; - return ConfigStatus(SetReturn::INVALID, ss.str()); - } - - int64_t value = std::stoll(val); - if (not boundary_check(value, lower_bound_, upper_bound_)) { - std::stringstream ss; - ss << "Config " << name_ << "(" << val << ") must in range [" << lower_bound_ << ", " << upper_bound_ - << "]."; - return ConfigStatus(SetReturn::OUT_OF_RANGE, ss.str()); - } - - std::string err; - if (is_valid_fn_ && not is_valid_fn_(value, err)) - return ConfigStatus(SetReturn::INVALID, err); - - int64_t prev = *config_; - *config_ = value; - if (update && update_fn_ && not update_fn_(value, prev, err)) { - *config_ = prev; - return ConfigStatus(SetReturn::UPDATE_FAILURE, err); - } - - return ConfigStatus(SetReturn::SUCCESS, ""); - } catch (std::exception& e) { - return ConfigStatus(SetReturn::EXCEPTION, e.what()); - } catch (...) { - return ConfigStatus(SetReturn::UNEXPECTED, "unexpected"); - } -} - -std::string -IntegerConfig::Get() { - assertm(inited_, "uninitialized"); - return std::to_string(*config_); -} - -FloatingConfig::FloatingConfig(const char* name, const char* alias, bool modifiable, double lower_bound, - double upper_bound, double* config, double default_value, - std::function is_valid_fn, - std::function update_fn) - : BaseConfig(name, alias, modifiable), - config_(config), - lower_bound_(lower_bound), - upper_bound_(upper_bound), - default_value_(default_value), - is_valid_fn_(std::move(is_valid_fn)), - update_fn_(std::move(update_fn)) { -} - -void -FloatingConfig::Init() { - BaseConfig::Init(); - assert(config_ != nullptr); - *config_ = default_value_; -} - -ConfigStatus -FloatingConfig::Set(const std::string& val, bool update) { - assertm(inited_, "uninitialized"); - try { - if (update and not modifiable_) { - std::stringstream ss; - ss << "Config " << name_ << " is immutable."; - return ConfigStatus(SetReturn::IMMUTABLE, ss.str()); - } - - double value = std::stod(val); - if (not boundary_check(value, lower_bound_, upper_bound_)) { - std::stringstream ss; - ss << "Config " << name_ << "(" << val << ") must in range [" << lower_bound_ << ", " << upper_bound_ - << "]."; - return ConfigStatus(SetReturn::OUT_OF_RANGE, ss.str()); - } - - std::string err; - if (is_valid_fn_ && not is_valid_fn_(value, err)) - return ConfigStatus(SetReturn::INVALID, err); - - double prev = *config_; - *config_ = value; - if (update && update_fn_ && not update_fn_(value, prev, err)) { - *config_ = prev; - - return ConfigStatus(SetReturn::UPDATE_FAILURE, err); - } - - return ConfigStatus(SetReturn::SUCCESS, ""); - } catch (std::exception& e) { - return ConfigStatus(SetReturn::EXCEPTION, e.what()); - } catch (...) { - return ConfigStatus(SetReturn::UNEXPECTED, "unexpected"); - } -} - -std::string -FloatingConfig::Get() { - assertm(inited_, "uninitialized"); - return std::to_string(*config_); -} - -SizeConfig::SizeConfig(const char* name, const char* alias, bool modifiable, int64_t lower_bound, int64_t upper_bound, - int64_t* config, int64_t default_value, - std::function is_valid_fn, - std::function update_fn) - : BaseConfig(name, alias, modifiable), - config_(config), - lower_bound_(lower_bound), - upper_bound_(upper_bound), - default_value_(default_value), - is_valid_fn_(std::move(is_valid_fn)), - update_fn_(std::move(update_fn)) { -} - -void -SizeConfig::Init() { - BaseConfig::Init(); - assert(config_ != nullptr); - *config_ = default_value_; -} - -ConfigStatus -SizeConfig::Set(const std::string& val, bool update) { - assertm(inited_, "uninitialized"); - try { - if (update and not modifiable_) { - std::stringstream ss; - ss << "Config " << name_ << " is immutable."; - return ConfigStatus(SetReturn::IMMUTABLE, ss.str()); - } - - std::string err; - int64_t value = parse_bytes(val, err); - if (not err.empty()) { - return ConfigStatus(SetReturn::INVALID, err); - } - - if (not boundary_check(value, lower_bound_, upper_bound_)) { - std::stringstream ss; - ss << "Config " << name_ << "(" << val << ") must in range [" << lower_bound_ << " Byte, " << upper_bound_ - << " Byte]."; - return ConfigStatus(SetReturn::OUT_OF_RANGE, ss.str()); - } - - if (is_valid_fn_ && not is_valid_fn_(value, err)) { - return ConfigStatus(SetReturn::INVALID, err); - } - - int64_t prev = *config_; - *config_ = value; - if (update && update_fn_ && not update_fn_(value, prev, err)) { - *config_ = prev; - return ConfigStatus(SetReturn::UPDATE_FAILURE, err); - } - - return ConfigStatus(SetReturn::SUCCESS, ""); - } catch (std::exception& e) { - return ConfigStatus(SetReturn::EXCEPTION, e.what()); - } catch (...) { - return ConfigStatus(SetReturn::UNEXPECTED, "unexpected"); - } -} - -std::string -SizeConfig::Get() { - assertm(inited_, "uninitialized"); - return std::to_string(*config_); -} - -} // namespace milvus diff --git a/proxy/src/config/ConfigType.h b/proxy/src/config/ConfigType.h deleted file mode 100644 index 5e1a8e92e8..0000000000 --- a/proxy/src/config/ConfigType.h +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include -#include - -namespace milvus { - -using configEnum = const std::unordered_map; -std::vector -OptionValue(const configEnum& ce); - -enum SetReturn { - SUCCESS = 1, - IMMUTABLE, - ENUM_VALUE_NOTFOUND, - INVALID, - OUT_OF_RANGE, - UPDATE_FAILURE, - EXCEPTION, - UNEXPECTED, -}; - -struct ConfigStatus { - ConfigStatus(SetReturn sr, std::string msg) : set_return(sr), message(std::move(msg)) { - } - SetReturn set_return; - std::string message; -}; - -class BaseConfig { - public: - BaseConfig(const char* name, const char* alias, bool modifiable); - virtual ~BaseConfig() = default; - - public: - bool inited_ = false; - const char* name_; - const char* alias_; - const bool modifiable_; - - public: - virtual void - Init(); - - virtual ConfigStatus - Set(const std::string& value, bool update) = 0; - - virtual std::string - Get() = 0; -}; -using BaseConfigPtr = std::shared_ptr; - -class BoolConfig : public BaseConfig { - public: - BoolConfig(const char* name, const char* alias, bool modifiable, bool* config, bool default_value, - std::function is_valid_fn, - std::function update_fn); - - private: - bool* config_; - const bool default_value_; - std::function is_valid_fn_; - std::function update_fn_; - - public: - void - Init() override; - - ConfigStatus - Set(const std::string& value, bool update) override; - - std::string - Get() override; -}; - -class StringConfig : public BaseConfig { - public: - StringConfig(const char* name, const char* alias, bool modifiable, std::string* config, const char* default_value, - std::function is_valid_fn, - std::function update_fn); - - private: - std::string* config_; - const char* default_value_; - std::function is_valid_fn_; - std::function update_fn_; - - public: - void - Init() override; - - ConfigStatus - Set(const std::string& value, bool update) override; - - std::string - Get() override; -}; - -class EnumConfig : public BaseConfig { - public: - EnumConfig(const char* name, const char* alias, bool modifiable, configEnum* enumd, int64_t* config, - int64_t default_value, std::function is_valid_fn, - std::function update_fn); - - private: - int64_t* config_; - configEnum* enum_value_; - const int64_t default_value_; - std::function is_valid_fn_; - std::function update_fn_; - - public: - void - Init() override; - - ConfigStatus - Set(const std::string& value, bool update) override; - - std::string - Get() override; -}; - -class IntegerConfig : public BaseConfig { - public: - IntegerConfig(const char* name, const char* alias, bool modifiable, int64_t lower_bound, int64_t upper_bound, - int64_t* config, int64_t default_value, - std::function is_valid_fn, - std::function update_fn); - - private: - int64_t* config_; - int64_t lower_bound_; - int64_t upper_bound_; - const int64_t default_value_; - std::function is_valid_fn_; - std::function update_fn_; - - public: - void - Init() override; - - ConfigStatus - Set(const std::string& value, bool update) override; - - std::string - Get() override; -}; - -class FloatingConfig : public BaseConfig { - public: - FloatingConfig(const char* name, const char* alias, bool modifiable, double lower_bound, double upper_bound, - double* config, double default_value, std::function is_valid_fn, - std::function update_fn); - - private: - double* config_; - double lower_bound_; - double upper_bound_; - const double default_value_; - std::function is_valid_fn_; - std::function update_fn_; - - public: - void - Init() override; - - ConfigStatus - Set(const std::string& value, bool update) override; - - std::string - Get() override; -}; - -class SizeConfig : public BaseConfig { - public: - SizeConfig(const char* name, const char* alias, bool modifiable, int64_t lower_bound, int64_t upper_bound, - int64_t* config, int64_t default_value, std::function is_valid_fn, - std::function update_fn); - - private: - int64_t* config_; - int64_t lower_bound_; - int64_t upper_bound_; - const int64_t default_value_; - std::function is_valid_fn_; - std::function update_fn_; - - public: - void - Init() override; - - ConfigStatus - Set(const std::string& value, bool update) override; - - std::string - Get() override; -}; - -#define CreateBoolConfig(name, modifiable, config_addr, default, is_valid, update) \ - std::make_shared(name, nullptr, modifiable, config_addr, (default), is_valid, update) - -#define CreateStringConfig(name, modifiable, config_addr, default, is_valid, update) \ - std::make_shared(name, nullptr, modifiable, config_addr, (default), is_valid, update) - -#define CreateEnumConfig(name, modifiable, enumd, config_addr, default, is_valid, update) \ - std::make_shared(name, nullptr, modifiable, enumd, config_addr, (default), is_valid, update) - -#define CreateIntegerConfig(name, modifiable, lower_bound, upper_bound, config_addr, default, is_valid, update) \ - std::make_shared(name, nullptr, modifiable, lower_bound, upper_bound, config_addr, (default), \ - is_valid, update) - -#define CreateFloatingConfig(name, modifiable, lower_bound, upper_bound, config_addr, default, is_valid, update) \ - std::make_shared(name, nullptr, modifiable, lower_bound, upper_bound, config_addr, (default), \ - is_valid, update) - -#define CreateSizeConfig(name, modifiable, lower_bound, upper_bound, config_addr, default, is_valid, update) \ - std::make_shared(name, nullptr, modifiable, lower_bound, upper_bound, config_addr, (default), \ - is_valid, update) - -} // namespace milvus diff --git a/proxy/src/config/ConfigTypeTest1.cpp b/proxy/src/config/ConfigTypeTest1.cpp deleted file mode 100644 index 72aa5d7227..0000000000 --- a/proxy/src/config/ConfigTypeTest1.cpp +++ /dev/null @@ -1,493 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include -#include - -#include "config/ServerConfig.h" -#include "gtest/gtest.h" - -namespace milvus { - -#define _MODIFIABLE (true) -#define _IMMUTABLE (false) - -template -class Utils { - public: - bool - validate_fn(const T& value, std::string& err) { - validate_value = value; - return true; - } - - bool - update_fn(const T& value, const T& prev, std::string& err) { - new_value = value; - prev_value = prev; - return true; - } - - protected: - T validate_value; - T new_value; - T prev_value; -}; - -/* ValidBoolConfigTest */ -class ValidBoolConfigTest : public testing::Test, public Utils { - protected: -}; - -TEST_F(ValidBoolConfigTest, init_load_update_get_test) { - auto validate = std::bind(&ValidBoolConfigTest::validate_fn, this, std::placeholders::_1, std::placeholders::_2); - auto update = std::bind(&ValidBoolConfigTest::update_fn, this, std::placeholders::_1, std::placeholders::_2, - std::placeholders::_3); - - bool bool_value = true; - auto bool_config = CreateBoolConfig("b", _MODIFIABLE, &bool_value, false, validate, update); - ASSERT_EQ(bool_value, true); - ASSERT_EQ(bool_config->modifiable_, true); - - bool_config->Init(); - ASSERT_EQ(bool_value, false); - ASSERT_EQ(bool_config->Get(), "false"); - - { - // now `bool_value` is `false`, calling Set(update=false) to set it to `true`, but not notify update_fn() - validate_value = false; - new_value = false; - prev_value = true; - - ConfigStatus status(SetReturn::SUCCESS, ""); - status = bool_config->Set("true", false); - - EXPECT_EQ(status.set_return, SetReturn::SUCCESS); - EXPECT_EQ(bool_value, true); - EXPECT_EQ(bool_config->Get(), "true"); - - // expect change - EXPECT_EQ(validate_value, true); - // expect not change - EXPECT_EQ(new_value, false); - EXPECT_EQ(prev_value, true); - } - - { - // now `bool_value` is `true`, calling Set(update=true) to set it to `false`, will notify update_fn() - validate_value = true; - new_value = true; - prev_value = false; - - ConfigStatus status(SetReturn::SUCCESS, ""); - status = bool_config->Set("false", true); - - EXPECT_EQ(status.set_return, SetReturn::SUCCESS); - EXPECT_EQ(bool_value, false); - EXPECT_EQ(bool_config->Get(), "false"); - - // expect change - EXPECT_EQ(validate_value, false); - EXPECT_EQ(new_value, false); - EXPECT_EQ(prev_value, true); - } -} - -/* ValidStringConfigTest */ -class ValidStringConfigTest : public testing::Test, public Utils { - protected: -}; - -TEST_F(ValidStringConfigTest, init_load_update_get_test) { - auto validate = std::bind(&ValidStringConfigTest::validate_fn, this, std::placeholders::_1, std::placeholders::_2); - auto update = std::bind(&ValidStringConfigTest::update_fn, this, std::placeholders::_1, std::placeholders::_2, - std::placeholders::_3); - - std::string string_value; - auto string_config = CreateStringConfig("s", _MODIFIABLE, &string_value, "Magic", validate, update); - ASSERT_EQ(string_value, ""); - ASSERT_EQ(string_config->modifiable_, true); - - string_config->Init(); - ASSERT_EQ(string_value, "Magic"); - ASSERT_EQ(string_config->Get(), "Magic"); - - { - // now `string_value` is `Magic`, calling Set(update=false) to set it to `cigaM`, but not notify update_fn() - validate_value = ""; - new_value = ""; - prev_value = ""; - - ConfigStatus status(SetReturn::SUCCESS, ""); - status = string_config->Set("cigaM", false); - - EXPECT_EQ(status.set_return, SetReturn::SUCCESS); - EXPECT_EQ(string_value, "cigaM"); - EXPECT_EQ(string_config->Get(), "cigaM"); - - // expect change - EXPECT_EQ(validate_value, "cigaM"); - // expect not change - EXPECT_EQ(new_value, ""); - EXPECT_EQ(prev_value, ""); - } - - { - // now `string_value` is `cigaM`, calling Set(update=true) to set it to `Check`, will notify update_fn() - validate_value = ""; - new_value = ""; - prev_value = ""; - - ConfigStatus status(SetReturn::SUCCESS, ""); - status = string_config->Set("Check", true); - - EXPECT_EQ(status.set_return, SetReturn::SUCCESS); - EXPECT_EQ(string_value, "Check"); - EXPECT_EQ(string_config->Get(), "Check"); - - // expect change - EXPECT_EQ(validate_value, "Check"); - EXPECT_EQ(new_value, "Check"); - EXPECT_EQ(prev_value, "cigaM"); - } -} - -/* ValidIntegerConfigTest */ -class ValidIntegerConfigTest : public testing::Test, public Utils { - protected: -}; - -TEST_F(ValidIntegerConfigTest, init_load_update_get_test) { - auto validate = std::bind(&ValidIntegerConfigTest::validate_fn, this, std::placeholders::_1, std::placeholders::_2); - auto update = std::bind(&ValidIntegerConfigTest::update_fn, this, std::placeholders::_1, std::placeholders::_2, - std::placeholders::_3); - - int64_t integer_value = 0; - auto integer_config = CreateIntegerConfig("i", _MODIFIABLE, -100, 100, &integer_value, 42, validate, update); - ASSERT_EQ(integer_value, 0); - ASSERT_EQ(integer_config->modifiable_, true); - - integer_config->Init(); - ASSERT_EQ(integer_value, 42); - ASSERT_EQ(integer_config->Get(), "42"); - - { - // now `integer_value` is `42`, calling Set(update=false) to set it to `24`, but not notify update_fn() - validate_value = 0; - new_value = 0; - prev_value = 0; - - ConfigStatus status(SetReturn::SUCCESS, ""); - status = integer_config->Set("24", false); - - EXPECT_EQ(status.set_return, SetReturn::SUCCESS); - EXPECT_EQ(integer_value, 24); - EXPECT_EQ(integer_config->Get(), "24"); - - // expect change - EXPECT_EQ(validate_value, 24); - // expect not change - EXPECT_EQ(new_value, 0); - EXPECT_EQ(prev_value, 0); - } - - { - // now `integer_value` is `24`, calling Set(update=true) to set it to `36`, will notify update_fn() - validate_value = 0; - new_value = 0; - prev_value = 0; - - ConfigStatus status(SetReturn::SUCCESS, ""); - status = integer_config->Set("36", true); - - EXPECT_EQ(status.set_return, SetReturn::SUCCESS); - EXPECT_EQ(integer_value, 36); - EXPECT_EQ(integer_config->Get(), "36"); - - // expect change - EXPECT_EQ(validate_value, 36); - EXPECT_EQ(new_value, 36); - EXPECT_EQ(prev_value, 24); - } -} - -/* ValidFloatingConfigTest */ -class ValidFloatingConfigTest : public testing::Test, public Utils { - protected: -}; - -TEST_F(ValidFloatingConfigTest, init_load_update_get_test) { - auto validate = - std::bind(&ValidFloatingConfigTest::validate_fn, this, std::placeholders::_1, std::placeholders::_2); - auto update = std::bind(&ValidFloatingConfigTest::update_fn, this, std::placeholders::_1, std::placeholders::_2, - std::placeholders::_3); - - double floating_value = 0.0; - auto floating_config = CreateFloatingConfig("f", _MODIFIABLE, -10.0, 10.0, &floating_value, 3.14, validate, update); - ASSERT_FLOAT_EQ(floating_value, 0.0); - ASSERT_EQ(floating_config->modifiable_, true); - - floating_config->Init(); - ASSERT_FLOAT_EQ(floating_value, 3.14); - ASSERT_FLOAT_EQ(std::stof(floating_config->Get()), 3.14); - - { - // now `floating_value` is `3.14`, calling Set(update=false) to set it to `6.22`, but not notify update_fn() - validate_value = 0.0; - new_value = 0.0; - prev_value = 0.0; - - ConfigStatus status(SetReturn::SUCCESS, ""); - status = floating_config->Set("6.22", false); - - EXPECT_EQ(status.set_return, SetReturn::SUCCESS); - ASSERT_FLOAT_EQ(floating_value, 6.22); - ASSERT_FLOAT_EQ(std::stof(floating_config->Get()), 6.22); - - // expect change - ASSERT_FLOAT_EQ(validate_value, 6.22); - // expect not change - ASSERT_FLOAT_EQ(new_value, 0.0); - ASSERT_FLOAT_EQ(prev_value, 0.0); - } - - { - // now `integer_value` is `6.22`, calling Set(update=true) to set it to `-3.14`, will notify update_fn() - validate_value = 0.0; - new_value = 0.0; - prev_value = 0.0; - - ConfigStatus status(SetReturn::SUCCESS, ""); - status = floating_config->Set("-3.14", true); - - EXPECT_EQ(status.set_return, SetReturn::SUCCESS); - ASSERT_FLOAT_EQ(floating_value, -3.14); - ASSERT_FLOAT_EQ(std::stof(floating_config->Get()), -3.14); - - // expect change - ASSERT_FLOAT_EQ(validate_value, -3.14); - ASSERT_FLOAT_EQ(new_value, -3.14); - ASSERT_FLOAT_EQ(prev_value, 6.22); - } -} - -/* ValidEnumConfigTest */ -class ValidEnumConfigTest : public testing::Test, public Utils { - protected: -}; - -// template <> -// int64_t Utils::validate_value = 0; -// template <> -// int64_t Utils::new_value = 0; -// template <> -// int64_t Utils::prev_value = 0; - -TEST_F(ValidEnumConfigTest, init_load_update_get_test) { - auto validate = std::bind(&ValidEnumConfigTest::validate_fn, this, std::placeholders::_1, std::placeholders::_2); - auto update = std::bind(&ValidEnumConfigTest::update_fn, this, std::placeholders::_1, std::placeholders::_2, - std::placeholders::_3); - - configEnum testEnum{ - {"a", 1}, - {"b", 2}, - {"c", 3}, - }; - int64_t enum_value = 0; - auto enum_config = CreateEnumConfig("e", _MODIFIABLE, &testEnum, &enum_value, 1, validate, update); - ASSERT_EQ(enum_value, 0); - ASSERT_EQ(enum_config->modifiable_, true); - - enum_config->Init(); - ASSERT_EQ(enum_value, 1); - ASSERT_EQ(enum_config->Get(), "a"); - - { - // now `enum_value` is `a`, calling Set(update=false) to set it to `b`, but not notify update_fn() - validate_value = 0; - new_value = 0; - prev_value = 0; - - ConfigStatus status(SetReturn::SUCCESS, ""); - status = enum_config->Set("b", false); - - EXPECT_EQ(status.set_return, SetReturn::SUCCESS); - ASSERT_EQ(enum_value, 2); - ASSERT_EQ(enum_config->Get(), "b"); - - // expect change - ASSERT_EQ(validate_value, 2); - // expect not change - ASSERT_EQ(new_value, 0); - ASSERT_EQ(prev_value, 0); - } - - { - // now `enum_value` is `b`, calling Set(update=true) to set it to `c`, will notify update_fn() - validate_value = 0; - new_value = 0; - prev_value = 0; - - ConfigStatus status(SetReturn::SUCCESS, ""); - status = enum_config->Set("c", true); - - EXPECT_EQ(status.set_return, SetReturn::SUCCESS); - ASSERT_EQ(enum_value, 3); - ASSERT_EQ(enum_config->Get(), "c"); - - // expect change - ASSERT_EQ(validate_value, 3); - ASSERT_EQ(new_value, 3); - ASSERT_EQ(prev_value, 2); - } -} - -/* ValidSizeConfigTest */ -class ValidSizeConfigTest : public testing::Test, public Utils { - protected: -}; - -// template <> -// int64_t Utils::validate_value = 0; -// template <> -// int64_t Utils::new_value = 0; -// template <> -// int64_t Utils::prev_value = 0; - -TEST_F(ValidSizeConfigTest, init_load_update_get_test) { - auto validate = std::bind(&ValidSizeConfigTest::validate_fn, this, std::placeholders::_1, std::placeholders::_2); - auto update = std::bind(&ValidSizeConfigTest::update_fn, this, std::placeholders::_1, std::placeholders::_2, - std::placeholders::_3); - - int64_t size_value = 0; - auto size_config = CreateSizeConfig("i", _MODIFIABLE, 0, 1024 * 1024, &size_value, 1024, validate, update); - ASSERT_EQ(size_value, 0); - ASSERT_EQ(size_config->modifiable_, true); - - size_config->Init(); - ASSERT_EQ(size_value, 1024); - ASSERT_EQ(size_config->Get(), "1024"); - - { - // now `size_value` is `1024`, calling Set(update=false) to set it to `4096`, but not notify update_fn() - validate_value = 0; - new_value = 0; - prev_value = 0; - - ConfigStatus status(SetReturn::SUCCESS, ""); - status = size_config->Set("4096", false); - - EXPECT_EQ(status.set_return, SetReturn::SUCCESS); - EXPECT_EQ(size_value, 4096); - EXPECT_EQ(size_config->Get(), "4096"); - - // expect change - EXPECT_EQ(validate_value, 4096); - // expect not change - EXPECT_EQ(new_value, 0); - EXPECT_EQ(prev_value, 0); - } - - { - // now `size_value` is `4096`, calling Set(update=true) to set it to `256kb`, will notify update_fn() - validate_value = 0; - new_value = 0; - prev_value = 0; - - ConfigStatus status(SetReturn::SUCCESS, ""); - status = size_config->Set("256kb", true); - - EXPECT_EQ(status.set_return, SetReturn::SUCCESS); - EXPECT_EQ(size_value, 256 * 1024); - EXPECT_EQ(size_config->Get(), "262144"); - - // expect change - EXPECT_EQ(validate_value, 262144); - EXPECT_EQ(new_value, 262144); - EXPECT_EQ(prev_value, 4096); - } -} - -class ValidTest : public testing::Test { - protected: - configEnum family{ - {"ipv4", 1}, - {"ipv6", 2}, - }; - - struct Server { - bool running = true; - std::string hostname; - int64_t family = 0; - int64_t port = 0; - double uptime = 0; - }; - - Server server; - - protected: - void - SetUp() override { - config_list = { - CreateBoolConfig("running", true, &server.running, true, nullptr, nullptr), - CreateStringConfig("hostname", true, &server.hostname, "Magic", nullptr, nullptr), - CreateEnumConfig("socket_family", false, &family, &server.family, 2, nullptr, nullptr), - CreateIntegerConfig("port", true, 1024, 65535, &server.port, 19530, nullptr, nullptr), - CreateFloatingConfig("uptime", true, 0, 9999.0, &server.uptime, 0, nullptr, nullptr), - }; - } - - void - TearDown() override { - } - - protected: - void - Init() { - for (auto& config : config_list) { - config->Init(); - } - } - - void - Load() { - std::unordered_map config_file{ - {"running", "false"}, - }; - - for (auto& c : config_file) Set(c.first, c.second, false); - } - - void - Set(const std::string& name, const std::string& value, bool update = true) { - for (auto& config : config_list) { - if (std::strcmp(name.c_str(), config->name_) == 0) { - config->Set(value, update); - return; - } - } - throw "Config " + name + " not found."; - } - - std::string - Get(const std::string& name) { - for (auto& config : config_list) { - if (std::strcmp(name.c_str(), config->name_) == 0) { - return config->Get(); - } - } - throw "Config " + name + " not found."; - } - - std::vector config_list; -}; - -} // namespace milvus diff --git a/proxy/src/config/ConfigTypeTest2.cpp b/proxy/src/config/ConfigTypeTest2.cpp deleted file mode 100644 index 42b903c7b1..0000000000 --- a/proxy/src/config/ConfigTypeTest2.cpp +++ /dev/null @@ -1,861 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "config/ServerConfig.h" -#include "gtest/gtest.h" - -namespace milvus { - -#define _MODIFIABLE (true) -#define _IMMUTABLE (false) - -template -class Utils { - public: - static bool - valid_check_failure(const T& value, std::string& err) { - err = "Value is invalid."; - return false; - } - - static bool - update_failure(const T& value, const T& prev, std::string& err) { - err = "Update is failure"; - return false; - } - - static bool - valid_check_raise_string(const T& value, std::string& err) { - throw "string exception"; - } - - static bool - valid_check_raise_exception(const T& value, std::string& err) { - throw std::bad_alloc(); - } -}; - -/* BoolConfigTest */ -class BoolConfigTest : public testing::Test, public Utils {}; - -TEST_F(BoolConfigTest, nullptr_init_test) { - auto bool_config = CreateBoolConfig("b", _MODIFIABLE, nullptr, true, nullptr, nullptr); - ASSERT_DEATH(bool_config->Init(), "nullptr"); -} - -TEST_F(BoolConfigTest, init_twice_test) { - bool bool_value; - auto bool_config = CreateBoolConfig("b", _MODIFIABLE, &bool_value, true, nullptr, nullptr); - ASSERT_DEATH( - { - bool_config->Init(); - bool_config->Init(); - }, - "initialized"); -} - -TEST_F(BoolConfigTest, non_init_test) { - bool bool_value; - auto bool_config = CreateBoolConfig("b", _MODIFIABLE, &bool_value, true, nullptr, nullptr); - ASSERT_DEATH(bool_config->Set("false", true), "uninitialized"); - ASSERT_DEATH(bool_config->Get(), "uninitialized"); -} - -TEST_F(BoolConfigTest, immutable_update_test) { - bool bool_value = false; - auto bool_config = CreateBoolConfig("b", _IMMUTABLE, &bool_value, true, nullptr, nullptr); - bool_config->Init(); - ASSERT_EQ(bool_value, true); - - ConfigStatus status(SUCCESS, ""); - status = bool_config->Set("false", true); - ASSERT_EQ(status.set_return, SetReturn::IMMUTABLE); - ASSERT_EQ(bool_value, true); -} - -TEST_F(BoolConfigTest, set_invalid_value_test) { - bool bool_value; - auto bool_config = CreateBoolConfig("b", _MODIFIABLE, &bool_value, true, nullptr, nullptr); - bool_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = bool_config->Set(" false", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(bool_config->Get(), "true"); - - status = bool_config->Set("false ", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(bool_config->Get(), "true"); - - status = bool_config->Set("afalse", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(bool_config->Get(), "true"); - - status = bool_config->Set("falsee", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(bool_config->Get(), "true"); - - status = bool_config->Set("abcdefg", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(bool_config->Get(), "true"); - - status = bool_config->Set("123456", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(bool_config->Get(), "true"); - - status = bool_config->Set("", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(bool_config->Get(), "true"); -} - -TEST_F(BoolConfigTest, valid_check_fail_test) { - bool bool_value; - auto bool_config = CreateBoolConfig("b", _MODIFIABLE, &bool_value, true, valid_check_failure, nullptr); - bool_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = bool_config->Set("123456", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(bool_config->Get(), "true"); -} - -TEST_F(BoolConfigTest, update_fail_test) { - bool bool_value; - auto bool_config = CreateBoolConfig("b", _MODIFIABLE, &bool_value, true, nullptr, update_failure); - bool_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = bool_config->Set("false", true); - ASSERT_EQ(status.set_return, SetReturn::UPDATE_FAILURE); - ASSERT_EQ(bool_config->Get(), "true"); -} - -TEST_F(BoolConfigTest, string_exception_test) { - bool bool_value; - auto bool_config = CreateBoolConfig("b", _MODIFIABLE, &bool_value, true, valid_check_raise_string, nullptr); - bool_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = bool_config->Set("false", true); - ASSERT_EQ(status.set_return, SetReturn::UNEXPECTED); - ASSERT_EQ(bool_config->Get(), "true"); -} - -TEST_F(BoolConfigTest, standard_exception_test) { - bool bool_value; - auto bool_config = CreateBoolConfig("b", _MODIFIABLE, &bool_value, true, valid_check_raise_exception, nullptr); - bool_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = bool_config->Set("false", true); - ASSERT_EQ(status.set_return, SetReturn::EXCEPTION); - ASSERT_EQ(bool_config->Get(), "true"); -} - -/* StringConfigTest */ -class StringConfigTest : public testing::Test, public Utils {}; - -TEST_F(StringConfigTest, nullptr_init_test) { - auto string_config = CreateStringConfig("s", true, nullptr, "Magic", nullptr, nullptr); - ASSERT_DEATH(string_config->Init(), "nullptr"); -} - -TEST_F(StringConfigTest, init_twice_test) { - std::string string_value; - auto string_config = CreateStringConfig("s", _MODIFIABLE, &string_value, "Magic", nullptr, nullptr); - ASSERT_DEATH( - { - string_config->Init(); - string_config->Init(); - }, - "initialized"); -} - -TEST_F(StringConfigTest, non_init_test) { - std::string string_value; - auto string_config = CreateStringConfig("s", _MODIFIABLE, &string_value, "Magic", nullptr, nullptr); - ASSERT_DEATH(string_config->Set("value", true), "uninitialized"); - ASSERT_DEATH(string_config->Get(), "uninitialized"); -} - -TEST_F(StringConfigTest, immutable_update_test) { - std::string string_value; - auto string_config = CreateStringConfig("s", _IMMUTABLE, &string_value, "Magic", nullptr, nullptr); - string_config->Init(); - ASSERT_EQ(string_value, "Magic"); - - ConfigStatus status(SUCCESS, ""); - status = string_config->Set("cigaM", true); - ASSERT_EQ(status.set_return, SetReturn::IMMUTABLE); - ASSERT_EQ(string_value, "Magic"); -} - -TEST_F(StringConfigTest, valid_check_fail_test) { - std::string string_value; - auto string_config = CreateStringConfig("s", _MODIFIABLE, &string_value, "Magic", valid_check_failure, nullptr); - string_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = string_config->Set("123456", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(string_config->Get(), "Magic"); -} - -TEST_F(StringConfigTest, update_fail_test) { - std::string string_value; - auto string_config = CreateStringConfig("s", _MODIFIABLE, &string_value, "Magic", nullptr, update_failure); - string_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = string_config->Set("Mi", true); - ASSERT_EQ(status.set_return, SetReturn::UPDATE_FAILURE); - ASSERT_EQ(string_config->Get(), "Magic"); -} - -TEST_F(StringConfigTest, string_exception_test) { - std::string string_value; - auto string_config = - CreateStringConfig("s", _MODIFIABLE, &string_value, "Magic", valid_check_raise_string, nullptr); - string_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = string_config->Set("any", true); - ASSERT_EQ(status.set_return, SetReturn::UNEXPECTED); - ASSERT_EQ(string_config->Get(), "Magic"); -} - -TEST_F(StringConfigTest, standard_exception_test) { - std::string string_value; - auto string_config = - CreateStringConfig("s", _MODIFIABLE, &string_value, "Magic", valid_check_raise_exception, nullptr); - string_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = string_config->Set("any", true); - ASSERT_EQ(status.set_return, SetReturn::EXCEPTION); - ASSERT_EQ(string_config->Get(), "Magic"); -} - -/* IntegerConfigTest */ -class IntegerConfigTest : public testing::Test, public Utils {}; - -TEST_F(IntegerConfigTest, nullptr_init_test) { - auto integer_config = CreateIntegerConfig("i", true, 1024, 65535, nullptr, 19530, nullptr, nullptr); - ASSERT_DEATH(integer_config->Init(), "nullptr"); -} - -TEST_F(IntegerConfigTest, init_twice_test) { - int64_t integer_value; - auto integer_config = CreateIntegerConfig("i", true, 1024, 65535, &integer_value, 19530, nullptr, nullptr); - ASSERT_DEATH( - { - integer_config->Init(); - integer_config->Init(); - }, - "initialized"); -} - -TEST_F(IntegerConfigTest, non_init_test) { - int64_t integer_value; - auto integer_config = CreateIntegerConfig("i", true, 1024, 65535, &integer_value, 19530, nullptr, nullptr); - ASSERT_DEATH(integer_config->Set("42", true), "uninitialized"); - ASSERT_DEATH(integer_config->Get(), "uninitialized"); -} - -TEST_F(IntegerConfigTest, immutable_update_test) { - int64_t integer_value; - auto integer_config = CreateIntegerConfig("i", _IMMUTABLE, 1024, 65535, &integer_value, 19530, nullptr, nullptr); - integer_config->Init(); - ASSERT_EQ(integer_value, 19530); - - ConfigStatus status(SUCCESS, ""); - status = integer_config->Set("2048", true); - ASSERT_EQ(status.set_return, SetReturn::IMMUTABLE); - ASSERT_EQ(integer_value, 19530); -} - -TEST_F(IntegerConfigTest, set_invalid_value_test) { -} - -TEST_F(IntegerConfigTest, valid_check_fail_test) { - int64_t integer_value; - auto integer_config = - CreateIntegerConfig("i", true, 1024, 65535, &integer_value, 19530, valid_check_failure, nullptr); - integer_config->Init(); - ConfigStatus status(SUCCESS, ""); - status = integer_config->Set("2048", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(integer_config->Get(), "19530"); -} - -TEST_F(IntegerConfigTest, update_fail_test) { - int64_t integer_value; - auto integer_config = CreateIntegerConfig("i", true, 1024, 65535, &integer_value, 19530, nullptr, update_failure); - integer_config->Init(); - ConfigStatus status(SUCCESS, ""); - status = integer_config->Set("2048", true); - ASSERT_EQ(status.set_return, SetReturn::UPDATE_FAILURE); - ASSERT_EQ(integer_config->Get(), "19530"); -} - -TEST_F(IntegerConfigTest, string_exception_test) { - int64_t integer_value; - auto integer_config = - CreateIntegerConfig("i", true, 1024, 65535, &integer_value, 19530, valid_check_raise_string, nullptr); - integer_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = integer_config->Set("2048", true); - ASSERT_EQ(status.set_return, SetReturn::UNEXPECTED); - ASSERT_EQ(integer_config->Get(), "19530"); -} - -TEST_F(IntegerConfigTest, standard_exception_test) { - int64_t integer_value; - auto integer_config = - CreateIntegerConfig("i", true, 1024, 65535, &integer_value, 19530, valid_check_raise_exception, nullptr); - integer_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = integer_config->Set("2048", true); - ASSERT_EQ(status.set_return, SetReturn::EXCEPTION); - ASSERT_EQ(integer_config->Get(), "19530"); -} - -TEST_F(IntegerConfigTest, out_of_range_test) { - int64_t integer_value; - auto integer_config = CreateIntegerConfig("i", true, 1024, 65535, &integer_value, 19530, nullptr, nullptr); - integer_config->Init(); - - { - ConfigStatus status(SUCCESS, ""); - status = integer_config->Set("1023", true); - ASSERT_EQ(status.set_return, SetReturn::OUT_OF_RANGE); - ASSERT_EQ(integer_config->Get(), "19530"); - } - - { - ConfigStatus status(SUCCESS, ""); - status = integer_config->Set("65536", true); - ASSERT_EQ(status.set_return, SetReturn::OUT_OF_RANGE); - ASSERT_EQ(integer_config->Get(), "19530"); - } -} - -TEST_F(IntegerConfigTest, invalid_bound_test) { - int64_t integer_value; - auto integer_config = CreateIntegerConfig("i", true, 100, 0, &integer_value, 50, nullptr, nullptr); - integer_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = integer_config->Set("30", true); - ASSERT_EQ(status.set_return, SetReturn::OUT_OF_RANGE); - ASSERT_EQ(integer_config->Get(), "50"); -} - -TEST_F(IntegerConfigTest, invalid_format_test) { - int64_t integer_value; - auto integer_config = CreateIntegerConfig("i", true, 0, 100, &integer_value, 50, nullptr, nullptr); - integer_config->Init(); - - { - ConfigStatus status(SUCCESS, ""); - status = integer_config->Set("3-0", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(integer_config->Get(), "50"); - } - - { - ConfigStatus status(SUCCESS, ""); - status = integer_config->Set("30-", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(integer_config->Get(), "50"); - } - - { - ConfigStatus status(SUCCESS, ""); - status = integer_config->Set("+30", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(integer_config->Get(), "50"); - } - - { - ConfigStatus status(SUCCESS, ""); - status = integer_config->Set("a30", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(integer_config->Get(), "50"); - } - - { - ConfigStatus status(SUCCESS, ""); - status = integer_config->Set("30a", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(integer_config->Get(), "50"); - } - - { - ConfigStatus status(SUCCESS, ""); - status = integer_config->Set("3a0", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(integer_config->Get(), "50"); - } -} - -/* FloatingConfigTest */ -class FloatingConfigTest : public testing::Test, public Utils {}; - -TEST_F(FloatingConfigTest, nullptr_init_test) { - auto floating_config = CreateFloatingConfig("f", true, 1.0, 9.9, nullptr, 4.5, nullptr, nullptr); - ASSERT_DEATH(floating_config->Init(), "nullptr"); -} - -TEST_F(FloatingConfigTest, init_twice_test) { - double floating_value; - auto floating_config = CreateFloatingConfig("f", true, 1.0, 9.9, &floating_value, 4.5, nullptr, nullptr); - ASSERT_DEATH( - { - floating_config->Init(); - floating_config->Init(); - }, - "initialized"); -} - -TEST_F(FloatingConfigTest, non_init_test) { - double floating_value; - auto floating_config = CreateFloatingConfig("f", true, 1.0, 9.9, &floating_value, 4.5, nullptr, nullptr); - ASSERT_DEATH(floating_config->Set("3.14", true), "uninitialized"); - ASSERT_DEATH(floating_config->Get(), "uninitialized"); -} - -TEST_F(FloatingConfigTest, immutable_update_test) { - double floating_value; - auto floating_config = CreateFloatingConfig("f", _IMMUTABLE, 1.0, 9.9, &floating_value, 4.5, nullptr, nullptr); - floating_config->Init(); - ASSERT_FLOAT_EQ(floating_value, 4.5); - - ConfigStatus status(SUCCESS, ""); - status = floating_config->Set("1.23", true); - ASSERT_EQ(status.set_return, SetReturn::IMMUTABLE); - ASSERT_FLOAT_EQ(std::stof(floating_config->Get()), 4.5); -} - -TEST_F(FloatingConfigTest, set_invalid_value_test) { -} - -TEST_F(FloatingConfigTest, valid_check_fail_test) { - double floating_value; - auto floating_config = - CreateFloatingConfig("f", true, 1.0, 9.9, &floating_value, 4.5, valid_check_failure, nullptr); - floating_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = floating_config->Set("1.23", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_FLOAT_EQ(std::stof(floating_config->Get()), 4.5); -} - -TEST_F(FloatingConfigTest, update_fail_test) { - double floating_value; - auto floating_config = CreateFloatingConfig("f", true, 1.0, 9.9, &floating_value, 4.5, nullptr, update_failure); - floating_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = floating_config->Set("1.23", true); - ASSERT_EQ(status.set_return, SetReturn::UPDATE_FAILURE); - ASSERT_FLOAT_EQ(std::stof(floating_config->Get()), 4.5); -} - -TEST_F(FloatingConfigTest, string_exception_test) { - double floating_value; - auto floating_config = - CreateFloatingConfig("f", true, 1.0, 9.9, &floating_value, 4.5, valid_check_raise_string, nullptr); - floating_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = floating_config->Set("1.23", true); - ASSERT_EQ(status.set_return, SetReturn::UNEXPECTED); - ASSERT_FLOAT_EQ(std::stof(floating_config->Get()), 4.5); -} - -TEST_F(FloatingConfigTest, standard_exception_test) { - double floating_value; - auto floating_config = - CreateFloatingConfig("f", true, 1.0, 9.9, &floating_value, 4.5, valid_check_raise_exception, nullptr); - floating_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = floating_config->Set("1.23", true); - ASSERT_EQ(status.set_return, SetReturn::EXCEPTION); - ASSERT_FLOAT_EQ(std::stof(floating_config->Get()), 4.5); -} - -TEST_F(FloatingConfigTest, out_of_range_test) { - double floating_value; - auto floating_config = - CreateFloatingConfig("f", true, 1.0, 9.9, &floating_value, 4.5, valid_check_raise_exception, nullptr); - floating_config->Init(); - - { - ConfigStatus status(SUCCESS, ""); - status = floating_config->Set("0.99", true); - ASSERT_EQ(status.set_return, SetReturn::OUT_OF_RANGE); - ASSERT_FLOAT_EQ(std::stof(floating_config->Get()), 4.5); - } - - { - ConfigStatus status(SUCCESS, ""); - status = floating_config->Set("10.00", true); - ASSERT_EQ(status.set_return, SetReturn::OUT_OF_RANGE); - ASSERT_FLOAT_EQ(std::stof(floating_config->Get()), 4.5); - } -} - -TEST_F(FloatingConfigTest, invalid_bound_test) { - double floating_value; - auto floating_config = - CreateFloatingConfig("f", true, 9.9, 1.0, &floating_value, 4.5, valid_check_raise_exception, nullptr); - floating_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = floating_config->Set("6.0", true); - ASSERT_EQ(status.set_return, SetReturn::OUT_OF_RANGE); - ASSERT_FLOAT_EQ(std::stof(floating_config->Get()), 4.5); -} - -TEST_F(FloatingConfigTest, DISABLED_invalid_format_test) { - double floating_value; - auto floating_config = CreateFloatingConfig("f", true, 1.0, 100.0, &floating_value, 4.5, nullptr, nullptr); - floating_config->Init(); - - { - ConfigStatus status(SUCCESS, ""); - status = floating_config->Set("6.0.1", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_FLOAT_EQ(std::stof(floating_config->Get()), 4.5); - } - - { - ConfigStatus status(SUCCESS, ""); - status = floating_config->Set("6a0", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_FLOAT_EQ(std::stof(floating_config->Get()), 4.5); - } -} - -/* EnumConfigTest */ -class EnumConfigTest : public testing::Test, public Utils {}; - -TEST_F(EnumConfigTest, nullptr_init_test) { - configEnum testEnum{ - {"e", 1}, - }; - int64_t testEnumValue; - auto enum_config_1 = CreateEnumConfig("e", _MODIFIABLE, &testEnum, nullptr, 2, nullptr, nullptr); - ASSERT_DEATH(enum_config_1->Init(), "nullptr"); - - auto enum_config_2 = CreateEnumConfig("e", _MODIFIABLE, nullptr, &testEnumValue, 2, nullptr, nullptr); - ASSERT_DEATH(enum_config_2->Init(), "nullptr"); - - auto enum_config_3 = CreateEnumConfig("e", _MODIFIABLE, nullptr, nullptr, 2, nullptr, nullptr); - ASSERT_DEATH(enum_config_3->Init(), "nullptr"); -} - -TEST_F(EnumConfigTest, init_twice_test) { - configEnum testEnum{ - {"e", 1}, - }; - int64_t enum_value; - auto enum_config = CreateEnumConfig("e", _MODIFIABLE, &testEnum, &enum_value, 2, nullptr, nullptr); - ASSERT_DEATH( - { - enum_config->Init(); - enum_config->Init(); - }, - "initialized"); -} - -TEST_F(EnumConfigTest, non_init_test) { - configEnum testEnum{ - {"e", 1}, - }; - int64_t enum_value; - auto enum_config = CreateEnumConfig("e", _MODIFIABLE, &testEnum, &enum_value, 2, nullptr, nullptr); - ASSERT_DEATH(enum_config->Set("e", true), "uninitialized"); - ASSERT_DEATH(enum_config->Get(), "uninitialized"); -} - -TEST_F(EnumConfigTest, immutable_update_test) { - configEnum testEnum{ - {"a", 1}, - {"b", 2}, - {"c", 3}, - }; - int64_t enum_value = 0; - auto enum_config = CreateEnumConfig("e", _IMMUTABLE, &testEnum, &enum_value, 1, nullptr, nullptr); - enum_config->Init(); - ASSERT_EQ(enum_value, 1); - - ConfigStatus status(SUCCESS, ""); - status = enum_config->Set("b", true); - ASSERT_EQ(status.set_return, SetReturn::IMMUTABLE); - ASSERT_EQ(enum_value, 1); -} - -TEST_F(EnumConfigTest, set_invalid_value_check) { - configEnum testEnum{ - {"a", 1}, - }; - int64_t enum_value = 0; - auto enum_config = CreateEnumConfig("e", _MODIFIABLE, &testEnum, &enum_value, 1, nullptr, nullptr); - enum_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = enum_config->Set("b", true); - ASSERT_EQ(status.set_return, SetReturn::ENUM_VALUE_NOTFOUND); - ASSERT_EQ(enum_config->Get(), "a"); -} - -TEST_F(EnumConfigTest, empty_enum_test) { - configEnum testEnum{}; - int64_t enum_value; - auto enum_config = CreateEnumConfig("e", _MODIFIABLE, &testEnum, &enum_value, 2, nullptr, nullptr); - ASSERT_DEATH(enum_config->Init(), "empty"); -} - -TEST_F(EnumConfigTest, valid_check_fail_test) { - configEnum testEnum{ - {"a", 1}, - {"b", 2}, - {"c", 3}, - }; - int64_t enum_value; - auto enum_config = CreateEnumConfig("e", _MODIFIABLE, &testEnum, &enum_value, 1, valid_check_failure, nullptr); - enum_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = enum_config->Set("b", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(enum_config->Get(), "a"); -} - -TEST_F(EnumConfigTest, update_fail_test) { - configEnum testEnum{ - {"a", 1}, - {"b", 2}, - {"c", 3}, - }; - int64_t enum_value; - auto enum_config = CreateEnumConfig("e", _MODIFIABLE, &testEnum, &enum_value, 1, nullptr, update_failure); - enum_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = enum_config->Set("b", true); - ASSERT_EQ(status.set_return, SetReturn::UPDATE_FAILURE); - ASSERT_EQ(enum_config->Get(), "a"); -} - -TEST_F(EnumConfigTest, string_exception_test) { - configEnum testEnum{ - {"a", 1}, - {"b", 2}, - {"c", 3}, - }; - int64_t enum_value; - auto enum_config = CreateEnumConfig("e", _MODIFIABLE, &testEnum, &enum_value, 1, valid_check_raise_string, nullptr); - enum_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = enum_config->Set("b", true); - ASSERT_EQ(status.set_return, SetReturn::UNEXPECTED); - ASSERT_EQ(enum_config->Get(), "a"); -} - -TEST_F(EnumConfigTest, standard_exception_test) { - configEnum testEnum{ - {"a", 1}, - {"b", 2}, - {"c", 3}, - }; - int64_t enum_value; - auto enum_config = - CreateEnumConfig("e", _MODIFIABLE, &testEnum, &enum_value, 1, valid_check_raise_exception, nullptr); - enum_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = enum_config->Set("b", true); - ASSERT_EQ(status.set_return, SetReturn::EXCEPTION); - ASSERT_EQ(enum_config->Get(), "a"); -} - -/* SizeConfigTest */ -class SizeConfigTest : public testing::Test, public Utils {}; - -TEST_F(SizeConfigTest, nullptr_init_test) { - auto size_config = CreateSizeConfig("i", true, 1024, 4096, nullptr, 2048, nullptr, nullptr); - ASSERT_DEATH(size_config->Init(), "nullptr"); -} - -TEST_F(SizeConfigTest, init_twice_test) { - int64_t size_value; - auto size_config = CreateSizeConfig("i", true, 1024, 4096, &size_value, 2048, nullptr, nullptr); - ASSERT_DEATH( - { - size_config->Init(); - size_config->Init(); - }, - "initialized"); -} - -TEST_F(SizeConfigTest, non_init_test) { - int64_t size_value; - auto size_config = CreateSizeConfig("i", true, 1024, 4096, &size_value, 2048, nullptr, nullptr); - ASSERT_DEATH(size_config->Set("3000", true), "uninitialized"); - ASSERT_DEATH(size_config->Get(), "uninitialized"); -} - -TEST_F(SizeConfigTest, immutable_update_test) { - int64_t size_value = 0; - auto size_config = CreateSizeConfig("i", _IMMUTABLE, 1024, 4096, &size_value, 2048, nullptr, nullptr); - size_config->Init(); - ASSERT_EQ(size_value, 2048); - - ConfigStatus status(SUCCESS, ""); - status = size_config->Set("3000", true); - ASSERT_EQ(status.set_return, SetReturn::IMMUTABLE); - ASSERT_EQ(size_value, 2048); -} - -TEST_F(SizeConfigTest, set_invalid_value_test) { -} - -TEST_F(SizeConfigTest, valid_check_fail_test) { - int64_t size_value; - auto size_config = CreateSizeConfig("i", true, 1024, 4096, &size_value, 2048, valid_check_failure, nullptr); - size_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = size_config->Set("3000", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(size_config->Get(), "2048"); -} - -TEST_F(SizeConfigTest, update_fail_test) { - int64_t size_value; - auto size_config = CreateSizeConfig("i", true, 1024, 4096, &size_value, 2048, nullptr, update_failure); - size_config->Init(); - ConfigStatus status(SUCCESS, ""); - status = size_config->Set("3000", true); - ASSERT_EQ(status.set_return, SetReturn::UPDATE_FAILURE); - ASSERT_EQ(size_config->Get(), "2048"); -} - -TEST_F(SizeConfigTest, string_exception_test) { - int64_t size_value; - auto size_config = CreateSizeConfig("i", true, 1024, 4096, &size_value, 2048, valid_check_raise_string, nullptr); - size_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = size_config->Set("3000", true); - ASSERT_EQ(status.set_return, SetReturn::UNEXPECTED); - ASSERT_EQ(size_config->Get(), "2048"); -} - -TEST_F(SizeConfigTest, standard_exception_test) { - int64_t size_value; - auto size_config = CreateSizeConfig("i", true, 1024, 4096, &size_value, 2048, valid_check_raise_exception, nullptr); - size_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = size_config->Set("3000", true); - ASSERT_EQ(status.set_return, SetReturn::EXCEPTION); - ASSERT_EQ(size_config->Get(), "2048"); -} - -TEST_F(SizeConfigTest, out_of_range_test) { - int64_t size_value; - auto size_config = CreateSizeConfig("i", true, 1024, 4096, &size_value, 2048, nullptr, nullptr); - size_config->Init(); - - { - ConfigStatus status(SUCCESS, ""); - status = size_config->Set("1023", true); - ASSERT_EQ(status.set_return, SetReturn::OUT_OF_RANGE); - ASSERT_EQ(size_config->Get(), "2048"); - } - - { - ConfigStatus status(SUCCESS, ""); - status = size_config->Set("4097", true); - ASSERT_EQ(status.set_return, SetReturn::OUT_OF_RANGE); - ASSERT_EQ(size_config->Get(), "2048"); - } -} - -TEST_F(SizeConfigTest, negative_integer_test) { - int64_t size_value; - auto size_config = CreateSizeConfig("i", true, 1024, 4096, &size_value, 2048, nullptr, nullptr); - size_config->Init(); - ConfigStatus status(SUCCESS, ""); - status = size_config->Set("-3KB", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(size_config->Get(), "2048"); -} - -TEST_F(SizeConfigTest, invalid_bound_test) { - int64_t size_value; - auto size_config = CreateSizeConfig("i", true, 100, 0, &size_value, 50, nullptr, nullptr); - size_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = size_config->Set("30", true); - ASSERT_EQ(status.set_return, SetReturn::OUT_OF_RANGE); - ASSERT_EQ(size_config->Get(), "50"); -} - -TEST_F(SizeConfigTest, invalid_unit_test) { - int64_t size_value; - auto size_config = CreateSizeConfig("i", true, 1024, 4096, &size_value, 2048, nullptr, nullptr); - size_config->Init(); - - ConfigStatus status(SUCCESS, ""); - status = size_config->Set("1 TB", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(size_config->Get(), "2048"); -} - -TEST_F(SizeConfigTest, invalid_format_test) { - int64_t size_value; - auto size_config = CreateSizeConfig("i", true, 1024, 4096, &size_value, 2048, nullptr, nullptr); - size_config->Init(); - - { - ConfigStatus status(SUCCESS, ""); - status = size_config->Set("a10GB", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(size_config->Get(), "2048"); - } - - { - ConfigStatus status(SUCCESS, ""); - status = size_config->Set("200*0", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(size_config->Get(), "2048"); - } - - { - ConfigStatus status(SUCCESS, ""); - status = size_config->Set("10AB", true); - ASSERT_EQ(status.set_return, SetReturn::INVALID); - ASSERT_EQ(size_config->Get(), "2048"); - } -} - -} // namespace milvus diff --git a/proxy/src/config/ServerConfig.cpp b/proxy/src/config/ServerConfig.cpp deleted file mode 100644 index 0526d7f992..0000000000 --- a/proxy/src/config/ServerConfig.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include -#include -#include -#include -#include - -#include "config/ServerConfig.h" - -namespace milvus { - -std::mutex config_mutex; - -std::mutex& -GetConfigMutex() { - return config_mutex; -} - -ServerConfig config; - -std::vector -ParsePreloadCollection(const std::string& str) { - std::stringstream ss(str); - std::vector collections; - std::string collection; - - while (std::getline(ss, collection, ',')) { - collections.push_back(collection); - } - return collections; -} - -std::vector -ParseGPUDevices(const std::string& str) { - std::stringstream ss(str); - std::vector devices; - std::unordered_set device_set; - std::string device; - - while (std::getline(ss, device, ',')) { - if (device.length() < 4) { - /* Invalid format string */ - return {}; - } - device_set.insert(std::stoll(device.substr(3))); - } - - for (auto dev : device_set) devices.push_back(dev); - return devices; -} - -} // namespace milvus diff --git a/proxy/src/config/ServerConfig.h b/proxy/src/config/ServerConfig.h deleted file mode 100644 index 2cc62ef58d..0000000000 --- a/proxy/src/config/ServerConfig.h +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include -#include - -#include "config/ConfigType.h" - -namespace milvus { - -extern std::mutex& -GetConfigMutex(); - -template -class ConfigValue { - public: - explicit ConfigValue(T init_value) : value(std::move(init_value)) { - } - - const T& - operator()() { - std::lock_guard lock(GetConfigMutex()); - return value; - } - - public: - T value; -}; - -enum ClusterRole { - RW = 1, - RO, -}; - -enum SimdType { - AUTO = 1, - SSE, - AVX2, - AVX512, -}; - -const configEnum SimdMap{ - {"auto", SimdType::AUTO}, - {"sse", SimdType::SSE}, - {"avx2", SimdType::AVX2}, - {"avx512", SimdType::AVX512}, -}; - -struct ServerConfig { - using String = ConfigValue; - using Bool = ConfigValue; - using Integer = ConfigValue; - using Floating = ConfigValue; - - String timezone{"unknown"}; -// Integer query_node_num{1}; - Integer proxy_id{0}; - - struct Network { - String address{"unknown"}; - Integer port{0}; - } network; - - struct Pulsar{ - String address{"localhost"}; - Integer port{6650}; - Integer topicnum{1024}; - }pulsar; - - struct Master{ - String address{"localhost"}; - Integer port{53100}; - Integer query_node_num{2}; - }master; - - struct Etcd{ - String address{"localhost"}; - Integer port{2379}; - String rootpath{"by-dev"}; - }etcd; - - struct TimeSync{ - Integer interval{10}; - }timesync; - - struct Engine { - Integer build_index_threshold{4096}; - Integer search_combine_nq{0}; - Integer use_blas_threshold{0}; - Integer omp_thread_num{0}; - Integer simd_type{0}; - } engine; - - struct Tracing { - String json_config_path{"unknown"}; - } tracing; - - - struct Logs { - String level{"unknown"}; - struct Trace { - Bool enable{false}; - } trace; - String path{"unknown"}; - Integer max_log_file_size{0}; - Integer log_rotate_num{0}; - } logs; -}; - -extern ServerConfig config; -extern std::mutex _config_mutex; - -std::vector -ParsePreloadCollection(const std::string&); - -std::vector -ParseGPUDevices(const std::string&); -} // namespace milvus diff --git a/proxy/src/config/ServerConfigTest.cpp b/proxy/src/config/ServerConfigTest.cpp deleted file mode 100644 index 76e0f844a7..0000000000 --- a/proxy/src/config/ServerConfigTest.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include - -#include "config/ServerConfig.h" - -TEST(ServerConfigTest, parse_invalid_devices) { - auto collections = milvus::ParseGPUDevices("gpu0,gpu1"); - ASSERT_EQ(collections.size(), 0); -} diff --git a/proxy/src/db/CMakeLists.txt b/proxy/src/db/CMakeLists.txt deleted file mode 100644 index 432cad577a..0000000000 --- a/proxy/src/db/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. -#------------------------------------------------------------------------------- - -# **************************** Engine Source Files **************************** -aux_source_directory( ${MILVUS_ENGINE_SRC}/db DB_MAIN_FILES ) - -set( ENGINE_FILES ${DB_MAIN_FILES}) - -# **************************** Add Target milvus engine **************************** -add_library( milvus_engine STATIC) -target_sources( milvus_engine PRIVATE ${ENGINE_FILES}) diff --git a/proxy/src/db/Constants.h b/proxy/src/db/Constants.h deleted file mode 100644 index 30d72f359a..0000000000 --- a/proxy/src/db/Constants.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include - -namespace milvus { -namespace engine { - -constexpr int64_t KB = 1LL << 10; -constexpr int64_t MB = 1LL << 20; -constexpr int64_t GB = 1LL << 30; -constexpr int64_t TB = 1LL << 40; - -constexpr int64_t MAX_TABLE_FILE_MEM = 128 * MB; - -constexpr int64_t MAX_NAME_LENGTH = 255; -constexpr int64_t MAX_DIMENSION = 32768; -constexpr int32_t MAX_SEGMENT_ROW_COUNT = 4 * 1024 * 1024; -constexpr int64_t DEFAULT_SEGMENT_ROW_COUNT = 100000; // default row count per segment when creating collection -constexpr int64_t MAX_INSERT_DATA_SIZE = 256 * MB; - -} // namespace engine -} // namespace milvus diff --git a/proxy/src/db/Types.cpp b/proxy/src/db/Types.cpp deleted file mode 100644 index b4ec1d7e91..0000000000 --- a/proxy/src/db/Types.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "db/Types.h" -// #include "knowhere/index/vector_index/helpers/IndexParameter.h" - -namespace milvus { -namespace engine { - -const char* FIELD_UID = "_id"; - -const char* ELEMENT_RAW_DATA = "_raw"; -const char* ELEMENT_BLOOM_FILTER = "_blf"; -const char* ELEMENT_DELETED_DOCS = "_del"; -const char* ELEMENT_INDEX_COMPRESS = "_compress"; - -const char* PARAM_UID_AUTOGEN = "auto_id"; -// const char* PARAM_DIMENSION = knowhere::meta::DIM; -const char* PARAM_INDEX_TYPE = "index_type"; -// const char* PARAM_INDEX_METRIC_TYPE = knowhere::Metric::TYPE; -const char* PARAM_INDEX_EXTRA_PARAMS = "params"; -const char* PARAM_SEGMENT_ROW_COUNT = "segment_row_count"; - -const char* DEFAULT_STRUCTURED_INDEX = "SORTED"; // this string should be defined in knowhere::IndexEnum -const char* DEFAULT_PARTITON_TAG = "_default"; - -} // namespace engine -} // namespace milvus diff --git a/proxy/src/db/Types.h b/proxy/src/db/Types.h deleted file mode 100644 index 65691f0d8d..0000000000 --- a/proxy/src/db/Types.h +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -// #include - -#include -#include -#include -#include -#include -#include -#include -#include - -// #include "cache/DataObj.h" -#include "db/Constants.h" -// #include "knowhere/index/vector_index/VecIndex.h" -#include "utils/Json.h" - -namespace milvus { -namespace engine { - -extern const char* FIELD_UID; - -extern const char* ELEMENT_RAW_DATA; -extern const char* ELEMENT_BLOOM_FILTER; -extern const char* ELEMENT_DELETED_DOCS; -extern const char* ELEMENT_INDEX_COMPRESS; - -extern const char* PARAM_UID_AUTOGEN; -extern const char* PARAM_DIMENSION; -extern const char* PARAM_INDEX_TYPE; -extern const char* PARAM_INDEX_METRIC_TYPE; -extern const char* PARAM_INDEX_EXTRA_PARAMS; -extern const char* PARAM_SEGMENT_ROW_COUNT; - -extern const char* DEFAULT_STRUCTURED_INDEX; -extern const char* DEFAULT_PARTITON_TAG; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -using id_t = int64_t; -using offset_t = int32_t; -using date_t = int32_t; - -using IDNumbers = std::vector; - -// using VectorDistance = faiss::Index::distance_t; -using VectorDistance = float; -using VectorDistances = std::vector; - -// using ResultIds = std::vector; -using ResultIds = std::vector; -using ResultDistances = std::vector; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -enum class DataType { - NONE = 0, - BOOL = 1, - INT8 = 2, - INT16 = 3, - INT32 = 4, - INT64 = 5, - - FLOAT = 10, - DOUBLE = 11, - - STRING = 20, - - VECTOR_BINARY = 100, - VECTOR_FLOAT = 101, -}; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -enum class FieldElementType { - FET_NONE = 0, - FET_RAW = 1, - FET_BLOOM_FILTER = 2, - FET_DELETED_DOCS = 3, - FET_INDEX = 4, - FET_COMPRESS_SQ8 = 5, -}; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// class BinaryData : public cache::DataObj { -// public: -// int64_t -// Size() { -// return data_.size(); -// } - -// public: -// std::vector data_; -// }; -// using BinaryDataPtr = std::shared_ptr; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// class VaribleData : public cache::DataObj { -// public: -// int64_t -// Size() { -// return data_.size() + offset_.size() * sizeof(int64_t); -// } - -// public: -// std::vector data_; -// std::vector offset_; -// }; -// using VaribleDataPtr = std::shared_ptr; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// using FIELD_TYPE_MAP = std::unordered_map; -// using FIELD_WIDTH_MAP = std::unordered_map; -// using FIXEDX_FIELD_MAP = std::unordered_map; -// using VARIABLE_FIELD_MAP = std::unordered_map; -// using VECTOR_INDEX_MAP = std::unordered_map; -// using STRUCTURED_INDEX_MAP = std::unordered_map; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -struct DataChunk { - int64_t count_ = 0; - // FIXEDX_FIELD_MAP fixed_fields_; - // VARIABLE_FIELD_MAP variable_fields_; -}; -using DataChunkPtr = std::shared_ptr; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -struct CollectionIndex { - std::string index_name_; - std::string index_type_; - std::string metric_name_; - milvus::json extra_params_ = {{"nlist", 2048}}; -}; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -struct VectorsData { - uint64_t vector_count_ = 0; - std::vector float_data_; - std::vector binary_data_; - IDNumbers id_array_; -}; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -struct AttrsData { - uint64_t attr_count_ = 0; - std::unordered_map attr_type_; - std::unordered_map> attr_data_; - IDNumbers id_array_; -}; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -struct QueryResult { - uint64_t row_num_; - engine::ResultIds result_ids_; - engine::ResultDistances result_distances_; - engine::DataChunkPtr data_chunk_; -}; -using QueryResultPtr = std::shared_ptr; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -struct DBMetaOptions { - std::string path_; - std::string backend_uri_; -}; // DBMetaOptions - -/////////////////////////////////////////////////////////////////////////////////////////////////// -struct DBOptions { - typedef enum { SINGLE = 0, CLUSTER_READONLY, CLUSTER_WRITABLE } MODE; - - DBMetaOptions meta_; - int mode_ = MODE::SINGLE; - - size_t insert_buffer_size_ = 4 * GB; - bool insert_cache_immediately_ = false; - - int64_t auto_flush_interval_ = 1; - - bool metric_enable_ = false; - - // wal relative configurations - bool wal_enable_ = false; - int64_t buffer_size_ = 256; - std::string mxlog_path_ = "/tmp/milvus/wal/"; - - // transcript configurations - bool transcript_enable_ = false; - std::string replay_script_path_; // for replay -}; // Options - -} // namespace engine -} // namespace milvus diff --git a/proxy/src/grpc/etcd.grpc.pb.cc b/proxy/src/grpc/etcd.grpc.pb.cc deleted file mode 100644 index c4aaef0efa..0000000000 --- a/proxy/src/grpc/etcd.grpc.pb.cc +++ /dev/null @@ -1,131 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: etcd.proto - -#include "etcd.pb.h" -#include "etcd.grpc.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -namespace etcdserverpb { - -static const char* Watch_method_names[] = { - "/etcdserverpb.Watch/Watch", -}; - -std::unique_ptr< Watch::Stub> Watch::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { - (void)options; - std::unique_ptr< Watch::Stub> stub(new Watch::Stub(channel)); - return stub; -} - -Watch::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) - : channel_(channel), rpcmethod_Watch_(Watch_method_names[0], ::grpc::internal::RpcMethod::BIDI_STREAMING, channel) - {} - -::grpc::ClientReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* Watch::Stub::WatchRaw(::grpc::ClientContext* context) { - return ::grpc_impl::internal::ClientReaderWriterFactory< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>::Create(channel_.get(), rpcmethod_Watch_, context); -} - -void Watch::Stub::experimental_async::Watch(::grpc::ClientContext* context, ::grpc::experimental::ClientBidiReactor< ::etcdserverpb::WatchRequest,::etcdserverpb::WatchResponse>* reactor) { - ::grpc_impl::internal::ClientCallbackReaderWriterFactory< ::etcdserverpb::WatchRequest,::etcdserverpb::WatchResponse>::Create(stub_->channel_.get(), stub_->rpcmethod_Watch_, context, reactor); -} - -::grpc::ClientAsyncReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* Watch::Stub::AsyncWatchRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { - return ::grpc_impl::internal::ClientAsyncReaderWriterFactory< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>::Create(channel_.get(), cq, rpcmethod_Watch_, context, true, tag); -} - -::grpc::ClientAsyncReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* Watch::Stub::PrepareAsyncWatchRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncReaderWriterFactory< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>::Create(channel_.get(), cq, rpcmethod_Watch_, context, false, nullptr); -} - -Watch::Service::Service() { - AddMethod(new ::grpc::internal::RpcServiceMethod( - Watch_method_names[0], - ::grpc::internal::RpcMethod::BIDI_STREAMING, - new ::grpc::internal::BidiStreamingHandler< Watch::Service, ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>( - std::mem_fn(&Watch::Service::Watch), this))); -} - -Watch::Service::~Service() { -} - -::grpc::Status Watch::Service::Watch(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::etcdserverpb::WatchResponse, ::etcdserverpb::WatchRequest>* stream) { - (void) context; - (void) stream; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - - -static const char* KV_method_names[] = { - "/etcdserverpb.KV/Range", -}; - -std::unique_ptr< KV::Stub> KV::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { - (void)options; - std::unique_ptr< KV::Stub> stub(new KV::Stub(channel)); - return stub; -} - -KV::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) - : channel_(channel), rpcmethod_Range_(KV_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - {} - -::grpc::Status KV::Stub::Range(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest& request, ::etcdserverpb::RangeResponse* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_Range_, context, request, response); -} - -void KV::Stub::experimental_async::Range(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest* request, ::etcdserverpb::RangeResponse* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Range_, context, request, response, std::move(f)); -} - -void KV::Stub::experimental_async::Range(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::etcdserverpb::RangeResponse* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Range_, context, request, response, std::move(f)); -} - -void KV::Stub::experimental_async::Range(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest* request, ::etcdserverpb::RangeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Range_, context, request, response, reactor); -} - -void KV::Stub::experimental_async::Range(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::etcdserverpb::RangeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Range_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::etcdserverpb::RangeResponse>* KV::Stub::AsyncRangeRaw(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::etcdserverpb::RangeResponse>::Create(channel_.get(), cq, rpcmethod_Range_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::etcdserverpb::RangeResponse>* KV::Stub::PrepareAsyncRangeRaw(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::etcdserverpb::RangeResponse>::Create(channel_.get(), cq, rpcmethod_Range_, context, request, false); -} - -KV::Service::Service() { - AddMethod(new ::grpc::internal::RpcServiceMethod( - KV_method_names[0], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< KV::Service, ::etcdserverpb::RangeRequest, ::etcdserverpb::RangeResponse>( - std::mem_fn(&KV::Service::Range), this))); -} - -KV::Service::~Service() { -} - -::grpc::Status KV::Service::Range(::grpc::ServerContext* context, const ::etcdserverpb::RangeRequest* request, ::etcdserverpb::RangeResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - - -} // namespace etcdserverpb - diff --git a/proxy/src/grpc/etcd.grpc.pb.h b/proxy/src/grpc/etcd.grpc.pb.h deleted file mode 100644 index 9634666f43..0000000000 --- a/proxy/src/grpc/etcd.grpc.pb.h +++ /dev/null @@ -1,446 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: etcd.proto -#ifndef GRPC_etcd_2eproto__INCLUDED -#define GRPC_etcd_2eproto__INCLUDED - -#include "etcd.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace grpc_impl { -class CompletionQueue; -class ServerCompletionQueue; -class ServerContext; -} // namespace grpc_impl - -namespace grpc { -namespace experimental { -template -class MessageAllocator; -} // namespace experimental -} // namespace grpc - -namespace etcdserverpb { - -class Watch final { - public: - static constexpr char const* service_full_name() { - return "etcdserverpb.Watch"; - } - class StubInterface { - public: - virtual ~StubInterface() {} - // Watch watches for events happening or that have happened. Both input and output - // are streams; the input stream is for creating and canceling watchers and the output - // stream sends events. One watch RPC can watch on multiple key ranges, streaming events - // for several watches at once. The entire event history can be watched starting from the - // last compaction revision. - std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>> Watch(::grpc::ClientContext* context) { - return std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>>(WatchRaw(context)); - } - std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>> AsyncWatch(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { - return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>>(AsyncWatchRaw(context, cq, tag)); - } - std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>> PrepareAsyncWatch(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>>(PrepareAsyncWatchRaw(context, cq)); - } - class experimental_async_interface { - public: - virtual ~experimental_async_interface() {} - // Watch watches for events happening or that have happened. Both input and output - // are streams; the input stream is for creating and canceling watchers and the output - // stream sends events. One watch RPC can watch on multiple key ranges, streaming events - // for several watches at once. The entire event history can be watched starting from the - // last compaction revision. - virtual void Watch(::grpc::ClientContext* context, ::grpc::experimental::ClientBidiReactor< ::etcdserverpb::WatchRequest,::etcdserverpb::WatchResponse>* reactor) = 0; - }; - virtual class experimental_async_interface* experimental_async() { return nullptr; } - private: - virtual ::grpc::ClientReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* WatchRaw(::grpc::ClientContext* context) = 0; - virtual ::grpc::ClientAsyncReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* AsyncWatchRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) = 0; - virtual ::grpc::ClientAsyncReaderWriterInterface< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* PrepareAsyncWatchRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) = 0; - }; - class Stub final : public StubInterface { - public: - Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); - std::unique_ptr< ::grpc::ClientReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>> Watch(::grpc::ClientContext* context) { - return std::unique_ptr< ::grpc::ClientReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>>(WatchRaw(context)); - } - std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>> AsyncWatch(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { - return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>>(AsyncWatchRaw(context, cq, tag)); - } - std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>> PrepareAsyncWatch(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>>(PrepareAsyncWatchRaw(context, cq)); - } - class experimental_async final : - public StubInterface::experimental_async_interface { - public: - void Watch(::grpc::ClientContext* context, ::grpc::experimental::ClientBidiReactor< ::etcdserverpb::WatchRequest,::etcdserverpb::WatchResponse>* reactor) override; - private: - friend class Stub; - explicit experimental_async(Stub* stub): stub_(stub) { } - Stub* stub() { return stub_; } - Stub* stub_; - }; - class experimental_async_interface* experimental_async() override { return &async_stub_; } - - private: - std::shared_ptr< ::grpc::ChannelInterface> channel_; - class experimental_async async_stub_{this}; - ::grpc::ClientReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* WatchRaw(::grpc::ClientContext* context) override; - ::grpc::ClientAsyncReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* AsyncWatchRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) override; - ::grpc::ClientAsyncReaderWriter< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* PrepareAsyncWatchRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) override; - const ::grpc::internal::RpcMethod rpcmethod_Watch_; - }; - 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(); - // Watch watches for events happening or that have happened. Both input and output - // are streams; the input stream is for creating and canceling watchers and the output - // stream sends events. One watch RPC can watch on multiple key ranges, streaming events - // for several watches at once. The entire event history can be watched starting from the - // last compaction revision. - virtual ::grpc::Status Watch(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::etcdserverpb::WatchResponse, ::etcdserverpb::WatchRequest>* stream); - }; - template - class WithAsyncMethod_Watch : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_Watch() { - ::grpc::Service::MarkMethodAsync(0); - } - ~WithAsyncMethod_Watch() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Watch(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::etcdserverpb::WatchResponse, ::etcdserverpb::WatchRequest>* /*stream*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestWatch(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::etcdserverpb::WatchResponse, ::etcdserverpb::WatchRequest>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncBidiStreaming(0, context, stream, new_call_cq, notification_cq, tag); - } - }; - typedef WithAsyncMethod_Watch AsyncService; - template - class ExperimentalWithCallbackMethod_Watch : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_Watch() { - ::grpc::Service::experimental().MarkMethodCallback(0, - new ::grpc_impl::internal::CallbackBidiHandler< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>( - [this] { return this->Watch(); })); - } - ~ExperimentalWithCallbackMethod_Watch() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Watch(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::etcdserverpb::WatchResponse, ::etcdserverpb::WatchRequest>* /*stream*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::experimental::ServerBidiReactor< ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>* Watch() { - return new ::grpc_impl::internal::UnimplementedBidiReactor< - ::etcdserverpb::WatchRequest, ::etcdserverpb::WatchResponse>;} - }; - typedef ExperimentalWithCallbackMethod_Watch ExperimentalCallbackService; - template - class WithGenericMethod_Watch : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_Watch() { - ::grpc::Service::MarkMethodGeneric(0); - } - ~WithGenericMethod_Watch() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Watch(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::etcdserverpb::WatchResponse, ::etcdserverpb::WatchRequest>* /*stream*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithRawMethod_Watch : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_Watch() { - ::grpc::Service::MarkMethodRaw(0); - } - ~WithRawMethod_Watch() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Watch(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::etcdserverpb::WatchResponse, ::etcdserverpb::WatchRequest>* /*stream*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestWatch(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncBidiStreaming(0, context, stream, new_call_cq, notification_cq, tag); - } - }; - template - class ExperimentalWithRawCallbackMethod_Watch : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_Watch() { - ::grpc::Service::experimental().MarkMethodRawCallback(0, - new ::grpc_impl::internal::CallbackBidiHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this] { return this->Watch(); })); - } - ~ExperimentalWithRawCallbackMethod_Watch() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Watch(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::etcdserverpb::WatchResponse, ::etcdserverpb::WatchRequest>* /*stream*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::experimental::ServerBidiReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* Watch() { - return new ::grpc_impl::internal::UnimplementedBidiReactor< - ::grpc::ByteBuffer, ::grpc::ByteBuffer>;} - }; - typedef Service StreamedUnaryService; - typedef Service SplitStreamedService; - typedef Service StreamedService; -}; - -class KV final { - public: - static constexpr char const* service_full_name() { - return "etcdserverpb.KV"; - } - class StubInterface { - public: - virtual ~StubInterface() {} - // Range gets the keys in the range from the key-value store. - virtual ::grpc::Status Range(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest& request, ::etcdserverpb::RangeResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::etcdserverpb::RangeResponse>> AsyncRange(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::etcdserverpb::RangeResponse>>(AsyncRangeRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::etcdserverpb::RangeResponse>> PrepareAsyncRange(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::etcdserverpb::RangeResponse>>(PrepareAsyncRangeRaw(context, request, cq)); - } - class experimental_async_interface { - public: - virtual ~experimental_async_interface() {} - // Range gets the keys in the range from the key-value store. - virtual void Range(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest* request, ::etcdserverpb::RangeResponse* response, std::function) = 0; - virtual void Range(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::etcdserverpb::RangeResponse* response, std::function) = 0; - virtual void Range(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest* request, ::etcdserverpb::RangeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void Range(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::etcdserverpb::RangeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - }; - virtual class experimental_async_interface* experimental_async() { return nullptr; } - private: - virtual ::grpc::ClientAsyncResponseReaderInterface< ::etcdserverpb::RangeResponse>* AsyncRangeRaw(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::etcdserverpb::RangeResponse>* PrepareAsyncRangeRaw(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest& request, ::grpc::CompletionQueue* cq) = 0; - }; - class Stub final : public StubInterface { - public: - Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); - ::grpc::Status Range(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest& request, ::etcdserverpb::RangeResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::etcdserverpb::RangeResponse>> AsyncRange(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::etcdserverpb::RangeResponse>>(AsyncRangeRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::etcdserverpb::RangeResponse>> PrepareAsyncRange(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::etcdserverpb::RangeResponse>>(PrepareAsyncRangeRaw(context, request, cq)); - } - class experimental_async final : - public StubInterface::experimental_async_interface { - public: - void Range(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest* request, ::etcdserverpb::RangeResponse* response, std::function) override; - void Range(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::etcdserverpb::RangeResponse* response, std::function) override; - void Range(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest* request, ::etcdserverpb::RangeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void Range(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::etcdserverpb::RangeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - private: - friend class Stub; - explicit experimental_async(Stub* stub): stub_(stub) { } - Stub* stub() { return stub_; } - Stub* stub_; - }; - class experimental_async_interface* experimental_async() override { return &async_stub_; } - - private: - std::shared_ptr< ::grpc::ChannelInterface> channel_; - class experimental_async async_stub_{this}; - ::grpc::ClientAsyncResponseReader< ::etcdserverpb::RangeResponse>* AsyncRangeRaw(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::etcdserverpb::RangeResponse>* PrepareAsyncRangeRaw(::grpc::ClientContext* context, const ::etcdserverpb::RangeRequest& request, ::grpc::CompletionQueue* cq) override; - const ::grpc::internal::RpcMethod rpcmethod_Range_; - }; - 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(); - // Range gets the keys in the range from the key-value store. - virtual ::grpc::Status Range(::grpc::ServerContext* context, const ::etcdserverpb::RangeRequest* request, ::etcdserverpb::RangeResponse* response); - }; - template - class WithAsyncMethod_Range : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_Range() { - ::grpc::Service::MarkMethodAsync(0); - } - ~WithAsyncMethod_Range() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Range(::grpc::ServerContext* /*context*/, const ::etcdserverpb::RangeRequest* /*request*/, ::etcdserverpb::RangeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRange(::grpc::ServerContext* context, ::etcdserverpb::RangeRequest* request, ::grpc::ServerAsyncResponseWriter< ::etcdserverpb::RangeResponse>* 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); - } - }; - typedef WithAsyncMethod_Range AsyncService; - template - class ExperimentalWithCallbackMethod_Range : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_Range() { - ::grpc::Service::experimental().MarkMethodCallback(0, - new ::grpc_impl::internal::CallbackUnaryHandler< ::etcdserverpb::RangeRequest, ::etcdserverpb::RangeResponse>( - [this](::grpc::ServerContext* context, - const ::etcdserverpb::RangeRequest* request, - ::etcdserverpb::RangeResponse* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->Range(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_Range( - ::grpc::experimental::MessageAllocator< ::etcdserverpb::RangeRequest, ::etcdserverpb::RangeResponse>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::etcdserverpb::RangeRequest, ::etcdserverpb::RangeResponse>*>( - ::grpc::Service::experimental().GetHandler(0)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_Range() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Range(::grpc::ServerContext* /*context*/, const ::etcdserverpb::RangeRequest* /*request*/, ::etcdserverpb::RangeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void Range(::grpc::ServerContext* /*context*/, const ::etcdserverpb::RangeRequest* /*request*/, ::etcdserverpb::RangeResponse* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - typedef ExperimentalWithCallbackMethod_Range ExperimentalCallbackService; - template - class WithGenericMethod_Range : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_Range() { - ::grpc::Service::MarkMethodGeneric(0); - } - ~WithGenericMethod_Range() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Range(::grpc::ServerContext* /*context*/, const ::etcdserverpb::RangeRequest* /*request*/, ::etcdserverpb::RangeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithRawMethod_Range : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_Range() { - ::grpc::Service::MarkMethodRaw(0); - } - ~WithRawMethod_Range() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Range(::grpc::ServerContext* /*context*/, const ::etcdserverpb::RangeRequest* /*request*/, ::etcdserverpb::RangeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRange(::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 ExperimentalWithRawCallbackMethod_Range : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_Range() { - ::grpc::Service::experimental().MarkMethodRawCallback(0, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->Range(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_Range() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Range(::grpc::ServerContext* /*context*/, const ::etcdserverpb::RangeRequest* /*request*/, ::etcdserverpb::RangeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void Range(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class WithStreamedUnaryMethod_Range : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_Range() { - ::grpc::Service::MarkMethodStreamed(0, - new ::grpc::internal::StreamedUnaryHandler< ::etcdserverpb::RangeRequest, ::etcdserverpb::RangeResponse>(std::bind(&WithStreamedUnaryMethod_Range::StreamedRange, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_Range() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status Range(::grpc::ServerContext* /*context*/, const ::etcdserverpb::RangeRequest* /*request*/, ::etcdserverpb::RangeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedRange(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::etcdserverpb::RangeRequest,::etcdserverpb::RangeResponse>* server_unary_streamer) = 0; - }; - typedef WithStreamedUnaryMethod_Range StreamedUnaryService; - typedef Service SplitStreamedService; - typedef WithStreamedUnaryMethod_Range StreamedService; -}; - -} // namespace etcdserverpb - - -#endif // GRPC_etcd_2eproto__INCLUDED diff --git a/proxy/src/grpc/etcd.pb.cc b/proxy/src/grpc/etcd.pb.cc deleted file mode 100644 index a3cc7e3c96..0000000000 --- a/proxy/src/grpc/etcd.pb.cc +++ /dev/null @@ -1,5058 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: etcd.proto - -#include "etcd.pb.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -// @@protoc_insertion_point(includes) -#include -extern PROTOBUF_INTERNAL_EXPORT_etcd_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Event_etcd_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_etcd_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_KeyValue_etcd_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_etcd_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ResponseHeader_etcd_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_etcd_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_WatchCancelRequest_etcd_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_etcd_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_WatchCreateRequest_etcd_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_etcd_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_WatchProgressRequest_etcd_2eproto; -namespace etcdserverpb { -class RangeRequestDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _RangeRequest_default_instance_; -class RangeResponseDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _RangeResponse_default_instance_; -class WatchRequestDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; - const ::etcdserverpb::WatchCreateRequest* create_request_; - const ::etcdserverpb::WatchCancelRequest* cancel_request_; - const ::etcdserverpb::WatchProgressRequest* progress_request_; -} _WatchRequest_default_instance_; -class WatchCreateRequestDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _WatchCreateRequest_default_instance_; -class WatchCancelRequestDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _WatchCancelRequest_default_instance_; -class WatchProgressRequestDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _WatchProgressRequest_default_instance_; -class WatchResponseDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _WatchResponse_default_instance_; -class ResponseHeaderDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _ResponseHeader_default_instance_; -class KeyValueDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _KeyValue_default_instance_; -class EventDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _Event_default_instance_; -} // namespace etcdserverpb -static void InitDefaultsscc_info_Event_etcd_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::etcdserverpb::_Event_default_instance_; - new (ptr) ::etcdserverpb::Event(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::etcdserverpb::Event::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Event_etcd_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_Event_etcd_2eproto}, { - &scc_info_KeyValue_etcd_2eproto.base,}}; - -static void InitDefaultsscc_info_KeyValue_etcd_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::etcdserverpb::_KeyValue_default_instance_; - new (ptr) ::etcdserverpb::KeyValue(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::etcdserverpb::KeyValue::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_KeyValue_etcd_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_KeyValue_etcd_2eproto}, {}}; - -static void InitDefaultsscc_info_RangeRequest_etcd_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::etcdserverpb::_RangeRequest_default_instance_; - new (ptr) ::etcdserverpb::RangeRequest(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::etcdserverpb::RangeRequest::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_RangeRequest_etcd_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_RangeRequest_etcd_2eproto}, {}}; - -static void InitDefaultsscc_info_RangeResponse_etcd_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::etcdserverpb::_RangeResponse_default_instance_; - new (ptr) ::etcdserverpb::RangeResponse(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::etcdserverpb::RangeResponse::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_RangeResponse_etcd_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_RangeResponse_etcd_2eproto}, { - &scc_info_ResponseHeader_etcd_2eproto.base, - &scc_info_KeyValue_etcd_2eproto.base,}}; - -static void InitDefaultsscc_info_ResponseHeader_etcd_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::etcdserverpb::_ResponseHeader_default_instance_; - new (ptr) ::etcdserverpb::ResponseHeader(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::etcdserverpb::ResponseHeader::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ResponseHeader_etcd_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_ResponseHeader_etcd_2eproto}, {}}; - -static void InitDefaultsscc_info_WatchCancelRequest_etcd_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::etcdserverpb::_WatchCancelRequest_default_instance_; - new (ptr) ::etcdserverpb::WatchCancelRequest(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::etcdserverpb::WatchCancelRequest::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_WatchCancelRequest_etcd_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_WatchCancelRequest_etcd_2eproto}, {}}; - -static void InitDefaultsscc_info_WatchCreateRequest_etcd_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::etcdserverpb::_WatchCreateRequest_default_instance_; - new (ptr) ::etcdserverpb::WatchCreateRequest(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::etcdserverpb::WatchCreateRequest::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_WatchCreateRequest_etcd_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_WatchCreateRequest_etcd_2eproto}, {}}; - -static void InitDefaultsscc_info_WatchProgressRequest_etcd_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::etcdserverpb::_WatchProgressRequest_default_instance_; - new (ptr) ::etcdserverpb::WatchProgressRequest(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::etcdserverpb::WatchProgressRequest::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_WatchProgressRequest_etcd_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_WatchProgressRequest_etcd_2eproto}, {}}; - -static void InitDefaultsscc_info_WatchRequest_etcd_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::etcdserverpb::_WatchRequest_default_instance_; - new (ptr) ::etcdserverpb::WatchRequest(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::etcdserverpb::WatchRequest::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_WatchRequest_etcd_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsscc_info_WatchRequest_etcd_2eproto}, { - &scc_info_WatchCreateRequest_etcd_2eproto.base, - &scc_info_WatchCancelRequest_etcd_2eproto.base, - &scc_info_WatchProgressRequest_etcd_2eproto.base,}}; - -static void InitDefaultsscc_info_WatchResponse_etcd_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::etcdserverpb::_WatchResponse_default_instance_; - new (ptr) ::etcdserverpb::WatchResponse(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::etcdserverpb::WatchResponse::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_WatchResponse_etcd_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_WatchResponse_etcd_2eproto}, { - &scc_info_ResponseHeader_etcd_2eproto.base, - &scc_info_Event_etcd_2eproto.base,}}; - -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_etcd_2eproto[10]; -static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_etcd_2eproto[4]; -static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_etcd_2eproto = nullptr; - -const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_etcd_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeRequest, key_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeRequest, range_end_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeRequest, limit_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeRequest, revision_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeRequest, sort_order_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeRequest, sort_target_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeRequest, serializable_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeRequest, keys_only_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeRequest, count_only_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeRequest, min_mod_revision_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeRequest, max_mod_revision_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeRequest, min_create_revision_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeRequest, max_create_revision_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeResponse, header_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeResponse, kvs_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeResponse, more_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::RangeResponse, count_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchRequest, _internal_metadata_), - ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchRequest, _oneof_case_[0]), - ~0u, // no _weak_field_map_ - offsetof(::etcdserverpb::WatchRequestDefaultTypeInternal, create_request_), - offsetof(::etcdserverpb::WatchRequestDefaultTypeInternal, cancel_request_), - offsetof(::etcdserverpb::WatchRequestDefaultTypeInternal, progress_request_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchRequest, request_union_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, key_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, range_end_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, start_revision_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, progress_notify_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, filters_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, prev_kv_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, watch_id_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCreateRequest, fragment_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCancelRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchCancelRequest, watch_id_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchProgressRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, header_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, watch_id_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, created_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, canceled_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, compact_revision_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, cancel_reason_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, fragment_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::WatchResponse, events_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::ResponseHeader, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::ResponseHeader, cluster_id_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::ResponseHeader, member_id_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::ResponseHeader, revision_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::ResponseHeader, raft_term_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::KeyValue, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::KeyValue, key_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::KeyValue, create_revision_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::KeyValue, mod_revision_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::KeyValue, version_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::KeyValue, value_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::KeyValue, lease_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::Event, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::etcdserverpb::Event, type_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::Event, kv_), - PROTOBUF_FIELD_OFFSET(::etcdserverpb::Event, prev_kv_), -}; -static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, sizeof(::etcdserverpb::RangeRequest)}, - { 18, -1, sizeof(::etcdserverpb::RangeResponse)}, - { 27, -1, sizeof(::etcdserverpb::WatchRequest)}, - { 36, -1, sizeof(::etcdserverpb::WatchCreateRequest)}, - { 49, -1, sizeof(::etcdserverpb::WatchCancelRequest)}, - { 55, -1, sizeof(::etcdserverpb::WatchProgressRequest)}, - { 60, -1, sizeof(::etcdserverpb::WatchResponse)}, - { 73, -1, sizeof(::etcdserverpb::ResponseHeader)}, - { 82, -1, sizeof(::etcdserverpb::KeyValue)}, - { 93, -1, sizeof(::etcdserverpb::Event)}, -}; - -static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&::etcdserverpb::_RangeRequest_default_instance_), - reinterpret_cast(&::etcdserverpb::_RangeResponse_default_instance_), - reinterpret_cast(&::etcdserverpb::_WatchRequest_default_instance_), - reinterpret_cast(&::etcdserverpb::_WatchCreateRequest_default_instance_), - reinterpret_cast(&::etcdserverpb::_WatchCancelRequest_default_instance_), - reinterpret_cast(&::etcdserverpb::_WatchProgressRequest_default_instance_), - reinterpret_cast(&::etcdserverpb::_WatchResponse_default_instance_), - reinterpret_cast(&::etcdserverpb::_ResponseHeader_default_instance_), - reinterpret_cast(&::etcdserverpb::_KeyValue_default_instance_), - reinterpret_cast(&::etcdserverpb::_Event_default_instance_), -}; - -const char descriptor_table_protodef_etcd_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\netcd.proto\022\014etcdserverpb\"\344\003\n\014RangeRequ" - "est\022\013\n\003key\030\001 \001(\014\022\021\n\trange_end\030\002 \001(\014\022\r\n\005l" - "imit\030\003 \001(\003\022\020\n\010revision\030\004 \001(\003\0228\n\nsort_ord" - "er\030\005 \001(\0162$.etcdserverpb.RangeRequest.Sor" - "tOrder\022:\n\013sort_target\030\006 \001(\0162%.etcdserver" - "pb.RangeRequest.SortTarget\022\024\n\014serializab" - "le\030\007 \001(\010\022\021\n\tkeys_only\030\010 \001(\010\022\022\n\ncount_onl" - "y\030\t \001(\010\022\030\n\020min_mod_revision\030\n \001(\003\022\030\n\020max" - "_mod_revision\030\013 \001(\003\022\033\n\023min_create_revisi" - "on\030\014 \001(\003\022\033\n\023max_create_revision\030\r \001(\003\".\n" - "\tSortOrder\022\010\n\004NONE\020\000\022\n\n\006ASCEND\020\001\022\013\n\007DESC" - "END\020\002\"B\n\nSortTarget\022\007\n\003KEY\020\000\022\013\n\007VERSION\020" - "\001\022\n\n\006CREATE\020\002\022\007\n\003MOD\020\003\022\t\n\005VALUE\020\004\"\177\n\rRan" - "geResponse\022,\n\006header\030\001 \001(\0132\034.etcdserverp" - "b.ResponseHeader\022#\n\003kvs\030\002 \003(\0132\026.etcdserv" - "erpb.KeyValue\022\014\n\004more\030\003 \001(\010\022\r\n\005count\030\004 \001" - "(\003\"\327\001\n\014WatchRequest\022:\n\016create_request\030\001 " - "\001(\0132 .etcdserverpb.WatchCreateRequestH\000\022" - ":\n\016cancel_request\030\002 \001(\0132 .etcdserverpb.W" - "atchCancelRequestH\000\022>\n\020progress_request\030" - "\003 \001(\0132\".etcdserverpb.WatchProgressReques" - "tH\000B\017\n\rrequest_union\"\377\001\n\022WatchCreateRequ" - "est\022\013\n\003key\030\001 \001(\014\022\021\n\trange_end\030\002 \001(\014\022\026\n\016s" - "tart_revision\030\003 \001(\003\022\027\n\017progress_notify\030\004" - " \001(\010\022<\n\007filters\030\005 \003(\0162+.etcdserverpb.Wat" - "chCreateRequest.FilterType\022\017\n\007prev_kv\030\006 " - "\001(\010\022\020\n\010watch_id\030\007 \001(\003\022\020\n\010fragment\030\010 \001(\010\"" - "%\n\nFilterType\022\t\n\005NOPUT\020\000\022\014\n\010NODELETE\020\001\"&" - "\n\022WatchCancelRequest\022\020\n\010watch_id\030\001 \001(\003\"\026" - "\n\024WatchProgressRequest\"\332\001\n\rWatchResponse" - "\022,\n\006header\030\001 \001(\0132\034.etcdserverpb.Response" - "Header\022\020\n\010watch_id\030\002 \001(\003\022\017\n\007created\030\003 \001(" - "\010\022\020\n\010canceled\030\004 \001(\010\022\030\n\020compact_revision\030" - "\005 \001(\003\022\025\n\rcancel_reason\030\006 \001(\t\022\020\n\010fragment" - "\030\007 \001(\010\022#\n\006events\030\013 \003(\0132\023.etcdserverpb.Ev" - "ent\"\\\n\016ResponseHeader\022\022\n\ncluster_id\030\001 \001(" - "\004\022\021\n\tmember_id\030\002 \001(\004\022\020\n\010revision\030\003 \001(\003\022\021" - "\n\traft_term\030\004 \001(\004\"u\n\010KeyValue\022\013\n\003key\030\001 \001" - "(\014\022\027\n\017create_revision\030\002 \001(\003\022\024\n\014mod_revis" - "ion\030\003 \001(\003\022\017\n\007version\030\004 \001(\003\022\r\n\005value\030\005 \001(" - "\014\022\r\n\005lease\030\006 \001(\003\"\243\001\n\005Event\022+\n\004type\030\001 \001(\016" - "2\035.etcdserverpb.Event.EventType\022\"\n\002kv\030\002 " - "\001(\0132\026.etcdserverpb.KeyValue\022\'\n\007prev_kv\030\003" - " \001(\0132\026.etcdserverpb.KeyValue\" \n\tEventTyp" - "e\022\007\n\003PUT\020\000\022\n\n\006DELETE\020\0012O\n\005Watch\022F\n\005Watch" - "\022\032.etcdserverpb.WatchRequest\032\033.etcdserve" - "rpb.WatchResponse\"\000(\0010\0012H\n\002KV\022B\n\005Range\022\032" - ".etcdserverpb.RangeRequest\032\033.etcdserverp" - "b.RangeResponse\"\000b\006proto3" - ; -static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_etcd_2eproto_deps[1] = { -}; -static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_etcd_2eproto_sccs[10] = { - &scc_info_Event_etcd_2eproto.base, - &scc_info_KeyValue_etcd_2eproto.base, - &scc_info_RangeRequest_etcd_2eproto.base, - &scc_info_RangeResponse_etcd_2eproto.base, - &scc_info_ResponseHeader_etcd_2eproto.base, - &scc_info_WatchCancelRequest_etcd_2eproto.base, - &scc_info_WatchCreateRequest_etcd_2eproto.base, - &scc_info_WatchProgressRequest_etcd_2eproto.base, - &scc_info_WatchRequest_etcd_2eproto.base, - &scc_info_WatchResponse_etcd_2eproto.base, -}; -static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_etcd_2eproto_once; -static bool descriptor_table_etcd_2eproto_initialized = false; -const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_etcd_2eproto = { - &descriptor_table_etcd_2eproto_initialized, descriptor_table_protodef_etcd_2eproto, "etcd.proto", 1945, - &descriptor_table_etcd_2eproto_once, descriptor_table_etcd_2eproto_sccs, descriptor_table_etcd_2eproto_deps, 10, 0, - schemas, file_default_instances, TableStruct_etcd_2eproto::offsets, - file_level_metadata_etcd_2eproto, 10, file_level_enum_descriptors_etcd_2eproto, file_level_service_descriptors_etcd_2eproto, -}; - -// Force running AddDescriptors() at dynamic initialization time. -static bool dynamic_init_dummy_etcd_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_etcd_2eproto), true); -namespace etcdserverpb { -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* RangeRequest_SortOrder_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_etcd_2eproto); - return file_level_enum_descriptors_etcd_2eproto[0]; -} -bool RangeRequest_SortOrder_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - return true; - default: - return false; - } -} - -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) -constexpr RangeRequest_SortOrder RangeRequest::NONE; -constexpr RangeRequest_SortOrder RangeRequest::ASCEND; -constexpr RangeRequest_SortOrder RangeRequest::DESCEND; -constexpr RangeRequest_SortOrder RangeRequest::SortOrder_MIN; -constexpr RangeRequest_SortOrder RangeRequest::SortOrder_MAX; -constexpr int RangeRequest::SortOrder_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* RangeRequest_SortTarget_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_etcd_2eproto); - return file_level_enum_descriptors_etcd_2eproto[1]; -} -bool RangeRequest_SortTarget_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - case 4: - return true; - default: - return false; - } -} - -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) -constexpr RangeRequest_SortTarget RangeRequest::KEY; -constexpr RangeRequest_SortTarget RangeRequest::VERSION; -constexpr RangeRequest_SortTarget RangeRequest::CREATE; -constexpr RangeRequest_SortTarget RangeRequest::MOD; -constexpr RangeRequest_SortTarget RangeRequest::VALUE; -constexpr RangeRequest_SortTarget RangeRequest::SortTarget_MIN; -constexpr RangeRequest_SortTarget RangeRequest::SortTarget_MAX; -constexpr int RangeRequest::SortTarget_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* WatchCreateRequest_FilterType_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_etcd_2eproto); - return file_level_enum_descriptors_etcd_2eproto[2]; -} -bool WatchCreateRequest_FilterType_IsValid(int value) { - switch (value) { - case 0: - case 1: - return true; - default: - return false; - } -} - -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) -constexpr WatchCreateRequest_FilterType WatchCreateRequest::NOPUT; -constexpr WatchCreateRequest_FilterType WatchCreateRequest::NODELETE; -constexpr WatchCreateRequest_FilterType WatchCreateRequest::FilterType_MIN; -constexpr WatchCreateRequest_FilterType WatchCreateRequest::FilterType_MAX; -constexpr int WatchCreateRequest::FilterType_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Event_EventType_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_etcd_2eproto); - return file_level_enum_descriptors_etcd_2eproto[3]; -} -bool Event_EventType_IsValid(int value) { - switch (value) { - case 0: - case 1: - return true; - default: - return false; - } -} - -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) -constexpr Event_EventType Event::PUT; -constexpr Event_EventType Event::DELETE; -constexpr Event_EventType Event::EventType_MIN; -constexpr Event_EventType Event::EventType_MAX; -constexpr int Event::EventType_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) - -// =================================================================== - -void RangeRequest::InitAsDefaultInstance() { -} -class RangeRequest::_Internal { - public: -}; - -RangeRequest::RangeRequest() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:etcdserverpb.RangeRequest) -} -RangeRequest::RangeRequest(const RangeRequest& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.key().empty()) { - key_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.key_); - } - range_end_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.range_end().empty()) { - range_end_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.range_end_); - } - ::memcpy(&limit_, &from.limit_, - static_cast(reinterpret_cast(&count_only_) - - reinterpret_cast(&limit_)) + sizeof(count_only_)); - // @@protoc_insertion_point(copy_constructor:etcdserverpb.RangeRequest) -} - -void RangeRequest::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_RangeRequest_etcd_2eproto.base); - key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - range_end_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&limit_, 0, static_cast( - reinterpret_cast(&count_only_) - - reinterpret_cast(&limit_)) + sizeof(count_only_)); -} - -RangeRequest::~RangeRequest() { - // @@protoc_insertion_point(destructor:etcdserverpb.RangeRequest) - SharedDtor(); -} - -void RangeRequest::SharedDtor() { - key_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - range_end_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void RangeRequest::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const RangeRequest& RangeRequest::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RangeRequest_etcd_2eproto.base); - return *internal_default_instance(); -} - - -void RangeRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:etcdserverpb.RangeRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - key_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - range_end_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&limit_, 0, static_cast( - reinterpret_cast(&count_only_) - - reinterpret_cast(&limit_)) + sizeof(count_only_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* RangeRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // bytes key = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_key(), ptr, ctx); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bytes range_end = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_range_end(), ptr, ctx); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 limit = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - limit_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 revision = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - revision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .etcdserverpb.RangeRequest.SortOrder sort_order = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - set_sort_order(static_cast<::etcdserverpb::RangeRequest_SortOrder>(val)); - } else goto handle_unusual; - continue; - // .etcdserverpb.RangeRequest.SortTarget sort_target = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - set_sort_target(static_cast<::etcdserverpb::RangeRequest_SortTarget>(val)); - } else goto handle_unusual; - continue; - // bool serializable = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { - serializable_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool keys_only = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { - keys_only_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool count_only = 9; - case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) { - count_only_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 min_mod_revision = 10; - case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) { - min_mod_revision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 max_mod_revision = 11; - case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) { - max_mod_revision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 min_create_revision = 12; - case 12: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) { - min_create_revision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 max_create_revision = 13; - case 13: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 104)) { - max_create_revision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool RangeRequest::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:etcdserverpb.RangeRequest) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // bytes key = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( - input, this->mutable_key())); - } else { - goto handle_unusual; - } - break; - } - - // bytes range_end = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( - input, this->mutable_range_end())); - } else { - goto handle_unusual; - } - break; - } - - // int64 limit = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &limit_))); - } else { - goto handle_unusual; - } - break; - } - - // int64 revision = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &revision_))); - } else { - goto handle_unusual; - } - break; - } - - // .etcdserverpb.RangeRequest.SortOrder sort_order = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { - int value = 0; - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - set_sort_order(static_cast< ::etcdserverpb::RangeRequest_SortOrder >(value)); - } else { - goto handle_unusual; - } - break; - } - - // .etcdserverpb.RangeRequest.SortTarget sort_target = 6; - case 6: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (48 & 0xFF)) { - int value = 0; - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - set_sort_target(static_cast< ::etcdserverpb::RangeRequest_SortTarget >(value)); - } else { - goto handle_unusual; - } - break; - } - - // bool serializable = 7; - case 7: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( - input, &serializable_))); - } else { - goto handle_unusual; - } - break; - } - - // bool keys_only = 8; - case 8: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (64 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( - input, &keys_only_))); - } else { - goto handle_unusual; - } - break; - } - - // bool count_only = 9; - case 9: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (72 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( - input, &count_only_))); - } else { - goto handle_unusual; - } - break; - } - - // int64 min_mod_revision = 10; - case 10: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (80 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &min_mod_revision_))); - } else { - goto handle_unusual; - } - break; - } - - // int64 max_mod_revision = 11; - case 11: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (88 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &max_mod_revision_))); - } else { - goto handle_unusual; - } - break; - } - - // int64 min_create_revision = 12; - case 12: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (96 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &min_create_revision_))); - } else { - goto handle_unusual; - } - break; - } - - // int64 max_create_revision = 13; - case 13: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (104 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &max_create_revision_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:etcdserverpb.RangeRequest) - return true; -failure: - // @@protoc_insertion_point(parse_failure:etcdserverpb.RangeRequest) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void RangeRequest::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:etcdserverpb.RangeRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // bytes key = 1; - if (this->key().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( - 1, this->key(), output); - } - - // bytes range_end = 2; - if (this->range_end().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( - 2, this->range_end(), output); - } - - // int64 limit = 3; - if (this->limit() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->limit(), output); - } - - // int64 revision = 4; - if (this->revision() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(4, this->revision(), output); - } - - // .etcdserverpb.RangeRequest.SortOrder sort_order = 5; - if (this->sort_order() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( - 5, this->sort_order(), output); - } - - // .etcdserverpb.RangeRequest.SortTarget sort_target = 6; - if (this->sort_target() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( - 6, this->sort_target(), output); - } - - // bool serializable = 7; - if (this->serializable() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(7, this->serializable(), output); - } - - // bool keys_only = 8; - if (this->keys_only() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(8, this->keys_only(), output); - } - - // bool count_only = 9; - if (this->count_only() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(9, this->count_only(), output); - } - - // int64 min_mod_revision = 10; - if (this->min_mod_revision() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(10, this->min_mod_revision(), output); - } - - // int64 max_mod_revision = 11; - if (this->max_mod_revision() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(11, this->max_mod_revision(), output); - } - - // int64 min_create_revision = 12; - if (this->min_create_revision() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(12, this->min_create_revision(), output); - } - - // int64 max_create_revision = 13; - if (this->max_create_revision() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(13, this->max_create_revision(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:etcdserverpb.RangeRequest) -} - -::PROTOBUF_NAMESPACE_ID::uint8* RangeRequest::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.RangeRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // bytes key = 1; - if (this->key().size() > 0) { - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( - 1, this->key(), target); - } - - // bytes range_end = 2; - if (this->range_end().size() > 0) { - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( - 2, this->range_end(), target); - } - - // int64 limit = 3; - if (this->limit() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->limit(), target); - } - - // int64 revision = 4; - if (this->revision() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->revision(), target); - } - - // .etcdserverpb.RangeRequest.SortOrder sort_order = 5; - if (this->sort_order() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 5, this->sort_order(), target); - } - - // .etcdserverpb.RangeRequest.SortTarget sort_target = 6; - if (this->sort_target() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 6, this->sort_target(), target); - } - - // bool serializable = 7; - if (this->serializable() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->serializable(), target); - } - - // bool keys_only = 8; - if (this->keys_only() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(8, this->keys_only(), target); - } - - // bool count_only = 9; - if (this->count_only() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(9, this->count_only(), target); - } - - // int64 min_mod_revision = 10; - if (this->min_mod_revision() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(10, this->min_mod_revision(), target); - } - - // int64 max_mod_revision = 11; - if (this->max_mod_revision() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(11, this->max_mod_revision(), target); - } - - // int64 min_create_revision = 12; - if (this->min_create_revision() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(12, this->min_create_revision(), target); - } - - // int64 max_create_revision = 13; - if (this->max_create_revision() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(13, this->max_create_revision(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.RangeRequest) - return target; -} - -size_t RangeRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.RangeRequest) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bytes key = 1; - if (this->key().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->key()); - } - - // bytes range_end = 2; - if (this->range_end().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->range_end()); - } - - // int64 limit = 3; - if (this->limit() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->limit()); - } - - // int64 revision = 4; - if (this->revision() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->revision()); - } - - // .etcdserverpb.RangeRequest.SortOrder sort_order = 5; - if (this->sort_order() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->sort_order()); - } - - // .etcdserverpb.RangeRequest.SortTarget sort_target = 6; - if (this->sort_target() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->sort_target()); - } - - // int64 min_mod_revision = 10; - if (this->min_mod_revision() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->min_mod_revision()); - } - - // int64 max_mod_revision = 11; - if (this->max_mod_revision() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->max_mod_revision()); - } - - // int64 min_create_revision = 12; - if (this->min_create_revision() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->min_create_revision()); - } - - // int64 max_create_revision = 13; - if (this->max_create_revision() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->max_create_revision()); - } - - // bool serializable = 7; - if (this->serializable() != 0) { - total_size += 1 + 1; - } - - // bool keys_only = 8; - if (this->keys_only() != 0) { - total_size += 1 + 1; - } - - // bool count_only = 9; - if (this->count_only() != 0) { - total_size += 1 + 1; - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void RangeRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.RangeRequest) - GOOGLE_DCHECK_NE(&from, this); - const RangeRequest* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.RangeRequest) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.RangeRequest) - MergeFrom(*source); - } -} - -void RangeRequest::MergeFrom(const RangeRequest& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.RangeRequest) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.key().size() > 0) { - - key_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.key_); - } - if (from.range_end().size() > 0) { - - range_end_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.range_end_); - } - if (from.limit() != 0) { - set_limit(from.limit()); - } - if (from.revision() != 0) { - set_revision(from.revision()); - } - if (from.sort_order() != 0) { - set_sort_order(from.sort_order()); - } - if (from.sort_target() != 0) { - set_sort_target(from.sort_target()); - } - if (from.min_mod_revision() != 0) { - set_min_mod_revision(from.min_mod_revision()); - } - if (from.max_mod_revision() != 0) { - set_max_mod_revision(from.max_mod_revision()); - } - if (from.min_create_revision() != 0) { - set_min_create_revision(from.min_create_revision()); - } - if (from.max_create_revision() != 0) { - set_max_create_revision(from.max_create_revision()); - } - if (from.serializable() != 0) { - set_serializable(from.serializable()); - } - if (from.keys_only() != 0) { - set_keys_only(from.keys_only()); - } - if (from.count_only() != 0) { - set_count_only(from.count_only()); - } -} - -void RangeRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.RangeRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void RangeRequest::CopyFrom(const RangeRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.RangeRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool RangeRequest::IsInitialized() const { - return true; -} - -void RangeRequest::InternalSwap(RangeRequest* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - key_.Swap(&other->key_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - range_end_.Swap(&other->range_end_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(limit_, other->limit_); - swap(revision_, other->revision_); - swap(sort_order_, other->sort_order_); - swap(sort_target_, other->sort_target_); - swap(min_mod_revision_, other->min_mod_revision_); - swap(max_mod_revision_, other->max_mod_revision_); - swap(min_create_revision_, other->min_create_revision_); - swap(max_create_revision_, other->max_create_revision_); - swap(serializable_, other->serializable_); - swap(keys_only_, other->keys_only_); - swap(count_only_, other->count_only_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata RangeRequest::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void RangeResponse::InitAsDefaultInstance() { - ::etcdserverpb::_RangeResponse_default_instance_._instance.get_mutable()->header_ = const_cast< ::etcdserverpb::ResponseHeader*>( - ::etcdserverpb::ResponseHeader::internal_default_instance()); -} -class RangeResponse::_Internal { - public: - static const ::etcdserverpb::ResponseHeader& header(const RangeResponse* msg); -}; - -const ::etcdserverpb::ResponseHeader& -RangeResponse::_Internal::header(const RangeResponse* msg) { - return *msg->header_; -} -RangeResponse::RangeResponse() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:etcdserverpb.RangeResponse) -} -RangeResponse::RangeResponse(const RangeResponse& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - kvs_(from.kvs_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_header()) { - header_ = new ::etcdserverpb::ResponseHeader(*from.header_); - } else { - header_ = nullptr; - } - ::memcpy(&count_, &from.count_, - static_cast(reinterpret_cast(&more_) - - reinterpret_cast(&count_)) + sizeof(more_)); - // @@protoc_insertion_point(copy_constructor:etcdserverpb.RangeResponse) -} - -void RangeResponse::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_RangeResponse_etcd_2eproto.base); - ::memset(&header_, 0, static_cast( - reinterpret_cast(&more_) - - reinterpret_cast(&header_)) + sizeof(more_)); -} - -RangeResponse::~RangeResponse() { - // @@protoc_insertion_point(destructor:etcdserverpb.RangeResponse) - SharedDtor(); -} - -void RangeResponse::SharedDtor() { - if (this != internal_default_instance()) delete header_; -} - -void RangeResponse::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const RangeResponse& RangeResponse::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RangeResponse_etcd_2eproto.base); - return *internal_default_instance(); -} - - -void RangeResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:etcdserverpb.RangeResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - kvs_.Clear(); - if (GetArenaNoVirtual() == nullptr && header_ != nullptr) { - delete header_; - } - header_ = nullptr; - ::memset(&count_, 0, static_cast( - reinterpret_cast(&more_) - - reinterpret_cast(&count_)) + sizeof(more_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* RangeResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .etcdserverpb.ResponseHeader header = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_header(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .etcdserverpb.KeyValue kvs = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_kvs(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18); - } else goto handle_unusual; - continue; - // bool more = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - more_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 count = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool RangeResponse::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:etcdserverpb.RangeResponse) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .etcdserverpb.ResponseHeader header = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_header())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .etcdserverpb.KeyValue kvs = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_kvs())); - } else { - goto handle_unusual; - } - break; - } - - // bool more = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( - input, &more_))); - } else { - goto handle_unusual; - } - break; - } - - // int64 count = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &count_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:etcdserverpb.RangeResponse) - return true; -failure: - // @@protoc_insertion_point(parse_failure:etcdserverpb.RangeResponse) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void RangeResponse::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:etcdserverpb.RangeResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .etcdserverpb.ResponseHeader header = 1; - if (this->has_header()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::header(this), output); - } - - // repeated .etcdserverpb.KeyValue kvs = 2; - for (unsigned int i = 0, - n = static_cast(this->kvs_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, - this->kvs(static_cast(i)), - output); - } - - // bool more = 3; - if (this->more() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(3, this->more(), output); - } - - // int64 count = 4; - if (this->count() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(4, this->count(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:etcdserverpb.RangeResponse) -} - -::PROTOBUF_NAMESPACE_ID::uint8* RangeResponse::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.RangeResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .etcdserverpb.ResponseHeader header = 1; - if (this->has_header()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::header(this), target); - } - - // repeated .etcdserverpb.KeyValue kvs = 2; - for (unsigned int i = 0, - n = static_cast(this->kvs_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 2, this->kvs(static_cast(i)), target); - } - - // bool more = 3; - if (this->more() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->more(), target); - } - - // int64 count = 4; - if (this->count() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->count(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.RangeResponse) - return target; -} - -size_t RangeResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.RangeResponse) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .etcdserverpb.KeyValue kvs = 2; - { - unsigned int count = static_cast(this->kvs_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->kvs(static_cast(i))); - } - } - - // .etcdserverpb.ResponseHeader header = 1; - if (this->has_header()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *header_); - } - - // int64 count = 4; - if (this->count() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->count()); - } - - // bool more = 3; - if (this->more() != 0) { - total_size += 1 + 1; - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void RangeResponse::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.RangeResponse) - GOOGLE_DCHECK_NE(&from, this); - const RangeResponse* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.RangeResponse) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.RangeResponse) - MergeFrom(*source); - } -} - -void RangeResponse::MergeFrom(const RangeResponse& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.RangeResponse) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - kvs_.MergeFrom(from.kvs_); - if (from.has_header()) { - mutable_header()->::etcdserverpb::ResponseHeader::MergeFrom(from.header()); - } - if (from.count() != 0) { - set_count(from.count()); - } - if (from.more() != 0) { - set_more(from.more()); - } -} - -void RangeResponse::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.RangeResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void RangeResponse::CopyFrom(const RangeResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.RangeResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool RangeResponse::IsInitialized() const { - return true; -} - -void RangeResponse::InternalSwap(RangeResponse* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&kvs_)->InternalSwap(CastToBase(&other->kvs_)); - swap(header_, other->header_); - swap(count_, other->count_); - swap(more_, other->more_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata RangeResponse::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void WatchRequest::InitAsDefaultInstance() { - ::etcdserverpb::_WatchRequest_default_instance_.create_request_ = const_cast< ::etcdserverpb::WatchCreateRequest*>( - ::etcdserverpb::WatchCreateRequest::internal_default_instance()); - ::etcdserverpb::_WatchRequest_default_instance_.cancel_request_ = const_cast< ::etcdserverpb::WatchCancelRequest*>( - ::etcdserverpb::WatchCancelRequest::internal_default_instance()); - ::etcdserverpb::_WatchRequest_default_instance_.progress_request_ = const_cast< ::etcdserverpb::WatchProgressRequest*>( - ::etcdserverpb::WatchProgressRequest::internal_default_instance()); -} -class WatchRequest::_Internal { - public: - static const ::etcdserverpb::WatchCreateRequest& create_request(const WatchRequest* msg); - static const ::etcdserverpb::WatchCancelRequest& cancel_request(const WatchRequest* msg); - static const ::etcdserverpb::WatchProgressRequest& progress_request(const WatchRequest* msg); -}; - -const ::etcdserverpb::WatchCreateRequest& -WatchRequest::_Internal::create_request(const WatchRequest* msg) { - return *msg->request_union_.create_request_; -} -const ::etcdserverpb::WatchCancelRequest& -WatchRequest::_Internal::cancel_request(const WatchRequest* msg) { - return *msg->request_union_.cancel_request_; -} -const ::etcdserverpb::WatchProgressRequest& -WatchRequest::_Internal::progress_request(const WatchRequest* msg) { - return *msg->request_union_.progress_request_; -} -void WatchRequest::set_allocated_create_request(::etcdserverpb::WatchCreateRequest* create_request) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - clear_request_union(); - if (create_request) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - create_request = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, create_request, submessage_arena); - } - set_has_create_request(); - request_union_.create_request_ = create_request; - } - // @@protoc_insertion_point(field_set_allocated:etcdserverpb.WatchRequest.create_request) -} -void WatchRequest::set_allocated_cancel_request(::etcdserverpb::WatchCancelRequest* cancel_request) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - clear_request_union(); - if (cancel_request) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - cancel_request = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, cancel_request, submessage_arena); - } - set_has_cancel_request(); - request_union_.cancel_request_ = cancel_request; - } - // @@protoc_insertion_point(field_set_allocated:etcdserverpb.WatchRequest.cancel_request) -} -void WatchRequest::set_allocated_progress_request(::etcdserverpb::WatchProgressRequest* progress_request) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - clear_request_union(); - if (progress_request) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - progress_request = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, progress_request, submessage_arena); - } - set_has_progress_request(); - request_union_.progress_request_ = progress_request; - } - // @@protoc_insertion_point(field_set_allocated:etcdserverpb.WatchRequest.progress_request) -} -WatchRequest::WatchRequest() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:etcdserverpb.WatchRequest) -} -WatchRequest::WatchRequest(const WatchRequest& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - clear_has_request_union(); - switch (from.request_union_case()) { - case kCreateRequest: { - mutable_create_request()->::etcdserverpb::WatchCreateRequest::MergeFrom(from.create_request()); - break; - } - case kCancelRequest: { - mutable_cancel_request()->::etcdserverpb::WatchCancelRequest::MergeFrom(from.cancel_request()); - break; - } - case kProgressRequest: { - mutable_progress_request()->::etcdserverpb::WatchProgressRequest::MergeFrom(from.progress_request()); - break; - } - case REQUEST_UNION_NOT_SET: { - break; - } - } - // @@protoc_insertion_point(copy_constructor:etcdserverpb.WatchRequest) -} - -void WatchRequest::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_WatchRequest_etcd_2eproto.base); - clear_has_request_union(); -} - -WatchRequest::~WatchRequest() { - // @@protoc_insertion_point(destructor:etcdserverpb.WatchRequest) - SharedDtor(); -} - -void WatchRequest::SharedDtor() { - if (has_request_union()) { - clear_request_union(); - } -} - -void WatchRequest::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const WatchRequest& WatchRequest::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_WatchRequest_etcd_2eproto.base); - return *internal_default_instance(); -} - - -void WatchRequest::clear_request_union() { -// @@protoc_insertion_point(one_of_clear_start:etcdserverpb.WatchRequest) - switch (request_union_case()) { - case kCreateRequest: { - delete request_union_.create_request_; - break; - } - case kCancelRequest: { - delete request_union_.cancel_request_; - break; - } - case kProgressRequest: { - delete request_union_.progress_request_; - break; - } - case REQUEST_UNION_NOT_SET: { - break; - } - } - _oneof_case_[0] = REQUEST_UNION_NOT_SET; -} - - -void WatchRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:etcdserverpb.WatchRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - clear_request_union(); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* WatchRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .etcdserverpb.WatchCreateRequest create_request = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_create_request(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .etcdserverpb.WatchCancelRequest cancel_request = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(mutable_cancel_request(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .etcdserverpb.WatchProgressRequest progress_request = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ctx->ParseMessage(mutable_progress_request(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool WatchRequest::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:etcdserverpb.WatchRequest) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .etcdserverpb.WatchCreateRequest create_request = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_create_request())); - } else { - goto handle_unusual; - } - break; - } - - // .etcdserverpb.WatchCancelRequest cancel_request = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_cancel_request())); - } else { - goto handle_unusual; - } - break; - } - - // .etcdserverpb.WatchProgressRequest progress_request = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_progress_request())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:etcdserverpb.WatchRequest) - return true; -failure: - // @@protoc_insertion_point(parse_failure:etcdserverpb.WatchRequest) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void WatchRequest::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:etcdserverpb.WatchRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .etcdserverpb.WatchCreateRequest create_request = 1; - if (has_create_request()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::create_request(this), output); - } - - // .etcdserverpb.WatchCancelRequest cancel_request = 2; - if (has_cancel_request()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, _Internal::cancel_request(this), output); - } - - // .etcdserverpb.WatchProgressRequest progress_request = 3; - if (has_progress_request()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 3, _Internal::progress_request(this), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:etcdserverpb.WatchRequest) -} - -::PROTOBUF_NAMESPACE_ID::uint8* WatchRequest::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.WatchRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .etcdserverpb.WatchCreateRequest create_request = 1; - if (has_create_request()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::create_request(this), target); - } - - // .etcdserverpb.WatchCancelRequest cancel_request = 2; - if (has_cancel_request()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 2, _Internal::cancel_request(this), target); - } - - // .etcdserverpb.WatchProgressRequest progress_request = 3; - if (has_progress_request()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 3, _Internal::progress_request(this), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.WatchRequest) - return target; -} - -size_t WatchRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.WatchRequest) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - switch (request_union_case()) { - // .etcdserverpb.WatchCreateRequest create_request = 1; - case kCreateRequest: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *request_union_.create_request_); - break; - } - // .etcdserverpb.WatchCancelRequest cancel_request = 2; - case kCancelRequest: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *request_union_.cancel_request_); - break; - } - // .etcdserverpb.WatchProgressRequest progress_request = 3; - case kProgressRequest: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *request_union_.progress_request_); - break; - } - case REQUEST_UNION_NOT_SET: { - break; - } - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void WatchRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.WatchRequest) - GOOGLE_DCHECK_NE(&from, this); - const WatchRequest* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.WatchRequest) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.WatchRequest) - MergeFrom(*source); - } -} - -void WatchRequest::MergeFrom(const WatchRequest& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.WatchRequest) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - switch (from.request_union_case()) { - case kCreateRequest: { - mutable_create_request()->::etcdserverpb::WatchCreateRequest::MergeFrom(from.create_request()); - break; - } - case kCancelRequest: { - mutable_cancel_request()->::etcdserverpb::WatchCancelRequest::MergeFrom(from.cancel_request()); - break; - } - case kProgressRequest: { - mutable_progress_request()->::etcdserverpb::WatchProgressRequest::MergeFrom(from.progress_request()); - break; - } - case REQUEST_UNION_NOT_SET: { - break; - } - } -} - -void WatchRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.WatchRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void WatchRequest::CopyFrom(const WatchRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.WatchRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool WatchRequest::IsInitialized() const { - return true; -} - -void WatchRequest::InternalSwap(WatchRequest* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(request_union_, other->request_union_); - swap(_oneof_case_[0], other->_oneof_case_[0]); -} - -::PROTOBUF_NAMESPACE_ID::Metadata WatchRequest::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void WatchCreateRequest::InitAsDefaultInstance() { -} -class WatchCreateRequest::_Internal { - public: -}; - -WatchCreateRequest::WatchCreateRequest() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:etcdserverpb.WatchCreateRequest) -} -WatchCreateRequest::WatchCreateRequest(const WatchCreateRequest& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - filters_(from.filters_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.key().empty()) { - key_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.key_); - } - range_end_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.range_end().empty()) { - range_end_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.range_end_); - } - ::memcpy(&start_revision_, &from.start_revision_, - static_cast(reinterpret_cast(&fragment_) - - reinterpret_cast(&start_revision_)) + sizeof(fragment_)); - // @@protoc_insertion_point(copy_constructor:etcdserverpb.WatchCreateRequest) -} - -void WatchCreateRequest::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_WatchCreateRequest_etcd_2eproto.base); - key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - range_end_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&start_revision_, 0, static_cast( - reinterpret_cast(&fragment_) - - reinterpret_cast(&start_revision_)) + sizeof(fragment_)); -} - -WatchCreateRequest::~WatchCreateRequest() { - // @@protoc_insertion_point(destructor:etcdserverpb.WatchCreateRequest) - SharedDtor(); -} - -void WatchCreateRequest::SharedDtor() { - key_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - range_end_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void WatchCreateRequest::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const WatchCreateRequest& WatchCreateRequest::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_WatchCreateRequest_etcd_2eproto.base); - return *internal_default_instance(); -} - - -void WatchCreateRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:etcdserverpb.WatchCreateRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - filters_.Clear(); - key_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - range_end_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&start_revision_, 0, static_cast( - reinterpret_cast(&fragment_) - - reinterpret_cast(&start_revision_)) + sizeof(fragment_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* WatchCreateRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // bytes key = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_key(), ptr, ctx); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bytes range_end = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_range_end(), ptr, ctx); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 start_revision = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - start_revision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool progress_notify = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - progress_notify_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .etcdserverpb.WatchCreateRequest.FilterType filters = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(mutable_filters(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - add_filters(static_cast<::etcdserverpb::WatchCreateRequest_FilterType>(val)); - } else goto handle_unusual; - continue; - // bool prev_kv = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - prev_kv_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 watch_id = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { - watch_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool fragment = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { - fragment_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool WatchCreateRequest::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:etcdserverpb.WatchCreateRequest) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // bytes key = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( - input, this->mutable_key())); - } else { - goto handle_unusual; - } - break; - } - - // bytes range_end = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( - input, this->mutable_range_end())); - } else { - goto handle_unusual; - } - break; - } - - // int64 start_revision = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &start_revision_))); - } else { - goto handle_unusual; - } - break; - } - - // bool progress_notify = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( - input, &progress_notify_))); - } else { - goto handle_unusual; - } - break; - } - - // repeated .etcdserverpb.WatchCreateRequest.FilterType filters = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) { - ::PROTOBUF_NAMESPACE_ID::uint32 length; - DO_(input->ReadVarint32(&length)); - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream::Limit limit = input->PushLimit(static_cast(length)); - while (input->BytesUntilLimit() > 0) { - int value = 0; - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - add_filters(static_cast< ::etcdserverpb::WatchCreateRequest_FilterType >(value)); - } - input->PopLimit(limit); - } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { - int value = 0; - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - add_filters(static_cast< ::etcdserverpb::WatchCreateRequest_FilterType >(value)); - } else { - goto handle_unusual; - } - break; - } - - // bool prev_kv = 6; - case 6: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (48 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( - input, &prev_kv_))); - } else { - goto handle_unusual; - } - break; - } - - // int64 watch_id = 7; - case 7: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &watch_id_))); - } else { - goto handle_unusual; - } - break; - } - - // bool fragment = 8; - case 8: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (64 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( - input, &fragment_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:etcdserverpb.WatchCreateRequest) - return true; -failure: - // @@protoc_insertion_point(parse_failure:etcdserverpb.WatchCreateRequest) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void WatchCreateRequest::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:etcdserverpb.WatchCreateRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // bytes key = 1; - if (this->key().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( - 1, this->key(), output); - } - - // bytes range_end = 2; - if (this->range_end().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( - 2, this->range_end(), output); - } - - // int64 start_revision = 3; - if (this->start_revision() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->start_revision(), output); - } - - // bool progress_notify = 4; - if (this->progress_notify() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(4, this->progress_notify(), output); - } - - // repeated .etcdserverpb.WatchCreateRequest.FilterType filters = 5; - if (this->filters_size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag( - 5, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, - output); - output->WriteVarint32(_filters_cached_byte_size_.load( - std::memory_order_relaxed)); - } - for (int i = 0, n = this->filters_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumNoTag( - this->filters(i), output); - } - - // bool prev_kv = 6; - if (this->prev_kv() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(6, this->prev_kv(), output); - } - - // int64 watch_id = 7; - if (this->watch_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(7, this->watch_id(), output); - } - - // bool fragment = 8; - if (this->fragment() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(8, this->fragment(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:etcdserverpb.WatchCreateRequest) -} - -::PROTOBUF_NAMESPACE_ID::uint8* WatchCreateRequest::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.WatchCreateRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // bytes key = 1; - if (this->key().size() > 0) { - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( - 1, this->key(), target); - } - - // bytes range_end = 2; - if (this->range_end().size() > 0) { - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( - 2, this->range_end(), target); - } - - // int64 start_revision = 3; - if (this->start_revision() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->start_revision(), target); - } - - // bool progress_notify = 4; - if (this->progress_notify() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->progress_notify(), target); - } - - // repeated .etcdserverpb.WatchCreateRequest.FilterType filters = 5; - if (this->filters_size() > 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( - 5, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, - target); - target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( _filters_cached_byte_size_.load(std::memory_order_relaxed), - target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumNoTagToArray( - this->filters_, target); - } - - // bool prev_kv = 6; - if (this->prev_kv() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->prev_kv(), target); - } - - // int64 watch_id = 7; - if (this->watch_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(7, this->watch_id(), target); - } - - // bool fragment = 8; - if (this->fragment() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(8, this->fragment(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.WatchCreateRequest) - return target; -} - -size_t WatchCreateRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.WatchCreateRequest) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .etcdserverpb.WatchCreateRequest.FilterType filters = 5; - { - size_t data_size = 0; - unsigned int count = static_cast(this->filters_size());for (unsigned int i = 0; i < count; i++) { - data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize( - this->filters(static_cast(i))); - } - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _filters_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // bytes key = 1; - if (this->key().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->key()); - } - - // bytes range_end = 2; - if (this->range_end().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->range_end()); - } - - // int64 start_revision = 3; - if (this->start_revision() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->start_revision()); - } - - // int64 watch_id = 7; - if (this->watch_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->watch_id()); - } - - // bool progress_notify = 4; - if (this->progress_notify() != 0) { - total_size += 1 + 1; - } - - // bool prev_kv = 6; - if (this->prev_kv() != 0) { - total_size += 1 + 1; - } - - // bool fragment = 8; - if (this->fragment() != 0) { - total_size += 1 + 1; - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void WatchCreateRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.WatchCreateRequest) - GOOGLE_DCHECK_NE(&from, this); - const WatchCreateRequest* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.WatchCreateRequest) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.WatchCreateRequest) - MergeFrom(*source); - } -} - -void WatchCreateRequest::MergeFrom(const WatchCreateRequest& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.WatchCreateRequest) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - filters_.MergeFrom(from.filters_); - if (from.key().size() > 0) { - - key_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.key_); - } - if (from.range_end().size() > 0) { - - range_end_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.range_end_); - } - if (from.start_revision() != 0) { - set_start_revision(from.start_revision()); - } - if (from.watch_id() != 0) { - set_watch_id(from.watch_id()); - } - if (from.progress_notify() != 0) { - set_progress_notify(from.progress_notify()); - } - if (from.prev_kv() != 0) { - set_prev_kv(from.prev_kv()); - } - if (from.fragment() != 0) { - set_fragment(from.fragment()); - } -} - -void WatchCreateRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.WatchCreateRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void WatchCreateRequest::CopyFrom(const WatchCreateRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.WatchCreateRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool WatchCreateRequest::IsInitialized() const { - return true; -} - -void WatchCreateRequest::InternalSwap(WatchCreateRequest* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - filters_.InternalSwap(&other->filters_); - key_.Swap(&other->key_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - range_end_.Swap(&other->range_end_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(start_revision_, other->start_revision_); - swap(watch_id_, other->watch_id_); - swap(progress_notify_, other->progress_notify_); - swap(prev_kv_, other->prev_kv_); - swap(fragment_, other->fragment_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata WatchCreateRequest::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void WatchCancelRequest::InitAsDefaultInstance() { -} -class WatchCancelRequest::_Internal { - public: -}; - -WatchCancelRequest::WatchCancelRequest() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:etcdserverpb.WatchCancelRequest) -} -WatchCancelRequest::WatchCancelRequest(const WatchCancelRequest& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - watch_id_ = from.watch_id_; - // @@protoc_insertion_point(copy_constructor:etcdserverpb.WatchCancelRequest) -} - -void WatchCancelRequest::SharedCtor() { - watch_id_ = PROTOBUF_LONGLONG(0); -} - -WatchCancelRequest::~WatchCancelRequest() { - // @@protoc_insertion_point(destructor:etcdserverpb.WatchCancelRequest) - SharedDtor(); -} - -void WatchCancelRequest::SharedDtor() { -} - -void WatchCancelRequest::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const WatchCancelRequest& WatchCancelRequest::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_WatchCancelRequest_etcd_2eproto.base); - return *internal_default_instance(); -} - - -void WatchCancelRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:etcdserverpb.WatchCancelRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - watch_id_ = PROTOBUF_LONGLONG(0); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* WatchCancelRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // int64 watch_id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - watch_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool WatchCancelRequest::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:etcdserverpb.WatchCancelRequest) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // int64 watch_id = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &watch_id_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:etcdserverpb.WatchCancelRequest) - return true; -failure: - // @@protoc_insertion_point(parse_failure:etcdserverpb.WatchCancelRequest) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void WatchCancelRequest::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:etcdserverpb.WatchCancelRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // int64 watch_id = 1; - if (this->watch_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(1, this->watch_id(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:etcdserverpb.WatchCancelRequest) -} - -::PROTOBUF_NAMESPACE_ID::uint8* WatchCancelRequest::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.WatchCancelRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // int64 watch_id = 1; - if (this->watch_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->watch_id(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.WatchCancelRequest) - return target; -} - -size_t WatchCancelRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.WatchCancelRequest) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // int64 watch_id = 1; - if (this->watch_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->watch_id()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void WatchCancelRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.WatchCancelRequest) - GOOGLE_DCHECK_NE(&from, this); - const WatchCancelRequest* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.WatchCancelRequest) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.WatchCancelRequest) - MergeFrom(*source); - } -} - -void WatchCancelRequest::MergeFrom(const WatchCancelRequest& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.WatchCancelRequest) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.watch_id() != 0) { - set_watch_id(from.watch_id()); - } -} - -void WatchCancelRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.WatchCancelRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void WatchCancelRequest::CopyFrom(const WatchCancelRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.WatchCancelRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool WatchCancelRequest::IsInitialized() const { - return true; -} - -void WatchCancelRequest::InternalSwap(WatchCancelRequest* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(watch_id_, other->watch_id_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata WatchCancelRequest::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void WatchProgressRequest::InitAsDefaultInstance() { -} -class WatchProgressRequest::_Internal { - public: -}; - -WatchProgressRequest::WatchProgressRequest() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:etcdserverpb.WatchProgressRequest) -} -WatchProgressRequest::WatchProgressRequest(const WatchProgressRequest& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:etcdserverpb.WatchProgressRequest) -} - -void WatchProgressRequest::SharedCtor() { -} - -WatchProgressRequest::~WatchProgressRequest() { - // @@protoc_insertion_point(destructor:etcdserverpb.WatchProgressRequest) - SharedDtor(); -} - -void WatchProgressRequest::SharedDtor() { -} - -void WatchProgressRequest::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const WatchProgressRequest& WatchProgressRequest::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_WatchProgressRequest_etcd_2eproto.base); - return *internal_default_instance(); -} - - -void WatchProgressRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:etcdserverpb.WatchProgressRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* WatchProgressRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - default: { - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool WatchProgressRequest::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:etcdserverpb.WatchProgressRequest) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - } -success: - // @@protoc_insertion_point(parse_success:etcdserverpb.WatchProgressRequest) - return true; -failure: - // @@protoc_insertion_point(parse_failure:etcdserverpb.WatchProgressRequest) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void WatchProgressRequest::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:etcdserverpb.WatchProgressRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:etcdserverpb.WatchProgressRequest) -} - -::PROTOBUF_NAMESPACE_ID::uint8* WatchProgressRequest::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.WatchProgressRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.WatchProgressRequest) - return target; -} - -size_t WatchProgressRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.WatchProgressRequest) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void WatchProgressRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.WatchProgressRequest) - GOOGLE_DCHECK_NE(&from, this); - const WatchProgressRequest* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.WatchProgressRequest) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.WatchProgressRequest) - MergeFrom(*source); - } -} - -void WatchProgressRequest::MergeFrom(const WatchProgressRequest& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.WatchProgressRequest) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - -} - -void WatchProgressRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.WatchProgressRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void WatchProgressRequest::CopyFrom(const WatchProgressRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.WatchProgressRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool WatchProgressRequest::IsInitialized() const { - return true; -} - -void WatchProgressRequest::InternalSwap(WatchProgressRequest* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata WatchProgressRequest::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void WatchResponse::InitAsDefaultInstance() { - ::etcdserverpb::_WatchResponse_default_instance_._instance.get_mutable()->header_ = const_cast< ::etcdserverpb::ResponseHeader*>( - ::etcdserverpb::ResponseHeader::internal_default_instance()); -} -class WatchResponse::_Internal { - public: - static const ::etcdserverpb::ResponseHeader& header(const WatchResponse* msg); -}; - -const ::etcdserverpb::ResponseHeader& -WatchResponse::_Internal::header(const WatchResponse* msg) { - return *msg->header_; -} -WatchResponse::WatchResponse() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:etcdserverpb.WatchResponse) -} -WatchResponse::WatchResponse(const WatchResponse& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - events_(from.events_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - cancel_reason_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.cancel_reason().empty()) { - cancel_reason_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.cancel_reason_); - } - if (from.has_header()) { - header_ = new ::etcdserverpb::ResponseHeader(*from.header_); - } else { - header_ = nullptr; - } - ::memcpy(&watch_id_, &from.watch_id_, - static_cast(reinterpret_cast(&fragment_) - - reinterpret_cast(&watch_id_)) + sizeof(fragment_)); - // @@protoc_insertion_point(copy_constructor:etcdserverpb.WatchResponse) -} - -void WatchResponse::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_WatchResponse_etcd_2eproto.base); - cancel_reason_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&header_, 0, static_cast( - reinterpret_cast(&fragment_) - - reinterpret_cast(&header_)) + sizeof(fragment_)); -} - -WatchResponse::~WatchResponse() { - // @@protoc_insertion_point(destructor:etcdserverpb.WatchResponse) - SharedDtor(); -} - -void WatchResponse::SharedDtor() { - cancel_reason_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete header_; -} - -void WatchResponse::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const WatchResponse& WatchResponse::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_WatchResponse_etcd_2eproto.base); - return *internal_default_instance(); -} - - -void WatchResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:etcdserverpb.WatchResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - events_.Clear(); - cancel_reason_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (GetArenaNoVirtual() == nullptr && header_ != nullptr) { - delete header_; - } - header_ = nullptr; - ::memset(&watch_id_, 0, static_cast( - reinterpret_cast(&fragment_) - - reinterpret_cast(&watch_id_)) + sizeof(fragment_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* WatchResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .etcdserverpb.ResponseHeader header = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_header(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 watch_id = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - watch_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool created = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - created_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool canceled = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - canceled_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 compact_revision = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - compact_revision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string cancel_reason = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_cancel_reason(), ptr, ctx, "etcdserverpb.WatchResponse.cancel_reason"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool fragment = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { - fragment_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .etcdserverpb.Event events = 11; - case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_events(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 90); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool WatchResponse::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:etcdserverpb.WatchResponse) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .etcdserverpb.ResponseHeader header = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_header())); - } else { - goto handle_unusual; - } - break; - } - - // int64 watch_id = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &watch_id_))); - } else { - goto handle_unusual; - } - break; - } - - // bool created = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( - input, &created_))); - } else { - goto handle_unusual; - } - break; - } - - // bool canceled = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( - input, &canceled_))); - } else { - goto handle_unusual; - } - break; - } - - // int64 compact_revision = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &compact_revision_))); - } else { - goto handle_unusual; - } - break; - } - - // string cancel_reason = 6; - case 6: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_cancel_reason())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->cancel_reason().data(), static_cast(this->cancel_reason().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "etcdserverpb.WatchResponse.cancel_reason")); - } else { - goto handle_unusual; - } - break; - } - - // bool fragment = 7; - case 7: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( - input, &fragment_))); - } else { - goto handle_unusual; - } - break; - } - - // repeated .etcdserverpb.Event events = 11; - case 11: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (90 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_events())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:etcdserverpb.WatchResponse) - return true; -failure: - // @@protoc_insertion_point(parse_failure:etcdserverpb.WatchResponse) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void WatchResponse::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:etcdserverpb.WatchResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .etcdserverpb.ResponseHeader header = 1; - if (this->has_header()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::header(this), output); - } - - // int64 watch_id = 2; - if (this->watch_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(2, this->watch_id(), output); - } - - // bool created = 3; - if (this->created() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(3, this->created(), output); - } - - // bool canceled = 4; - if (this->canceled() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(4, this->canceled(), output); - } - - // int64 compact_revision = 5; - if (this->compact_revision() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(5, this->compact_revision(), output); - } - - // string cancel_reason = 6; - if (this->cancel_reason().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->cancel_reason().data(), static_cast(this->cancel_reason().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "etcdserverpb.WatchResponse.cancel_reason"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 6, this->cancel_reason(), output); - } - - // bool fragment = 7; - if (this->fragment() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(7, this->fragment(), output); - } - - // repeated .etcdserverpb.Event events = 11; - for (unsigned int i = 0, - n = static_cast(this->events_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 11, - this->events(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:etcdserverpb.WatchResponse) -} - -::PROTOBUF_NAMESPACE_ID::uint8* WatchResponse::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.WatchResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .etcdserverpb.ResponseHeader header = 1; - if (this->has_header()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::header(this), target); - } - - // int64 watch_id = 2; - if (this->watch_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->watch_id(), target); - } - - // bool created = 3; - if (this->created() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->created(), target); - } - - // bool canceled = 4; - if (this->canceled() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->canceled(), target); - } - - // int64 compact_revision = 5; - if (this->compact_revision() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(5, this->compact_revision(), target); - } - - // string cancel_reason = 6; - if (this->cancel_reason().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->cancel_reason().data(), static_cast(this->cancel_reason().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "etcdserverpb.WatchResponse.cancel_reason"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 6, this->cancel_reason(), target); - } - - // bool fragment = 7; - if (this->fragment() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->fragment(), target); - } - - // repeated .etcdserverpb.Event events = 11; - for (unsigned int i = 0, - n = static_cast(this->events_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 11, this->events(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.WatchResponse) - return target; -} - -size_t WatchResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.WatchResponse) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .etcdserverpb.Event events = 11; - { - unsigned int count = static_cast(this->events_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->events(static_cast(i))); - } - } - - // string cancel_reason = 6; - if (this->cancel_reason().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->cancel_reason()); - } - - // .etcdserverpb.ResponseHeader header = 1; - if (this->has_header()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *header_); - } - - // int64 watch_id = 2; - if (this->watch_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->watch_id()); - } - - // int64 compact_revision = 5; - if (this->compact_revision() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->compact_revision()); - } - - // bool created = 3; - if (this->created() != 0) { - total_size += 1 + 1; - } - - // bool canceled = 4; - if (this->canceled() != 0) { - total_size += 1 + 1; - } - - // bool fragment = 7; - if (this->fragment() != 0) { - total_size += 1 + 1; - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void WatchResponse::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.WatchResponse) - GOOGLE_DCHECK_NE(&from, this); - const WatchResponse* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.WatchResponse) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.WatchResponse) - MergeFrom(*source); - } -} - -void WatchResponse::MergeFrom(const WatchResponse& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.WatchResponse) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - events_.MergeFrom(from.events_); - if (from.cancel_reason().size() > 0) { - - cancel_reason_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.cancel_reason_); - } - if (from.has_header()) { - mutable_header()->::etcdserverpb::ResponseHeader::MergeFrom(from.header()); - } - if (from.watch_id() != 0) { - set_watch_id(from.watch_id()); - } - if (from.compact_revision() != 0) { - set_compact_revision(from.compact_revision()); - } - if (from.created() != 0) { - set_created(from.created()); - } - if (from.canceled() != 0) { - set_canceled(from.canceled()); - } - if (from.fragment() != 0) { - set_fragment(from.fragment()); - } -} - -void WatchResponse::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.WatchResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void WatchResponse::CopyFrom(const WatchResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.WatchResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool WatchResponse::IsInitialized() const { - return true; -} - -void WatchResponse::InternalSwap(WatchResponse* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&events_)->InternalSwap(CastToBase(&other->events_)); - cancel_reason_.Swap(&other->cancel_reason_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(header_, other->header_); - swap(watch_id_, other->watch_id_); - swap(compact_revision_, other->compact_revision_); - swap(created_, other->created_); - swap(canceled_, other->canceled_); - swap(fragment_, other->fragment_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata WatchResponse::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void ResponseHeader::InitAsDefaultInstance() { -} -class ResponseHeader::_Internal { - public: -}; - -ResponseHeader::ResponseHeader() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:etcdserverpb.ResponseHeader) -} -ResponseHeader::ResponseHeader(const ResponseHeader& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::memcpy(&cluster_id_, &from.cluster_id_, - static_cast(reinterpret_cast(&raft_term_) - - reinterpret_cast(&cluster_id_)) + sizeof(raft_term_)); - // @@protoc_insertion_point(copy_constructor:etcdserverpb.ResponseHeader) -} - -void ResponseHeader::SharedCtor() { - ::memset(&cluster_id_, 0, static_cast( - reinterpret_cast(&raft_term_) - - reinterpret_cast(&cluster_id_)) + sizeof(raft_term_)); -} - -ResponseHeader::~ResponseHeader() { - // @@protoc_insertion_point(destructor:etcdserverpb.ResponseHeader) - SharedDtor(); -} - -void ResponseHeader::SharedDtor() { -} - -void ResponseHeader::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const ResponseHeader& ResponseHeader::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ResponseHeader_etcd_2eproto.base); - return *internal_default_instance(); -} - - -void ResponseHeader::Clear() { -// @@protoc_insertion_point(message_clear_start:etcdserverpb.ResponseHeader) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&cluster_id_, 0, static_cast( - reinterpret_cast(&raft_term_) - - reinterpret_cast(&cluster_id_)) + sizeof(raft_term_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* ResponseHeader::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // uint64 cluster_id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - cluster_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 member_id = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - member_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 revision = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - revision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 raft_term = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - raft_term_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool ResponseHeader::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:etcdserverpb.ResponseHeader) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // uint64 cluster_id = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &cluster_id_))); - } else { - goto handle_unusual; - } - break; - } - - // uint64 member_id = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &member_id_))); - } else { - goto handle_unusual; - } - break; - } - - // int64 revision = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &revision_))); - } else { - goto handle_unusual; - } - break; - } - - // uint64 raft_term = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &raft_term_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:etcdserverpb.ResponseHeader) - return true; -failure: - // @@protoc_insertion_point(parse_failure:etcdserverpb.ResponseHeader) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void ResponseHeader::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:etcdserverpb.ResponseHeader) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint64 cluster_id = 1; - if (this->cluster_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(1, this->cluster_id(), output); - } - - // uint64 member_id = 2; - if (this->member_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(2, this->member_id(), output); - } - - // int64 revision = 3; - if (this->revision() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->revision(), output); - } - - // uint64 raft_term = 4; - if (this->raft_term() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(4, this->raft_term(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:etcdserverpb.ResponseHeader) -} - -::PROTOBUF_NAMESPACE_ID::uint8* ResponseHeader::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.ResponseHeader) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint64 cluster_id = 1; - if (this->cluster_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->cluster_id(), target); - } - - // uint64 member_id = 2; - if (this->member_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->member_id(), target); - } - - // int64 revision = 3; - if (this->revision() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->revision(), target); - } - - // uint64 raft_term = 4; - if (this->raft_term() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(4, this->raft_term(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.ResponseHeader) - return target; -} - -size_t ResponseHeader::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.ResponseHeader) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // uint64 cluster_id = 1; - if (this->cluster_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->cluster_id()); - } - - // uint64 member_id = 2; - if (this->member_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->member_id()); - } - - // int64 revision = 3; - if (this->revision() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->revision()); - } - - // uint64 raft_term = 4; - if (this->raft_term() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->raft_term()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void ResponseHeader::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.ResponseHeader) - GOOGLE_DCHECK_NE(&from, this); - const ResponseHeader* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.ResponseHeader) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.ResponseHeader) - MergeFrom(*source); - } -} - -void ResponseHeader::MergeFrom(const ResponseHeader& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.ResponseHeader) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.cluster_id() != 0) { - set_cluster_id(from.cluster_id()); - } - if (from.member_id() != 0) { - set_member_id(from.member_id()); - } - if (from.revision() != 0) { - set_revision(from.revision()); - } - if (from.raft_term() != 0) { - set_raft_term(from.raft_term()); - } -} - -void ResponseHeader::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.ResponseHeader) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void ResponseHeader::CopyFrom(const ResponseHeader& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.ResponseHeader) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool ResponseHeader::IsInitialized() const { - return true; -} - -void ResponseHeader::InternalSwap(ResponseHeader* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(cluster_id_, other->cluster_id_); - swap(member_id_, other->member_id_); - swap(revision_, other->revision_); - swap(raft_term_, other->raft_term_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata ResponseHeader::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void KeyValue::InitAsDefaultInstance() { -} -class KeyValue::_Internal { - public: -}; - -KeyValue::KeyValue() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:etcdserverpb.KeyValue) -} -KeyValue::KeyValue(const KeyValue& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.key().empty()) { - key_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.key_); - } - value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.value().empty()) { - value_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value_); - } - ::memcpy(&create_revision_, &from.create_revision_, - static_cast(reinterpret_cast(&lease_) - - reinterpret_cast(&create_revision_)) + sizeof(lease_)); - // @@protoc_insertion_point(copy_constructor:etcdserverpb.KeyValue) -} - -void KeyValue::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_KeyValue_etcd_2eproto.base); - key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&create_revision_, 0, static_cast( - reinterpret_cast(&lease_) - - reinterpret_cast(&create_revision_)) + sizeof(lease_)); -} - -KeyValue::~KeyValue() { - // @@protoc_insertion_point(destructor:etcdserverpb.KeyValue) - SharedDtor(); -} - -void KeyValue::SharedDtor() { - key_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void KeyValue::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const KeyValue& KeyValue::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_KeyValue_etcd_2eproto.base); - return *internal_default_instance(); -} - - -void KeyValue::Clear() { -// @@protoc_insertion_point(message_clear_start:etcdserverpb.KeyValue) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - key_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - value_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&create_revision_, 0, static_cast( - reinterpret_cast(&lease_) - - reinterpret_cast(&create_revision_)) + sizeof(lease_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* KeyValue::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // bytes key = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_key(), ptr, ctx); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 create_revision = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - create_revision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 mod_revision = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - mod_revision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 version = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bytes value = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_value(), ptr, ctx); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 lease = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - lease_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool KeyValue::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:etcdserverpb.KeyValue) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // bytes key = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( - input, this->mutable_key())); - } else { - goto handle_unusual; - } - break; - } - - // int64 create_revision = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &create_revision_))); - } else { - goto handle_unusual; - } - break; - } - - // int64 mod_revision = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &mod_revision_))); - } else { - goto handle_unusual; - } - break; - } - - // int64 version = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &version_))); - } else { - goto handle_unusual; - } - break; - } - - // bytes value = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( - input, this->mutable_value())); - } else { - goto handle_unusual; - } - break; - } - - // int64 lease = 6; - case 6: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (48 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &lease_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:etcdserverpb.KeyValue) - return true; -failure: - // @@protoc_insertion_point(parse_failure:etcdserverpb.KeyValue) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void KeyValue::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:etcdserverpb.KeyValue) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // bytes key = 1; - if (this->key().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( - 1, this->key(), output); - } - - // int64 create_revision = 2; - if (this->create_revision() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(2, this->create_revision(), output); - } - - // int64 mod_revision = 3; - if (this->mod_revision() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->mod_revision(), output); - } - - // int64 version = 4; - if (this->version() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(4, this->version(), output); - } - - // bytes value = 5; - if (this->value().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( - 5, this->value(), output); - } - - // int64 lease = 6; - if (this->lease() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(6, this->lease(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:etcdserverpb.KeyValue) -} - -::PROTOBUF_NAMESPACE_ID::uint8* KeyValue::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.KeyValue) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // bytes key = 1; - if (this->key().size() > 0) { - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( - 1, this->key(), target); - } - - // int64 create_revision = 2; - if (this->create_revision() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->create_revision(), target); - } - - // int64 mod_revision = 3; - if (this->mod_revision() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->mod_revision(), target); - } - - // int64 version = 4; - if (this->version() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->version(), target); - } - - // bytes value = 5; - if (this->value().size() > 0) { - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( - 5, this->value(), target); - } - - // int64 lease = 6; - if (this->lease() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(6, this->lease(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.KeyValue) - return target; -} - -size_t KeyValue::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.KeyValue) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bytes key = 1; - if (this->key().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->key()); - } - - // bytes value = 5; - if (this->value().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->value()); - } - - // int64 create_revision = 2; - if (this->create_revision() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->create_revision()); - } - - // int64 mod_revision = 3; - if (this->mod_revision() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->mod_revision()); - } - - // int64 version = 4; - if (this->version() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->version()); - } - - // int64 lease = 6; - if (this->lease() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->lease()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void KeyValue::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.KeyValue) - GOOGLE_DCHECK_NE(&from, this); - const KeyValue* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.KeyValue) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.KeyValue) - MergeFrom(*source); - } -} - -void KeyValue::MergeFrom(const KeyValue& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.KeyValue) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.key().size() > 0) { - - key_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.key_); - } - if (from.value().size() > 0) { - - value_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value_); - } - if (from.create_revision() != 0) { - set_create_revision(from.create_revision()); - } - if (from.mod_revision() != 0) { - set_mod_revision(from.mod_revision()); - } - if (from.version() != 0) { - set_version(from.version()); - } - if (from.lease() != 0) { - set_lease(from.lease()); - } -} - -void KeyValue::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.KeyValue) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void KeyValue::CopyFrom(const KeyValue& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.KeyValue) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool KeyValue::IsInitialized() const { - return true; -} - -void KeyValue::InternalSwap(KeyValue* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - key_.Swap(&other->key_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - value_.Swap(&other->value_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(create_revision_, other->create_revision_); - swap(mod_revision_, other->mod_revision_); - swap(version_, other->version_); - swap(lease_, other->lease_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata KeyValue::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void Event::InitAsDefaultInstance() { - ::etcdserverpb::_Event_default_instance_._instance.get_mutable()->kv_ = const_cast< ::etcdserverpb::KeyValue*>( - ::etcdserverpb::KeyValue::internal_default_instance()); - ::etcdserverpb::_Event_default_instance_._instance.get_mutable()->prev_kv_ = const_cast< ::etcdserverpb::KeyValue*>( - ::etcdserverpb::KeyValue::internal_default_instance()); -} -class Event::_Internal { - public: - static const ::etcdserverpb::KeyValue& kv(const Event* msg); - static const ::etcdserverpb::KeyValue& prev_kv(const Event* msg); -}; - -const ::etcdserverpb::KeyValue& -Event::_Internal::kv(const Event* msg) { - return *msg->kv_; -} -const ::etcdserverpb::KeyValue& -Event::_Internal::prev_kv(const Event* msg) { - return *msg->prev_kv_; -} -Event::Event() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:etcdserverpb.Event) -} -Event::Event(const Event& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_kv()) { - kv_ = new ::etcdserverpb::KeyValue(*from.kv_); - } else { - kv_ = nullptr; - } - if (from.has_prev_kv()) { - prev_kv_ = new ::etcdserverpb::KeyValue(*from.prev_kv_); - } else { - prev_kv_ = nullptr; - } - type_ = from.type_; - // @@protoc_insertion_point(copy_constructor:etcdserverpb.Event) -} - -void Event::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Event_etcd_2eproto.base); - ::memset(&kv_, 0, static_cast( - reinterpret_cast(&type_) - - reinterpret_cast(&kv_)) + sizeof(type_)); -} - -Event::~Event() { - // @@protoc_insertion_point(destructor:etcdserverpb.Event) - SharedDtor(); -} - -void Event::SharedDtor() { - if (this != internal_default_instance()) delete kv_; - if (this != internal_default_instance()) delete prev_kv_; -} - -void Event::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const Event& Event::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Event_etcd_2eproto.base); - return *internal_default_instance(); -} - - -void Event::Clear() { -// @@protoc_insertion_point(message_clear_start:etcdserverpb.Event) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - if (GetArenaNoVirtual() == nullptr && kv_ != nullptr) { - delete kv_; - } - kv_ = nullptr; - if (GetArenaNoVirtual() == nullptr && prev_kv_ != nullptr) { - delete prev_kv_; - } - prev_kv_ = nullptr; - type_ = 0; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* Event::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .etcdserverpb.Event.EventType type = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - set_type(static_cast<::etcdserverpb::Event_EventType>(val)); - } else goto handle_unusual; - continue; - // .etcdserverpb.KeyValue kv = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(mutable_kv(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .etcdserverpb.KeyValue prev_kv = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ctx->ParseMessage(mutable_prev_kv(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool Event::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:etcdserverpb.Event) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .etcdserverpb.Event.EventType type = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { - int value = 0; - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - set_type(static_cast< ::etcdserverpb::Event_EventType >(value)); - } else { - goto handle_unusual; - } - break; - } - - // .etcdserverpb.KeyValue kv = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_kv())); - } else { - goto handle_unusual; - } - break; - } - - // .etcdserverpb.KeyValue prev_kv = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_prev_kv())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:etcdserverpb.Event) - return true; -failure: - // @@protoc_insertion_point(parse_failure:etcdserverpb.Event) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void Event::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:etcdserverpb.Event) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .etcdserverpb.Event.EventType type = 1; - if (this->type() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( - 1, this->type(), output); - } - - // .etcdserverpb.KeyValue kv = 2; - if (this->has_kv()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, _Internal::kv(this), output); - } - - // .etcdserverpb.KeyValue prev_kv = 3; - if (this->has_prev_kv()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 3, _Internal::prev_kv(this), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:etcdserverpb.Event) -} - -::PROTOBUF_NAMESPACE_ID::uint8* Event::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:etcdserverpb.Event) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .etcdserverpb.Event.EventType type = 1; - if (this->type() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 1, this->type(), target); - } - - // .etcdserverpb.KeyValue kv = 2; - if (this->has_kv()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 2, _Internal::kv(this), target); - } - - // .etcdserverpb.KeyValue prev_kv = 3; - if (this->has_prev_kv()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 3, _Internal::prev_kv(this), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:etcdserverpb.Event) - return target; -} - -size_t Event::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:etcdserverpb.Event) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // .etcdserverpb.KeyValue kv = 2; - if (this->has_kv()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *kv_); - } - - // .etcdserverpb.KeyValue prev_kv = 3; - if (this->has_prev_kv()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *prev_kv_); - } - - // .etcdserverpb.Event.EventType type = 1; - if (this->type() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->type()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Event::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:etcdserverpb.Event) - GOOGLE_DCHECK_NE(&from, this); - const Event* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:etcdserverpb.Event) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:etcdserverpb.Event) - MergeFrom(*source); - } -} - -void Event::MergeFrom(const Event& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:etcdserverpb.Event) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.has_kv()) { - mutable_kv()->::etcdserverpb::KeyValue::MergeFrom(from.kv()); - } - if (from.has_prev_kv()) { - mutable_prev_kv()->::etcdserverpb::KeyValue::MergeFrom(from.prev_kv()); - } - if (from.type() != 0) { - set_type(from.type()); - } -} - -void Event::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:etcdserverpb.Event) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Event::CopyFrom(const Event& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:etcdserverpb.Event) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Event::IsInitialized() const { - return true; -} - -void Event::InternalSwap(Event* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(kv_, other->kv_); - swap(prev_kv_, other->prev_kv_); - swap(type_, other->type_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Event::GetMetadata() const { - return GetMetadataStatic(); -} - - -// @@protoc_insertion_point(namespace_scope) -} // namespace etcdserverpb -PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::etcdserverpb::RangeRequest* Arena::CreateMaybeMessage< ::etcdserverpb::RangeRequest >(Arena* arena) { - return Arena::CreateInternal< ::etcdserverpb::RangeRequest >(arena); -} -template<> PROTOBUF_NOINLINE ::etcdserverpb::RangeResponse* Arena::CreateMaybeMessage< ::etcdserverpb::RangeResponse >(Arena* arena) { - return Arena::CreateInternal< ::etcdserverpb::RangeResponse >(arena); -} -template<> PROTOBUF_NOINLINE ::etcdserverpb::WatchRequest* Arena::CreateMaybeMessage< ::etcdserverpb::WatchRequest >(Arena* arena) { - return Arena::CreateInternal< ::etcdserverpb::WatchRequest >(arena); -} -template<> PROTOBUF_NOINLINE ::etcdserverpb::WatchCreateRequest* Arena::CreateMaybeMessage< ::etcdserverpb::WatchCreateRequest >(Arena* arena) { - return Arena::CreateInternal< ::etcdserverpb::WatchCreateRequest >(arena); -} -template<> PROTOBUF_NOINLINE ::etcdserverpb::WatchCancelRequest* Arena::CreateMaybeMessage< ::etcdserverpb::WatchCancelRequest >(Arena* arena) { - return Arena::CreateInternal< ::etcdserverpb::WatchCancelRequest >(arena); -} -template<> PROTOBUF_NOINLINE ::etcdserverpb::WatchProgressRequest* Arena::CreateMaybeMessage< ::etcdserverpb::WatchProgressRequest >(Arena* arena) { - return Arena::CreateInternal< ::etcdserverpb::WatchProgressRequest >(arena); -} -template<> PROTOBUF_NOINLINE ::etcdserverpb::WatchResponse* Arena::CreateMaybeMessage< ::etcdserverpb::WatchResponse >(Arena* arena) { - return Arena::CreateInternal< ::etcdserverpb::WatchResponse >(arena); -} -template<> PROTOBUF_NOINLINE ::etcdserverpb::ResponseHeader* Arena::CreateMaybeMessage< ::etcdserverpb::ResponseHeader >(Arena* arena) { - return Arena::CreateInternal< ::etcdserverpb::ResponseHeader >(arena); -} -template<> PROTOBUF_NOINLINE ::etcdserverpb::KeyValue* Arena::CreateMaybeMessage< ::etcdserverpb::KeyValue >(Arena* arena) { - return Arena::CreateInternal< ::etcdserverpb::KeyValue >(arena); -} -template<> PROTOBUF_NOINLINE ::etcdserverpb::Event* Arena::CreateMaybeMessage< ::etcdserverpb::Event >(Arena* arena) { - return Arena::CreateInternal< ::etcdserverpb::Event >(arena); -} -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) -#include diff --git a/proxy/src/grpc/etcd.pb.h b/proxy/src/grpc/etcd.pb.h deleted file mode 100644 index eba865a348..0000000000 --- a/proxy/src/grpc/etcd.pb.h +++ /dev/null @@ -1,3370 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: etcd.proto - -#ifndef GOOGLE_PROTOBUF_INCLUDED_etcd_2eproto -#define GOOGLE_PROTOBUF_INCLUDED_etcd_2eproto - -#include -#include - -#include -#if PROTOBUF_VERSION < 3009000 -#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 -#if 3009000 < 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 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: export -#include // IWYU pragma: export -#include -#include -// @@protoc_insertion_point(includes) -#include -#define PROTOBUF_INTERNAL_EXPORT_etcd_2eproto -PROTOBUF_NAMESPACE_OPEN -namespace internal { -class AnyMetadata; -} // namespace internal -PROTOBUF_NAMESPACE_CLOSE - -// Internal implementation detail -- do not use these members. -struct TableStruct_etcd_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[10] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; - static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; -}; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_etcd_2eproto; -namespace etcdserverpb { -class Event; -class EventDefaultTypeInternal; -extern EventDefaultTypeInternal _Event_default_instance_; -class KeyValue; -class KeyValueDefaultTypeInternal; -extern KeyValueDefaultTypeInternal _KeyValue_default_instance_; -class RangeRequest; -class RangeRequestDefaultTypeInternal; -extern RangeRequestDefaultTypeInternal _RangeRequest_default_instance_; -class RangeResponse; -class RangeResponseDefaultTypeInternal; -extern RangeResponseDefaultTypeInternal _RangeResponse_default_instance_; -class ResponseHeader; -class ResponseHeaderDefaultTypeInternal; -extern ResponseHeaderDefaultTypeInternal _ResponseHeader_default_instance_; -class WatchCancelRequest; -class WatchCancelRequestDefaultTypeInternal; -extern WatchCancelRequestDefaultTypeInternal _WatchCancelRequest_default_instance_; -class WatchCreateRequest; -class WatchCreateRequestDefaultTypeInternal; -extern WatchCreateRequestDefaultTypeInternal _WatchCreateRequest_default_instance_; -class WatchProgressRequest; -class WatchProgressRequestDefaultTypeInternal; -extern WatchProgressRequestDefaultTypeInternal _WatchProgressRequest_default_instance_; -class WatchRequest; -class WatchRequestDefaultTypeInternal; -extern WatchRequestDefaultTypeInternal _WatchRequest_default_instance_; -class WatchResponse; -class WatchResponseDefaultTypeInternal; -extern WatchResponseDefaultTypeInternal _WatchResponse_default_instance_; -} // namespace etcdserverpb -PROTOBUF_NAMESPACE_OPEN -template<> ::etcdserverpb::Event* Arena::CreateMaybeMessage<::etcdserverpb::Event>(Arena*); -template<> ::etcdserverpb::KeyValue* Arena::CreateMaybeMessage<::etcdserverpb::KeyValue>(Arena*); -template<> ::etcdserverpb::RangeRequest* Arena::CreateMaybeMessage<::etcdserverpb::RangeRequest>(Arena*); -template<> ::etcdserverpb::RangeResponse* Arena::CreateMaybeMessage<::etcdserverpb::RangeResponse>(Arena*); -template<> ::etcdserverpb::ResponseHeader* Arena::CreateMaybeMessage<::etcdserverpb::ResponseHeader>(Arena*); -template<> ::etcdserverpb::WatchCancelRequest* Arena::CreateMaybeMessage<::etcdserverpb::WatchCancelRequest>(Arena*); -template<> ::etcdserverpb::WatchCreateRequest* Arena::CreateMaybeMessage<::etcdserverpb::WatchCreateRequest>(Arena*); -template<> ::etcdserverpb::WatchProgressRequest* Arena::CreateMaybeMessage<::etcdserverpb::WatchProgressRequest>(Arena*); -template<> ::etcdserverpb::WatchRequest* Arena::CreateMaybeMessage<::etcdserverpb::WatchRequest>(Arena*); -template<> ::etcdserverpb::WatchResponse* Arena::CreateMaybeMessage<::etcdserverpb::WatchResponse>(Arena*); -PROTOBUF_NAMESPACE_CLOSE -namespace etcdserverpb { - -enum RangeRequest_SortOrder : int { - RangeRequest_SortOrder_NONE = 0, - RangeRequest_SortOrder_ASCEND = 1, - RangeRequest_SortOrder_DESCEND = 2, - RangeRequest_SortOrder_RangeRequest_SortOrder_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - RangeRequest_SortOrder_RangeRequest_SortOrder_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool RangeRequest_SortOrder_IsValid(int value); -constexpr RangeRequest_SortOrder RangeRequest_SortOrder_SortOrder_MIN = RangeRequest_SortOrder_NONE; -constexpr RangeRequest_SortOrder RangeRequest_SortOrder_SortOrder_MAX = RangeRequest_SortOrder_DESCEND; -constexpr int RangeRequest_SortOrder_SortOrder_ARRAYSIZE = RangeRequest_SortOrder_SortOrder_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* RangeRequest_SortOrder_descriptor(); -template -inline const std::string& RangeRequest_SortOrder_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function RangeRequest_SortOrder_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - RangeRequest_SortOrder_descriptor(), enum_t_value); -} -inline bool RangeRequest_SortOrder_Parse( - const std::string& name, RangeRequest_SortOrder* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - RangeRequest_SortOrder_descriptor(), name, value); -} -enum RangeRequest_SortTarget : int { - RangeRequest_SortTarget_KEY = 0, - RangeRequest_SortTarget_VERSION = 1, - RangeRequest_SortTarget_CREATE = 2, - RangeRequest_SortTarget_MOD = 3, - RangeRequest_SortTarget_VALUE = 4, - RangeRequest_SortTarget_RangeRequest_SortTarget_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - RangeRequest_SortTarget_RangeRequest_SortTarget_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool RangeRequest_SortTarget_IsValid(int value); -constexpr RangeRequest_SortTarget RangeRequest_SortTarget_SortTarget_MIN = RangeRequest_SortTarget_KEY; -constexpr RangeRequest_SortTarget RangeRequest_SortTarget_SortTarget_MAX = RangeRequest_SortTarget_VALUE; -constexpr int RangeRequest_SortTarget_SortTarget_ARRAYSIZE = RangeRequest_SortTarget_SortTarget_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* RangeRequest_SortTarget_descriptor(); -template -inline const std::string& RangeRequest_SortTarget_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function RangeRequest_SortTarget_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - RangeRequest_SortTarget_descriptor(), enum_t_value); -} -inline bool RangeRequest_SortTarget_Parse( - const std::string& name, RangeRequest_SortTarget* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - RangeRequest_SortTarget_descriptor(), name, value); -} -enum WatchCreateRequest_FilterType : int { - WatchCreateRequest_FilterType_NOPUT = 0, - WatchCreateRequest_FilterType_NODELETE = 1, - WatchCreateRequest_FilterType_WatchCreateRequest_FilterType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - WatchCreateRequest_FilterType_WatchCreateRequest_FilterType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool WatchCreateRequest_FilterType_IsValid(int value); -constexpr WatchCreateRequest_FilterType WatchCreateRequest_FilterType_FilterType_MIN = WatchCreateRequest_FilterType_NOPUT; -constexpr WatchCreateRequest_FilterType WatchCreateRequest_FilterType_FilterType_MAX = WatchCreateRequest_FilterType_NODELETE; -constexpr int WatchCreateRequest_FilterType_FilterType_ARRAYSIZE = WatchCreateRequest_FilterType_FilterType_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* WatchCreateRequest_FilterType_descriptor(); -template -inline const std::string& WatchCreateRequest_FilterType_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function WatchCreateRequest_FilterType_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - WatchCreateRequest_FilterType_descriptor(), enum_t_value); -} -inline bool WatchCreateRequest_FilterType_Parse( - const std::string& name, WatchCreateRequest_FilterType* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - WatchCreateRequest_FilterType_descriptor(), name, value); -} -enum Event_EventType : int { - Event_EventType_PUT = 0, - Event_EventType_DELETE = 1, - Event_EventType_Event_EventType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - Event_EventType_Event_EventType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool Event_EventType_IsValid(int value); -constexpr Event_EventType Event_EventType_EventType_MIN = Event_EventType_PUT; -constexpr Event_EventType Event_EventType_EventType_MAX = Event_EventType_DELETE; -constexpr int Event_EventType_EventType_ARRAYSIZE = Event_EventType_EventType_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Event_EventType_descriptor(); -template -inline const std::string& Event_EventType_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Event_EventType_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - Event_EventType_descriptor(), enum_t_value); -} -inline bool Event_EventType_Parse( - const std::string& name, Event_EventType* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - Event_EventType_descriptor(), name, value); -} -// =================================================================== - -class RangeRequest : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.RangeRequest) */ { - public: - RangeRequest(); - virtual ~RangeRequest(); - - RangeRequest(const RangeRequest& from); - RangeRequest(RangeRequest&& from) noexcept - : RangeRequest() { - *this = ::std::move(from); - } - - inline RangeRequest& operator=(const RangeRequest& from) { - CopyFrom(from); - return *this; - } - inline RangeRequest& operator=(RangeRequest&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const RangeRequest& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const RangeRequest* internal_default_instance() { - return reinterpret_cast( - &_RangeRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - friend void swap(RangeRequest& a, RangeRequest& b) { - a.Swap(&b); - } - inline void Swap(RangeRequest* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline RangeRequest* New() const final { - return CreateMaybeMessage(nullptr); - } - - RangeRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const RangeRequest& from); - void MergeFrom(const RangeRequest& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(RangeRequest* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "etcdserverpb.RangeRequest"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); - return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - typedef RangeRequest_SortOrder SortOrder; - static constexpr SortOrder NONE = - RangeRequest_SortOrder_NONE; - static constexpr SortOrder ASCEND = - RangeRequest_SortOrder_ASCEND; - static constexpr SortOrder DESCEND = - RangeRequest_SortOrder_DESCEND; - static inline bool SortOrder_IsValid(int value) { - return RangeRequest_SortOrder_IsValid(value); - } - static constexpr SortOrder SortOrder_MIN = - RangeRequest_SortOrder_SortOrder_MIN; - static constexpr SortOrder SortOrder_MAX = - RangeRequest_SortOrder_SortOrder_MAX; - static constexpr int SortOrder_ARRAYSIZE = - RangeRequest_SortOrder_SortOrder_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - SortOrder_descriptor() { - return RangeRequest_SortOrder_descriptor(); - } - template - static inline const std::string& SortOrder_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function SortOrder_Name."); - return RangeRequest_SortOrder_Name(enum_t_value); - } - static inline bool SortOrder_Parse(const std::string& name, - SortOrder* value) { - return RangeRequest_SortOrder_Parse(name, value); - } - - typedef RangeRequest_SortTarget SortTarget; - static constexpr SortTarget KEY = - RangeRequest_SortTarget_KEY; - static constexpr SortTarget VERSION = - RangeRequest_SortTarget_VERSION; - static constexpr SortTarget CREATE = - RangeRequest_SortTarget_CREATE; - static constexpr SortTarget MOD = - RangeRequest_SortTarget_MOD; - static constexpr SortTarget VALUE = - RangeRequest_SortTarget_VALUE; - static inline bool SortTarget_IsValid(int value) { - return RangeRequest_SortTarget_IsValid(value); - } - static constexpr SortTarget SortTarget_MIN = - RangeRequest_SortTarget_SortTarget_MIN; - static constexpr SortTarget SortTarget_MAX = - RangeRequest_SortTarget_SortTarget_MAX; - static constexpr int SortTarget_ARRAYSIZE = - RangeRequest_SortTarget_SortTarget_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - SortTarget_descriptor() { - return RangeRequest_SortTarget_descriptor(); - } - template - static inline const std::string& SortTarget_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function SortTarget_Name."); - return RangeRequest_SortTarget_Name(enum_t_value); - } - static inline bool SortTarget_Parse(const std::string& name, - SortTarget* value) { - return RangeRequest_SortTarget_Parse(name, value); - } - - // accessors ------------------------------------------------------- - - enum : int { - kKeyFieldNumber = 1, - kRangeEndFieldNumber = 2, - kLimitFieldNumber = 3, - kRevisionFieldNumber = 4, - kSortOrderFieldNumber = 5, - kSortTargetFieldNumber = 6, - kMinModRevisionFieldNumber = 10, - kMaxModRevisionFieldNumber = 11, - kMinCreateRevisionFieldNumber = 12, - kMaxCreateRevisionFieldNumber = 13, - kSerializableFieldNumber = 7, - kKeysOnlyFieldNumber = 8, - kCountOnlyFieldNumber = 9, - }; - // bytes key = 1; - void clear_key(); - const std::string& key() const; - void set_key(const std::string& value); - void set_key(std::string&& value); - void set_key(const char* value); - void set_key(const void* value, size_t size); - std::string* mutable_key(); - std::string* release_key(); - void set_allocated_key(std::string* key); - - // bytes range_end = 2; - void clear_range_end(); - const std::string& range_end() const; - void set_range_end(const std::string& value); - void set_range_end(std::string&& value); - void set_range_end(const char* value); - void set_range_end(const void* value, size_t size); - std::string* mutable_range_end(); - std::string* release_range_end(); - void set_allocated_range_end(std::string* range_end); - - // int64 limit = 3; - void clear_limit(); - ::PROTOBUF_NAMESPACE_ID::int64 limit() const; - void set_limit(::PROTOBUF_NAMESPACE_ID::int64 value); - - // int64 revision = 4; - void clear_revision(); - ::PROTOBUF_NAMESPACE_ID::int64 revision() const; - void set_revision(::PROTOBUF_NAMESPACE_ID::int64 value); - - // .etcdserverpb.RangeRequest.SortOrder sort_order = 5; - void clear_sort_order(); - ::etcdserverpb::RangeRequest_SortOrder sort_order() const; - void set_sort_order(::etcdserverpb::RangeRequest_SortOrder value); - - // .etcdserverpb.RangeRequest.SortTarget sort_target = 6; - void clear_sort_target(); - ::etcdserverpb::RangeRequest_SortTarget sort_target() const; - void set_sort_target(::etcdserverpb::RangeRequest_SortTarget value); - - // int64 min_mod_revision = 10; - void clear_min_mod_revision(); - ::PROTOBUF_NAMESPACE_ID::int64 min_mod_revision() const; - void set_min_mod_revision(::PROTOBUF_NAMESPACE_ID::int64 value); - - // int64 max_mod_revision = 11; - void clear_max_mod_revision(); - ::PROTOBUF_NAMESPACE_ID::int64 max_mod_revision() const; - void set_max_mod_revision(::PROTOBUF_NAMESPACE_ID::int64 value); - - // int64 min_create_revision = 12; - void clear_min_create_revision(); - ::PROTOBUF_NAMESPACE_ID::int64 min_create_revision() const; - void set_min_create_revision(::PROTOBUF_NAMESPACE_ID::int64 value); - - // int64 max_create_revision = 13; - void clear_max_create_revision(); - ::PROTOBUF_NAMESPACE_ID::int64 max_create_revision() const; - void set_max_create_revision(::PROTOBUF_NAMESPACE_ID::int64 value); - - // bool serializable = 7; - void clear_serializable(); - bool serializable() const; - void set_serializable(bool value); - - // bool keys_only = 8; - void clear_keys_only(); - bool keys_only() const; - void set_keys_only(bool value); - - // bool count_only = 9; - void clear_count_only(); - bool count_only() const; - void set_count_only(bool value); - - // @@protoc_insertion_point(class_scope:etcdserverpb.RangeRequest) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr range_end_; - ::PROTOBUF_NAMESPACE_ID::int64 limit_; - ::PROTOBUF_NAMESPACE_ID::int64 revision_; - int sort_order_; - int sort_target_; - ::PROTOBUF_NAMESPACE_ID::int64 min_mod_revision_; - ::PROTOBUF_NAMESPACE_ID::int64 max_mod_revision_; - ::PROTOBUF_NAMESPACE_ID::int64 min_create_revision_; - ::PROTOBUF_NAMESPACE_ID::int64 max_create_revision_; - bool serializable_; - bool keys_only_; - bool count_only_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_etcd_2eproto; -}; -// ------------------------------------------------------------------- - -class RangeResponse : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.RangeResponse) */ { - public: - RangeResponse(); - virtual ~RangeResponse(); - - RangeResponse(const RangeResponse& from); - RangeResponse(RangeResponse&& from) noexcept - : RangeResponse() { - *this = ::std::move(from); - } - - inline RangeResponse& operator=(const RangeResponse& from) { - CopyFrom(from); - return *this; - } - inline RangeResponse& operator=(RangeResponse&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const RangeResponse& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const RangeResponse* internal_default_instance() { - return reinterpret_cast( - &_RangeResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 1; - - friend void swap(RangeResponse& a, RangeResponse& b) { - a.Swap(&b); - } - inline void Swap(RangeResponse* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline RangeResponse* New() const final { - return CreateMaybeMessage(nullptr); - } - - RangeResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const RangeResponse& from); - void MergeFrom(const RangeResponse& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(RangeResponse* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "etcdserverpb.RangeResponse"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); - return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kKvsFieldNumber = 2, - kHeaderFieldNumber = 1, - kCountFieldNumber = 4, - kMoreFieldNumber = 3, - }; - // repeated .etcdserverpb.KeyValue kvs = 2; - int kvs_size() const; - void clear_kvs(); - ::etcdserverpb::KeyValue* mutable_kvs(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::etcdserverpb::KeyValue >* - mutable_kvs(); - const ::etcdserverpb::KeyValue& kvs(int index) const; - ::etcdserverpb::KeyValue* add_kvs(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::etcdserverpb::KeyValue >& - kvs() const; - - // .etcdserverpb.ResponseHeader header = 1; - bool has_header() const; - void clear_header(); - const ::etcdserverpb::ResponseHeader& header() const; - ::etcdserverpb::ResponseHeader* release_header(); - ::etcdserverpb::ResponseHeader* mutable_header(); - void set_allocated_header(::etcdserverpb::ResponseHeader* header); - - // int64 count = 4; - void clear_count(); - ::PROTOBUF_NAMESPACE_ID::int64 count() const; - void set_count(::PROTOBUF_NAMESPACE_ID::int64 value); - - // bool more = 3; - void clear_more(); - bool more() const; - void set_more(bool value); - - // @@protoc_insertion_point(class_scope:etcdserverpb.RangeResponse) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::etcdserverpb::KeyValue > kvs_; - ::etcdserverpb::ResponseHeader* header_; - ::PROTOBUF_NAMESPACE_ID::int64 count_; - bool more_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_etcd_2eproto; -}; -// ------------------------------------------------------------------- - -class WatchRequest : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.WatchRequest) */ { - public: - WatchRequest(); - virtual ~WatchRequest(); - - WatchRequest(const WatchRequest& from); - WatchRequest(WatchRequest&& from) noexcept - : WatchRequest() { - *this = ::std::move(from); - } - - inline WatchRequest& operator=(const WatchRequest& from) { - CopyFrom(from); - return *this; - } - inline WatchRequest& operator=(WatchRequest&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const WatchRequest& default_instance(); - - enum RequestUnionCase { - kCreateRequest = 1, - kCancelRequest = 2, - kProgressRequest = 3, - REQUEST_UNION_NOT_SET = 0, - }; - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const WatchRequest* internal_default_instance() { - return reinterpret_cast( - &_WatchRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 2; - - friend void swap(WatchRequest& a, WatchRequest& b) { - a.Swap(&b); - } - inline void Swap(WatchRequest* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline WatchRequest* New() const final { - return CreateMaybeMessage(nullptr); - } - - WatchRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const WatchRequest& from); - void MergeFrom(const WatchRequest& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(WatchRequest* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "etcdserverpb.WatchRequest"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); - return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kCreateRequestFieldNumber = 1, - kCancelRequestFieldNumber = 2, - kProgressRequestFieldNumber = 3, - }; - // .etcdserverpb.WatchCreateRequest create_request = 1; - bool has_create_request() const; - void clear_create_request(); - const ::etcdserverpb::WatchCreateRequest& create_request() const; - ::etcdserverpb::WatchCreateRequest* release_create_request(); - ::etcdserverpb::WatchCreateRequest* mutable_create_request(); - void set_allocated_create_request(::etcdserverpb::WatchCreateRequest* create_request); - - // .etcdserverpb.WatchCancelRequest cancel_request = 2; - bool has_cancel_request() const; - void clear_cancel_request(); - const ::etcdserverpb::WatchCancelRequest& cancel_request() const; - ::etcdserverpb::WatchCancelRequest* release_cancel_request(); - ::etcdserverpb::WatchCancelRequest* mutable_cancel_request(); - void set_allocated_cancel_request(::etcdserverpb::WatchCancelRequest* cancel_request); - - // .etcdserverpb.WatchProgressRequest progress_request = 3; - bool has_progress_request() const; - void clear_progress_request(); - const ::etcdserverpb::WatchProgressRequest& progress_request() const; - ::etcdserverpb::WatchProgressRequest* release_progress_request(); - ::etcdserverpb::WatchProgressRequest* mutable_progress_request(); - void set_allocated_progress_request(::etcdserverpb::WatchProgressRequest* progress_request); - - void clear_request_union(); - RequestUnionCase request_union_case() const; - // @@protoc_insertion_point(class_scope:etcdserverpb.WatchRequest) - private: - class _Internal; - void set_has_create_request(); - void set_has_cancel_request(); - void set_has_progress_request(); - - inline bool has_request_union() const; - inline void clear_has_request_union(); - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - union RequestUnionUnion { - RequestUnionUnion() {} - ::etcdserverpb::WatchCreateRequest* create_request_; - ::etcdserverpb::WatchCancelRequest* cancel_request_; - ::etcdserverpb::WatchProgressRequest* progress_request_; - } request_union_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; - - friend struct ::TableStruct_etcd_2eproto; -}; -// ------------------------------------------------------------------- - -class WatchCreateRequest : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.WatchCreateRequest) */ { - public: - WatchCreateRequest(); - virtual ~WatchCreateRequest(); - - WatchCreateRequest(const WatchCreateRequest& from); - WatchCreateRequest(WatchCreateRequest&& from) noexcept - : WatchCreateRequest() { - *this = ::std::move(from); - } - - inline WatchCreateRequest& operator=(const WatchCreateRequest& from) { - CopyFrom(from); - return *this; - } - inline WatchCreateRequest& operator=(WatchCreateRequest&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const WatchCreateRequest& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const WatchCreateRequest* internal_default_instance() { - return reinterpret_cast( - &_WatchCreateRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 3; - - friend void swap(WatchCreateRequest& a, WatchCreateRequest& b) { - a.Swap(&b); - } - inline void Swap(WatchCreateRequest* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline WatchCreateRequest* New() const final { - return CreateMaybeMessage(nullptr); - } - - WatchCreateRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const WatchCreateRequest& from); - void MergeFrom(const WatchCreateRequest& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(WatchCreateRequest* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "etcdserverpb.WatchCreateRequest"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); - return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - typedef WatchCreateRequest_FilterType FilterType; - static constexpr FilterType NOPUT = - WatchCreateRequest_FilterType_NOPUT; - static constexpr FilterType NODELETE = - WatchCreateRequest_FilterType_NODELETE; - static inline bool FilterType_IsValid(int value) { - return WatchCreateRequest_FilterType_IsValid(value); - } - static constexpr FilterType FilterType_MIN = - WatchCreateRequest_FilterType_FilterType_MIN; - static constexpr FilterType FilterType_MAX = - WatchCreateRequest_FilterType_FilterType_MAX; - static constexpr int FilterType_ARRAYSIZE = - WatchCreateRequest_FilterType_FilterType_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - FilterType_descriptor() { - return WatchCreateRequest_FilterType_descriptor(); - } - template - static inline const std::string& FilterType_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function FilterType_Name."); - return WatchCreateRequest_FilterType_Name(enum_t_value); - } - static inline bool FilterType_Parse(const std::string& name, - FilterType* value) { - return WatchCreateRequest_FilterType_Parse(name, value); - } - - // accessors ------------------------------------------------------- - - enum : int { - kFiltersFieldNumber = 5, - kKeyFieldNumber = 1, - kRangeEndFieldNumber = 2, - kStartRevisionFieldNumber = 3, - kWatchIdFieldNumber = 7, - kProgressNotifyFieldNumber = 4, - kPrevKvFieldNumber = 6, - kFragmentFieldNumber = 8, - }; - // repeated .etcdserverpb.WatchCreateRequest.FilterType filters = 5; - int filters_size() const; - void clear_filters(); - ::etcdserverpb::WatchCreateRequest_FilterType filters(int index) const; - void set_filters(int index, ::etcdserverpb::WatchCreateRequest_FilterType value); - void add_filters(::etcdserverpb::WatchCreateRequest_FilterType value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField& filters() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField* mutable_filters(); - - // bytes key = 1; - void clear_key(); - const std::string& key() const; - void set_key(const std::string& value); - void set_key(std::string&& value); - void set_key(const char* value); - void set_key(const void* value, size_t size); - std::string* mutable_key(); - std::string* release_key(); - void set_allocated_key(std::string* key); - - // bytes range_end = 2; - void clear_range_end(); - const std::string& range_end() const; - void set_range_end(const std::string& value); - void set_range_end(std::string&& value); - void set_range_end(const char* value); - void set_range_end(const void* value, size_t size); - std::string* mutable_range_end(); - std::string* release_range_end(); - void set_allocated_range_end(std::string* range_end); - - // int64 start_revision = 3; - void clear_start_revision(); - ::PROTOBUF_NAMESPACE_ID::int64 start_revision() const; - void set_start_revision(::PROTOBUF_NAMESPACE_ID::int64 value); - - // int64 watch_id = 7; - void clear_watch_id(); - ::PROTOBUF_NAMESPACE_ID::int64 watch_id() const; - void set_watch_id(::PROTOBUF_NAMESPACE_ID::int64 value); - - // bool progress_notify = 4; - void clear_progress_notify(); - bool progress_notify() const; - void set_progress_notify(bool value); - - // bool prev_kv = 6; - void clear_prev_kv(); - bool prev_kv() const; - void set_prev_kv(bool value); - - // bool fragment = 8; - void clear_fragment(); - bool fragment() const; - void set_fragment(bool value); - - // @@protoc_insertion_point(class_scope:etcdserverpb.WatchCreateRequest) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField filters_; - mutable std::atomic _filters_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr range_end_; - ::PROTOBUF_NAMESPACE_ID::int64 start_revision_; - ::PROTOBUF_NAMESPACE_ID::int64 watch_id_; - bool progress_notify_; - bool prev_kv_; - bool fragment_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_etcd_2eproto; -}; -// ------------------------------------------------------------------- - -class WatchCancelRequest : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.WatchCancelRequest) */ { - public: - WatchCancelRequest(); - virtual ~WatchCancelRequest(); - - WatchCancelRequest(const WatchCancelRequest& from); - WatchCancelRequest(WatchCancelRequest&& from) noexcept - : WatchCancelRequest() { - *this = ::std::move(from); - } - - inline WatchCancelRequest& operator=(const WatchCancelRequest& from) { - CopyFrom(from); - return *this; - } - inline WatchCancelRequest& operator=(WatchCancelRequest&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const WatchCancelRequest& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const WatchCancelRequest* internal_default_instance() { - return reinterpret_cast( - &_WatchCancelRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 4; - - friend void swap(WatchCancelRequest& a, WatchCancelRequest& b) { - a.Swap(&b); - } - inline void Swap(WatchCancelRequest* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline WatchCancelRequest* New() const final { - return CreateMaybeMessage(nullptr); - } - - WatchCancelRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const WatchCancelRequest& from); - void MergeFrom(const WatchCancelRequest& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(WatchCancelRequest* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "etcdserverpb.WatchCancelRequest"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); - return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kWatchIdFieldNumber = 1, - }; - // int64 watch_id = 1; - void clear_watch_id(); - ::PROTOBUF_NAMESPACE_ID::int64 watch_id() const; - void set_watch_id(::PROTOBUF_NAMESPACE_ID::int64 value); - - // @@protoc_insertion_point(class_scope:etcdserverpb.WatchCancelRequest) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::int64 watch_id_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_etcd_2eproto; -}; -// ------------------------------------------------------------------- - -class WatchProgressRequest : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.WatchProgressRequest) */ { - public: - WatchProgressRequest(); - virtual ~WatchProgressRequest(); - - WatchProgressRequest(const WatchProgressRequest& from); - WatchProgressRequest(WatchProgressRequest&& from) noexcept - : WatchProgressRequest() { - *this = ::std::move(from); - } - - inline WatchProgressRequest& operator=(const WatchProgressRequest& from) { - CopyFrom(from); - return *this; - } - inline WatchProgressRequest& operator=(WatchProgressRequest&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const WatchProgressRequest& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const WatchProgressRequest* internal_default_instance() { - return reinterpret_cast( - &_WatchProgressRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 5; - - friend void swap(WatchProgressRequest& a, WatchProgressRequest& b) { - a.Swap(&b); - } - inline void Swap(WatchProgressRequest* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline WatchProgressRequest* New() const final { - return CreateMaybeMessage(nullptr); - } - - WatchProgressRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const WatchProgressRequest& from); - void MergeFrom(const WatchProgressRequest& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(WatchProgressRequest* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "etcdserverpb.WatchProgressRequest"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); - return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - // @@protoc_insertion_point(class_scope:etcdserverpb.WatchProgressRequest) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_etcd_2eproto; -}; -// ------------------------------------------------------------------- - -class WatchResponse : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.WatchResponse) */ { - public: - WatchResponse(); - virtual ~WatchResponse(); - - WatchResponse(const WatchResponse& from); - WatchResponse(WatchResponse&& from) noexcept - : WatchResponse() { - *this = ::std::move(from); - } - - inline WatchResponse& operator=(const WatchResponse& from) { - CopyFrom(from); - return *this; - } - inline WatchResponse& operator=(WatchResponse&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const WatchResponse& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const WatchResponse* internal_default_instance() { - return reinterpret_cast( - &_WatchResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 6; - - friend void swap(WatchResponse& a, WatchResponse& b) { - a.Swap(&b); - } - inline void Swap(WatchResponse* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline WatchResponse* New() const final { - return CreateMaybeMessage(nullptr); - } - - WatchResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const WatchResponse& from); - void MergeFrom(const WatchResponse& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(WatchResponse* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "etcdserverpb.WatchResponse"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); - return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kEventsFieldNumber = 11, - kCancelReasonFieldNumber = 6, - kHeaderFieldNumber = 1, - kWatchIdFieldNumber = 2, - kCompactRevisionFieldNumber = 5, - kCreatedFieldNumber = 3, - kCanceledFieldNumber = 4, - kFragmentFieldNumber = 7, - }; - // repeated .etcdserverpb.Event events = 11; - int events_size() const; - void clear_events(); - ::etcdserverpb::Event* mutable_events(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::etcdserverpb::Event >* - mutable_events(); - const ::etcdserverpb::Event& events(int index) const; - ::etcdserverpb::Event* add_events(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::etcdserverpb::Event >& - events() const; - - // string cancel_reason = 6; - void clear_cancel_reason(); - const std::string& cancel_reason() const; - void set_cancel_reason(const std::string& value); - void set_cancel_reason(std::string&& value); - void set_cancel_reason(const char* value); - void set_cancel_reason(const char* value, size_t size); - std::string* mutable_cancel_reason(); - std::string* release_cancel_reason(); - void set_allocated_cancel_reason(std::string* cancel_reason); - - // .etcdserverpb.ResponseHeader header = 1; - bool has_header() const; - void clear_header(); - const ::etcdserverpb::ResponseHeader& header() const; - ::etcdserverpb::ResponseHeader* release_header(); - ::etcdserverpb::ResponseHeader* mutable_header(); - void set_allocated_header(::etcdserverpb::ResponseHeader* header); - - // int64 watch_id = 2; - void clear_watch_id(); - ::PROTOBUF_NAMESPACE_ID::int64 watch_id() const; - void set_watch_id(::PROTOBUF_NAMESPACE_ID::int64 value); - - // int64 compact_revision = 5; - void clear_compact_revision(); - ::PROTOBUF_NAMESPACE_ID::int64 compact_revision() const; - void set_compact_revision(::PROTOBUF_NAMESPACE_ID::int64 value); - - // bool created = 3; - void clear_created(); - bool created() const; - void set_created(bool value); - - // bool canceled = 4; - void clear_canceled(); - bool canceled() const; - void set_canceled(bool value); - - // bool fragment = 7; - void clear_fragment(); - bool fragment() const; - void set_fragment(bool value); - - // @@protoc_insertion_point(class_scope:etcdserverpb.WatchResponse) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::etcdserverpb::Event > events_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr cancel_reason_; - ::etcdserverpb::ResponseHeader* header_; - ::PROTOBUF_NAMESPACE_ID::int64 watch_id_; - ::PROTOBUF_NAMESPACE_ID::int64 compact_revision_; - bool created_; - bool canceled_; - bool fragment_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_etcd_2eproto; -}; -// ------------------------------------------------------------------- - -class ResponseHeader : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.ResponseHeader) */ { - public: - ResponseHeader(); - virtual ~ResponseHeader(); - - ResponseHeader(const ResponseHeader& 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 (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const ResponseHeader& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const ResponseHeader* internal_default_instance() { - return reinterpret_cast( - &_ResponseHeader_default_instance_); - } - static constexpr int kIndexInFileMessages = - 7; - - friend void swap(ResponseHeader& a, ResponseHeader& b) { - a.Swap(&b); - } - inline void Swap(ResponseHeader* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline ResponseHeader* New() const final { - return CreateMaybeMessage(nullptr); - } - - ResponseHeader* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const ResponseHeader& from); - void MergeFrom(const ResponseHeader& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(ResponseHeader* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "etcdserverpb.ResponseHeader"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); - return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kClusterIdFieldNumber = 1, - kMemberIdFieldNumber = 2, - kRevisionFieldNumber = 3, - kRaftTermFieldNumber = 4, - }; - // uint64 cluster_id = 1; - void clear_cluster_id(); - ::PROTOBUF_NAMESPACE_ID::uint64 cluster_id() const; - void set_cluster_id(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // uint64 member_id = 2; - void clear_member_id(); - ::PROTOBUF_NAMESPACE_ID::uint64 member_id() const; - void set_member_id(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // int64 revision = 3; - void clear_revision(); - ::PROTOBUF_NAMESPACE_ID::int64 revision() const; - void set_revision(::PROTOBUF_NAMESPACE_ID::int64 value); - - // uint64 raft_term = 4; - void clear_raft_term(); - ::PROTOBUF_NAMESPACE_ID::uint64 raft_term() const; - void set_raft_term(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // @@protoc_insertion_point(class_scope:etcdserverpb.ResponseHeader) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::uint64 cluster_id_; - ::PROTOBUF_NAMESPACE_ID::uint64 member_id_; - ::PROTOBUF_NAMESPACE_ID::int64 revision_; - ::PROTOBUF_NAMESPACE_ID::uint64 raft_term_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_etcd_2eproto; -}; -// ------------------------------------------------------------------- - -class KeyValue : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.KeyValue) */ { - public: - KeyValue(); - virtual ~KeyValue(); - - KeyValue(const KeyValue& from); - KeyValue(KeyValue&& from) noexcept - : KeyValue() { - *this = ::std::move(from); - } - - inline KeyValue& operator=(const KeyValue& from) { - CopyFrom(from); - return *this; - } - inline KeyValue& operator=(KeyValue&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const KeyValue& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const KeyValue* internal_default_instance() { - return reinterpret_cast( - &_KeyValue_default_instance_); - } - static constexpr int kIndexInFileMessages = - 8; - - friend void swap(KeyValue& a, KeyValue& b) { - a.Swap(&b); - } - inline void Swap(KeyValue* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline KeyValue* New() const final { - return CreateMaybeMessage(nullptr); - } - - KeyValue* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const KeyValue& from); - void MergeFrom(const KeyValue& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(KeyValue* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "etcdserverpb.KeyValue"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); - return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kKeyFieldNumber = 1, - kValueFieldNumber = 5, - kCreateRevisionFieldNumber = 2, - kModRevisionFieldNumber = 3, - kVersionFieldNumber = 4, - kLeaseFieldNumber = 6, - }; - // bytes key = 1; - void clear_key(); - const std::string& key() const; - void set_key(const std::string& value); - void set_key(std::string&& value); - void set_key(const char* value); - void set_key(const void* value, size_t size); - std::string* mutable_key(); - std::string* release_key(); - void set_allocated_key(std::string* key); - - // bytes value = 5; - void clear_value(); - const std::string& value() const; - void set_value(const std::string& value); - void set_value(std::string&& value); - void set_value(const char* value); - void set_value(const void* value, size_t size); - std::string* mutable_value(); - std::string* release_value(); - void set_allocated_value(std::string* value); - - // int64 create_revision = 2; - void clear_create_revision(); - ::PROTOBUF_NAMESPACE_ID::int64 create_revision() const; - void set_create_revision(::PROTOBUF_NAMESPACE_ID::int64 value); - - // int64 mod_revision = 3; - void clear_mod_revision(); - ::PROTOBUF_NAMESPACE_ID::int64 mod_revision() const; - void set_mod_revision(::PROTOBUF_NAMESPACE_ID::int64 value); - - // int64 version = 4; - void clear_version(); - ::PROTOBUF_NAMESPACE_ID::int64 version() const; - void set_version(::PROTOBUF_NAMESPACE_ID::int64 value); - - // int64 lease = 6; - void clear_lease(); - ::PROTOBUF_NAMESPACE_ID::int64 lease() const; - void set_lease(::PROTOBUF_NAMESPACE_ID::int64 value); - - // @@protoc_insertion_point(class_scope:etcdserverpb.KeyValue) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_; - ::PROTOBUF_NAMESPACE_ID::int64 create_revision_; - ::PROTOBUF_NAMESPACE_ID::int64 mod_revision_; - ::PROTOBUF_NAMESPACE_ID::int64 version_; - ::PROTOBUF_NAMESPACE_ID::int64 lease_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_etcd_2eproto; -}; -// ------------------------------------------------------------------- - -class Event : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:etcdserverpb.Event) */ { - public: - Event(); - virtual ~Event(); - - Event(const Event& from); - Event(Event&& from) noexcept - : Event() { - *this = ::std::move(from); - } - - inline Event& operator=(const Event& from) { - CopyFrom(from); - return *this; - } - inline Event& operator=(Event&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const Event& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const Event* internal_default_instance() { - return reinterpret_cast( - &_Event_default_instance_); - } - static constexpr int kIndexInFileMessages = - 9; - - friend void swap(Event& a, Event& b) { - a.Swap(&b); - } - inline void Swap(Event* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline Event* New() const final { - return CreateMaybeMessage(nullptr); - } - - Event* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const Event& from); - void MergeFrom(const Event& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Event* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "etcdserverpb.Event"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_etcd_2eproto); - return ::descriptor_table_etcd_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - typedef Event_EventType EventType; - static constexpr EventType PUT = - Event_EventType_PUT; - static constexpr EventType DELETE = - Event_EventType_DELETE; - static inline bool EventType_IsValid(int value) { - return Event_EventType_IsValid(value); - } - static constexpr EventType EventType_MIN = - Event_EventType_EventType_MIN; - static constexpr EventType EventType_MAX = - Event_EventType_EventType_MAX; - static constexpr int EventType_ARRAYSIZE = - Event_EventType_EventType_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - EventType_descriptor() { - return Event_EventType_descriptor(); - } - template - static inline const std::string& EventType_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function EventType_Name."); - return Event_EventType_Name(enum_t_value); - } - static inline bool EventType_Parse(const std::string& name, - EventType* value) { - return Event_EventType_Parse(name, value); - } - - // accessors ------------------------------------------------------- - - enum : int { - kKvFieldNumber = 2, - kPrevKvFieldNumber = 3, - kTypeFieldNumber = 1, - }; - // .etcdserverpb.KeyValue kv = 2; - bool has_kv() const; - void clear_kv(); - const ::etcdserverpb::KeyValue& kv() const; - ::etcdserverpb::KeyValue* release_kv(); - ::etcdserverpb::KeyValue* mutable_kv(); - void set_allocated_kv(::etcdserverpb::KeyValue* kv); - - // .etcdserverpb.KeyValue prev_kv = 3; - bool has_prev_kv() const; - void clear_prev_kv(); - const ::etcdserverpb::KeyValue& prev_kv() const; - ::etcdserverpb::KeyValue* release_prev_kv(); - ::etcdserverpb::KeyValue* mutable_prev_kv(); - void set_allocated_prev_kv(::etcdserverpb::KeyValue* prev_kv); - - // .etcdserverpb.Event.EventType type = 1; - void clear_type(); - ::etcdserverpb::Event_EventType type() const; - void set_type(::etcdserverpb::Event_EventType value); - - // @@protoc_insertion_point(class_scope:etcdserverpb.Event) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::etcdserverpb::KeyValue* kv_; - ::etcdserverpb::KeyValue* prev_kv_; - int type_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_etcd_2eproto; -}; -// =================================================================== - - -// =================================================================== - -#ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// RangeRequest - -// bytes key = 1; -inline void RangeRequest::clear_key() { - key_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& RangeRequest::key() const { - // @@protoc_insertion_point(field_get:etcdserverpb.RangeRequest.key) - return key_.GetNoArena(); -} -inline void RangeRequest::set_key(const std::string& value) { - - key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:etcdserverpb.RangeRequest.key) -} -inline void RangeRequest::set_key(std::string&& value) { - - key_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:etcdserverpb.RangeRequest.key) -} -inline void RangeRequest::set_key(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:etcdserverpb.RangeRequest.key) -} -inline void RangeRequest::set_key(const void* value, size_t size) { - - key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:etcdserverpb.RangeRequest.key) -} -inline std::string* RangeRequest::mutable_key() { - - // @@protoc_insertion_point(field_mutable:etcdserverpb.RangeRequest.key) - return key_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* RangeRequest::release_key() { - // @@protoc_insertion_point(field_release:etcdserverpb.RangeRequest.key) - - return key_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void RangeRequest::set_allocated_key(std::string* key) { - if (key != nullptr) { - - } else { - - } - key_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), key); - // @@protoc_insertion_point(field_set_allocated:etcdserverpb.RangeRequest.key) -} - -// bytes range_end = 2; -inline void RangeRequest::clear_range_end() { - range_end_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& RangeRequest::range_end() const { - // @@protoc_insertion_point(field_get:etcdserverpb.RangeRequest.range_end) - return range_end_.GetNoArena(); -} -inline void RangeRequest::set_range_end(const std::string& value) { - - range_end_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:etcdserverpb.RangeRequest.range_end) -} -inline void RangeRequest::set_range_end(std::string&& value) { - - range_end_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:etcdserverpb.RangeRequest.range_end) -} -inline void RangeRequest::set_range_end(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - range_end_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:etcdserverpb.RangeRequest.range_end) -} -inline void RangeRequest::set_range_end(const void* value, size_t size) { - - range_end_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:etcdserverpb.RangeRequest.range_end) -} -inline std::string* RangeRequest::mutable_range_end() { - - // @@protoc_insertion_point(field_mutable:etcdserverpb.RangeRequest.range_end) - return range_end_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* RangeRequest::release_range_end() { - // @@protoc_insertion_point(field_release:etcdserverpb.RangeRequest.range_end) - - return range_end_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void RangeRequest::set_allocated_range_end(std::string* range_end) { - if (range_end != nullptr) { - - } else { - - } - range_end_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), range_end); - // @@protoc_insertion_point(field_set_allocated:etcdserverpb.RangeRequest.range_end) -} - -// int64 limit = 3; -inline void RangeRequest::clear_limit() { - limit_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 RangeRequest::limit() const { - // @@protoc_insertion_point(field_get:etcdserverpb.RangeRequest.limit) - return limit_; -} -inline void RangeRequest::set_limit(::PROTOBUF_NAMESPACE_ID::int64 value) { - - limit_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.RangeRequest.limit) -} - -// int64 revision = 4; -inline void RangeRequest::clear_revision() { - revision_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 RangeRequest::revision() const { - // @@protoc_insertion_point(field_get:etcdserverpb.RangeRequest.revision) - return revision_; -} -inline void RangeRequest::set_revision(::PROTOBUF_NAMESPACE_ID::int64 value) { - - revision_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.RangeRequest.revision) -} - -// .etcdserverpb.RangeRequest.SortOrder sort_order = 5; -inline void RangeRequest::clear_sort_order() { - sort_order_ = 0; -} -inline ::etcdserverpb::RangeRequest_SortOrder RangeRequest::sort_order() const { - // @@protoc_insertion_point(field_get:etcdserverpb.RangeRequest.sort_order) - return static_cast< ::etcdserverpb::RangeRequest_SortOrder >(sort_order_); -} -inline void RangeRequest::set_sort_order(::etcdserverpb::RangeRequest_SortOrder value) { - - sort_order_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.RangeRequest.sort_order) -} - -// .etcdserverpb.RangeRequest.SortTarget sort_target = 6; -inline void RangeRequest::clear_sort_target() { - sort_target_ = 0; -} -inline ::etcdserverpb::RangeRequest_SortTarget RangeRequest::sort_target() const { - // @@protoc_insertion_point(field_get:etcdserverpb.RangeRequest.sort_target) - return static_cast< ::etcdserverpb::RangeRequest_SortTarget >(sort_target_); -} -inline void RangeRequest::set_sort_target(::etcdserverpb::RangeRequest_SortTarget value) { - - sort_target_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.RangeRequest.sort_target) -} - -// bool serializable = 7; -inline void RangeRequest::clear_serializable() { - serializable_ = false; -} -inline bool RangeRequest::serializable() const { - // @@protoc_insertion_point(field_get:etcdserverpb.RangeRequest.serializable) - return serializable_; -} -inline void RangeRequest::set_serializable(bool value) { - - serializable_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.RangeRequest.serializable) -} - -// bool keys_only = 8; -inline void RangeRequest::clear_keys_only() { - keys_only_ = false; -} -inline bool RangeRequest::keys_only() const { - // @@protoc_insertion_point(field_get:etcdserverpb.RangeRequest.keys_only) - return keys_only_; -} -inline void RangeRequest::set_keys_only(bool value) { - - keys_only_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.RangeRequest.keys_only) -} - -// bool count_only = 9; -inline void RangeRequest::clear_count_only() { - count_only_ = false; -} -inline bool RangeRequest::count_only() const { - // @@protoc_insertion_point(field_get:etcdserverpb.RangeRequest.count_only) - return count_only_; -} -inline void RangeRequest::set_count_only(bool value) { - - count_only_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.RangeRequest.count_only) -} - -// int64 min_mod_revision = 10; -inline void RangeRequest::clear_min_mod_revision() { - min_mod_revision_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 RangeRequest::min_mod_revision() const { - // @@protoc_insertion_point(field_get:etcdserverpb.RangeRequest.min_mod_revision) - return min_mod_revision_; -} -inline void RangeRequest::set_min_mod_revision(::PROTOBUF_NAMESPACE_ID::int64 value) { - - min_mod_revision_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.RangeRequest.min_mod_revision) -} - -// int64 max_mod_revision = 11; -inline void RangeRequest::clear_max_mod_revision() { - max_mod_revision_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 RangeRequest::max_mod_revision() const { - // @@protoc_insertion_point(field_get:etcdserverpb.RangeRequest.max_mod_revision) - return max_mod_revision_; -} -inline void RangeRequest::set_max_mod_revision(::PROTOBUF_NAMESPACE_ID::int64 value) { - - max_mod_revision_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.RangeRequest.max_mod_revision) -} - -// int64 min_create_revision = 12; -inline void RangeRequest::clear_min_create_revision() { - min_create_revision_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 RangeRequest::min_create_revision() const { - // @@protoc_insertion_point(field_get:etcdserverpb.RangeRequest.min_create_revision) - return min_create_revision_; -} -inline void RangeRequest::set_min_create_revision(::PROTOBUF_NAMESPACE_ID::int64 value) { - - min_create_revision_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.RangeRequest.min_create_revision) -} - -// int64 max_create_revision = 13; -inline void RangeRequest::clear_max_create_revision() { - max_create_revision_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 RangeRequest::max_create_revision() const { - // @@protoc_insertion_point(field_get:etcdserverpb.RangeRequest.max_create_revision) - return max_create_revision_; -} -inline void RangeRequest::set_max_create_revision(::PROTOBUF_NAMESPACE_ID::int64 value) { - - max_create_revision_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.RangeRequest.max_create_revision) -} - -// ------------------------------------------------------------------- - -// RangeResponse - -// .etcdserverpb.ResponseHeader header = 1; -inline bool RangeResponse::has_header() const { - return this != internal_default_instance() && header_ != nullptr; -} -inline void RangeResponse::clear_header() { - if (GetArenaNoVirtual() == nullptr && header_ != nullptr) { - delete header_; - } - header_ = nullptr; -} -inline const ::etcdserverpb::ResponseHeader& RangeResponse::header() const { - const ::etcdserverpb::ResponseHeader* p = header_; - // @@protoc_insertion_point(field_get:etcdserverpb.RangeResponse.header) - return p != nullptr ? *p : *reinterpret_cast( - &::etcdserverpb::_ResponseHeader_default_instance_); -} -inline ::etcdserverpb::ResponseHeader* RangeResponse::release_header() { - // @@protoc_insertion_point(field_release:etcdserverpb.RangeResponse.header) - - ::etcdserverpb::ResponseHeader* temp = header_; - header_ = nullptr; - return temp; -} -inline ::etcdserverpb::ResponseHeader* RangeResponse::mutable_header() { - - if (header_ == nullptr) { - auto* p = CreateMaybeMessage<::etcdserverpb::ResponseHeader>(GetArenaNoVirtual()); - header_ = p; - } - // @@protoc_insertion_point(field_mutable:etcdserverpb.RangeResponse.header) - return header_; -} -inline void RangeResponse::set_allocated_header(::etcdserverpb::ResponseHeader* header) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete header_; - } - if (header) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - header = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, header, submessage_arena); - } - - } else { - - } - header_ = header; - // @@protoc_insertion_point(field_set_allocated:etcdserverpb.RangeResponse.header) -} - -// repeated .etcdserverpb.KeyValue kvs = 2; -inline int RangeResponse::kvs_size() const { - return kvs_.size(); -} -inline void RangeResponse::clear_kvs() { - kvs_.Clear(); -} -inline ::etcdserverpb::KeyValue* RangeResponse::mutable_kvs(int index) { - // @@protoc_insertion_point(field_mutable:etcdserverpb.RangeResponse.kvs) - return kvs_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::etcdserverpb::KeyValue >* -RangeResponse::mutable_kvs() { - // @@protoc_insertion_point(field_mutable_list:etcdserverpb.RangeResponse.kvs) - return &kvs_; -} -inline const ::etcdserverpb::KeyValue& RangeResponse::kvs(int index) const { - // @@protoc_insertion_point(field_get:etcdserverpb.RangeResponse.kvs) - return kvs_.Get(index); -} -inline ::etcdserverpb::KeyValue* RangeResponse::add_kvs() { - // @@protoc_insertion_point(field_add:etcdserverpb.RangeResponse.kvs) - return kvs_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::etcdserverpb::KeyValue >& -RangeResponse::kvs() const { - // @@protoc_insertion_point(field_list:etcdserverpb.RangeResponse.kvs) - return kvs_; -} - -// bool more = 3; -inline void RangeResponse::clear_more() { - more_ = false; -} -inline bool RangeResponse::more() const { - // @@protoc_insertion_point(field_get:etcdserverpb.RangeResponse.more) - return more_; -} -inline void RangeResponse::set_more(bool value) { - - more_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.RangeResponse.more) -} - -// int64 count = 4; -inline void RangeResponse::clear_count() { - count_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 RangeResponse::count() const { - // @@protoc_insertion_point(field_get:etcdserverpb.RangeResponse.count) - return count_; -} -inline void RangeResponse::set_count(::PROTOBUF_NAMESPACE_ID::int64 value) { - - count_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.RangeResponse.count) -} - -// ------------------------------------------------------------------- - -// WatchRequest - -// .etcdserverpb.WatchCreateRequest create_request = 1; -inline bool WatchRequest::has_create_request() const { - return request_union_case() == kCreateRequest; -} -inline void WatchRequest::set_has_create_request() { - _oneof_case_[0] = kCreateRequest; -} -inline void WatchRequest::clear_create_request() { - if (has_create_request()) { - delete request_union_.create_request_; - clear_has_request_union(); - } -} -inline ::etcdserverpb::WatchCreateRequest* WatchRequest::release_create_request() { - // @@protoc_insertion_point(field_release:etcdserverpb.WatchRequest.create_request) - if (has_create_request()) { - clear_has_request_union(); - ::etcdserverpb::WatchCreateRequest* temp = request_union_.create_request_; - request_union_.create_request_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::etcdserverpb::WatchCreateRequest& WatchRequest::create_request() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchRequest.create_request) - return has_create_request() - ? *request_union_.create_request_ - : *reinterpret_cast< ::etcdserverpb::WatchCreateRequest*>(&::etcdserverpb::_WatchCreateRequest_default_instance_); -} -inline ::etcdserverpb::WatchCreateRequest* WatchRequest::mutable_create_request() { - if (!has_create_request()) { - clear_request_union(); - set_has_create_request(); - request_union_.create_request_ = CreateMaybeMessage< ::etcdserverpb::WatchCreateRequest >( - GetArenaNoVirtual()); - } - // @@protoc_insertion_point(field_mutable:etcdserverpb.WatchRequest.create_request) - return request_union_.create_request_; -} - -// .etcdserverpb.WatchCancelRequest cancel_request = 2; -inline bool WatchRequest::has_cancel_request() const { - return request_union_case() == kCancelRequest; -} -inline void WatchRequest::set_has_cancel_request() { - _oneof_case_[0] = kCancelRequest; -} -inline void WatchRequest::clear_cancel_request() { - if (has_cancel_request()) { - delete request_union_.cancel_request_; - clear_has_request_union(); - } -} -inline ::etcdserverpb::WatchCancelRequest* WatchRequest::release_cancel_request() { - // @@protoc_insertion_point(field_release:etcdserverpb.WatchRequest.cancel_request) - if (has_cancel_request()) { - clear_has_request_union(); - ::etcdserverpb::WatchCancelRequest* temp = request_union_.cancel_request_; - request_union_.cancel_request_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::etcdserverpb::WatchCancelRequest& WatchRequest::cancel_request() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchRequest.cancel_request) - return has_cancel_request() - ? *request_union_.cancel_request_ - : *reinterpret_cast< ::etcdserverpb::WatchCancelRequest*>(&::etcdserverpb::_WatchCancelRequest_default_instance_); -} -inline ::etcdserverpb::WatchCancelRequest* WatchRequest::mutable_cancel_request() { - if (!has_cancel_request()) { - clear_request_union(); - set_has_cancel_request(); - request_union_.cancel_request_ = CreateMaybeMessage< ::etcdserverpb::WatchCancelRequest >( - GetArenaNoVirtual()); - } - // @@protoc_insertion_point(field_mutable:etcdserverpb.WatchRequest.cancel_request) - return request_union_.cancel_request_; -} - -// .etcdserverpb.WatchProgressRequest progress_request = 3; -inline bool WatchRequest::has_progress_request() const { - return request_union_case() == kProgressRequest; -} -inline void WatchRequest::set_has_progress_request() { - _oneof_case_[0] = kProgressRequest; -} -inline void WatchRequest::clear_progress_request() { - if (has_progress_request()) { - delete request_union_.progress_request_; - clear_has_request_union(); - } -} -inline ::etcdserverpb::WatchProgressRequest* WatchRequest::release_progress_request() { - // @@protoc_insertion_point(field_release:etcdserverpb.WatchRequest.progress_request) - if (has_progress_request()) { - clear_has_request_union(); - ::etcdserverpb::WatchProgressRequest* temp = request_union_.progress_request_; - request_union_.progress_request_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::etcdserverpb::WatchProgressRequest& WatchRequest::progress_request() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchRequest.progress_request) - return has_progress_request() - ? *request_union_.progress_request_ - : *reinterpret_cast< ::etcdserverpb::WatchProgressRequest*>(&::etcdserverpb::_WatchProgressRequest_default_instance_); -} -inline ::etcdserverpb::WatchProgressRequest* WatchRequest::mutable_progress_request() { - if (!has_progress_request()) { - clear_request_union(); - set_has_progress_request(); - request_union_.progress_request_ = CreateMaybeMessage< ::etcdserverpb::WatchProgressRequest >( - GetArenaNoVirtual()); - } - // @@protoc_insertion_point(field_mutable:etcdserverpb.WatchRequest.progress_request) - return request_union_.progress_request_; -} - -inline bool WatchRequest::has_request_union() const { - return request_union_case() != REQUEST_UNION_NOT_SET; -} -inline void WatchRequest::clear_has_request_union() { - _oneof_case_[0] = REQUEST_UNION_NOT_SET; -} -inline WatchRequest::RequestUnionCase WatchRequest::request_union_case() const { - return WatchRequest::RequestUnionCase(_oneof_case_[0]); -} -// ------------------------------------------------------------------- - -// WatchCreateRequest - -// bytes key = 1; -inline void WatchCreateRequest::clear_key() { - key_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& WatchCreateRequest::key() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchCreateRequest.key) - return key_.GetNoArena(); -} -inline void WatchCreateRequest::set_key(const std::string& value) { - - key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:etcdserverpb.WatchCreateRequest.key) -} -inline void WatchCreateRequest::set_key(std::string&& value) { - - key_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:etcdserverpb.WatchCreateRequest.key) -} -inline void WatchCreateRequest::set_key(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:etcdserverpb.WatchCreateRequest.key) -} -inline void WatchCreateRequest::set_key(const void* value, size_t size) { - - key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:etcdserverpb.WatchCreateRequest.key) -} -inline std::string* WatchCreateRequest::mutable_key() { - - // @@protoc_insertion_point(field_mutable:etcdserverpb.WatchCreateRequest.key) - return key_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* WatchCreateRequest::release_key() { - // @@protoc_insertion_point(field_release:etcdserverpb.WatchCreateRequest.key) - - return key_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void WatchCreateRequest::set_allocated_key(std::string* key) { - if (key != nullptr) { - - } else { - - } - key_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), key); - // @@protoc_insertion_point(field_set_allocated:etcdserverpb.WatchCreateRequest.key) -} - -// bytes range_end = 2; -inline void WatchCreateRequest::clear_range_end() { - range_end_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& WatchCreateRequest::range_end() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchCreateRequest.range_end) - return range_end_.GetNoArena(); -} -inline void WatchCreateRequest::set_range_end(const std::string& value) { - - range_end_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:etcdserverpb.WatchCreateRequest.range_end) -} -inline void WatchCreateRequest::set_range_end(std::string&& value) { - - range_end_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:etcdserverpb.WatchCreateRequest.range_end) -} -inline void WatchCreateRequest::set_range_end(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - range_end_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:etcdserverpb.WatchCreateRequest.range_end) -} -inline void WatchCreateRequest::set_range_end(const void* value, size_t size) { - - range_end_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:etcdserverpb.WatchCreateRequest.range_end) -} -inline std::string* WatchCreateRequest::mutable_range_end() { - - // @@protoc_insertion_point(field_mutable:etcdserverpb.WatchCreateRequest.range_end) - return range_end_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* WatchCreateRequest::release_range_end() { - // @@protoc_insertion_point(field_release:etcdserverpb.WatchCreateRequest.range_end) - - return range_end_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void WatchCreateRequest::set_allocated_range_end(std::string* range_end) { - if (range_end != nullptr) { - - } else { - - } - range_end_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), range_end); - // @@protoc_insertion_point(field_set_allocated:etcdserverpb.WatchCreateRequest.range_end) -} - -// int64 start_revision = 3; -inline void WatchCreateRequest::clear_start_revision() { - start_revision_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 WatchCreateRequest::start_revision() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchCreateRequest.start_revision) - return start_revision_; -} -inline void WatchCreateRequest::set_start_revision(::PROTOBUF_NAMESPACE_ID::int64 value) { - - start_revision_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.WatchCreateRequest.start_revision) -} - -// bool progress_notify = 4; -inline void WatchCreateRequest::clear_progress_notify() { - progress_notify_ = false; -} -inline bool WatchCreateRequest::progress_notify() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchCreateRequest.progress_notify) - return progress_notify_; -} -inline void WatchCreateRequest::set_progress_notify(bool value) { - - progress_notify_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.WatchCreateRequest.progress_notify) -} - -// repeated .etcdserverpb.WatchCreateRequest.FilterType filters = 5; -inline int WatchCreateRequest::filters_size() const { - return filters_.size(); -} -inline void WatchCreateRequest::clear_filters() { - filters_.Clear(); -} -inline ::etcdserverpb::WatchCreateRequest_FilterType WatchCreateRequest::filters(int index) const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchCreateRequest.filters) - return static_cast< ::etcdserverpb::WatchCreateRequest_FilterType >(filters_.Get(index)); -} -inline void WatchCreateRequest::set_filters(int index, ::etcdserverpb::WatchCreateRequest_FilterType value) { - filters_.Set(index, value); - // @@protoc_insertion_point(field_set:etcdserverpb.WatchCreateRequest.filters) -} -inline void WatchCreateRequest::add_filters(::etcdserverpb::WatchCreateRequest_FilterType value) { - filters_.Add(value); - // @@protoc_insertion_point(field_add:etcdserverpb.WatchCreateRequest.filters) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField& -WatchCreateRequest::filters() const { - // @@protoc_insertion_point(field_list:etcdserverpb.WatchCreateRequest.filters) - return filters_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* -WatchCreateRequest::mutable_filters() { - // @@protoc_insertion_point(field_mutable_list:etcdserverpb.WatchCreateRequest.filters) - return &filters_; -} - -// bool prev_kv = 6; -inline void WatchCreateRequest::clear_prev_kv() { - prev_kv_ = false; -} -inline bool WatchCreateRequest::prev_kv() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchCreateRequest.prev_kv) - return prev_kv_; -} -inline void WatchCreateRequest::set_prev_kv(bool value) { - - prev_kv_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.WatchCreateRequest.prev_kv) -} - -// int64 watch_id = 7; -inline void WatchCreateRequest::clear_watch_id() { - watch_id_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 WatchCreateRequest::watch_id() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchCreateRequest.watch_id) - return watch_id_; -} -inline void WatchCreateRequest::set_watch_id(::PROTOBUF_NAMESPACE_ID::int64 value) { - - watch_id_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.WatchCreateRequest.watch_id) -} - -// bool fragment = 8; -inline void WatchCreateRequest::clear_fragment() { - fragment_ = false; -} -inline bool WatchCreateRequest::fragment() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchCreateRequest.fragment) - return fragment_; -} -inline void WatchCreateRequest::set_fragment(bool value) { - - fragment_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.WatchCreateRequest.fragment) -} - -// ------------------------------------------------------------------- - -// WatchCancelRequest - -// int64 watch_id = 1; -inline void WatchCancelRequest::clear_watch_id() { - watch_id_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 WatchCancelRequest::watch_id() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchCancelRequest.watch_id) - return watch_id_; -} -inline void WatchCancelRequest::set_watch_id(::PROTOBUF_NAMESPACE_ID::int64 value) { - - watch_id_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.WatchCancelRequest.watch_id) -} - -// ------------------------------------------------------------------- - -// WatchProgressRequest - -// ------------------------------------------------------------------- - -// WatchResponse - -// .etcdserverpb.ResponseHeader header = 1; -inline bool WatchResponse::has_header() const { - return this != internal_default_instance() && header_ != nullptr; -} -inline void WatchResponse::clear_header() { - if (GetArenaNoVirtual() == nullptr && header_ != nullptr) { - delete header_; - } - header_ = nullptr; -} -inline const ::etcdserverpb::ResponseHeader& WatchResponse::header() const { - const ::etcdserverpb::ResponseHeader* p = header_; - // @@protoc_insertion_point(field_get:etcdserverpb.WatchResponse.header) - return p != nullptr ? *p : *reinterpret_cast( - &::etcdserverpb::_ResponseHeader_default_instance_); -} -inline ::etcdserverpb::ResponseHeader* WatchResponse::release_header() { - // @@protoc_insertion_point(field_release:etcdserverpb.WatchResponse.header) - - ::etcdserverpb::ResponseHeader* temp = header_; - header_ = nullptr; - return temp; -} -inline ::etcdserverpb::ResponseHeader* WatchResponse::mutable_header() { - - if (header_ == nullptr) { - auto* p = CreateMaybeMessage<::etcdserverpb::ResponseHeader>(GetArenaNoVirtual()); - header_ = p; - } - // @@protoc_insertion_point(field_mutable:etcdserverpb.WatchResponse.header) - return header_; -} -inline void WatchResponse::set_allocated_header(::etcdserverpb::ResponseHeader* header) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete header_; - } - if (header) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - header = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, header, submessage_arena); - } - - } else { - - } - header_ = header; - // @@protoc_insertion_point(field_set_allocated:etcdserverpb.WatchResponse.header) -} - -// int64 watch_id = 2; -inline void WatchResponse::clear_watch_id() { - watch_id_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 WatchResponse::watch_id() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchResponse.watch_id) - return watch_id_; -} -inline void WatchResponse::set_watch_id(::PROTOBUF_NAMESPACE_ID::int64 value) { - - watch_id_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.WatchResponse.watch_id) -} - -// bool created = 3; -inline void WatchResponse::clear_created() { - created_ = false; -} -inline bool WatchResponse::created() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchResponse.created) - return created_; -} -inline void WatchResponse::set_created(bool value) { - - created_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.WatchResponse.created) -} - -// bool canceled = 4; -inline void WatchResponse::clear_canceled() { - canceled_ = false; -} -inline bool WatchResponse::canceled() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchResponse.canceled) - return canceled_; -} -inline void WatchResponse::set_canceled(bool value) { - - canceled_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.WatchResponse.canceled) -} - -// int64 compact_revision = 5; -inline void WatchResponse::clear_compact_revision() { - compact_revision_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 WatchResponse::compact_revision() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchResponse.compact_revision) - return compact_revision_; -} -inline void WatchResponse::set_compact_revision(::PROTOBUF_NAMESPACE_ID::int64 value) { - - compact_revision_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.WatchResponse.compact_revision) -} - -// string cancel_reason = 6; -inline void WatchResponse::clear_cancel_reason() { - cancel_reason_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& WatchResponse::cancel_reason() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchResponse.cancel_reason) - return cancel_reason_.GetNoArena(); -} -inline void WatchResponse::set_cancel_reason(const std::string& value) { - - cancel_reason_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:etcdserverpb.WatchResponse.cancel_reason) -} -inline void WatchResponse::set_cancel_reason(std::string&& value) { - - cancel_reason_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:etcdserverpb.WatchResponse.cancel_reason) -} -inline void WatchResponse::set_cancel_reason(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - cancel_reason_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:etcdserverpb.WatchResponse.cancel_reason) -} -inline void WatchResponse::set_cancel_reason(const char* value, size_t size) { - - cancel_reason_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:etcdserverpb.WatchResponse.cancel_reason) -} -inline std::string* WatchResponse::mutable_cancel_reason() { - - // @@protoc_insertion_point(field_mutable:etcdserverpb.WatchResponse.cancel_reason) - return cancel_reason_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* WatchResponse::release_cancel_reason() { - // @@protoc_insertion_point(field_release:etcdserverpb.WatchResponse.cancel_reason) - - return cancel_reason_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void WatchResponse::set_allocated_cancel_reason(std::string* cancel_reason) { - if (cancel_reason != nullptr) { - - } else { - - } - cancel_reason_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), cancel_reason); - // @@protoc_insertion_point(field_set_allocated:etcdserverpb.WatchResponse.cancel_reason) -} - -// bool fragment = 7; -inline void WatchResponse::clear_fragment() { - fragment_ = false; -} -inline bool WatchResponse::fragment() const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchResponse.fragment) - return fragment_; -} -inline void WatchResponse::set_fragment(bool value) { - - fragment_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.WatchResponse.fragment) -} - -// repeated .etcdserverpb.Event events = 11; -inline int WatchResponse::events_size() const { - return events_.size(); -} -inline void WatchResponse::clear_events() { - events_.Clear(); -} -inline ::etcdserverpb::Event* WatchResponse::mutable_events(int index) { - // @@protoc_insertion_point(field_mutable:etcdserverpb.WatchResponse.events) - return events_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::etcdserverpb::Event >* -WatchResponse::mutable_events() { - // @@protoc_insertion_point(field_mutable_list:etcdserverpb.WatchResponse.events) - return &events_; -} -inline const ::etcdserverpb::Event& WatchResponse::events(int index) const { - // @@protoc_insertion_point(field_get:etcdserverpb.WatchResponse.events) - return events_.Get(index); -} -inline ::etcdserverpb::Event* WatchResponse::add_events() { - // @@protoc_insertion_point(field_add:etcdserverpb.WatchResponse.events) - return events_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::etcdserverpb::Event >& -WatchResponse::events() const { - // @@protoc_insertion_point(field_list:etcdserverpb.WatchResponse.events) - return events_; -} - -// ------------------------------------------------------------------- - -// ResponseHeader - -// uint64 cluster_id = 1; -inline void ResponseHeader::clear_cluster_id() { - cluster_id_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 ResponseHeader::cluster_id() const { - // @@protoc_insertion_point(field_get:etcdserverpb.ResponseHeader.cluster_id) - return cluster_id_; -} -inline void ResponseHeader::set_cluster_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - cluster_id_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.ResponseHeader.cluster_id) -} - -// uint64 member_id = 2; -inline void ResponseHeader::clear_member_id() { - member_id_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 ResponseHeader::member_id() const { - // @@protoc_insertion_point(field_get:etcdserverpb.ResponseHeader.member_id) - return member_id_; -} -inline void ResponseHeader::set_member_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - member_id_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.ResponseHeader.member_id) -} - -// int64 revision = 3; -inline void ResponseHeader::clear_revision() { - revision_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 ResponseHeader::revision() const { - // @@protoc_insertion_point(field_get:etcdserverpb.ResponseHeader.revision) - return revision_; -} -inline void ResponseHeader::set_revision(::PROTOBUF_NAMESPACE_ID::int64 value) { - - revision_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.ResponseHeader.revision) -} - -// uint64 raft_term = 4; -inline void ResponseHeader::clear_raft_term() { - raft_term_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 ResponseHeader::raft_term() const { - // @@protoc_insertion_point(field_get:etcdserverpb.ResponseHeader.raft_term) - return raft_term_; -} -inline void ResponseHeader::set_raft_term(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - raft_term_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.ResponseHeader.raft_term) -} - -// ------------------------------------------------------------------- - -// KeyValue - -// bytes key = 1; -inline void KeyValue::clear_key() { - key_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& KeyValue::key() const { - // @@protoc_insertion_point(field_get:etcdserverpb.KeyValue.key) - return key_.GetNoArena(); -} -inline void KeyValue::set_key(const std::string& value) { - - key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:etcdserverpb.KeyValue.key) -} -inline void KeyValue::set_key(std::string&& value) { - - key_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:etcdserverpb.KeyValue.key) -} -inline void KeyValue::set_key(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:etcdserverpb.KeyValue.key) -} -inline void KeyValue::set_key(const void* value, size_t size) { - - key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:etcdserverpb.KeyValue.key) -} -inline std::string* KeyValue::mutable_key() { - - // @@protoc_insertion_point(field_mutable:etcdserverpb.KeyValue.key) - return key_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* KeyValue::release_key() { - // @@protoc_insertion_point(field_release:etcdserverpb.KeyValue.key) - - return key_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void KeyValue::set_allocated_key(std::string* key) { - if (key != nullptr) { - - } else { - - } - key_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), key); - // @@protoc_insertion_point(field_set_allocated:etcdserverpb.KeyValue.key) -} - -// int64 create_revision = 2; -inline void KeyValue::clear_create_revision() { - create_revision_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 KeyValue::create_revision() const { - // @@protoc_insertion_point(field_get:etcdserverpb.KeyValue.create_revision) - return create_revision_; -} -inline void KeyValue::set_create_revision(::PROTOBUF_NAMESPACE_ID::int64 value) { - - create_revision_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.KeyValue.create_revision) -} - -// int64 mod_revision = 3; -inline void KeyValue::clear_mod_revision() { - mod_revision_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 KeyValue::mod_revision() const { - // @@protoc_insertion_point(field_get:etcdserverpb.KeyValue.mod_revision) - return mod_revision_; -} -inline void KeyValue::set_mod_revision(::PROTOBUF_NAMESPACE_ID::int64 value) { - - mod_revision_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.KeyValue.mod_revision) -} - -// int64 version = 4; -inline void KeyValue::clear_version() { - version_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 KeyValue::version() const { - // @@protoc_insertion_point(field_get:etcdserverpb.KeyValue.version) - return version_; -} -inline void KeyValue::set_version(::PROTOBUF_NAMESPACE_ID::int64 value) { - - version_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.KeyValue.version) -} - -// bytes value = 5; -inline void KeyValue::clear_value() { - value_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& KeyValue::value() const { - // @@protoc_insertion_point(field_get:etcdserverpb.KeyValue.value) - return value_.GetNoArena(); -} -inline void KeyValue::set_value(const std::string& value) { - - value_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:etcdserverpb.KeyValue.value) -} -inline void KeyValue::set_value(std::string&& value) { - - value_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:etcdserverpb.KeyValue.value) -} -inline void KeyValue::set_value(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - value_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:etcdserverpb.KeyValue.value) -} -inline void KeyValue::set_value(const void* value, size_t size) { - - value_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:etcdserverpb.KeyValue.value) -} -inline std::string* KeyValue::mutable_value() { - - // @@protoc_insertion_point(field_mutable:etcdserverpb.KeyValue.value) - return value_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* KeyValue::release_value() { - // @@protoc_insertion_point(field_release:etcdserverpb.KeyValue.value) - - return value_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void KeyValue::set_allocated_value(std::string* value) { - if (value != nullptr) { - - } else { - - } - value_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set_allocated:etcdserverpb.KeyValue.value) -} - -// int64 lease = 6; -inline void KeyValue::clear_lease() { - lease_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 KeyValue::lease() const { - // @@protoc_insertion_point(field_get:etcdserverpb.KeyValue.lease) - return lease_; -} -inline void KeyValue::set_lease(::PROTOBUF_NAMESPACE_ID::int64 value) { - - lease_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.KeyValue.lease) -} - -// ------------------------------------------------------------------- - -// Event - -// .etcdserverpb.Event.EventType type = 1; -inline void Event::clear_type() { - type_ = 0; -} -inline ::etcdserverpb::Event_EventType Event::type() const { - // @@protoc_insertion_point(field_get:etcdserverpb.Event.type) - return static_cast< ::etcdserverpb::Event_EventType >(type_); -} -inline void Event::set_type(::etcdserverpb::Event_EventType value) { - - type_ = value; - // @@protoc_insertion_point(field_set:etcdserverpb.Event.type) -} - -// .etcdserverpb.KeyValue kv = 2; -inline bool Event::has_kv() const { - return this != internal_default_instance() && kv_ != nullptr; -} -inline void Event::clear_kv() { - if (GetArenaNoVirtual() == nullptr && kv_ != nullptr) { - delete kv_; - } - kv_ = nullptr; -} -inline const ::etcdserverpb::KeyValue& Event::kv() const { - const ::etcdserverpb::KeyValue* p = kv_; - // @@protoc_insertion_point(field_get:etcdserverpb.Event.kv) - return p != nullptr ? *p : *reinterpret_cast( - &::etcdserverpb::_KeyValue_default_instance_); -} -inline ::etcdserverpb::KeyValue* Event::release_kv() { - // @@protoc_insertion_point(field_release:etcdserverpb.Event.kv) - - ::etcdserverpb::KeyValue* temp = kv_; - kv_ = nullptr; - return temp; -} -inline ::etcdserverpb::KeyValue* Event::mutable_kv() { - - if (kv_ == nullptr) { - auto* p = CreateMaybeMessage<::etcdserverpb::KeyValue>(GetArenaNoVirtual()); - kv_ = p; - } - // @@protoc_insertion_point(field_mutable:etcdserverpb.Event.kv) - return kv_; -} -inline void Event::set_allocated_kv(::etcdserverpb::KeyValue* kv) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete kv_; - } - if (kv) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - kv = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, kv, submessage_arena); - } - - } else { - - } - kv_ = kv; - // @@protoc_insertion_point(field_set_allocated:etcdserverpb.Event.kv) -} - -// .etcdserverpb.KeyValue prev_kv = 3; -inline bool Event::has_prev_kv() const { - return this != internal_default_instance() && prev_kv_ != nullptr; -} -inline void Event::clear_prev_kv() { - if (GetArenaNoVirtual() == nullptr && prev_kv_ != nullptr) { - delete prev_kv_; - } - prev_kv_ = nullptr; -} -inline const ::etcdserverpb::KeyValue& Event::prev_kv() const { - const ::etcdserverpb::KeyValue* p = prev_kv_; - // @@protoc_insertion_point(field_get:etcdserverpb.Event.prev_kv) - return p != nullptr ? *p : *reinterpret_cast( - &::etcdserverpb::_KeyValue_default_instance_); -} -inline ::etcdserverpb::KeyValue* Event::release_prev_kv() { - // @@protoc_insertion_point(field_release:etcdserverpb.Event.prev_kv) - - ::etcdserverpb::KeyValue* temp = prev_kv_; - prev_kv_ = nullptr; - return temp; -} -inline ::etcdserverpb::KeyValue* Event::mutable_prev_kv() { - - if (prev_kv_ == nullptr) { - auto* p = CreateMaybeMessage<::etcdserverpb::KeyValue>(GetArenaNoVirtual()); - prev_kv_ = p; - } - // @@protoc_insertion_point(field_mutable:etcdserverpb.Event.prev_kv) - return prev_kv_; -} -inline void Event::set_allocated_prev_kv(::etcdserverpb::KeyValue* prev_kv) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete prev_kv_; - } - if (prev_kv) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - prev_kv = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, prev_kv, submessage_arena); - } - - } else { - - } - prev_kv_ = prev_kv; - // @@protoc_insertion_point(field_set_allocated:etcdserverpb.Event.prev_kv) -} - -#ifdef __GNUC__ - #pragma GCC diagnostic pop -#endif // __GNUC__ -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - - -// @@protoc_insertion_point(namespace_scope) - -} // namespace etcdserverpb - -PROTOBUF_NAMESPACE_OPEN - -template <> struct is_proto_enum< ::etcdserverpb::RangeRequest_SortOrder> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::etcdserverpb::RangeRequest_SortOrder>() { - return ::etcdserverpb::RangeRequest_SortOrder_descriptor(); -} -template <> struct is_proto_enum< ::etcdserverpb::RangeRequest_SortTarget> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::etcdserverpb::RangeRequest_SortTarget>() { - return ::etcdserverpb::RangeRequest_SortTarget_descriptor(); -} -template <> struct is_proto_enum< ::etcdserverpb::WatchCreateRequest_FilterType> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::etcdserverpb::WatchCreateRequest_FilterType>() { - return ::etcdserverpb::WatchCreateRequest_FilterType_descriptor(); -} -template <> struct is_proto_enum< ::etcdserverpb::Event_EventType> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::etcdserverpb::Event_EventType>() { - return ::etcdserverpb::Event_EventType_descriptor(); -} - -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) - -#include -#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_etcd_2eproto diff --git a/proxy/src/grpc/master.grpc.pb.cc b/proxy/src/grpc/master.grpc.pb.cc deleted file mode 100644 index 5fb5fecdfc..0000000000 --- a/proxy/src/grpc/master.grpc.pb.cc +++ /dev/null @@ -1,125 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: master.proto - -#include "master.pb.h" -#include "master.grpc.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -namespace masterpb { - -static const char* Master_method_names[] = { - "/masterpb.Master/CreateCollection", - "/masterpb.Master/CreateIndex", -}; - -std::unique_ptr< Master::Stub> Master::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { - (void)options; - std::unique_ptr< Master::Stub> stub(new Master::Stub(channel)); - return stub; -} - -Master::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) - : channel_(channel), rpcmethod_CreateCollection_(Master_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_CreateIndex_(Master_method_names[1], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - {} - -::grpc::Status Master::Stub::CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::milvus::grpc::Status* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_CreateCollection_, context, request, response); -} - -void Master::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, std::move(f)); -} - -void Master::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, std::move(f)); -} - -void Master::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, reactor); -} - -void Master::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* Master::Stub::AsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateCollection_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* Master::Stub::PrepareAsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateCollection_, context, request, false); -} - -::grpc::Status Master::Stub::CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::milvus::grpc::Status* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_CreateIndex_, context, request, response); -} - -void Master::Stub::experimental_async::CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateIndex_, context, request, response, std::move(f)); -} - -void Master::Stub::experimental_async::CreateIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateIndex_, context, request, response, std::move(f)); -} - -void Master::Stub::experimental_async::CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateIndex_, context, request, response, reactor); -} - -void Master::Stub::experimental_async::CreateIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateIndex_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* Master::Stub::AsyncCreateIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateIndex_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* Master::Stub::PrepareAsyncCreateIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateIndex_, context, request, false); -} - -Master::Service::Service() { - AddMethod(new ::grpc::internal::RpcServiceMethod( - Master_method_names[0], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< Master::Service, ::milvus::grpc::Mapping, ::milvus::grpc::Status>( - std::mem_fn(&Master::Service::CreateCollection), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - Master_method_names[1], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< Master::Service, ::milvus::grpc::IndexParam, ::milvus::grpc::Status>( - std::mem_fn(&Master::Service::CreateIndex), this))); -} - -Master::Service::~Service() { -} - -::grpc::Status Master::Service::CreateCollection(::grpc::ServerContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status Master::Service::CreateIndex(::grpc::ServerContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - - -} // namespace masterpb - diff --git a/proxy/src/grpc/master.grpc.pb.h b/proxy/src/grpc/master.grpc.pb.h deleted file mode 100644 index a45cbf4511..0000000000 --- a/proxy/src/grpc/master.grpc.pb.h +++ /dev/null @@ -1,413 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: master.proto -#ifndef GRPC_master_2eproto__INCLUDED -#define GRPC_master_2eproto__INCLUDED - -#include "master.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace grpc_impl { -class CompletionQueue; -class ServerCompletionQueue; -class ServerContext; -} // namespace grpc_impl - -namespace grpc { -namespace experimental { -template -class MessageAllocator; -} // namespace experimental -} // namespace grpc - -namespace masterpb { - -class Master final { - public: - static constexpr char const* service_full_name() { - return "masterpb.Master"; - } - class StubInterface { - public: - virtual ~StubInterface() {} - virtual ::grpc::Status CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::milvus::grpc::Status* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> AsyncCreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(AsyncCreateCollectionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> PrepareAsyncCreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(PrepareAsyncCreateCollectionRaw(context, request, cq)); - } - virtual ::grpc::Status CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::milvus::grpc::Status* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> AsyncCreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(AsyncCreateIndexRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> PrepareAsyncCreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(PrepareAsyncCreateIndexRaw(context, request, cq)); - } - class experimental_async_interface { - public: - virtual ~experimental_async_interface() {} - virtual void CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void CreateIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void CreateIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - }; - virtual class experimental_async_interface* experimental_async() { return nullptr; } - private: - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* AsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* PrepareAsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* AsyncCreateIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* PrepareAsyncCreateIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) = 0; - }; - class Stub final : public StubInterface { - public: - Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); - ::grpc::Status CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::milvus::grpc::Status* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> AsyncCreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(AsyncCreateCollectionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> PrepareAsyncCreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(PrepareAsyncCreateCollectionRaw(context, request, cq)); - } - ::grpc::Status CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::milvus::grpc::Status* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> AsyncCreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(AsyncCreateIndexRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> PrepareAsyncCreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(PrepareAsyncCreateIndexRaw(context, request, cq)); - } - class experimental_async final : - public StubInterface::experimental_async_interface { - public: - void CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, std::function) override; - void CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) override; - void CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, std::function) override; - void CreateIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) override; - void CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void CreateIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - private: - friend class Stub; - explicit experimental_async(Stub* stub): stub_(stub) { } - Stub* stub() { return stub_; } - Stub* stub_; - }; - class experimental_async_interface* experimental_async() override { return &async_stub_; } - - private: - std::shared_ptr< ::grpc::ChannelInterface> channel_; - class experimental_async async_stub_{this}; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* AsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* PrepareAsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* AsyncCreateIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* PrepareAsyncCreateIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) override; - const ::grpc::internal::RpcMethod rpcmethod_CreateCollection_; - const ::grpc::internal::RpcMethod rpcmethod_CreateIndex_; - }; - 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 CreateCollection(::grpc::ServerContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response); - virtual ::grpc::Status CreateIndex(::grpc::ServerContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response); - }; - template - class WithAsyncMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_CreateCollection() { - ::grpc::Service::MarkMethodAsync(0); - } - ~WithAsyncMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCreateCollection(::grpc::ServerContext* context, ::milvus::grpc::Mapping* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::Status>* 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_CreateIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_CreateIndex() { - ::grpc::Service::MarkMethodAsync(1); - } - ~WithAsyncMethod_CreateIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCreateIndex(::grpc::ServerContext* context, ::milvus::grpc::IndexParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::Status>* 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); - } - }; - typedef WithAsyncMethod_CreateCollection > AsyncService; - template - class ExperimentalWithCallbackMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_CreateCollection() { - ::grpc::Service::experimental().MarkMethodCallback(0, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::Mapping, ::milvus::grpc::Status>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::Mapping* request, - ::milvus::grpc::Status* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->CreateCollection(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_CreateCollection( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::Mapping, ::milvus::grpc::Status>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::Mapping, ::milvus::grpc::Status>*>( - ::grpc::Service::experimental().GetHandler(0)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_CreateIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_CreateIndex() { - ::grpc::Service::experimental().MarkMethodCallback(1, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::IndexParam, ::milvus::grpc::Status>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::IndexParam* request, - ::milvus::grpc::Status* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->CreateIndex(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_CreateIndex( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::IndexParam, ::milvus::grpc::Status>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::IndexParam, ::milvus::grpc::Status>*>( - ::grpc::Service::experimental().GetHandler(1)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_CreateIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void CreateIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - typedef ExperimentalWithCallbackMethod_CreateCollection > ExperimentalCallbackService; - template - class WithGenericMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_CreateCollection() { - ::grpc::Service::MarkMethodGeneric(0); - } - ~WithGenericMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_CreateIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_CreateIndex() { - ::grpc::Service::MarkMethodGeneric(1); - } - ~WithGenericMethod_CreateIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithRawMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_CreateCollection() { - ::grpc::Service::MarkMethodRaw(0); - } - ~WithRawMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCreateCollection(::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_CreateIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_CreateIndex() { - ::grpc::Service::MarkMethodRaw(1); - } - ~WithRawMethod_CreateIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCreateIndex(::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 ExperimentalWithRawCallbackMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_CreateCollection() { - ::grpc::Service::experimental().MarkMethodRawCallback(0, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->CreateCollection(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void CreateCollection(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_CreateIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_CreateIndex() { - ::grpc::Service::experimental().MarkMethodRawCallback(1, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->CreateIndex(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_CreateIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void CreateIndex(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class WithStreamedUnaryMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_CreateCollection() { - ::grpc::Service::MarkMethodStreamed(0, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::Mapping, ::milvus::grpc::Status>(std::bind(&WithStreamedUnaryMethod_CreateCollection::StreamedCreateCollection, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedCreateCollection(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::Mapping,::milvus::grpc::Status>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_CreateIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_CreateIndex() { - ::grpc::Service::MarkMethodStreamed(1, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::IndexParam, ::milvus::grpc::Status>(std::bind(&WithStreamedUnaryMethod_CreateIndex::StreamedCreateIndex, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_CreateIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status CreateIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedCreateIndex(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::IndexParam,::milvus::grpc::Status>* server_unary_streamer) = 0; - }; - typedef WithStreamedUnaryMethod_CreateCollection > StreamedUnaryService; - typedef Service SplitStreamedService; - typedef WithStreamedUnaryMethod_CreateCollection > StreamedService; -}; - -} // namespace masterpb - - -#endif // GRPC_master_2eproto__INCLUDED diff --git a/proxy/src/grpc/master.pb.cc b/proxy/src/grpc/master.pb.cc deleted file mode 100644 index 859cabaf9c..0000000000 --- a/proxy/src/grpc/master.pb.cc +++ /dev/null @@ -1,1912 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: master.proto - -#include "master.pb.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -// @@protoc_insertion_point(includes) -#include -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_IndexParam_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Schema_message_2eproto; -namespace masterpb { -class CollectionDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _Collection_default_instance_; -class SegmentDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _Segment_default_instance_; -class SegmentStatDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _SegmentStat_default_instance_; -} // namespace masterpb -static void InitDefaultsscc_info_Collection_master_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::masterpb::_Collection_default_instance_; - new (ptr) ::masterpb::Collection(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::masterpb::Collection::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_Collection_master_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_Collection_master_2eproto}, { - &scc_info_Schema_message_2eproto.base, - &scc_info_IndexParam_message_2eproto.base,}}; - -static void InitDefaultsscc_info_Segment_master_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::masterpb::_Segment_default_instance_; - new (ptr) ::masterpb::Segment(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::masterpb::Segment::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Segment_master_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_Segment_master_2eproto}, {}}; - -static void InitDefaultsscc_info_SegmentStat_master_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::masterpb::_SegmentStat_default_instance_; - new (ptr) ::masterpb::SegmentStat(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::masterpb::SegmentStat::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SegmentStat_master_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_SegmentStat_master_2eproto}, {}}; - -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_master_2eproto[3]; -static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_master_2eproto[1]; -static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_master_2eproto = nullptr; - -const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_master_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::masterpb::Collection, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::masterpb::Collection, id_), - PROTOBUF_FIELD_OFFSET(::masterpb::Collection, name_), - PROTOBUF_FIELD_OFFSET(::masterpb::Collection, schema_), - PROTOBUF_FIELD_OFFSET(::masterpb::Collection, create_time_), - PROTOBUF_FIELD_OFFSET(::masterpb::Collection, segment_ids_), - PROTOBUF_FIELD_OFFSET(::masterpb::Collection, partition_tags_), - PROTOBUF_FIELD_OFFSET(::masterpb::Collection, indexes_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, segment_id_), - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, collection_id_), - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, partition_tag_), - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, channel_start_), - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, channel_end_), - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, open_timestamp_), - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, close_timestamp_), - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, collection_name_), - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, status_), - PROTOBUF_FIELD_OFFSET(::masterpb::Segment, rows_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, segment_id_), - PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, memory_size_), - PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, memory_rate_), - PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, status_), - PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, rows_), -}; -static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, sizeof(::masterpb::Collection)}, - { 12, -1, sizeof(::masterpb::Segment)}, - { 27, -1, sizeof(::masterpb::SegmentStat)}, -}; - -static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&::masterpb::_Collection_default_instance_), - reinterpret_cast(&::masterpb::_Segment_default_instance_), - reinterpret_cast(&::masterpb::_SegmentStat_default_instance_), -}; - -const char descriptor_table_protodef_master_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\014master.proto\022\010masterpb\032\rmessage.proto\"" - "\267\001\n\nCollection\022\n\n\002id\030\001 \001(\004\022\014\n\004name\030\002 \001(\t" - "\022#\n\006schema\030\003 \001(\0132\023.milvus.grpc.Schema\022\023\n" - "\013create_time\030\004 \001(\004\022\023\n\013segment_ids\030\005 \003(\004\022" - "\026\n\016partition_tags\030\006 \003(\t\022(\n\007indexes\030\007 \003(\013" - "2\027.milvus.grpc.IndexParam\"\370\001\n\007Segment\022\022\n" - "\nsegment_id\030\001 \001(\004\022\025\n\rcollection_id\030\002 \001(\004" - "\022\025\n\rpartition_tag\030\003 \001(\t\022\025\n\rchannel_start" - "\030\004 \001(\005\022\023\n\013channel_end\030\005 \001(\005\022\026\n\016open_time" - "stamp\030\006 \001(\004\022\027\n\017close_timestamp\030\007 \001(\004\022\027\n\017" - "collection_name\030\010 \001(\t\022\'\n\006status\030\t \001(\0162\027." - "masterpb.SegmentStatus\022\014\n\004rows\030\n \001(\003\"\202\001\n" - "\013SegmentStat\022\022\n\nsegment_id\030\001 \001(\004\022\023\n\013memo" - "ry_size\030\002 \001(\004\022\023\n\013memory_rate\030\003 \001(\002\022\'\n\006st" - "atus\030\004 \001(\0162\027.masterpb.SegmentStatus\022\014\n\004r" - "ows\030\005 \001(\003*B\n\rSegmentStatus\022\n\n\006OPENED\020\000\022\n" - "\n\006CLOSED\020\001\022\014\n\010INDEXING\020\002\022\013\n\007INDEXED\020\0032\210\001" - "\n\006Master\022\?\n\020CreateCollection\022\024.milvus.gr" - "pc.Mapping\032\023.milvus.grpc.Status\"\000\022=\n\013Cre" - "ateIndex\022\027.milvus.grpc.IndexParam\032\023.milv" - "us.grpc.Status\"\000B\010Z\006masterb\006proto3" - ; -static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_master_2eproto_deps[1] = { - &::descriptor_table_message_2eproto, -}; -static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_master_2eproto_sccs[3] = { - &scc_info_Collection_master_2eproto.base, - &scc_info_Segment_master_2eproto.base, - &scc_info_SegmentStat_master_2eproto.base, -}; -static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_master_2eproto_once; -static bool descriptor_table_master_2eproto_initialized = false; -const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_master_2eproto = { - &descriptor_table_master_2eproto_initialized, descriptor_table_protodef_master_2eproto, "master.proto", 834, - &descriptor_table_master_2eproto_once, descriptor_table_master_2eproto_sccs, descriptor_table_master_2eproto_deps, 3, 1, - schemas, file_default_instances, TableStruct_master_2eproto::offsets, - file_level_metadata_master_2eproto, 3, file_level_enum_descriptors_master_2eproto, file_level_service_descriptors_master_2eproto, -}; - -// Force running AddDescriptors() at dynamic initialization time. -static bool dynamic_init_dummy_master_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_master_2eproto), true); -namespace masterpb { -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SegmentStatus_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_master_2eproto); - return file_level_enum_descriptors_master_2eproto[0]; -} -bool SegmentStatus_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - return true; - default: - return false; - } -} - - -// =================================================================== - -void Collection::InitAsDefaultInstance() { - ::masterpb::_Collection_default_instance_._instance.get_mutable()->schema_ = const_cast< ::milvus::grpc::Schema*>( - ::milvus::grpc::Schema::internal_default_instance()); -} -class Collection::_Internal { - public: - static const ::milvus::grpc::Schema& schema(const Collection* msg); -}; - -const ::milvus::grpc::Schema& -Collection::_Internal::schema(const Collection* msg) { - return *msg->schema_; -} -void Collection::clear_schema() { - if (GetArenaNoVirtual() == nullptr && schema_ != nullptr) { - delete schema_; - } - schema_ = nullptr; -} -void Collection::clear_indexes() { - indexes_.Clear(); -} -Collection::Collection() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:masterpb.Collection) -} -Collection::Collection(const Collection& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - segment_ids_(from.segment_ids_), - partition_tags_(from.partition_tags_), - indexes_(from.indexes_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.name().empty()) { - name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_); - } - if (from.has_schema()) { - schema_ = new ::milvus::grpc::Schema(*from.schema_); - } else { - schema_ = nullptr; - } - ::memcpy(&id_, &from.id_, - static_cast(reinterpret_cast(&create_time_) - - reinterpret_cast(&id_)) + sizeof(create_time_)); - // @@protoc_insertion_point(copy_constructor:masterpb.Collection) -} - -void Collection::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Collection_master_2eproto.base); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&schema_, 0, static_cast( - reinterpret_cast(&create_time_) - - reinterpret_cast(&schema_)) + sizeof(create_time_)); -} - -Collection::~Collection() { - // @@protoc_insertion_point(destructor:masterpb.Collection) - SharedDtor(); -} - -void Collection::SharedDtor() { - name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete schema_; -} - -void Collection::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const Collection& Collection::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Collection_master_2eproto.base); - return *internal_default_instance(); -} - - -void Collection::Clear() { -// @@protoc_insertion_point(message_clear_start:masterpb.Collection) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - segment_ids_.Clear(); - partition_tags_.Clear(); - indexes_.Clear(); - name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (GetArenaNoVirtual() == nullptr && schema_ != nullptr) { - delete schema_; - } - schema_ = nullptr; - ::memset(&id_, 0, static_cast( - reinterpret_cast(&create_time_) - - reinterpret_cast(&id_)) + sizeof(create_time_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* Collection::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // uint64 id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string name = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_name(), ptr, ctx, "masterpb.Collection.name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .milvus.grpc.Schema schema = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ctx->ParseMessage(mutable_schema(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 create_time = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - create_time_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated uint64 segment_ids = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(mutable_segment_ids(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40) { - add_segment_ids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated string partition_tags = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { - ptr -= 1; - do { - ptr += 1; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_partition_tags(), ptr, ctx, "masterpb.Collection.partition_tags"); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 50); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.IndexParam indexes = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_indexes(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 58); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool Collection::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:masterpb.Collection) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // uint64 id = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &id_))); - } else { - goto handle_unusual; - } - break; - } - - // string name = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), static_cast(this->name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "masterpb.Collection.name")); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.Schema schema = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_schema())); - } else { - goto handle_unusual; - } - break; - } - - // uint64 create_time = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &create_time_))); - } else { - goto handle_unusual; - } - break; - } - - // repeated uint64 segment_ids = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, this->mutable_segment_ids()))); - } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - 1, 42u, input, this->mutable_segment_ids()))); - } else { - goto handle_unusual; - } - break; - } - - // repeated string partition_tags = 6; - case 6: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->add_partition_tags())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tags(this->partition_tags_size() - 1).data(), - static_cast(this->partition_tags(this->partition_tags_size() - 1).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "masterpb.Collection.partition_tags")); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.IndexParam indexes = 7; - case 7: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (58 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_indexes())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:masterpb.Collection) - return true; -failure: - // @@protoc_insertion_point(parse_failure:masterpb.Collection) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void Collection::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:masterpb.Collection) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint64 id = 1; - if (this->id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(1, this->id(), output); - } - - // string name = 2; - if (this->name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), static_cast(this->name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "masterpb.Collection.name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 2, this->name(), output); - } - - // .milvus.grpc.Schema schema = 3; - if (this->has_schema()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 3, _Internal::schema(this), output); - } - - // uint64 create_time = 4; - if (this->create_time() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(4, this->create_time(), output); - } - - // repeated uint64 segment_ids = 5; - if (this->segment_ids_size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(5, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); - output->WriteVarint32(_segment_ids_cached_byte_size_.load( - std::memory_order_relaxed)); - } - for (int i = 0, n = this->segment_ids_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64NoTag( - this->segment_ids(i), output); - } - - // repeated string partition_tags = 6; - for (int i = 0, n = this->partition_tags_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tags(i).data(), static_cast(this->partition_tags(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "masterpb.Collection.partition_tags"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString( - 6, this->partition_tags(i), output); - } - - // repeated .milvus.grpc.IndexParam indexes = 7; - for (unsigned int i = 0, - n = static_cast(this->indexes_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 7, - this->indexes(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:masterpb.Collection) -} - -::PROTOBUF_NAMESPACE_ID::uint8* Collection::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:masterpb.Collection) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint64 id = 1; - if (this->id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->id(), target); - } - - // string name = 2; - if (this->name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), static_cast(this->name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "masterpb.Collection.name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 2, this->name(), target); - } - - // .milvus.grpc.Schema schema = 3; - if (this->has_schema()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 3, _Internal::schema(this), target); - } - - // uint64 create_time = 4; - if (this->create_time() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(4, this->create_time(), target); - } - - // repeated uint64 segment_ids = 5; - if (this->segment_ids_size() > 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( - 5, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, - target); - target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( - _segment_ids_cached_byte_size_.load(std::memory_order_relaxed), - target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteUInt64NoTagToArray(this->segment_ids_, target); - } - - // repeated string partition_tags = 6; - for (int i = 0, n = this->partition_tags_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tags(i).data(), static_cast(this->partition_tags(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "masterpb.Collection.partition_tags"); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteStringToArray(6, this->partition_tags(i), target); - } - - // repeated .milvus.grpc.IndexParam indexes = 7; - for (unsigned int i = 0, - n = static_cast(this->indexes_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 7, this->indexes(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:masterpb.Collection) - return target; -} - -size_t Collection::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:masterpb.Collection) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated uint64 segment_ids = 5; - { - size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - UInt64Size(this->segment_ids_); - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _segment_ids_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // repeated string partition_tags = 6; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->partition_tags_size()); - for (int i = 0, n = this->partition_tags_size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->partition_tags(i)); - } - - // repeated .milvus.grpc.IndexParam indexes = 7; - { - unsigned int count = static_cast(this->indexes_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->indexes(static_cast(i))); - } - } - - // string name = 2; - if (this->name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->name()); - } - - // .milvus.grpc.Schema schema = 3; - if (this->has_schema()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *schema_); - } - - // uint64 id = 1; - if (this->id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->id()); - } - - // uint64 create_time = 4; - if (this->create_time() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->create_time()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Collection::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:masterpb.Collection) - GOOGLE_DCHECK_NE(&from, this); - const Collection* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:masterpb.Collection) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:masterpb.Collection) - MergeFrom(*source); - } -} - -void Collection::MergeFrom(const Collection& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:masterpb.Collection) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - segment_ids_.MergeFrom(from.segment_ids_); - partition_tags_.MergeFrom(from.partition_tags_); - indexes_.MergeFrom(from.indexes_); - if (from.name().size() > 0) { - - name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_); - } - if (from.has_schema()) { - mutable_schema()->::milvus::grpc::Schema::MergeFrom(from.schema()); - } - if (from.id() != 0) { - set_id(from.id()); - } - if (from.create_time() != 0) { - set_create_time(from.create_time()); - } -} - -void Collection::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:masterpb.Collection) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Collection::CopyFrom(const Collection& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:masterpb.Collection) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Collection::IsInitialized() const { - return true; -} - -void Collection::InternalSwap(Collection* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - segment_ids_.InternalSwap(&other->segment_ids_); - partition_tags_.InternalSwap(CastToBase(&other->partition_tags_)); - CastToBase(&indexes_)->InternalSwap(CastToBase(&other->indexes_)); - name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(schema_, other->schema_); - swap(id_, other->id_); - swap(create_time_, other->create_time_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Collection::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void Segment::InitAsDefaultInstance() { -} -class Segment::_Internal { - public: -}; - -Segment::Segment() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:masterpb.Segment) -} -Segment::Segment(const Segment& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - partition_tag_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.partition_tag().empty()) { - partition_tag_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.partition_tag_); - } - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.collection_name().empty()) { - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - ::memcpy(&segment_id_, &from.segment_id_, - static_cast(reinterpret_cast(&status_) - - reinterpret_cast(&segment_id_)) + sizeof(status_)); - // @@protoc_insertion_point(copy_constructor:masterpb.Segment) -} - -void Segment::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Segment_master_2eproto.base); - partition_tag_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&segment_id_, 0, static_cast( - reinterpret_cast(&status_) - - reinterpret_cast(&segment_id_)) + sizeof(status_)); -} - -Segment::~Segment() { - // @@protoc_insertion_point(destructor:masterpb.Segment) - SharedDtor(); -} - -void Segment::SharedDtor() { - partition_tag_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - collection_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void Segment::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const Segment& Segment::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Segment_master_2eproto.base); - return *internal_default_instance(); -} - - -void Segment::Clear() { -// @@protoc_insertion_point(message_clear_start:masterpb.Segment) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - partition_tag_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&segment_id_, 0, static_cast( - reinterpret_cast(&status_) - - reinterpret_cast(&segment_id_)) + sizeof(status_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* Segment::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // uint64 segment_id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - segment_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 collection_id = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - collection_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string partition_tag = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_partition_tag(), ptr, ctx, "masterpb.Segment.partition_tag"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int32 channel_start = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - channel_start_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int32 channel_end = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - channel_end_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 open_timestamp = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - open_timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 close_timestamp = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { - close_timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string collection_name = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_collection_name(), ptr, ctx, "masterpb.Segment.collection_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .masterpb.SegmentStatus status = 9; - case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - set_status(static_cast<::masterpb::SegmentStatus>(val)); - } else goto handle_unusual; - continue; - // int64 rows = 10; - case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) { - rows_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool Segment::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:masterpb.Segment) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // uint64 segment_id = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &segment_id_))); - } else { - goto handle_unusual; - } - break; - } - - // uint64 collection_id = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &collection_id_))); - } else { - goto handle_unusual; - } - break; - } - - // string partition_tag = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_partition_tag())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag().data(), static_cast(this->partition_tag().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "masterpb.Segment.partition_tag")); - } else { - goto handle_unusual; - } - break; - } - - // int32 channel_start = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>( - input, &channel_start_))); - } else { - goto handle_unusual; - } - break; - } - - // int32 channel_end = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>( - input, &channel_end_))); - } else { - goto handle_unusual; - } - break; - } - - // uint64 open_timestamp = 6; - case 6: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (48 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &open_timestamp_))); - } else { - goto handle_unusual; - } - break; - } - - // uint64 close_timestamp = 7; - case 7: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &close_timestamp_))); - } else { - goto handle_unusual; - } - break; - } - - // string collection_name = 8; - case 8: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (66 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_collection_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "masterpb.Segment.collection_name")); - } else { - goto handle_unusual; - } - break; - } - - // .masterpb.SegmentStatus status = 9; - case 9: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (72 & 0xFF)) { - int value = 0; - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - set_status(static_cast< ::masterpb::SegmentStatus >(value)); - } else { - goto handle_unusual; - } - break; - } - - // int64 rows = 10; - case 10: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (80 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &rows_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:masterpb.Segment) - return true; -failure: - // @@protoc_insertion_point(parse_failure:masterpb.Segment) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void Segment::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:masterpb.Segment) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint64 segment_id = 1; - if (this->segment_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(1, this->segment_id(), output); - } - - // uint64 collection_id = 2; - if (this->collection_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(2, this->collection_id(), output); - } - - // string partition_tag = 3; - if (this->partition_tag().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag().data(), static_cast(this->partition_tag().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "masterpb.Segment.partition_tag"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 3, this->partition_tag(), output); - } - - // int32 channel_start = 4; - if (this->channel_start() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(4, this->channel_start(), output); - } - - // int32 channel_end = 5; - if (this->channel_end() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(5, this->channel_end(), output); - } - - // uint64 open_timestamp = 6; - if (this->open_timestamp() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(6, this->open_timestamp(), output); - } - - // uint64 close_timestamp = 7; - if (this->close_timestamp() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(7, this->close_timestamp(), output); - } - - // string collection_name = 8; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "masterpb.Segment.collection_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 8, this->collection_name(), output); - } - - // .masterpb.SegmentStatus status = 9; - if (this->status() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( - 9, this->status(), output); - } - - // int64 rows = 10; - if (this->rows() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(10, this->rows(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:masterpb.Segment) -} - -::PROTOBUF_NAMESPACE_ID::uint8* Segment::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:masterpb.Segment) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint64 segment_id = 1; - if (this->segment_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->segment_id(), target); - } - - // uint64 collection_id = 2; - if (this->collection_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->collection_id(), target); - } - - // string partition_tag = 3; - if (this->partition_tag().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag().data(), static_cast(this->partition_tag().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "masterpb.Segment.partition_tag"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 3, this->partition_tag(), target); - } - - // int32 channel_start = 4; - if (this->channel_start() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->channel_start(), target); - } - - // int32 channel_end = 5; - if (this->channel_end() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->channel_end(), target); - } - - // uint64 open_timestamp = 6; - if (this->open_timestamp() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(6, this->open_timestamp(), target); - } - - // uint64 close_timestamp = 7; - if (this->close_timestamp() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(7, this->close_timestamp(), target); - } - - // string collection_name = 8; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "masterpb.Segment.collection_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 8, this->collection_name(), target); - } - - // .masterpb.SegmentStatus status = 9; - if (this->status() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 9, this->status(), target); - } - - // int64 rows = 10; - if (this->rows() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(10, this->rows(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:masterpb.Segment) - return target; -} - -size_t Segment::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:masterpb.Segment) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string partition_tag = 3; - if (this->partition_tag().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->partition_tag()); - } - - // string collection_name = 8; - if (this->collection_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_name()); - } - - // uint64 segment_id = 1; - if (this->segment_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->segment_id()); - } - - // uint64 collection_id = 2; - if (this->collection_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->collection_id()); - } - - // int32 channel_start = 4; - if (this->channel_start() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - this->channel_start()); - } - - // int32 channel_end = 5; - if (this->channel_end() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - this->channel_end()); - } - - // uint64 open_timestamp = 6; - if (this->open_timestamp() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->open_timestamp()); - } - - // uint64 close_timestamp = 7; - if (this->close_timestamp() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->close_timestamp()); - } - - // int64 rows = 10; - if (this->rows() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->rows()); - } - - // .masterpb.SegmentStatus status = 9; - if (this->status() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->status()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Segment::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:masterpb.Segment) - GOOGLE_DCHECK_NE(&from, this); - const Segment* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:masterpb.Segment) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:masterpb.Segment) - MergeFrom(*source); - } -} - -void Segment::MergeFrom(const Segment& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:masterpb.Segment) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.partition_tag().size() > 0) { - - partition_tag_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.partition_tag_); - } - if (from.collection_name().size() > 0) { - - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - if (from.segment_id() != 0) { - set_segment_id(from.segment_id()); - } - if (from.collection_id() != 0) { - set_collection_id(from.collection_id()); - } - if (from.channel_start() != 0) { - set_channel_start(from.channel_start()); - } - if (from.channel_end() != 0) { - set_channel_end(from.channel_end()); - } - if (from.open_timestamp() != 0) { - set_open_timestamp(from.open_timestamp()); - } - if (from.close_timestamp() != 0) { - set_close_timestamp(from.close_timestamp()); - } - if (from.rows() != 0) { - set_rows(from.rows()); - } - if (from.status() != 0) { - set_status(from.status()); - } -} - -void Segment::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:masterpb.Segment) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Segment::CopyFrom(const Segment& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:masterpb.Segment) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Segment::IsInitialized() const { - return true; -} - -void Segment::InternalSwap(Segment* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - partition_tag_.Swap(&other->partition_tag_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - collection_name_.Swap(&other->collection_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(segment_id_, other->segment_id_); - swap(collection_id_, other->collection_id_); - swap(channel_start_, other->channel_start_); - swap(channel_end_, other->channel_end_); - swap(open_timestamp_, other->open_timestamp_); - swap(close_timestamp_, other->close_timestamp_); - swap(rows_, other->rows_); - swap(status_, other->status_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Segment::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void SegmentStat::InitAsDefaultInstance() { -} -class SegmentStat::_Internal { - public: -}; - -SegmentStat::SegmentStat() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:masterpb.SegmentStat) -} -SegmentStat::SegmentStat(const SegmentStat& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::memcpy(&segment_id_, &from.segment_id_, - static_cast(reinterpret_cast(&rows_) - - reinterpret_cast(&segment_id_)) + sizeof(rows_)); - // @@protoc_insertion_point(copy_constructor:masterpb.SegmentStat) -} - -void SegmentStat::SharedCtor() { - ::memset(&segment_id_, 0, static_cast( - reinterpret_cast(&rows_) - - reinterpret_cast(&segment_id_)) + sizeof(rows_)); -} - -SegmentStat::~SegmentStat() { - // @@protoc_insertion_point(destructor:masterpb.SegmentStat) - SharedDtor(); -} - -void SegmentStat::SharedDtor() { -} - -void SegmentStat::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const SegmentStat& SegmentStat::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SegmentStat_master_2eproto.base); - return *internal_default_instance(); -} - - -void SegmentStat::Clear() { -// @@protoc_insertion_point(message_clear_start:masterpb.SegmentStat) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&segment_id_, 0, static_cast( - reinterpret_cast(&rows_) - - reinterpret_cast(&segment_id_)) + sizeof(rows_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* SegmentStat::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // uint64 segment_id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - segment_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 memory_size = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - memory_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // float memory_rate = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 29)) { - memory_rate_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(float); - } else goto handle_unusual; - continue; - // .masterpb.SegmentStatus status = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - set_status(static_cast<::masterpb::SegmentStatus>(val)); - } else goto handle_unusual; - continue; - // int64 rows = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - rows_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool SegmentStat::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:masterpb.SegmentStat) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // uint64 segment_id = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &segment_id_))); - } else { - goto handle_unusual; - } - break; - } - - // uint64 memory_size = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &memory_size_))); - } else { - goto handle_unusual; - } - break; - } - - // float memory_rate = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (29 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( - input, &memory_rate_))); - } else { - goto handle_unusual; - } - break; - } - - // .masterpb.SegmentStatus status = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { - int value = 0; - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - set_status(static_cast< ::masterpb::SegmentStatus >(value)); - } else { - goto handle_unusual; - } - break; - } - - // int64 rows = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &rows_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:masterpb.SegmentStat) - return true; -failure: - // @@protoc_insertion_point(parse_failure:masterpb.SegmentStat) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void SegmentStat::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:masterpb.SegmentStat) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint64 segment_id = 1; - if (this->segment_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(1, this->segment_id(), output); - } - - // uint64 memory_size = 2; - if (this->memory_size() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(2, this->memory_size(), output); - } - - // float memory_rate = 3; - if (!(this->memory_rate() <= 0 && this->memory_rate() >= 0)) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(3, this->memory_rate(), output); - } - - // .masterpb.SegmentStatus status = 4; - if (this->status() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( - 4, this->status(), output); - } - - // int64 rows = 5; - if (this->rows() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(5, this->rows(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:masterpb.SegmentStat) -} - -::PROTOBUF_NAMESPACE_ID::uint8* SegmentStat::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:masterpb.SegmentStat) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint64 segment_id = 1; - if (this->segment_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->segment_id(), target); - } - - // uint64 memory_size = 2; - if (this->memory_size() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->memory_size(), target); - } - - // float memory_rate = 3; - if (!(this->memory_rate() <= 0 && this->memory_rate() >= 0)) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->memory_rate(), target); - } - - // .masterpb.SegmentStatus status = 4; - if (this->status() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 4, this->status(), target); - } - - // int64 rows = 5; - if (this->rows() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(5, this->rows(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:masterpb.SegmentStat) - return target; -} - -size_t SegmentStat::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:masterpb.SegmentStat) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // uint64 segment_id = 1; - if (this->segment_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->segment_id()); - } - - // uint64 memory_size = 2; - if (this->memory_size() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->memory_size()); - } - - // float memory_rate = 3; - if (!(this->memory_rate() <= 0 && this->memory_rate() >= 0)) { - total_size += 1 + 4; - } - - // .masterpb.SegmentStatus status = 4; - if (this->status() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->status()); - } - - // int64 rows = 5; - if (this->rows() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->rows()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void SegmentStat::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:masterpb.SegmentStat) - GOOGLE_DCHECK_NE(&from, this); - const SegmentStat* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:masterpb.SegmentStat) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:masterpb.SegmentStat) - MergeFrom(*source); - } -} - -void SegmentStat::MergeFrom(const SegmentStat& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:masterpb.SegmentStat) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.segment_id() != 0) { - set_segment_id(from.segment_id()); - } - if (from.memory_size() != 0) { - set_memory_size(from.memory_size()); - } - if (!(from.memory_rate() <= 0 && from.memory_rate() >= 0)) { - set_memory_rate(from.memory_rate()); - } - if (from.status() != 0) { - set_status(from.status()); - } - if (from.rows() != 0) { - set_rows(from.rows()); - } -} - -void SegmentStat::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:masterpb.SegmentStat) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void SegmentStat::CopyFrom(const SegmentStat& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:masterpb.SegmentStat) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool SegmentStat::IsInitialized() const { - return true; -} - -void SegmentStat::InternalSwap(SegmentStat* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(segment_id_, other->segment_id_); - swap(memory_size_, other->memory_size_); - swap(memory_rate_, other->memory_rate_); - swap(status_, other->status_); - swap(rows_, other->rows_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata SegmentStat::GetMetadata() const { - return GetMetadataStatic(); -} - - -// @@protoc_insertion_point(namespace_scope) -} // namespace masterpb -PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::masterpb::Collection* Arena::CreateMaybeMessage< ::masterpb::Collection >(Arena* arena) { - return Arena::CreateInternal< ::masterpb::Collection >(arena); -} -template<> PROTOBUF_NOINLINE ::masterpb::Segment* Arena::CreateMaybeMessage< ::masterpb::Segment >(Arena* arena) { - return Arena::CreateInternal< ::masterpb::Segment >(arena); -} -template<> PROTOBUF_NOINLINE ::masterpb::SegmentStat* Arena::CreateMaybeMessage< ::masterpb::SegmentStat >(Arena* arena) { - return Arena::CreateInternal< ::masterpb::SegmentStat >(arena); -} -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) -#include diff --git a/proxy/src/grpc/master.pb.h b/proxy/src/grpc/master.pb.h deleted file mode 100644 index a572507692..0000000000 --- a/proxy/src/grpc/master.pb.h +++ /dev/null @@ -1,1250 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: master.proto - -#ifndef GOOGLE_PROTOBUF_INCLUDED_master_2eproto -#define GOOGLE_PROTOBUF_INCLUDED_master_2eproto - -#include -#include - -#include -#if PROTOBUF_VERSION < 3009000 -#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 -#if 3009000 < 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 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: export -#include // IWYU pragma: export -#include -#include -#include "message.pb.h" -// @@protoc_insertion_point(includes) -#include -#define PROTOBUF_INTERNAL_EXPORT_master_2eproto -PROTOBUF_NAMESPACE_OPEN -namespace internal { -class AnyMetadata; -} // namespace internal -PROTOBUF_NAMESPACE_CLOSE - -// Internal implementation detail -- do not use these members. -struct TableStruct_master_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[3] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; - static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; -}; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_master_2eproto; -namespace masterpb { -class Collection; -class CollectionDefaultTypeInternal; -extern CollectionDefaultTypeInternal _Collection_default_instance_; -class Segment; -class SegmentDefaultTypeInternal; -extern SegmentDefaultTypeInternal _Segment_default_instance_; -class SegmentStat; -class SegmentStatDefaultTypeInternal; -extern SegmentStatDefaultTypeInternal _SegmentStat_default_instance_; -} // namespace masterpb -PROTOBUF_NAMESPACE_OPEN -template<> ::masterpb::Collection* Arena::CreateMaybeMessage<::masterpb::Collection>(Arena*); -template<> ::masterpb::Segment* Arena::CreateMaybeMessage<::masterpb::Segment>(Arena*); -template<> ::masterpb::SegmentStat* Arena::CreateMaybeMessage<::masterpb::SegmentStat>(Arena*); -PROTOBUF_NAMESPACE_CLOSE -namespace masterpb { - -enum SegmentStatus : int { - OPENED = 0, - CLOSED = 1, - INDEXING = 2, - INDEXED = 3, - SegmentStatus_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - SegmentStatus_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool SegmentStatus_IsValid(int value); -constexpr SegmentStatus SegmentStatus_MIN = OPENED; -constexpr SegmentStatus SegmentStatus_MAX = INDEXED; -constexpr int SegmentStatus_ARRAYSIZE = SegmentStatus_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SegmentStatus_descriptor(); -template -inline const std::string& SegmentStatus_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function SegmentStatus_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - SegmentStatus_descriptor(), enum_t_value); -} -inline bool SegmentStatus_Parse( - const std::string& name, SegmentStatus* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - SegmentStatus_descriptor(), name, value); -} -// =================================================================== - -class Collection : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:masterpb.Collection) */ { - public: - Collection(); - virtual ~Collection(); - - Collection(const Collection& from); - Collection(Collection&& from) noexcept - : Collection() { - *this = ::std::move(from); - } - - inline Collection& operator=(const Collection& from) { - CopyFrom(from); - return *this; - } - inline Collection& operator=(Collection&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const Collection& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const Collection* internal_default_instance() { - return reinterpret_cast( - &_Collection_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - friend void swap(Collection& a, Collection& b) { - a.Swap(&b); - } - inline void Swap(Collection* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline Collection* New() const final { - return CreateMaybeMessage(nullptr); - } - - Collection* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const Collection& from); - void MergeFrom(const Collection& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Collection* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "masterpb.Collection"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_master_2eproto); - return ::descriptor_table_master_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kSegmentIdsFieldNumber = 5, - kPartitionTagsFieldNumber = 6, - kIndexesFieldNumber = 7, - kNameFieldNumber = 2, - kSchemaFieldNumber = 3, - kIdFieldNumber = 1, - kCreateTimeFieldNumber = 4, - }; - // repeated uint64 segment_ids = 5; - int segment_ids_size() const; - void clear_segment_ids(); - ::PROTOBUF_NAMESPACE_ID::uint64 segment_ids(int index) const; - void set_segment_ids(int index, ::PROTOBUF_NAMESPACE_ID::uint64 value); - void add_segment_ids(::PROTOBUF_NAMESPACE_ID::uint64 value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >& - segment_ids() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >* - mutable_segment_ids(); - - // repeated string partition_tags = 6; - int partition_tags_size() const; - void clear_partition_tags(); - const std::string& partition_tags(int index) const; - std::string* mutable_partition_tags(int index); - void set_partition_tags(int index, const std::string& value); - void set_partition_tags(int index, std::string&& value); - void set_partition_tags(int index, const char* value); - void set_partition_tags(int index, const char* value, size_t size); - std::string* add_partition_tags(); - void add_partition_tags(const std::string& value); - void add_partition_tags(std::string&& value); - void add_partition_tags(const char* value); - void add_partition_tags(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& partition_tags() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_partition_tags(); - - // repeated .milvus.grpc.IndexParam indexes = 7; - int indexes_size() const; - void clear_indexes(); - ::milvus::grpc::IndexParam* mutable_indexes(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::IndexParam >* - mutable_indexes(); - const ::milvus::grpc::IndexParam& indexes(int index) const; - ::milvus::grpc::IndexParam* add_indexes(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::IndexParam >& - indexes() const; - - // string name = 2; - void clear_name(); - const std::string& name() const; - void set_name(const std::string& value); - void set_name(std::string&& value); - void set_name(const char* value); - void set_name(const char* value, size_t size); - std::string* mutable_name(); - std::string* release_name(); - void set_allocated_name(std::string* name); - - // .milvus.grpc.Schema schema = 3; - bool has_schema() const; - void clear_schema(); - const ::milvus::grpc::Schema& schema() const; - ::milvus::grpc::Schema* release_schema(); - ::milvus::grpc::Schema* mutable_schema(); - void set_allocated_schema(::milvus::grpc::Schema* schema); - - // uint64 id = 1; - void clear_id(); - ::PROTOBUF_NAMESPACE_ID::uint64 id() const; - void set_id(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // uint64 create_time = 4; - void clear_create_time(); - ::PROTOBUF_NAMESPACE_ID::uint64 create_time() const; - void set_create_time(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // @@protoc_insertion_point(class_scope:masterpb.Collection) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 > segment_ids_; - mutable std::atomic _segment_ids_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField partition_tags_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::IndexParam > indexes_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::milvus::grpc::Schema* schema_; - ::PROTOBUF_NAMESPACE_ID::uint64 id_; - ::PROTOBUF_NAMESPACE_ID::uint64 create_time_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_master_2eproto; -}; -// ------------------------------------------------------------------- - -class Segment : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:masterpb.Segment) */ { - public: - Segment(); - virtual ~Segment(); - - Segment(const Segment& from); - Segment(Segment&& from) noexcept - : Segment() { - *this = ::std::move(from); - } - - inline Segment& operator=(const Segment& from) { - CopyFrom(from); - return *this; - } - inline Segment& operator=(Segment&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const Segment& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const Segment* internal_default_instance() { - return reinterpret_cast( - &_Segment_default_instance_); - } - static constexpr int kIndexInFileMessages = - 1; - - friend void swap(Segment& a, Segment& b) { - a.Swap(&b); - } - inline void Swap(Segment* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline Segment* New() const final { - return CreateMaybeMessage(nullptr); - } - - Segment* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const Segment& from); - void MergeFrom(const Segment& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Segment* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "masterpb.Segment"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_master_2eproto); - return ::descriptor_table_master_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kPartitionTagFieldNumber = 3, - kCollectionNameFieldNumber = 8, - kSegmentIdFieldNumber = 1, - kCollectionIdFieldNumber = 2, - kChannelStartFieldNumber = 4, - kChannelEndFieldNumber = 5, - kOpenTimestampFieldNumber = 6, - kCloseTimestampFieldNumber = 7, - kRowsFieldNumber = 10, - kStatusFieldNumber = 9, - }; - // string partition_tag = 3; - void clear_partition_tag(); - const std::string& partition_tag() const; - void set_partition_tag(const std::string& value); - void set_partition_tag(std::string&& value); - void set_partition_tag(const char* value); - void set_partition_tag(const char* value, size_t size); - std::string* mutable_partition_tag(); - std::string* release_partition_tag(); - void set_allocated_partition_tag(std::string* partition_tag); - - // string collection_name = 8; - void clear_collection_name(); - const std::string& collection_name() const; - void set_collection_name(const std::string& value); - void set_collection_name(std::string&& value); - void set_collection_name(const char* value); - void set_collection_name(const char* value, size_t size); - std::string* mutable_collection_name(); - std::string* release_collection_name(); - void set_allocated_collection_name(std::string* collection_name); - - // uint64 segment_id = 1; - void clear_segment_id(); - ::PROTOBUF_NAMESPACE_ID::uint64 segment_id() const; - void set_segment_id(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // uint64 collection_id = 2; - void clear_collection_id(); - ::PROTOBUF_NAMESPACE_ID::uint64 collection_id() const; - void set_collection_id(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // int32 channel_start = 4; - void clear_channel_start(); - ::PROTOBUF_NAMESPACE_ID::int32 channel_start() const; - void set_channel_start(::PROTOBUF_NAMESPACE_ID::int32 value); - - // int32 channel_end = 5; - void clear_channel_end(); - ::PROTOBUF_NAMESPACE_ID::int32 channel_end() const; - void set_channel_end(::PROTOBUF_NAMESPACE_ID::int32 value); - - // uint64 open_timestamp = 6; - void clear_open_timestamp(); - ::PROTOBUF_NAMESPACE_ID::uint64 open_timestamp() const; - void set_open_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // uint64 close_timestamp = 7; - void clear_close_timestamp(); - ::PROTOBUF_NAMESPACE_ID::uint64 close_timestamp() const; - void set_close_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // int64 rows = 10; - void clear_rows(); - ::PROTOBUF_NAMESPACE_ID::int64 rows() const; - void set_rows(::PROTOBUF_NAMESPACE_ID::int64 value); - - // .masterpb.SegmentStatus status = 9; - void clear_status(); - ::masterpb::SegmentStatus status() const; - void set_status(::masterpb::SegmentStatus value); - - // @@protoc_insertion_point(class_scope:masterpb.Segment) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr partition_tag_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr collection_name_; - ::PROTOBUF_NAMESPACE_ID::uint64 segment_id_; - ::PROTOBUF_NAMESPACE_ID::uint64 collection_id_; - ::PROTOBUF_NAMESPACE_ID::int32 channel_start_; - ::PROTOBUF_NAMESPACE_ID::int32 channel_end_; - ::PROTOBUF_NAMESPACE_ID::uint64 open_timestamp_; - ::PROTOBUF_NAMESPACE_ID::uint64 close_timestamp_; - ::PROTOBUF_NAMESPACE_ID::int64 rows_; - int status_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_master_2eproto; -}; -// ------------------------------------------------------------------- - -class SegmentStat : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:masterpb.SegmentStat) */ { - public: - SegmentStat(); - virtual ~SegmentStat(); - - SegmentStat(const SegmentStat& from); - SegmentStat(SegmentStat&& from) noexcept - : SegmentStat() { - *this = ::std::move(from); - } - - inline SegmentStat& operator=(const SegmentStat& from) { - CopyFrom(from); - return *this; - } - inline SegmentStat& operator=(SegmentStat&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const SegmentStat& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const SegmentStat* internal_default_instance() { - return reinterpret_cast( - &_SegmentStat_default_instance_); - } - static constexpr int kIndexInFileMessages = - 2; - - friend void swap(SegmentStat& a, SegmentStat& b) { - a.Swap(&b); - } - inline void Swap(SegmentStat* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline SegmentStat* New() const final { - return CreateMaybeMessage(nullptr); - } - - SegmentStat* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const SegmentStat& from); - void MergeFrom(const SegmentStat& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(SegmentStat* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "masterpb.SegmentStat"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_master_2eproto); - return ::descriptor_table_master_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kSegmentIdFieldNumber = 1, - kMemorySizeFieldNumber = 2, - kMemoryRateFieldNumber = 3, - kStatusFieldNumber = 4, - kRowsFieldNumber = 5, - }; - // uint64 segment_id = 1; - void clear_segment_id(); - ::PROTOBUF_NAMESPACE_ID::uint64 segment_id() const; - void set_segment_id(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // uint64 memory_size = 2; - void clear_memory_size(); - ::PROTOBUF_NAMESPACE_ID::uint64 memory_size() const; - void set_memory_size(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // float memory_rate = 3; - void clear_memory_rate(); - float memory_rate() const; - void set_memory_rate(float value); - - // .masterpb.SegmentStatus status = 4; - void clear_status(); - ::masterpb::SegmentStatus status() const; - void set_status(::masterpb::SegmentStatus value); - - // int64 rows = 5; - void clear_rows(); - ::PROTOBUF_NAMESPACE_ID::int64 rows() const; - void set_rows(::PROTOBUF_NAMESPACE_ID::int64 value); - - // @@protoc_insertion_point(class_scope:masterpb.SegmentStat) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::uint64 segment_id_; - ::PROTOBUF_NAMESPACE_ID::uint64 memory_size_; - float memory_rate_; - int status_; - ::PROTOBUF_NAMESPACE_ID::int64 rows_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_master_2eproto; -}; -// =================================================================== - - -// =================================================================== - -#ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// Collection - -// uint64 id = 1; -inline void Collection::clear_id() { - id_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Collection::id() const { - // @@protoc_insertion_point(field_get:masterpb.Collection.id) - return id_; -} -inline void Collection::set_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - id_ = value; - // @@protoc_insertion_point(field_set:masterpb.Collection.id) -} - -// string name = 2; -inline void Collection::clear_name() { - name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& Collection::name() const { - // @@protoc_insertion_point(field_get:masterpb.Collection.name) - return name_.GetNoArena(); -} -inline void Collection::set_name(const std::string& value) { - - name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:masterpb.Collection.name) -} -inline void Collection::set_name(std::string&& value) { - - name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:masterpb.Collection.name) -} -inline void Collection::set_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:masterpb.Collection.name) -} -inline void Collection::set_name(const char* value, size_t size) { - - name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:masterpb.Collection.name) -} -inline std::string* Collection::mutable_name() { - - // @@protoc_insertion_point(field_mutable:masterpb.Collection.name) - return name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* Collection::release_name() { - // @@protoc_insertion_point(field_release:masterpb.Collection.name) - - return name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void Collection::set_allocated_name(std::string* name) { - if (name != nullptr) { - - } else { - - } - name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name); - // @@protoc_insertion_point(field_set_allocated:masterpb.Collection.name) -} - -// .milvus.grpc.Schema schema = 3; -inline bool Collection::has_schema() const { - return this != internal_default_instance() && schema_ != nullptr; -} -inline const ::milvus::grpc::Schema& Collection::schema() const { - const ::milvus::grpc::Schema* p = schema_; - // @@protoc_insertion_point(field_get:masterpb.Collection.schema) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Schema_default_instance_); -} -inline ::milvus::grpc::Schema* Collection::release_schema() { - // @@protoc_insertion_point(field_release:masterpb.Collection.schema) - - ::milvus::grpc::Schema* temp = schema_; - schema_ = nullptr; - return temp; -} -inline ::milvus::grpc::Schema* Collection::mutable_schema() { - - if (schema_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Schema>(GetArenaNoVirtual()); - schema_ = p; - } - // @@protoc_insertion_point(field_mutable:masterpb.Collection.schema) - return schema_; -} -inline void Collection::set_allocated_schema(::milvus::grpc::Schema* schema) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(schema_); - } - if (schema) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - schema = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, schema, submessage_arena); - } - - } else { - - } - schema_ = schema; - // @@protoc_insertion_point(field_set_allocated:masterpb.Collection.schema) -} - -// uint64 create_time = 4; -inline void Collection::clear_create_time() { - create_time_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Collection::create_time() const { - // @@protoc_insertion_point(field_get:masterpb.Collection.create_time) - return create_time_; -} -inline void Collection::set_create_time(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - create_time_ = value; - // @@protoc_insertion_point(field_set:masterpb.Collection.create_time) -} - -// repeated uint64 segment_ids = 5; -inline int Collection::segment_ids_size() const { - return segment_ids_.size(); -} -inline void Collection::clear_segment_ids() { - segment_ids_.Clear(); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Collection::segment_ids(int index) const { - // @@protoc_insertion_point(field_get:masterpb.Collection.segment_ids) - return segment_ids_.Get(index); -} -inline void Collection::set_segment_ids(int index, ::PROTOBUF_NAMESPACE_ID::uint64 value) { - segment_ids_.Set(index, value); - // @@protoc_insertion_point(field_set:masterpb.Collection.segment_ids) -} -inline void Collection::add_segment_ids(::PROTOBUF_NAMESPACE_ID::uint64 value) { - segment_ids_.Add(value); - // @@protoc_insertion_point(field_add:masterpb.Collection.segment_ids) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >& -Collection::segment_ids() const { - // @@protoc_insertion_point(field_list:masterpb.Collection.segment_ids) - return segment_ids_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >* -Collection::mutable_segment_ids() { - // @@protoc_insertion_point(field_mutable_list:masterpb.Collection.segment_ids) - return &segment_ids_; -} - -// repeated string partition_tags = 6; -inline int Collection::partition_tags_size() const { - return partition_tags_.size(); -} -inline void Collection::clear_partition_tags() { - partition_tags_.Clear(); -} -inline const std::string& Collection::partition_tags(int index) const { - // @@protoc_insertion_point(field_get:masterpb.Collection.partition_tags) - return partition_tags_.Get(index); -} -inline std::string* Collection::mutable_partition_tags(int index) { - // @@protoc_insertion_point(field_mutable:masterpb.Collection.partition_tags) - return partition_tags_.Mutable(index); -} -inline void Collection::set_partition_tags(int index, const std::string& value) { - // @@protoc_insertion_point(field_set:masterpb.Collection.partition_tags) - partition_tags_.Mutable(index)->assign(value); -} -inline void Collection::set_partition_tags(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:masterpb.Collection.partition_tags) - partition_tags_.Mutable(index)->assign(std::move(value)); -} -inline void Collection::set_partition_tags(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - partition_tags_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:masterpb.Collection.partition_tags) -} -inline void Collection::set_partition_tags(int index, const char* value, size_t size) { - partition_tags_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:masterpb.Collection.partition_tags) -} -inline std::string* Collection::add_partition_tags() { - // @@protoc_insertion_point(field_add_mutable:masterpb.Collection.partition_tags) - return partition_tags_.Add(); -} -inline void Collection::add_partition_tags(const std::string& value) { - partition_tags_.Add()->assign(value); - // @@protoc_insertion_point(field_add:masterpb.Collection.partition_tags) -} -inline void Collection::add_partition_tags(std::string&& value) { - partition_tags_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:masterpb.Collection.partition_tags) -} -inline void Collection::add_partition_tags(const char* value) { - GOOGLE_DCHECK(value != nullptr); - partition_tags_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:masterpb.Collection.partition_tags) -} -inline void Collection::add_partition_tags(const char* value, size_t size) { - partition_tags_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:masterpb.Collection.partition_tags) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -Collection::partition_tags() const { - // @@protoc_insertion_point(field_list:masterpb.Collection.partition_tags) - return partition_tags_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -Collection::mutable_partition_tags() { - // @@protoc_insertion_point(field_mutable_list:masterpb.Collection.partition_tags) - return &partition_tags_; -} - -// repeated .milvus.grpc.IndexParam indexes = 7; -inline int Collection::indexes_size() const { - return indexes_.size(); -} -inline ::milvus::grpc::IndexParam* Collection::mutable_indexes(int index) { - // @@protoc_insertion_point(field_mutable:masterpb.Collection.indexes) - return indexes_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::IndexParam >* -Collection::mutable_indexes() { - // @@protoc_insertion_point(field_mutable_list:masterpb.Collection.indexes) - return &indexes_; -} -inline const ::milvus::grpc::IndexParam& Collection::indexes(int index) const { - // @@protoc_insertion_point(field_get:masterpb.Collection.indexes) - return indexes_.Get(index); -} -inline ::milvus::grpc::IndexParam* Collection::add_indexes() { - // @@protoc_insertion_point(field_add:masterpb.Collection.indexes) - return indexes_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::IndexParam >& -Collection::indexes() const { - // @@protoc_insertion_point(field_list:masterpb.Collection.indexes) - return indexes_; -} - -// ------------------------------------------------------------------- - -// Segment - -// uint64 segment_id = 1; -inline void Segment::clear_segment_id() { - segment_id_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Segment::segment_id() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.segment_id) - return segment_id_; -} -inline void Segment::set_segment_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - segment_id_ = value; - // @@protoc_insertion_point(field_set:masterpb.Segment.segment_id) -} - -// uint64 collection_id = 2; -inline void Segment::clear_collection_id() { - collection_id_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Segment::collection_id() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.collection_id) - return collection_id_; -} -inline void Segment::set_collection_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - collection_id_ = value; - // @@protoc_insertion_point(field_set:masterpb.Segment.collection_id) -} - -// string partition_tag = 3; -inline void Segment::clear_partition_tag() { - partition_tag_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& Segment::partition_tag() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.partition_tag) - return partition_tag_.GetNoArena(); -} -inline void Segment::set_partition_tag(const std::string& value) { - - partition_tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:masterpb.Segment.partition_tag) -} -inline void Segment::set_partition_tag(std::string&& value) { - - partition_tag_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:masterpb.Segment.partition_tag) -} -inline void Segment::set_partition_tag(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - partition_tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:masterpb.Segment.partition_tag) -} -inline void Segment::set_partition_tag(const char* value, size_t size) { - - partition_tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:masterpb.Segment.partition_tag) -} -inline std::string* Segment::mutable_partition_tag() { - - // @@protoc_insertion_point(field_mutable:masterpb.Segment.partition_tag) - return partition_tag_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* Segment::release_partition_tag() { - // @@protoc_insertion_point(field_release:masterpb.Segment.partition_tag) - - return partition_tag_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void Segment::set_allocated_partition_tag(std::string* partition_tag) { - if (partition_tag != nullptr) { - - } else { - - } - partition_tag_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), partition_tag); - // @@protoc_insertion_point(field_set_allocated:masterpb.Segment.partition_tag) -} - -// int32 channel_start = 4; -inline void Segment::clear_channel_start() { - channel_start_ = 0; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 Segment::channel_start() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.channel_start) - return channel_start_; -} -inline void Segment::set_channel_start(::PROTOBUF_NAMESPACE_ID::int32 value) { - - channel_start_ = value; - // @@protoc_insertion_point(field_set:masterpb.Segment.channel_start) -} - -// int32 channel_end = 5; -inline void Segment::clear_channel_end() { - channel_end_ = 0; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 Segment::channel_end() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.channel_end) - return channel_end_; -} -inline void Segment::set_channel_end(::PROTOBUF_NAMESPACE_ID::int32 value) { - - channel_end_ = value; - // @@protoc_insertion_point(field_set:masterpb.Segment.channel_end) -} - -// uint64 open_timestamp = 6; -inline void Segment::clear_open_timestamp() { - open_timestamp_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Segment::open_timestamp() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.open_timestamp) - return open_timestamp_; -} -inline void Segment::set_open_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - open_timestamp_ = value; - // @@protoc_insertion_point(field_set:masterpb.Segment.open_timestamp) -} - -// uint64 close_timestamp = 7; -inline void Segment::clear_close_timestamp() { - close_timestamp_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Segment::close_timestamp() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.close_timestamp) - return close_timestamp_; -} -inline void Segment::set_close_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - close_timestamp_ = value; - // @@protoc_insertion_point(field_set:masterpb.Segment.close_timestamp) -} - -// string collection_name = 8; -inline void Segment::clear_collection_name() { - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& Segment::collection_name() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.collection_name) - return collection_name_.GetNoArena(); -} -inline void Segment::set_collection_name(const std::string& value) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:masterpb.Segment.collection_name) -} -inline void Segment::set_collection_name(std::string&& value) { - - collection_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:masterpb.Segment.collection_name) -} -inline void Segment::set_collection_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:masterpb.Segment.collection_name) -} -inline void Segment::set_collection_name(const char* value, size_t size) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:masterpb.Segment.collection_name) -} -inline std::string* Segment::mutable_collection_name() { - - // @@protoc_insertion_point(field_mutable:masterpb.Segment.collection_name) - return collection_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* Segment::release_collection_name() { - // @@protoc_insertion_point(field_release:masterpb.Segment.collection_name) - - return collection_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void Segment::set_allocated_collection_name(std::string* collection_name) { - if (collection_name != nullptr) { - - } else { - - } - collection_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), collection_name); - // @@protoc_insertion_point(field_set_allocated:masterpb.Segment.collection_name) -} - -// .masterpb.SegmentStatus status = 9; -inline void Segment::clear_status() { - status_ = 0; -} -inline ::masterpb::SegmentStatus Segment::status() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.status) - return static_cast< ::masterpb::SegmentStatus >(status_); -} -inline void Segment::set_status(::masterpb::SegmentStatus value) { - - status_ = value; - // @@protoc_insertion_point(field_set:masterpb.Segment.status) -} - -// int64 rows = 10; -inline void Segment::clear_rows() { - rows_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 Segment::rows() const { - // @@protoc_insertion_point(field_get:masterpb.Segment.rows) - return rows_; -} -inline void Segment::set_rows(::PROTOBUF_NAMESPACE_ID::int64 value) { - - rows_ = value; - // @@protoc_insertion_point(field_set:masterpb.Segment.rows) -} - -// ------------------------------------------------------------------- - -// SegmentStat - -// uint64 segment_id = 1; -inline void SegmentStat::clear_segment_id() { - segment_id_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 SegmentStat::segment_id() const { - // @@protoc_insertion_point(field_get:masterpb.SegmentStat.segment_id) - return segment_id_; -} -inline void SegmentStat::set_segment_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - segment_id_ = value; - // @@protoc_insertion_point(field_set:masterpb.SegmentStat.segment_id) -} - -// uint64 memory_size = 2; -inline void SegmentStat::clear_memory_size() { - memory_size_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 SegmentStat::memory_size() const { - // @@protoc_insertion_point(field_get:masterpb.SegmentStat.memory_size) - return memory_size_; -} -inline void SegmentStat::set_memory_size(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - memory_size_ = value; - // @@protoc_insertion_point(field_set:masterpb.SegmentStat.memory_size) -} - -// float memory_rate = 3; -inline void SegmentStat::clear_memory_rate() { - memory_rate_ = 0; -} -inline float SegmentStat::memory_rate() const { - // @@protoc_insertion_point(field_get:masterpb.SegmentStat.memory_rate) - return memory_rate_; -} -inline void SegmentStat::set_memory_rate(float value) { - - memory_rate_ = value; - // @@protoc_insertion_point(field_set:masterpb.SegmentStat.memory_rate) -} - -// .masterpb.SegmentStatus status = 4; -inline void SegmentStat::clear_status() { - status_ = 0; -} -inline ::masterpb::SegmentStatus SegmentStat::status() const { - // @@protoc_insertion_point(field_get:masterpb.SegmentStat.status) - return static_cast< ::masterpb::SegmentStatus >(status_); -} -inline void SegmentStat::set_status(::masterpb::SegmentStatus value) { - - status_ = value; - // @@protoc_insertion_point(field_set:masterpb.SegmentStat.status) -} - -// int64 rows = 5; -inline void SegmentStat::clear_rows() { - rows_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 SegmentStat::rows() const { - // @@protoc_insertion_point(field_get:masterpb.SegmentStat.rows) - return rows_; -} -inline void SegmentStat::set_rows(::PROTOBUF_NAMESPACE_ID::int64 value) { - - rows_ = value; - // @@protoc_insertion_point(field_set:masterpb.SegmentStat.rows) -} - -#ifdef __GNUC__ - #pragma GCC diagnostic pop -#endif // __GNUC__ -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - - -// @@protoc_insertion_point(namespace_scope) - -} // namespace masterpb - -PROTOBUF_NAMESPACE_OPEN - -template <> struct is_proto_enum< ::masterpb::SegmentStatus> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::masterpb::SegmentStatus>() { - return ::masterpb::SegmentStatus_descriptor(); -} - -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) - -#include -#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_master_2eproto diff --git a/proxy/src/grpc/message.grpc.pb.cc b/proxy/src/grpc/message.grpc.pb.cc deleted file mode 100644 index fe4a3073e8..0000000000 --- a/proxy/src/grpc/message.grpc.pb.cc +++ /dev/null @@ -1,1093 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: message.proto - -#include "message.pb.h" -#include "message.grpc.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -namespace milvus { -namespace grpc { - -static const char* MilvusService_method_names[] = { - "/milvus.grpc.MilvusService/CreateCollection", - "/milvus.grpc.MilvusService/HasCollection", - "/milvus.grpc.MilvusService/DescribeCollection", - "/milvus.grpc.MilvusService/CountCollection", - "/milvus.grpc.MilvusService/ShowCollections", - "/milvus.grpc.MilvusService/ShowCollectionInfo", - "/milvus.grpc.MilvusService/DropCollection", - "/milvus.grpc.MilvusService/CreateIndex", - "/milvus.grpc.MilvusService/DescribeIndex", - "/milvus.grpc.MilvusService/DropIndex", - "/milvus.grpc.MilvusService/CreatePartition", - "/milvus.grpc.MilvusService/HasPartition", - "/milvus.grpc.MilvusService/ShowPartitions", - "/milvus.grpc.MilvusService/DropPartition", - "/milvus.grpc.MilvusService/Insert", - "/milvus.grpc.MilvusService/GetEntityByID", - "/milvus.grpc.MilvusService/GetEntityIDs", - "/milvus.grpc.MilvusService/Search", - "/milvus.grpc.MilvusService/SearchInSegment", - "/milvus.grpc.MilvusService/Cmd", - "/milvus.grpc.MilvusService/DeleteByID", - "/milvus.grpc.MilvusService/PreloadCollection", - "/milvus.grpc.MilvusService/Flush", - "/milvus.grpc.MilvusService/Compact", - "/milvus.grpc.MilvusService/SearchPB", -}; - -std::unique_ptr< MilvusService::Stub> MilvusService::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { - (void)options; - std::unique_ptr< MilvusService::Stub> stub(new MilvusService::Stub(channel)); - return stub; -} - -MilvusService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) - : channel_(channel), rpcmethod_CreateCollection_(MilvusService_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_HasCollection_(MilvusService_method_names[1], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_DescribeCollection_(MilvusService_method_names[2], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_CountCollection_(MilvusService_method_names[3], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_ShowCollections_(MilvusService_method_names[4], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_ShowCollectionInfo_(MilvusService_method_names[5], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_DropCollection_(MilvusService_method_names[6], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_CreateIndex_(MilvusService_method_names[7], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_DescribeIndex_(MilvusService_method_names[8], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_DropIndex_(MilvusService_method_names[9], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_CreatePartition_(MilvusService_method_names[10], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_HasPartition_(MilvusService_method_names[11], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_ShowPartitions_(MilvusService_method_names[12], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_DropPartition_(MilvusService_method_names[13], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Insert_(MilvusService_method_names[14], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_GetEntityByID_(MilvusService_method_names[15], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_GetEntityIDs_(MilvusService_method_names[16], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Search_(MilvusService_method_names[17], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_SearchInSegment_(MilvusService_method_names[18], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Cmd_(MilvusService_method_names[19], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_DeleteByID_(MilvusService_method_names[20], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_PreloadCollection_(MilvusService_method_names[21], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Flush_(MilvusService_method_names[22], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_Compact_(MilvusService_method_names[23], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_SearchPB_(MilvusService_method_names[24], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - {} - -::grpc::Status MilvusService::Stub::CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::milvus::grpc::Status* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_CreateCollection_, context, request, response); -} - -void MilvusService::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateCollection_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateCollection_, context, request, false); -} - -::grpc::Status MilvusService::Stub::HasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::BoolReply* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_HasCollection_, context, request, response); -} - -void MilvusService::Stub::experimental_async::HasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::BoolReply* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_HasCollection_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::HasCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_HasCollection_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::HasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_HasCollection_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::HasCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_HasCollection_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* MilvusService::Stub::AsyncHasCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::BoolReply>::Create(channel_.get(), cq, rpcmethod_HasCollection_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* MilvusService::Stub::PrepareAsyncHasCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::BoolReply>::Create(channel_.get(), cq, rpcmethod_HasCollection_, context, request, false); -} - -::grpc::Status MilvusService::Stub::DescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Mapping* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DescribeCollection_, context, request, response); -} - -void MilvusService::Stub::experimental_async::DescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Mapping* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeCollection_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::DescribeCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Mapping* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeCollection_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::DescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Mapping* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DescribeCollection_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::DescribeCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Mapping* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DescribeCollection_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Mapping>* MilvusService::Stub::AsyncDescribeCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Mapping>::Create(channel_.get(), cq, rpcmethod_DescribeCollection_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Mapping>* MilvusService::Stub::PrepareAsyncDescribeCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Mapping>::Create(channel_.get(), cq, rpcmethod_DescribeCollection_, context, request, false); -} - -::grpc::Status MilvusService::Stub::CountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::CollectionRowCount* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_CountCollection_, context, request, response); -} - -void MilvusService::Stub::experimental_async::CountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionRowCount* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CountCollection_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::CountCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionRowCount* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CountCollection_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::CountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionRowCount* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CountCollection_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::CountCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionRowCount* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CountCollection_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionRowCount>* MilvusService::Stub::AsyncCountCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionRowCount>::Create(channel_.get(), cq, rpcmethod_CountCollection_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionRowCount>* MilvusService::Stub::PrepareAsyncCountCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionRowCount>::Create(channel_.get(), cq, rpcmethod_CountCollection_, context, request, false); -} - -::grpc::Status MilvusService::Stub::ShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::milvus::grpc::CollectionNameList* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_ShowCollections_, context, request, response); -} - -void MilvusService::Stub::experimental_async::ShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::CollectionNameList* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowCollections_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::ShowCollections(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionNameList* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowCollections_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::ShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::CollectionNameList* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowCollections_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::ShowCollections(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionNameList* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowCollections_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionNameList>* MilvusService::Stub::AsyncShowCollectionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionNameList>::Create(channel_.get(), cq, rpcmethod_ShowCollections_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionNameList>* MilvusService::Stub::PrepareAsyncShowCollectionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionNameList>::Create(channel_.get(), cq, rpcmethod_ShowCollections_, context, request, false); -} - -::grpc::Status MilvusService::Stub::ShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::CollectionInfo* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_ShowCollectionInfo_, context, request, response); -} - -void MilvusService::Stub::experimental_async::ShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionInfo* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowCollectionInfo_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::ShowCollectionInfo(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionInfo* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowCollectionInfo_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::ShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionInfo* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowCollectionInfo_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::ShowCollectionInfo(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionInfo* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowCollectionInfo_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionInfo>* MilvusService::Stub::AsyncShowCollectionInfoRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionInfo>::Create(channel_.get(), cq, rpcmethod_ShowCollectionInfo_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionInfo>* MilvusService::Stub::PrepareAsyncShowCollectionInfoRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionInfo>::Create(channel_.get(), cq, rpcmethod_ShowCollectionInfo_, context, request, false); -} - -::grpc::Status MilvusService::Stub::DropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Status* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DropCollection_, context, request, response); -} - -void MilvusService::Stub::experimental_async::DropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropCollection_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::DropCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropCollection_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::DropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropCollection_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::DropCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropCollection_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncDropCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropCollection_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncDropCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropCollection_, context, request, false); -} - -::grpc::Status MilvusService::Stub::CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::milvus::grpc::Status* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_CreateIndex_, context, request, response); -} - -void MilvusService::Stub::experimental_async::CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateIndex_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::CreateIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateIndex_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateIndex_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::CreateIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateIndex_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncCreateIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateIndex_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncCreateIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateIndex_, context, request, false); -} - -::grpc::Status MilvusService::Stub::DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::milvus::grpc::IndexParam* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DescribeIndex_, context, request, response); -} - -void MilvusService::Stub::experimental_async::DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::IndexParam* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeIndex_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::DescribeIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::IndexParam* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeIndex_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::IndexParam* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DescribeIndex_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::DescribeIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::IndexParam* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DescribeIndex_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::IndexParam>* MilvusService::Stub::AsyncDescribeIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::IndexParam>::Create(channel_.get(), cq, rpcmethod_DescribeIndex_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::IndexParam>* MilvusService::Stub::PrepareAsyncDescribeIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::IndexParam>::Create(channel_.get(), cq, rpcmethod_DescribeIndex_, context, request, false); -} - -::grpc::Status MilvusService::Stub::DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::milvus::grpc::Status* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DropIndex_, context, request, response); -} - -void MilvusService::Stub::experimental_async::DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropIndex_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::DropIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropIndex_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropIndex_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::DropIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropIndex_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncDropIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropIndex_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncDropIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropIndex_, context, request, false); -} - -::grpc::Status MilvusService::Stub::CreatePartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::milvus::grpc::Status* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_CreatePartition_, context, request, response); -} - -void MilvusService::Stub::experimental_async::CreatePartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreatePartition_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::CreatePartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreatePartition_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::CreatePartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreatePartition_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::CreatePartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreatePartition_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncCreatePartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreatePartition_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncCreatePartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreatePartition_, context, request, false); -} - -::grpc::Status MilvusService::Stub::HasPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::milvus::grpc::BoolReply* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_HasPartition_, context, request, response); -} - -void MilvusService::Stub::experimental_async::HasPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::BoolReply* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_HasPartition_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::HasPartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_HasPartition_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::HasPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_HasPartition_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::HasPartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_HasPartition_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* MilvusService::Stub::AsyncHasPartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::BoolReply>::Create(channel_.get(), cq, rpcmethod_HasPartition_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* MilvusService::Stub::PrepareAsyncHasPartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::BoolReply>::Create(channel_.get(), cq, rpcmethod_HasPartition_, context, request, false); -} - -::grpc::Status MilvusService::Stub::ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::PartitionList* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_ShowPartitions_, context, request, response); -} - -void MilvusService::Stub::experimental_async::ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::PartitionList* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowPartitions_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::ShowPartitions(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::PartitionList* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowPartitions_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::PartitionList* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowPartitions_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::ShowPartitions(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::PartitionList* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowPartitions_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::PartitionList>* MilvusService::Stub::AsyncShowPartitionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::PartitionList>::Create(channel_.get(), cq, rpcmethod_ShowPartitions_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::PartitionList>* MilvusService::Stub::PrepareAsyncShowPartitionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::PartitionList>::Create(channel_.get(), cq, rpcmethod_ShowPartitions_, context, request, false); -} - -::grpc::Status MilvusService::Stub::DropPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::milvus::grpc::Status* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DropPartition_, context, request, response); -} - -void MilvusService::Stub::experimental_async::DropPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropPartition_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::DropPartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropPartition_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::DropPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropPartition_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::DropPartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropPartition_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncDropPartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropPartition_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncDropPartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropPartition_, context, request, false); -} - -::grpc::Status MilvusService::Stub::Insert(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::milvus::grpc::EntityIds* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_Insert_, context, request, response); -} - -void MilvusService::Stub::experimental_async::Insert(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam* request, ::milvus::grpc::EntityIds* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Insert_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::Insert(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::EntityIds* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Insert_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::Insert(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam* request, ::milvus::grpc::EntityIds* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Insert_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::Insert(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::EntityIds* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Insert_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::EntityIds>* MilvusService::Stub::AsyncInsertRaw(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::EntityIds>::Create(channel_.get(), cq, rpcmethod_Insert_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::EntityIds>* MilvusService::Stub::PrepareAsyncInsertRaw(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::EntityIds>::Create(channel_.get(), cq, rpcmethod_Insert_, context, request, false); -} - -::grpc::Status MilvusService::Stub::GetEntityByID(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity& request, ::milvus::grpc::Entities* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_GetEntityByID_, context, request, response); -} - -void MilvusService::Stub::experimental_async::GetEntityByID(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity* request, ::milvus::grpc::Entities* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_GetEntityByID_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::GetEntityByID(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Entities* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_GetEntityByID_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::GetEntityByID(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity* request, ::milvus::grpc::Entities* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_GetEntityByID_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::GetEntityByID(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Entities* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_GetEntityByID_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Entities>* MilvusService::Stub::AsyncGetEntityByIDRaw(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Entities>::Create(channel_.get(), cq, rpcmethod_GetEntityByID_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Entities>* MilvusService::Stub::PrepareAsyncGetEntityByIDRaw(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Entities>::Create(channel_.get(), cq, rpcmethod_GetEntityByID_, context, request, false); -} - -::grpc::Status MilvusService::Stub::GetEntityIDs(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam& request, ::milvus::grpc::EntityIds* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_GetEntityIDs_, context, request, response); -} - -void MilvusService::Stub::experimental_async::GetEntityIDs(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam* request, ::milvus::grpc::EntityIds* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_GetEntityIDs_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::GetEntityIDs(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::EntityIds* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_GetEntityIDs_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::GetEntityIDs(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam* request, ::milvus::grpc::EntityIds* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_GetEntityIDs_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::GetEntityIDs(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::EntityIds* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_GetEntityIDs_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::EntityIds>* MilvusService::Stub::AsyncGetEntityIDsRaw(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::EntityIds>::Create(channel_.get(), cq, rpcmethod_GetEntityIDs_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::EntityIds>* MilvusService::Stub::PrepareAsyncGetEntityIDsRaw(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::EntityIds>::Create(channel_.get(), cq, rpcmethod_GetEntityIDs_, context, request, false); -} - -::grpc::Status MilvusService::Stub::Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::milvus::grpc::QueryResult* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_Search_, context, request, response); -} - -void MilvusService::Stub::experimental_async::Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::QueryResult* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Search_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Search_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Search_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Search_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>* MilvusService::Stub::AsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::QueryResult>::Create(channel_.get(), cq, rpcmethod_Search_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>* MilvusService::Stub::PrepareAsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::QueryResult>::Create(channel_.get(), cq, rpcmethod_Search_, context, request, false); -} - -::grpc::Status MilvusService::Stub::SearchInSegment(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam& request, ::milvus::grpc::QueryResult* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_SearchInSegment_, context, request, response); -} - -void MilvusService::Stub::experimental_async::SearchInSegment(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam* request, ::milvus::grpc::QueryResult* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_SearchInSegment_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::SearchInSegment(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_SearchInSegment_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::SearchInSegment(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_SearchInSegment_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::SearchInSegment(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_SearchInSegment_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>* MilvusService::Stub::AsyncSearchInSegmentRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::QueryResult>::Create(channel_.get(), cq, rpcmethod_SearchInSegment_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>* MilvusService::Stub::PrepareAsyncSearchInSegmentRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::QueryResult>::Create(channel_.get(), cq, rpcmethod_SearchInSegment_, context, request, false); -} - -::grpc::Status MilvusService::Stub::Cmd(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::milvus::grpc::StringReply* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_Cmd_, context, request, response); -} - -void MilvusService::Stub::experimental_async::Cmd(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::StringReply* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Cmd_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::Cmd(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::StringReply* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Cmd_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::Cmd(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::StringReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Cmd_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::Cmd(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::StringReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Cmd_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::StringReply>* MilvusService::Stub::AsyncCmdRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::StringReply>::Create(channel_.get(), cq, rpcmethod_Cmd_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::StringReply>* MilvusService::Stub::PrepareAsyncCmdRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::StringReply>::Create(channel_.get(), cq, rpcmethod_Cmd_, context, request, false); -} - -::grpc::Status MilvusService::Stub::DeleteByID(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam& request, ::milvus::grpc::Status* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DeleteByID_, context, request, response); -} - -void MilvusService::Stub::experimental_async::DeleteByID(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DeleteByID_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::DeleteByID(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DeleteByID_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::DeleteByID(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DeleteByID_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::DeleteByID(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DeleteByID_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncDeleteByIDRaw(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DeleteByID_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncDeleteByIDRaw(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DeleteByID_, context, request, false); -} - -::grpc::Status MilvusService::Stub::PreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Status* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_PreloadCollection_, context, request, response); -} - -void MilvusService::Stub::experimental_async::PreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_PreloadCollection_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::PreloadCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_PreloadCollection_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::PreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_PreloadCollection_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::PreloadCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_PreloadCollection_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncPreloadCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_PreloadCollection_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncPreloadCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_PreloadCollection_, context, request, false); -} - -::grpc::Status MilvusService::Stub::Flush(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam& request, ::milvus::grpc::Status* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_Flush_, context, request, response); -} - -void MilvusService::Stub::experimental_async::Flush(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Flush_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::Flush(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Flush_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::Flush(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Flush_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::Flush(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Flush_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncFlushRaw(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_Flush_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncFlushRaw(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_Flush_, context, request, false); -} - -::grpc::Status MilvusService::Stub::Compact(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam& request, ::milvus::grpc::Status* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_Compact_, context, request, response); -} - -void MilvusService::Stub::experimental_async::Compact(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Compact_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::Compact(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Compact_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::Compact(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Compact_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::Compact(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Compact_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncCompactRaw(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_Compact_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncCompactRaw(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_Compact_, context, request, false); -} - -::grpc::Status MilvusService::Stub::SearchPB(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB& request, ::milvus::grpc::QueryResult* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_SearchPB_, context, request, response); -} - -void MilvusService::Stub::experimental_async::SearchPB(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB* request, ::milvus::grpc::QueryResult* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_SearchPB_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::SearchPB(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_SearchPB_, context, request, response, std::move(f)); -} - -void MilvusService::Stub::experimental_async::SearchPB(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_SearchPB_, context, request, response, reactor); -} - -void MilvusService::Stub::experimental_async::SearchPB(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_SearchPB_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>* MilvusService::Stub::AsyncSearchPBRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::QueryResult>::Create(channel_.get(), cq, rpcmethod_SearchPB_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>* MilvusService::Stub::PrepareAsyncSearchPBRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::QueryResult>::Create(channel_.get(), cq, rpcmethod_SearchPB_, context, request, false); -} - -MilvusService::Service::Service() { - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[0], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::Mapping, ::milvus::grpc::Status>( - std::mem_fn(&MilvusService::Service::CreateCollection), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[1], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::BoolReply>( - std::mem_fn(&MilvusService::Service::HasCollection), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[2], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::Mapping>( - std::mem_fn(&MilvusService::Service::DescribeCollection), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[3], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::CollectionRowCount>( - std::mem_fn(&MilvusService::Service::CountCollection), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[4], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::Command, ::milvus::grpc::CollectionNameList>( - std::mem_fn(&MilvusService::Service::ShowCollections), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[5], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::CollectionInfo>( - std::mem_fn(&MilvusService::Service::ShowCollectionInfo), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[6], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::Status>( - std::mem_fn(&MilvusService::Service::DropCollection), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[7], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::IndexParam, ::milvus::grpc::Status>( - std::mem_fn(&MilvusService::Service::CreateIndex), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[8], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::IndexParam, ::milvus::grpc::IndexParam>( - std::mem_fn(&MilvusService::Service::DescribeIndex), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[9], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::IndexParam, ::milvus::grpc::Status>( - std::mem_fn(&MilvusService::Service::DropIndex), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[10], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::PartitionParam, ::milvus::grpc::Status>( - std::mem_fn(&MilvusService::Service::CreatePartition), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[11], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::PartitionParam, ::milvus::grpc::BoolReply>( - std::mem_fn(&MilvusService::Service::HasPartition), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[12], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::PartitionList>( - std::mem_fn(&MilvusService::Service::ShowPartitions), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[13], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::PartitionParam, ::milvus::grpc::Status>( - std::mem_fn(&MilvusService::Service::DropPartition), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[14], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::InsertParam, ::milvus::grpc::EntityIds>( - std::mem_fn(&MilvusService::Service::Insert), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[15], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::EntityIdentity, ::milvus::grpc::Entities>( - std::mem_fn(&MilvusService::Service::GetEntityByID), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[16], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::GetEntityIDsParam, ::milvus::grpc::EntityIds>( - std::mem_fn(&MilvusService::Service::GetEntityIDs), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[17], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::SearchParam, ::milvus::grpc::QueryResult>( - std::mem_fn(&MilvusService::Service::Search), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[18], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::SearchInSegmentParam, ::milvus::grpc::QueryResult>( - std::mem_fn(&MilvusService::Service::SearchInSegment), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[19], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::Command, ::milvus::grpc::StringReply>( - std::mem_fn(&MilvusService::Service::Cmd), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[20], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::DeleteByIDParam, ::milvus::grpc::Status>( - std::mem_fn(&MilvusService::Service::DeleteByID), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[21], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::Status>( - std::mem_fn(&MilvusService::Service::PreloadCollection), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[22], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::FlushParam, ::milvus::grpc::Status>( - std::mem_fn(&MilvusService::Service::Flush), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[23], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CompactParam, ::milvus::grpc::Status>( - std::mem_fn(&MilvusService::Service::Compact), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - MilvusService_method_names[24], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::SearchParamPB, ::milvus::grpc::QueryResult>( - std::mem_fn(&MilvusService::Service::SearchPB), this))); -} - -MilvusService::Service::~Service() { -} - -::grpc::Status MilvusService::Service::CreateCollection(::grpc::ServerContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::HasCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::BoolReply* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::DescribeCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Mapping* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::CountCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionRowCount* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::ShowCollections(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::CollectionNameList* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::ShowCollectionInfo(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionInfo* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::DropCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::CreateIndex(::grpc::ServerContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::DescribeIndex(::grpc::ServerContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::IndexParam* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::DropIndex(::grpc::ServerContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::CreatePartition(::grpc::ServerContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::Status* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::HasPartition(::grpc::ServerContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::BoolReply* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::ShowPartitions(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::PartitionList* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::DropPartition(::grpc::ServerContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::Status* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::Insert(::grpc::ServerContext* context, const ::milvus::grpc::InsertParam* request, ::milvus::grpc::EntityIds* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::GetEntityByID(::grpc::ServerContext* context, const ::milvus::grpc::EntityIdentity* request, ::milvus::grpc::Entities* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::GetEntityIDs(::grpc::ServerContext* context, const ::milvus::grpc::GetEntityIDsParam* request, ::milvus::grpc::EntityIds* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::Search(::grpc::ServerContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::QueryResult* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::SearchInSegment(::grpc::ServerContext* context, const ::milvus::grpc::SearchInSegmentParam* request, ::milvus::grpc::QueryResult* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::Cmd(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::StringReply* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::DeleteByID(::grpc::ServerContext* context, const ::milvus::grpc::DeleteByIDParam* request, ::milvus::grpc::Status* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::PreloadCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::Flush(::grpc::ServerContext* context, const ::milvus::grpc::FlushParam* request, ::milvus::grpc::Status* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::Compact(::grpc::ServerContext* context, const ::milvus::grpc::CompactParam* request, ::milvus::grpc::Status* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status MilvusService::Service::SearchPB(::grpc::ServerContext* context, const ::milvus::grpc::SearchParamPB* request, ::milvus::grpc::QueryResult* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - - -} // namespace milvus -} // namespace grpc - diff --git a/proxy/src/grpc/message.grpc.pb.h b/proxy/src/grpc/message.grpc.pb.h deleted file mode 100644 index 6931363081..0000000000 --- a/proxy/src/grpc/message.grpc.pb.h +++ /dev/null @@ -1,4556 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: message.proto -#ifndef GRPC_message_2eproto__INCLUDED -#define GRPC_message_2eproto__INCLUDED - -#include "message.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace grpc_impl { -class CompletionQueue; -class ServerCompletionQueue; -class ServerContext; -} // namespace grpc_impl - -namespace grpc { -namespace experimental { -template -class MessageAllocator; -} // namespace experimental -} // namespace grpc - -namespace milvus { -namespace grpc { - -class MilvusService final { - public: - static constexpr char const* service_full_name() { - return "milvus.grpc.MilvusService"; - } - class StubInterface { - public: - virtual ~StubInterface() {} - // * - // @brief This method is used to create collection - // - // @param CollectionSchema, use to provide collection information to be created. - // - // @return Status - virtual ::grpc::Status CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::milvus::grpc::Status* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> AsyncCreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(AsyncCreateCollectionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> PrepareAsyncCreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(PrepareAsyncCreateCollectionRaw(context, request, cq)); - } - // * - // @brief This method is used to test collection existence. - // - // @param CollectionName, collection name is going to be tested. - // - // @return BoolReply - virtual ::grpc::Status HasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::BoolReply* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>> AsyncHasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>>(AsyncHasCollectionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>> PrepareAsyncHasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>>(PrepareAsyncHasCollectionRaw(context, request, cq)); - } - // * - // @brief This method is used to get collection schema. - // - // @param CollectionName, target collection name. - // - // @return CollectionSchema - virtual ::grpc::Status DescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Mapping* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Mapping>> AsyncDescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Mapping>>(AsyncDescribeCollectionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Mapping>> PrepareAsyncDescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Mapping>>(PrepareAsyncDescribeCollectionRaw(context, request, cq)); - } - // * - // @brief This method is used to get collection schema. - // - // @param CollectionName, target collection name. - // - // @return CollectionRowCount - virtual ::grpc::Status CountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::CollectionRowCount* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionRowCount>> AsyncCountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionRowCount>>(AsyncCountCollectionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionRowCount>> PrepareAsyncCountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionRowCount>>(PrepareAsyncCountCollectionRaw(context, request, cq)); - } - // * - // @brief This method is used to list all collections. - // - // @param Command, dummy parameter. - // - // @return CollectionNameList - virtual ::grpc::Status ShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::milvus::grpc::CollectionNameList* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionNameList>> AsyncShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionNameList>>(AsyncShowCollectionsRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionNameList>> PrepareAsyncShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionNameList>>(PrepareAsyncShowCollectionsRaw(context, request, cq)); - } - // * - // @brief This method is used to get collection detail information. - // - // @param CollectionName, target collection name. - // - // @return CollectionInfo - virtual ::grpc::Status ShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::CollectionInfo* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionInfo>> AsyncShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionInfo>>(AsyncShowCollectionInfoRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionInfo>> PrepareAsyncShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionInfo>>(PrepareAsyncShowCollectionInfoRaw(context, request, cq)); - } - // * - // @brief This method is used to delete collection. - // - // @param CollectionName, collection name is going to be deleted. - // - // @return Status - virtual ::grpc::Status DropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Status* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> AsyncDropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(AsyncDropCollectionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> PrepareAsyncDropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(PrepareAsyncDropCollectionRaw(context, request, cq)); - } - // * - // @brief This method is used to build index by collection in sync mode. - // - // @param IndexParam, index paramters. - // - // @return Status - virtual ::grpc::Status CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::milvus::grpc::Status* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> AsyncCreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(AsyncCreateIndexRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> PrepareAsyncCreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(PrepareAsyncCreateIndexRaw(context, request, cq)); - } - // * - // @brief This method is used to describe index - // - // @param IndexParam, target index. - // - // @return IndexParam - virtual ::grpc::Status DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::milvus::grpc::IndexParam* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::IndexParam>> AsyncDescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::IndexParam>>(AsyncDescribeIndexRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::IndexParam>> PrepareAsyncDescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::IndexParam>>(PrepareAsyncDescribeIndexRaw(context, request, cq)); - } - // * - // @brief This method is used to drop index - // - // @param IndexParam, target field. if the IndexParam.field_name is empty, will drop all index of the collection - // - // @return Status - virtual ::grpc::Status DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::milvus::grpc::Status* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> AsyncDropIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(AsyncDropIndexRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> PrepareAsyncDropIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(PrepareAsyncDropIndexRaw(context, request, cq)); - } - // * - // @brief This method is used to create partition - // - // @param PartitionParam, partition parameters. - // - // @return Status - virtual ::grpc::Status CreatePartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::milvus::grpc::Status* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> AsyncCreatePartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(AsyncCreatePartitionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> PrepareAsyncCreatePartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(PrepareAsyncCreatePartitionRaw(context, request, cq)); - } - // * - // @brief This method is used to test partition existence. - // - // @param PartitionParam, target partition. - // - // @return BoolReply - virtual ::grpc::Status HasPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::milvus::grpc::BoolReply* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>> AsyncHasPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>>(AsyncHasPartitionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>> PrepareAsyncHasPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>>(PrepareAsyncHasPartitionRaw(context, request, cq)); - } - // * - // @brief This method is used to show partition information - // - // @param CollectionName, target collection name. - // - // @return PartitionList - virtual ::grpc::Status ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::PartitionList* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::PartitionList>> AsyncShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::PartitionList>>(AsyncShowPartitionsRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::PartitionList>> PrepareAsyncShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::PartitionList>>(PrepareAsyncShowPartitionsRaw(context, request, cq)); - } - // * - // @brief This method is used to drop partition - // - // @param PartitionParam, target partition. - // - // @return Status - virtual ::grpc::Status DropPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::milvus::grpc::Status* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> AsyncDropPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(AsyncDropPartitionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> PrepareAsyncDropPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(PrepareAsyncDropPartitionRaw(context, request, cq)); - } - // * - // @brief This method is used to add vector array to collection. - // - // @param InsertParam, insert parameters. - // - // @return VectorIds - virtual ::grpc::Status Insert(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::milvus::grpc::EntityIds* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::EntityIds>> AsyncInsert(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::EntityIds>>(AsyncInsertRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::EntityIds>> PrepareAsyncInsert(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::EntityIds>>(PrepareAsyncInsertRaw(context, request, cq)); - } - // * - // @brief This method is used to get entities data by id array. - // - // @param EntitiesIdentity, target entity id array. - // - // @return EntitiesData - virtual ::grpc::Status GetEntityByID(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity& request, ::milvus::grpc::Entities* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Entities>> AsyncGetEntityByID(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Entities>>(AsyncGetEntityByIDRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Entities>> PrepareAsyncGetEntityByID(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Entities>>(PrepareAsyncGetEntityByIDRaw(context, request, cq)); - } - // * - // @brief This method is used to get vector ids from a segment - // - // @param GetVectorIDsParam, target collection and segment - // - // @return VectorIds - virtual ::grpc::Status GetEntityIDs(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam& request, ::milvus::grpc::EntityIds* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::EntityIds>> AsyncGetEntityIDs(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::EntityIds>>(AsyncGetEntityIDsRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::EntityIds>> PrepareAsyncGetEntityIDs(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::EntityIds>>(PrepareAsyncGetEntityIDsRaw(context, request, cq)); - } - // * - // @brief This method is used to query vector in collection. - // - // @param SearchParam, search parameters. - // - // @return KQueryResult - virtual ::grpc::Status Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::milvus::grpc::QueryResult* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>> AsyncSearch(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>>(AsyncSearchRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>> PrepareAsyncSearch(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>>(PrepareAsyncSearchRaw(context, request, cq)); - } - // * - // @brief This method is used to query vector in specified files. - // - // @param SearchInSegmentParam, target segments to search. - // - // @return TopKQueryResult - virtual ::grpc::Status SearchInSegment(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam& request, ::milvus::grpc::QueryResult* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>> AsyncSearchInSegment(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>>(AsyncSearchInSegmentRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>> PrepareAsyncSearchInSegment(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>>(PrepareAsyncSearchInSegmentRaw(context, request, cq)); - } - // * - // @brief This method is used to give the server status. - // - // @param Command, command string - // - // @return StringReply - virtual ::grpc::Status Cmd(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::milvus::grpc::StringReply* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::StringReply>> AsyncCmd(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::StringReply>>(AsyncCmdRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::StringReply>> PrepareAsyncCmd(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::StringReply>>(PrepareAsyncCmdRaw(context, request, cq)); - } - // * - // @brief This method is used to delete vector by id - // - // @param DeleteByIDParam, delete parameters. - // - // @return status - virtual ::grpc::Status DeleteByID(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam& request, ::milvus::grpc::Status* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> AsyncDeleteByID(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(AsyncDeleteByIDRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> PrepareAsyncDeleteByID(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(PrepareAsyncDeleteByIDRaw(context, request, cq)); - } - // * - // @brief This method is used to preload collection - // - // @param CollectionName, target collection name. - // - // @return Status - virtual ::grpc::Status PreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Status* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> AsyncPreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(AsyncPreloadCollectionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> PrepareAsyncPreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(PrepareAsyncPreloadCollectionRaw(context, request, cq)); - } - // * - // @brief This method is used to flush buffer into storage. - // - // @param FlushParam, flush parameters - // - // @return Status - virtual ::grpc::Status Flush(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam& request, ::milvus::grpc::Status* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> AsyncFlush(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(AsyncFlushRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> PrepareAsyncFlush(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(PrepareAsyncFlushRaw(context, request, cq)); - } - // * - // @brief This method is used to compact collection - // - // @param CompactParam, compact parameters - // - // @return Status - virtual ::grpc::Status Compact(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam& request, ::milvus::grpc::Status* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> AsyncCompact(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(AsyncCompactRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>> PrepareAsyncCompact(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>>(PrepareAsyncCompactRaw(context, request, cq)); - } - // *******************************New Interface******************************************* - // - virtual ::grpc::Status SearchPB(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB& request, ::milvus::grpc::QueryResult* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>> AsyncSearchPB(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>>(AsyncSearchPBRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>> PrepareAsyncSearchPB(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>>(PrepareAsyncSearchPBRaw(context, request, cq)); - } - class experimental_async_interface { - public: - virtual ~experimental_async_interface() {} - // * - // @brief This method is used to create collection - // - // @param CollectionSchema, use to provide collection information to be created. - // - // @return Status - virtual void CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to test collection existence. - // - // @param CollectionName, collection name is going to be tested. - // - // @return BoolReply - virtual void HasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::BoolReply* response, std::function) = 0; - virtual void HasCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, std::function) = 0; - virtual void HasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void HasCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to get collection schema. - // - // @param CollectionName, target collection name. - // - // @return CollectionSchema - virtual void DescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Mapping* response, std::function) = 0; - virtual void DescribeCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Mapping* response, std::function) = 0; - virtual void DescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Mapping* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void DescribeCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Mapping* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to get collection schema. - // - // @param CollectionName, target collection name. - // - // @return CollectionRowCount - virtual void CountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionRowCount* response, std::function) = 0; - virtual void CountCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionRowCount* response, std::function) = 0; - virtual void CountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionRowCount* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void CountCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionRowCount* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to list all collections. - // - // @param Command, dummy parameter. - // - // @return CollectionNameList - virtual void ShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::CollectionNameList* response, std::function) = 0; - virtual void ShowCollections(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionNameList* response, std::function) = 0; - virtual void ShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::CollectionNameList* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void ShowCollections(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionNameList* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to get collection detail information. - // - // @param CollectionName, target collection name. - // - // @return CollectionInfo - virtual void ShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionInfo* response, std::function) = 0; - virtual void ShowCollectionInfo(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionInfo* response, std::function) = 0; - virtual void ShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionInfo* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void ShowCollectionInfo(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionInfo* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to delete collection. - // - // @param CollectionName, collection name is going to be deleted. - // - // @return Status - virtual void DropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void DropCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void DropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void DropCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to build index by collection in sync mode. - // - // @param IndexParam, index paramters. - // - // @return Status - virtual void CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void CreateIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void CreateIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to describe index - // - // @param IndexParam, target index. - // - // @return IndexParam - virtual void DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::IndexParam* response, std::function) = 0; - virtual void DescribeIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::IndexParam* response, std::function) = 0; - virtual void DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::IndexParam* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void DescribeIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::IndexParam* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to drop index - // - // @param IndexParam, target field. if the IndexParam.field_name is empty, will drop all index of the collection - // - // @return Status - virtual void DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void DropIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void DropIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to create partition - // - // @param PartitionParam, partition parameters. - // - // @return Status - virtual void CreatePartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void CreatePartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void CreatePartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void CreatePartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to test partition existence. - // - // @param PartitionParam, target partition. - // - // @return BoolReply - virtual void HasPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::BoolReply* response, std::function) = 0; - virtual void HasPartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, std::function) = 0; - virtual void HasPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void HasPartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to show partition information - // - // @param CollectionName, target collection name. - // - // @return PartitionList - virtual void ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::PartitionList* response, std::function) = 0; - virtual void ShowPartitions(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::PartitionList* response, std::function) = 0; - virtual void ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::PartitionList* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void ShowPartitions(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::PartitionList* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to drop partition - // - // @param PartitionParam, target partition. - // - // @return Status - virtual void DropPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void DropPartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void DropPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void DropPartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to add vector array to collection. - // - // @param InsertParam, insert parameters. - // - // @return VectorIds - virtual void Insert(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam* request, ::milvus::grpc::EntityIds* response, std::function) = 0; - virtual void Insert(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::EntityIds* response, std::function) = 0; - virtual void Insert(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam* request, ::milvus::grpc::EntityIds* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void Insert(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::EntityIds* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to get entities data by id array. - // - // @param EntitiesIdentity, target entity id array. - // - // @return EntitiesData - virtual void GetEntityByID(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity* request, ::milvus::grpc::Entities* response, std::function) = 0; - virtual void GetEntityByID(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Entities* response, std::function) = 0; - virtual void GetEntityByID(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity* request, ::milvus::grpc::Entities* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void GetEntityByID(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Entities* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to get vector ids from a segment - // - // @param GetVectorIDsParam, target collection and segment - // - // @return VectorIds - virtual void GetEntityIDs(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam* request, ::milvus::grpc::EntityIds* response, std::function) = 0; - virtual void GetEntityIDs(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::EntityIds* response, std::function) = 0; - virtual void GetEntityIDs(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam* request, ::milvus::grpc::EntityIds* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void GetEntityIDs(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::EntityIds* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to query vector in collection. - // - // @param SearchParam, search parameters. - // - // @return KQueryResult - virtual void Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::QueryResult* response, std::function) = 0; - virtual void Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, std::function) = 0; - virtual void Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to query vector in specified files. - // - // @param SearchInSegmentParam, target segments to search. - // - // @return TopKQueryResult - virtual void SearchInSegment(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam* request, ::milvus::grpc::QueryResult* response, std::function) = 0; - virtual void SearchInSegment(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, std::function) = 0; - virtual void SearchInSegment(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void SearchInSegment(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to give the server status. - // - // @param Command, command string - // - // @return StringReply - virtual void Cmd(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::StringReply* response, std::function) = 0; - virtual void Cmd(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::StringReply* response, std::function) = 0; - virtual void Cmd(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::StringReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void Cmd(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::StringReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to delete vector by id - // - // @param DeleteByIDParam, delete parameters. - // - // @return status - virtual void DeleteByID(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void DeleteByID(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void DeleteByID(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void DeleteByID(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to preload collection - // - // @param CollectionName, target collection name. - // - // @return Status - virtual void PreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void PreloadCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void PreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void PreloadCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to flush buffer into storage. - // - // @param FlushParam, flush parameters - // - // @return Status - virtual void Flush(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void Flush(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void Flush(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void Flush(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // * - // @brief This method is used to compact collection - // - // @param CompactParam, compact parameters - // - // @return Status - virtual void Compact(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void Compact(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) = 0; - virtual void Compact(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void Compact(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // *******************************New Interface******************************************* - // - virtual void SearchPB(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB* request, ::milvus::grpc::QueryResult* response, std::function) = 0; - virtual void SearchPB(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, std::function) = 0; - virtual void SearchPB(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void SearchPB(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - }; - virtual class experimental_async_interface* experimental_async() { return nullptr; } - private: - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* AsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* PrepareAsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>* AsyncHasCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>* PrepareAsyncHasCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Mapping>* AsyncDescribeCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Mapping>* PrepareAsyncDescribeCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionRowCount>* AsyncCountCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionRowCount>* PrepareAsyncCountCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionNameList>* AsyncShowCollectionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionNameList>* PrepareAsyncShowCollectionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionInfo>* AsyncShowCollectionInfoRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::CollectionInfo>* PrepareAsyncShowCollectionInfoRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* AsyncDropCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* PrepareAsyncDropCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* AsyncCreateIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* PrepareAsyncCreateIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::IndexParam>* AsyncDescribeIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::IndexParam>* PrepareAsyncDescribeIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* AsyncDropIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* PrepareAsyncDropIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* AsyncCreatePartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* PrepareAsyncCreatePartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>* AsyncHasPartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::BoolReply>* PrepareAsyncHasPartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::PartitionList>* AsyncShowPartitionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::PartitionList>* PrepareAsyncShowPartitionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* AsyncDropPartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* PrepareAsyncDropPartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::EntityIds>* AsyncInsertRaw(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::EntityIds>* PrepareAsyncInsertRaw(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Entities>* AsyncGetEntityByIDRaw(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Entities>* PrepareAsyncGetEntityByIDRaw(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::EntityIds>* AsyncGetEntityIDsRaw(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::EntityIds>* PrepareAsyncGetEntityIDsRaw(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>* AsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>* PrepareAsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>* AsyncSearchInSegmentRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>* PrepareAsyncSearchInSegmentRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::StringReply>* AsyncCmdRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::StringReply>* PrepareAsyncCmdRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* AsyncDeleteByIDRaw(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* PrepareAsyncDeleteByIDRaw(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* AsyncPreloadCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* PrepareAsyncPreloadCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* AsyncFlushRaw(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* PrepareAsyncFlushRaw(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* AsyncCompactRaw(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::Status>* PrepareAsyncCompactRaw(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>* AsyncSearchPBRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::milvus::grpc::QueryResult>* PrepareAsyncSearchPBRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB& request, ::grpc::CompletionQueue* cq) = 0; - }; - class Stub final : public StubInterface { - public: - Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); - ::grpc::Status CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::milvus::grpc::Status* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> AsyncCreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(AsyncCreateCollectionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> PrepareAsyncCreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(PrepareAsyncCreateCollectionRaw(context, request, cq)); - } - ::grpc::Status HasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::BoolReply* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>> AsyncHasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>>(AsyncHasCollectionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>> PrepareAsyncHasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>>(PrepareAsyncHasCollectionRaw(context, request, cq)); - } - ::grpc::Status DescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Mapping* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Mapping>> AsyncDescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Mapping>>(AsyncDescribeCollectionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Mapping>> PrepareAsyncDescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Mapping>>(PrepareAsyncDescribeCollectionRaw(context, request, cq)); - } - ::grpc::Status CountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::CollectionRowCount* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionRowCount>> AsyncCountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionRowCount>>(AsyncCountCollectionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionRowCount>> PrepareAsyncCountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionRowCount>>(PrepareAsyncCountCollectionRaw(context, request, cq)); - } - ::grpc::Status ShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::milvus::grpc::CollectionNameList* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionNameList>> AsyncShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionNameList>>(AsyncShowCollectionsRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionNameList>> PrepareAsyncShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionNameList>>(PrepareAsyncShowCollectionsRaw(context, request, cq)); - } - ::grpc::Status ShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::CollectionInfo* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionInfo>> AsyncShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionInfo>>(AsyncShowCollectionInfoRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionInfo>> PrepareAsyncShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionInfo>>(PrepareAsyncShowCollectionInfoRaw(context, request, cq)); - } - ::grpc::Status DropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Status* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> AsyncDropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(AsyncDropCollectionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> PrepareAsyncDropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(PrepareAsyncDropCollectionRaw(context, request, cq)); - } - ::grpc::Status CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::milvus::grpc::Status* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> AsyncCreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(AsyncCreateIndexRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> PrepareAsyncCreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(PrepareAsyncCreateIndexRaw(context, request, cq)); - } - ::grpc::Status DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::milvus::grpc::IndexParam* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::IndexParam>> AsyncDescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::IndexParam>>(AsyncDescribeIndexRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::IndexParam>> PrepareAsyncDescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::IndexParam>>(PrepareAsyncDescribeIndexRaw(context, request, cq)); - } - ::grpc::Status DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::milvus::grpc::Status* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> AsyncDropIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(AsyncDropIndexRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> PrepareAsyncDropIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(PrepareAsyncDropIndexRaw(context, request, cq)); - } - ::grpc::Status CreatePartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::milvus::grpc::Status* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> AsyncCreatePartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(AsyncCreatePartitionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> PrepareAsyncCreatePartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(PrepareAsyncCreatePartitionRaw(context, request, cq)); - } - ::grpc::Status HasPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::milvus::grpc::BoolReply* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>> AsyncHasPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>>(AsyncHasPartitionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>> PrepareAsyncHasPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>>(PrepareAsyncHasPartitionRaw(context, request, cq)); - } - ::grpc::Status ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::PartitionList* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::PartitionList>> AsyncShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::PartitionList>>(AsyncShowPartitionsRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::PartitionList>> PrepareAsyncShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::PartitionList>>(PrepareAsyncShowPartitionsRaw(context, request, cq)); - } - ::grpc::Status DropPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::milvus::grpc::Status* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> AsyncDropPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(AsyncDropPartitionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> PrepareAsyncDropPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(PrepareAsyncDropPartitionRaw(context, request, cq)); - } - ::grpc::Status Insert(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::milvus::grpc::EntityIds* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::EntityIds>> AsyncInsert(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::EntityIds>>(AsyncInsertRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::EntityIds>> PrepareAsyncInsert(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::EntityIds>>(PrepareAsyncInsertRaw(context, request, cq)); - } - ::grpc::Status GetEntityByID(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity& request, ::milvus::grpc::Entities* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Entities>> AsyncGetEntityByID(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Entities>>(AsyncGetEntityByIDRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Entities>> PrepareAsyncGetEntityByID(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Entities>>(PrepareAsyncGetEntityByIDRaw(context, request, cq)); - } - ::grpc::Status GetEntityIDs(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam& request, ::milvus::grpc::EntityIds* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::EntityIds>> AsyncGetEntityIDs(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::EntityIds>>(AsyncGetEntityIDsRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::EntityIds>> PrepareAsyncGetEntityIDs(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::EntityIds>>(PrepareAsyncGetEntityIDsRaw(context, request, cq)); - } - ::grpc::Status Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::milvus::grpc::QueryResult* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>> AsyncSearch(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>>(AsyncSearchRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>> PrepareAsyncSearch(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>>(PrepareAsyncSearchRaw(context, request, cq)); - } - ::grpc::Status SearchInSegment(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam& request, ::milvus::grpc::QueryResult* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>> AsyncSearchInSegment(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>>(AsyncSearchInSegmentRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>> PrepareAsyncSearchInSegment(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>>(PrepareAsyncSearchInSegmentRaw(context, request, cq)); - } - ::grpc::Status Cmd(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::milvus::grpc::StringReply* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::StringReply>> AsyncCmd(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::StringReply>>(AsyncCmdRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::StringReply>> PrepareAsyncCmd(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::StringReply>>(PrepareAsyncCmdRaw(context, request, cq)); - } - ::grpc::Status DeleteByID(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam& request, ::milvus::grpc::Status* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> AsyncDeleteByID(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(AsyncDeleteByIDRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> PrepareAsyncDeleteByID(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(PrepareAsyncDeleteByIDRaw(context, request, cq)); - } - ::grpc::Status PreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Status* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> AsyncPreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(AsyncPreloadCollectionRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> PrepareAsyncPreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(PrepareAsyncPreloadCollectionRaw(context, request, cq)); - } - ::grpc::Status Flush(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam& request, ::milvus::grpc::Status* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> AsyncFlush(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(AsyncFlushRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> PrepareAsyncFlush(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(PrepareAsyncFlushRaw(context, request, cq)); - } - ::grpc::Status Compact(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam& request, ::milvus::grpc::Status* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> AsyncCompact(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(AsyncCompactRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>> PrepareAsyncCompact(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>>(PrepareAsyncCompactRaw(context, request, cq)); - } - ::grpc::Status SearchPB(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB& request, ::milvus::grpc::QueryResult* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>> AsyncSearchPB(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>>(AsyncSearchPBRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>> PrepareAsyncSearchPB(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>>(PrepareAsyncSearchPBRaw(context, request, cq)); - } - class experimental_async final : - public StubInterface::experimental_async_interface { - public: - void CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, std::function) override; - void CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) override; - void CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void HasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::BoolReply* response, std::function) override; - void HasCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, std::function) override; - void HasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void HasCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void DescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Mapping* response, std::function) override; - void DescribeCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Mapping* response, std::function) override; - void DescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Mapping* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void DescribeCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Mapping* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void CountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionRowCount* response, std::function) override; - void CountCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionRowCount* response, std::function) override; - void CountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionRowCount* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void CountCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionRowCount* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void ShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::CollectionNameList* response, std::function) override; - void ShowCollections(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionNameList* response, std::function) override; - void ShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::CollectionNameList* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void ShowCollections(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionNameList* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void ShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionInfo* response, std::function) override; - void ShowCollectionInfo(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionInfo* response, std::function) override; - void ShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionInfo* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void ShowCollectionInfo(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionInfo* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void DropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, std::function) override; - void DropCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) override; - void DropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void DropCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, std::function) override; - void CreateIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) override; - void CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void CreateIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::IndexParam* response, std::function) override; - void DescribeIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::IndexParam* response, std::function) override; - void DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::IndexParam* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void DescribeIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::IndexParam* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, std::function) override; - void DropIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) override; - void DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void DropIndex(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void CreatePartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::Status* response, std::function) override; - void CreatePartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) override; - void CreatePartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void CreatePartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void HasPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::BoolReply* response, std::function) override; - void HasPartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, std::function) override; - void HasPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void HasPartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::PartitionList* response, std::function) override; - void ShowPartitions(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::PartitionList* response, std::function) override; - void ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::PartitionList* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void ShowPartitions(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::PartitionList* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void DropPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::Status* response, std::function) override; - void DropPartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) override; - void DropPartition(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void DropPartition(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void Insert(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam* request, ::milvus::grpc::EntityIds* response, std::function) override; - void Insert(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::EntityIds* response, std::function) override; - void Insert(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam* request, ::milvus::grpc::EntityIds* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void Insert(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::EntityIds* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void GetEntityByID(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity* request, ::milvus::grpc::Entities* response, std::function) override; - void GetEntityByID(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Entities* response, std::function) override; - void GetEntityByID(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity* request, ::milvus::grpc::Entities* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void GetEntityByID(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Entities* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void GetEntityIDs(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam* request, ::milvus::grpc::EntityIds* response, std::function) override; - void GetEntityIDs(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::EntityIds* response, std::function) override; - void GetEntityIDs(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam* request, ::milvus::grpc::EntityIds* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void GetEntityIDs(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::EntityIds* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::QueryResult* response, std::function) override; - void Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, std::function) override; - void Search(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void Search(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void SearchInSegment(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam* request, ::milvus::grpc::QueryResult* response, std::function) override; - void SearchInSegment(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, std::function) override; - void SearchInSegment(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void SearchInSegment(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void Cmd(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::StringReply* response, std::function) override; - void Cmd(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::StringReply* response, std::function) override; - void Cmd(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::StringReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void Cmd(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::StringReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void DeleteByID(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam* request, ::milvus::grpc::Status* response, std::function) override; - void DeleteByID(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) override; - void DeleteByID(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void DeleteByID(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void PreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, std::function) override; - void PreloadCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) override; - void PreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void PreloadCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void Flush(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam* request, ::milvus::grpc::Status* response, std::function) override; - void Flush(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) override; - void Flush(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void Flush(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void Compact(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam* request, ::milvus::grpc::Status* response, std::function) override; - void Compact(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function) override; - void Compact(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void Compact(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void SearchPB(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB* request, ::milvus::grpc::QueryResult* response, std::function) override; - void SearchPB(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, std::function) override; - void SearchPB(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void SearchPB(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::QueryResult* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - private: - friend class Stub; - explicit experimental_async(Stub* stub): stub_(stub) { } - Stub* stub() { return stub_; } - Stub* stub_; - }; - class experimental_async_interface* experimental_async() override { return &async_stub_; } - - private: - std::shared_ptr< ::grpc::ChannelInterface> channel_; - class experimental_async async_stub_{this}; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* AsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* PrepareAsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::Mapping& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* AsyncHasCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* PrepareAsyncHasCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Mapping>* AsyncDescribeCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Mapping>* PrepareAsyncDescribeCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionRowCount>* AsyncCountCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionRowCount>* PrepareAsyncCountCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionNameList>* AsyncShowCollectionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionNameList>* PrepareAsyncShowCollectionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionInfo>* AsyncShowCollectionInfoRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionInfo>* PrepareAsyncShowCollectionInfoRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* AsyncDropCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* PrepareAsyncDropCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* AsyncCreateIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* PrepareAsyncCreateIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::IndexParam>* AsyncDescribeIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::IndexParam>* PrepareAsyncDescribeIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* AsyncDropIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* PrepareAsyncDropIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* AsyncCreatePartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* PrepareAsyncCreatePartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* AsyncHasPartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* PrepareAsyncHasPartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::PartitionList>* AsyncShowPartitionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::PartitionList>* PrepareAsyncShowPartitionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* AsyncDropPartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* PrepareAsyncDropPartitionRaw(::grpc::ClientContext* context, const ::milvus::grpc::PartitionParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::EntityIds>* AsyncInsertRaw(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::EntityIds>* PrepareAsyncInsertRaw(::grpc::ClientContext* context, const ::milvus::grpc::InsertParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Entities>* AsyncGetEntityByIDRaw(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Entities>* PrepareAsyncGetEntityByIDRaw(::grpc::ClientContext* context, const ::milvus::grpc::EntityIdentity& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::EntityIds>* AsyncGetEntityIDsRaw(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::EntityIds>* PrepareAsyncGetEntityIDsRaw(::grpc::ClientContext* context, const ::milvus::grpc::GetEntityIDsParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>* AsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>* PrepareAsyncSearchRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>* AsyncSearchInSegmentRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>* PrepareAsyncSearchInSegmentRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchInSegmentParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::StringReply>* AsyncCmdRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::StringReply>* PrepareAsyncCmdRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* AsyncDeleteByIDRaw(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* PrepareAsyncDeleteByIDRaw(::grpc::ClientContext* context, const ::milvus::grpc::DeleteByIDParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* AsyncPreloadCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* PrepareAsyncPreloadCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* AsyncFlushRaw(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* PrepareAsyncFlushRaw(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* AsyncCompactRaw(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* PrepareAsyncCompactRaw(::grpc::ClientContext* context, const ::milvus::grpc::CompactParam& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>* AsyncSearchPBRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::milvus::grpc::QueryResult>* PrepareAsyncSearchPBRaw(::grpc::ClientContext* context, const ::milvus::grpc::SearchParamPB& request, ::grpc::CompletionQueue* cq) override; - const ::grpc::internal::RpcMethod rpcmethod_CreateCollection_; - const ::grpc::internal::RpcMethod rpcmethod_HasCollection_; - const ::grpc::internal::RpcMethod rpcmethod_DescribeCollection_; - const ::grpc::internal::RpcMethod rpcmethod_CountCollection_; - const ::grpc::internal::RpcMethod rpcmethod_ShowCollections_; - const ::grpc::internal::RpcMethod rpcmethod_ShowCollectionInfo_; - const ::grpc::internal::RpcMethod rpcmethod_DropCollection_; - const ::grpc::internal::RpcMethod rpcmethod_CreateIndex_; - const ::grpc::internal::RpcMethod rpcmethod_DescribeIndex_; - const ::grpc::internal::RpcMethod rpcmethod_DropIndex_; - const ::grpc::internal::RpcMethod rpcmethod_CreatePartition_; - const ::grpc::internal::RpcMethod rpcmethod_HasPartition_; - const ::grpc::internal::RpcMethod rpcmethod_ShowPartitions_; - const ::grpc::internal::RpcMethod rpcmethod_DropPartition_; - const ::grpc::internal::RpcMethod rpcmethod_Insert_; - const ::grpc::internal::RpcMethod rpcmethod_GetEntityByID_; - const ::grpc::internal::RpcMethod rpcmethod_GetEntityIDs_; - const ::grpc::internal::RpcMethod rpcmethod_Search_; - const ::grpc::internal::RpcMethod rpcmethod_SearchInSegment_; - const ::grpc::internal::RpcMethod rpcmethod_Cmd_; - const ::grpc::internal::RpcMethod rpcmethod_DeleteByID_; - const ::grpc::internal::RpcMethod rpcmethod_PreloadCollection_; - const ::grpc::internal::RpcMethod rpcmethod_Flush_; - const ::grpc::internal::RpcMethod rpcmethod_Compact_; - const ::grpc::internal::RpcMethod rpcmethod_SearchPB_; - }; - 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(); - // * - // @brief This method is used to create collection - // - // @param CollectionSchema, use to provide collection information to be created. - // - // @return Status - virtual ::grpc::Status CreateCollection(::grpc::ServerContext* context, const ::milvus::grpc::Mapping* request, ::milvus::grpc::Status* response); - // * - // @brief This method is used to test collection existence. - // - // @param CollectionName, collection name is going to be tested. - // - // @return BoolReply - virtual ::grpc::Status HasCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::BoolReply* response); - // * - // @brief This method is used to get collection schema. - // - // @param CollectionName, target collection name. - // - // @return CollectionSchema - virtual ::grpc::Status DescribeCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Mapping* response); - // * - // @brief This method is used to get collection schema. - // - // @param CollectionName, target collection name. - // - // @return CollectionRowCount - virtual ::grpc::Status CountCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionRowCount* response); - // * - // @brief This method is used to list all collections. - // - // @param Command, dummy parameter. - // - // @return CollectionNameList - virtual ::grpc::Status ShowCollections(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::CollectionNameList* response); - // * - // @brief This method is used to get collection detail information. - // - // @param CollectionName, target collection name. - // - // @return CollectionInfo - virtual ::grpc::Status ShowCollectionInfo(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionInfo* response); - // * - // @brief This method is used to delete collection. - // - // @param CollectionName, collection name is going to be deleted. - // - // @return Status - virtual ::grpc::Status DropCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response); - // * - // @brief This method is used to build index by collection in sync mode. - // - // @param IndexParam, index paramters. - // - // @return Status - virtual ::grpc::Status CreateIndex(::grpc::ServerContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response); - // * - // @brief This method is used to describe index - // - // @param IndexParam, target index. - // - // @return IndexParam - virtual ::grpc::Status DescribeIndex(::grpc::ServerContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::IndexParam* response); - // * - // @brief This method is used to drop index - // - // @param IndexParam, target field. if the IndexParam.field_name is empty, will drop all index of the collection - // - // @return Status - virtual ::grpc::Status DropIndex(::grpc::ServerContext* context, const ::milvus::grpc::IndexParam* request, ::milvus::grpc::Status* response); - // * - // @brief This method is used to create partition - // - // @param PartitionParam, partition parameters. - // - // @return Status - virtual ::grpc::Status CreatePartition(::grpc::ServerContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::Status* response); - // * - // @brief This method is used to test partition existence. - // - // @param PartitionParam, target partition. - // - // @return BoolReply - virtual ::grpc::Status HasPartition(::grpc::ServerContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::BoolReply* response); - // * - // @brief This method is used to show partition information - // - // @param CollectionName, target collection name. - // - // @return PartitionList - virtual ::grpc::Status ShowPartitions(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::PartitionList* response); - // * - // @brief This method is used to drop partition - // - // @param PartitionParam, target partition. - // - // @return Status - virtual ::grpc::Status DropPartition(::grpc::ServerContext* context, const ::milvus::grpc::PartitionParam* request, ::milvus::grpc::Status* response); - // * - // @brief This method is used to add vector array to collection. - // - // @param InsertParam, insert parameters. - // - // @return VectorIds - virtual ::grpc::Status Insert(::grpc::ServerContext* context, const ::milvus::grpc::InsertParam* request, ::milvus::grpc::EntityIds* response); - // * - // @brief This method is used to get entities data by id array. - // - // @param EntitiesIdentity, target entity id array. - // - // @return EntitiesData - virtual ::grpc::Status GetEntityByID(::grpc::ServerContext* context, const ::milvus::grpc::EntityIdentity* request, ::milvus::grpc::Entities* response); - // * - // @brief This method is used to get vector ids from a segment - // - // @param GetVectorIDsParam, target collection and segment - // - // @return VectorIds - virtual ::grpc::Status GetEntityIDs(::grpc::ServerContext* context, const ::milvus::grpc::GetEntityIDsParam* request, ::milvus::grpc::EntityIds* response); - // * - // @brief This method is used to query vector in collection. - // - // @param SearchParam, search parameters. - // - // @return KQueryResult - virtual ::grpc::Status Search(::grpc::ServerContext* context, const ::milvus::grpc::SearchParam* request, ::milvus::grpc::QueryResult* response); - // * - // @brief This method is used to query vector in specified files. - // - // @param SearchInSegmentParam, target segments to search. - // - // @return TopKQueryResult - virtual ::grpc::Status SearchInSegment(::grpc::ServerContext* context, const ::milvus::grpc::SearchInSegmentParam* request, ::milvus::grpc::QueryResult* response); - // * - // @brief This method is used to give the server status. - // - // @param Command, command string - // - // @return StringReply - virtual ::grpc::Status Cmd(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::StringReply* response); - // * - // @brief This method is used to delete vector by id - // - // @param DeleteByIDParam, delete parameters. - // - // @return status - virtual ::grpc::Status DeleteByID(::grpc::ServerContext* context, const ::milvus::grpc::DeleteByIDParam* request, ::milvus::grpc::Status* response); - // * - // @brief This method is used to preload collection - // - // @param CollectionName, target collection name. - // - // @return Status - virtual ::grpc::Status PreloadCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response); - // * - // @brief This method is used to flush buffer into storage. - // - // @param FlushParam, flush parameters - // - // @return Status - virtual ::grpc::Status Flush(::grpc::ServerContext* context, const ::milvus::grpc::FlushParam* request, ::milvus::grpc::Status* response); - // * - // @brief This method is used to compact collection - // - // @param CompactParam, compact parameters - // - // @return Status - virtual ::grpc::Status Compact(::grpc::ServerContext* context, const ::milvus::grpc::CompactParam* request, ::milvus::grpc::Status* response); - // *******************************New Interface******************************************* - // - virtual ::grpc::Status SearchPB(::grpc::ServerContext* context, const ::milvus::grpc::SearchParamPB* request, ::milvus::grpc::QueryResult* response); - }; - template - class WithAsyncMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_CreateCollection() { - ::grpc::Service::MarkMethodAsync(0); - } - ~WithAsyncMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCreateCollection(::grpc::ServerContext* context, ::milvus::grpc::Mapping* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::Status>* 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_HasCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_HasCollection() { - ::grpc::Service::MarkMethodAsync(1); - } - ~WithAsyncMethod_HasCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status HasCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::BoolReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestHasCollection(::grpc::ServerContext* context, ::milvus::grpc::CollectionName* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::BoolReply>* 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_DescribeCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_DescribeCollection() { - ::grpc::Service::MarkMethodAsync(2); - } - ~WithAsyncMethod_DescribeCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DescribeCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Mapping* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestDescribeCollection(::grpc::ServerContext* context, ::milvus::grpc::CollectionName* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::Mapping>* 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_CountCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_CountCollection() { - ::grpc::Service::MarkMethodAsync(3); - } - ~WithAsyncMethod_CountCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CountCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::CollectionRowCount* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCountCollection(::grpc::ServerContext* context, ::milvus::grpc::CollectionName* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::CollectionRowCount>* 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_ShowCollections : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_ShowCollections() { - ::grpc::Service::MarkMethodAsync(4); - } - ~WithAsyncMethod_ShowCollections() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status ShowCollections(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Command* /*request*/, ::milvus::grpc::CollectionNameList* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestShowCollections(::grpc::ServerContext* context, ::milvus::grpc::Command* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::CollectionNameList>* 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_ShowCollectionInfo : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_ShowCollectionInfo() { - ::grpc::Service::MarkMethodAsync(5); - } - ~WithAsyncMethod_ShowCollectionInfo() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status ShowCollectionInfo(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::CollectionInfo* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestShowCollectionInfo(::grpc::ServerContext* context, ::milvus::grpc::CollectionName* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::CollectionInfo>* 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_DropCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_DropCollection() { - ::grpc::Service::MarkMethodAsync(6); - } - ~WithAsyncMethod_DropCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DropCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestDropCollection(::grpc::ServerContext* context, ::milvus::grpc::CollectionName* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::Status>* 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_CreateIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_CreateIndex() { - ::grpc::Service::MarkMethodAsync(7); - } - ~WithAsyncMethod_CreateIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCreateIndex(::grpc::ServerContext* context, ::milvus::grpc::IndexParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::Status>* 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_DescribeIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_DescribeIndex() { - ::grpc::Service::MarkMethodAsync(8); - } - ~WithAsyncMethod_DescribeIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DescribeIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::IndexParam* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestDescribeIndex(::grpc::ServerContext* context, ::milvus::grpc::IndexParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::IndexParam>* 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_DropIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_DropIndex() { - ::grpc::Service::MarkMethodAsync(9); - } - ~WithAsyncMethod_DropIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DropIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestDropIndex(::grpc::ServerContext* context, ::milvus::grpc::IndexParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::Status>* 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 WithAsyncMethod_CreatePartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_CreatePartition() { - ::grpc::Service::MarkMethodAsync(10); - } - ~WithAsyncMethod_CreatePartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreatePartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCreatePartition(::grpc::ServerContext* context, ::milvus::grpc::PartitionParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::Status>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(10, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_HasPartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_HasPartition() { - ::grpc::Service::MarkMethodAsync(11); - } - ~WithAsyncMethod_HasPartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status HasPartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::BoolReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestHasPartition(::grpc::ServerContext* context, ::milvus::grpc::PartitionParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::BoolReply>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(11, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_ShowPartitions : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_ShowPartitions() { - ::grpc::Service::MarkMethodAsync(12); - } - ~WithAsyncMethod_ShowPartitions() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status ShowPartitions(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::PartitionList* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestShowPartitions(::grpc::ServerContext* context, ::milvus::grpc::CollectionName* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::PartitionList>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(12, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_DropPartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_DropPartition() { - ::grpc::Service::MarkMethodAsync(13); - } - ~WithAsyncMethod_DropPartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DropPartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestDropPartition(::grpc::ServerContext* context, ::milvus::grpc::PartitionParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::Status>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(13, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_Insert : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_Insert() { - ::grpc::Service::MarkMethodAsync(14); - } - ~WithAsyncMethod_Insert() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Insert(::grpc::ServerContext* /*context*/, const ::milvus::grpc::InsertParam* /*request*/, ::milvus::grpc::EntityIds* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestInsert(::grpc::ServerContext* context, ::milvus::grpc::InsertParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::EntityIds>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(14, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_GetEntityByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_GetEntityByID() { - ::grpc::Service::MarkMethodAsync(15); - } - ~WithAsyncMethod_GetEntityByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetEntityByID(::grpc::ServerContext* /*context*/, const ::milvus::grpc::EntityIdentity* /*request*/, ::milvus::grpc::Entities* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestGetEntityByID(::grpc::ServerContext* context, ::milvus::grpc::EntityIdentity* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::Entities>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(15, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_GetEntityIDs : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_GetEntityIDs() { - ::grpc::Service::MarkMethodAsync(16); - } - ~WithAsyncMethod_GetEntityIDs() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetEntityIDs(::grpc::ServerContext* /*context*/, const ::milvus::grpc::GetEntityIDsParam* /*request*/, ::milvus::grpc::EntityIds* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestGetEntityIDs(::grpc::ServerContext* context, ::milvus::grpc::GetEntityIDsParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::EntityIds>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(16, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_Search : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_Search() { - ::grpc::Service::MarkMethodAsync(17); - } - ~WithAsyncMethod_Search() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestSearch(::grpc::ServerContext* context, ::milvus::grpc::SearchParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::QueryResult>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(17, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_SearchInSegment : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_SearchInSegment() { - ::grpc::Service::MarkMethodAsync(18); - } - ~WithAsyncMethod_SearchInSegment() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SearchInSegment(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInSegmentParam* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestSearchInSegment(::grpc::ServerContext* context, ::milvus::grpc::SearchInSegmentParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::QueryResult>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(18, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_Cmd : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_Cmd() { - ::grpc::Service::MarkMethodAsync(19); - } - ~WithAsyncMethod_Cmd() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Cmd(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Command* /*request*/, ::milvus::grpc::StringReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCmd(::grpc::ServerContext* context, ::milvus::grpc::Command* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::StringReply>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(19, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_DeleteByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_DeleteByID() { - ::grpc::Service::MarkMethodAsync(20); - } - ~WithAsyncMethod_DeleteByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DeleteByID(::grpc::ServerContext* /*context*/, const ::milvus::grpc::DeleteByIDParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestDeleteByID(::grpc::ServerContext* context, ::milvus::grpc::DeleteByIDParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::Status>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(20, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_PreloadCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_PreloadCollection() { - ::grpc::Service::MarkMethodAsync(21); - } - ~WithAsyncMethod_PreloadCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status PreloadCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestPreloadCollection(::grpc::ServerContext* context, ::milvus::grpc::CollectionName* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::Status>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(21, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_Flush : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_Flush() { - ::grpc::Service::MarkMethodAsync(22); - } - ~WithAsyncMethod_Flush() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Flush(::grpc::ServerContext* /*context*/, const ::milvus::grpc::FlushParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestFlush(::grpc::ServerContext* context, ::milvus::grpc::FlushParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::Status>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(22, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_Compact : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_Compact() { - ::grpc::Service::MarkMethodAsync(23); - } - ~WithAsyncMethod_Compact() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Compact(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CompactParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCompact(::grpc::ServerContext* context, ::milvus::grpc::CompactParam* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::Status>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(23, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_SearchPB : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_SearchPB() { - ::grpc::Service::MarkMethodAsync(24); - } - ~WithAsyncMethod_SearchPB() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SearchPB(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParamPB* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestSearchPB(::grpc::ServerContext* context, ::milvus::grpc::SearchParamPB* request, ::grpc::ServerAsyncResponseWriter< ::milvus::grpc::QueryResult>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(24, context, request, response, new_call_cq, notification_cq, tag); - } - }; - typedef WithAsyncMethod_CreateCollection > > > > > > > > > > > > > > > > > > > > > > > > AsyncService; - template - class ExperimentalWithCallbackMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_CreateCollection() { - ::grpc::Service::experimental().MarkMethodCallback(0, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::Mapping, ::milvus::grpc::Status>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::Mapping* request, - ::milvus::grpc::Status* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->CreateCollection(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_CreateCollection( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::Mapping, ::milvus::grpc::Status>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::Mapping, ::milvus::grpc::Status>*>( - ::grpc::Service::experimental().GetHandler(0)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_HasCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_HasCollection() { - ::grpc::Service::experimental().MarkMethodCallback(1, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::BoolReply>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::CollectionName* request, - ::milvus::grpc::BoolReply* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->HasCollection(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_HasCollection( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::CollectionName, ::milvus::grpc::BoolReply>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::BoolReply>*>( - ::grpc::Service::experimental().GetHandler(1)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_HasCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status HasCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::BoolReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void HasCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::BoolReply* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_DescribeCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_DescribeCollection() { - ::grpc::Service::experimental().MarkMethodCallback(2, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::Mapping>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::CollectionName* request, - ::milvus::grpc::Mapping* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->DescribeCollection(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_DescribeCollection( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::CollectionName, ::milvus::grpc::Mapping>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::Mapping>*>( - ::grpc::Service::experimental().GetHandler(2)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_DescribeCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DescribeCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Mapping* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void DescribeCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Mapping* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_CountCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_CountCollection() { - ::grpc::Service::experimental().MarkMethodCallback(3, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::CollectionRowCount>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::CollectionName* request, - ::milvus::grpc::CollectionRowCount* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->CountCollection(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_CountCollection( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::CollectionName, ::milvus::grpc::CollectionRowCount>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::CollectionRowCount>*>( - ::grpc::Service::experimental().GetHandler(3)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_CountCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CountCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::CollectionRowCount* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void CountCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::CollectionRowCount* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_ShowCollections : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_ShowCollections() { - ::grpc::Service::experimental().MarkMethodCallback(4, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::Command, ::milvus::grpc::CollectionNameList>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::Command* request, - ::milvus::grpc::CollectionNameList* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->ShowCollections(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_ShowCollections( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::Command, ::milvus::grpc::CollectionNameList>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::Command, ::milvus::grpc::CollectionNameList>*>( - ::grpc::Service::experimental().GetHandler(4)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_ShowCollections() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status ShowCollections(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Command* /*request*/, ::milvus::grpc::CollectionNameList* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void ShowCollections(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Command* /*request*/, ::milvus::grpc::CollectionNameList* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_ShowCollectionInfo : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_ShowCollectionInfo() { - ::grpc::Service::experimental().MarkMethodCallback(5, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::CollectionInfo>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::CollectionName* request, - ::milvus::grpc::CollectionInfo* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->ShowCollectionInfo(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_ShowCollectionInfo( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::CollectionName, ::milvus::grpc::CollectionInfo>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::CollectionInfo>*>( - ::grpc::Service::experimental().GetHandler(5)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_ShowCollectionInfo() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status ShowCollectionInfo(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::CollectionInfo* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void ShowCollectionInfo(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::CollectionInfo* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_DropCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_DropCollection() { - ::grpc::Service::experimental().MarkMethodCallback(6, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::Status>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::CollectionName* request, - ::milvus::grpc::Status* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->DropCollection(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_DropCollection( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::CollectionName, ::milvus::grpc::Status>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::Status>*>( - ::grpc::Service::experimental().GetHandler(6)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_DropCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DropCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void DropCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Status* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_CreateIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_CreateIndex() { - ::grpc::Service::experimental().MarkMethodCallback(7, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::IndexParam, ::milvus::grpc::Status>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::IndexParam* request, - ::milvus::grpc::Status* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->CreateIndex(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_CreateIndex( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::IndexParam, ::milvus::grpc::Status>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::IndexParam, ::milvus::grpc::Status>*>( - ::grpc::Service::experimental().GetHandler(7)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_CreateIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void CreateIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_DescribeIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_DescribeIndex() { - ::grpc::Service::experimental().MarkMethodCallback(8, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::IndexParam, ::milvus::grpc::IndexParam>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::IndexParam* request, - ::milvus::grpc::IndexParam* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->DescribeIndex(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_DescribeIndex( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::IndexParam, ::milvus::grpc::IndexParam>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::IndexParam, ::milvus::grpc::IndexParam>*>( - ::grpc::Service::experimental().GetHandler(8)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_DescribeIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DescribeIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::IndexParam* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void DescribeIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::IndexParam* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_DropIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_DropIndex() { - ::grpc::Service::experimental().MarkMethodCallback(9, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::IndexParam, ::milvus::grpc::Status>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::IndexParam* request, - ::milvus::grpc::Status* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->DropIndex(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_DropIndex( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::IndexParam, ::milvus::grpc::Status>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::IndexParam, ::milvus::grpc::Status>*>( - ::grpc::Service::experimental().GetHandler(9)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_DropIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DropIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void DropIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_CreatePartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_CreatePartition() { - ::grpc::Service::experimental().MarkMethodCallback(10, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::PartitionParam, ::milvus::grpc::Status>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::PartitionParam* request, - ::milvus::grpc::Status* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->CreatePartition(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_CreatePartition( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::PartitionParam, ::milvus::grpc::Status>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::PartitionParam, ::milvus::grpc::Status>*>( - ::grpc::Service::experimental().GetHandler(10)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_CreatePartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreatePartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void CreatePartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::Status* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_HasPartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_HasPartition() { - ::grpc::Service::experimental().MarkMethodCallback(11, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::PartitionParam, ::milvus::grpc::BoolReply>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::PartitionParam* request, - ::milvus::grpc::BoolReply* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->HasPartition(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_HasPartition( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::PartitionParam, ::milvus::grpc::BoolReply>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::PartitionParam, ::milvus::grpc::BoolReply>*>( - ::grpc::Service::experimental().GetHandler(11)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_HasPartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status HasPartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::BoolReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void HasPartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::BoolReply* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_ShowPartitions : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_ShowPartitions() { - ::grpc::Service::experimental().MarkMethodCallback(12, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::PartitionList>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::CollectionName* request, - ::milvus::grpc::PartitionList* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->ShowPartitions(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_ShowPartitions( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::CollectionName, ::milvus::grpc::PartitionList>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::PartitionList>*>( - ::grpc::Service::experimental().GetHandler(12)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_ShowPartitions() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status ShowPartitions(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::PartitionList* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void ShowPartitions(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::PartitionList* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_DropPartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_DropPartition() { - ::grpc::Service::experimental().MarkMethodCallback(13, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::PartitionParam, ::milvus::grpc::Status>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::PartitionParam* request, - ::milvus::grpc::Status* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->DropPartition(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_DropPartition( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::PartitionParam, ::milvus::grpc::Status>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::PartitionParam, ::milvus::grpc::Status>*>( - ::grpc::Service::experimental().GetHandler(13)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_DropPartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DropPartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void DropPartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::Status* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_Insert : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_Insert() { - ::grpc::Service::experimental().MarkMethodCallback(14, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::InsertParam, ::milvus::grpc::EntityIds>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::InsertParam* request, - ::milvus::grpc::EntityIds* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->Insert(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_Insert( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::InsertParam, ::milvus::grpc::EntityIds>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::InsertParam, ::milvus::grpc::EntityIds>*>( - ::grpc::Service::experimental().GetHandler(14)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_Insert() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Insert(::grpc::ServerContext* /*context*/, const ::milvus::grpc::InsertParam* /*request*/, ::milvus::grpc::EntityIds* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void Insert(::grpc::ServerContext* /*context*/, const ::milvus::grpc::InsertParam* /*request*/, ::milvus::grpc::EntityIds* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_GetEntityByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_GetEntityByID() { - ::grpc::Service::experimental().MarkMethodCallback(15, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::EntityIdentity, ::milvus::grpc::Entities>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::EntityIdentity* request, - ::milvus::grpc::Entities* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->GetEntityByID(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_GetEntityByID( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::EntityIdentity, ::milvus::grpc::Entities>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::EntityIdentity, ::milvus::grpc::Entities>*>( - ::grpc::Service::experimental().GetHandler(15)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_GetEntityByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetEntityByID(::grpc::ServerContext* /*context*/, const ::milvus::grpc::EntityIdentity* /*request*/, ::milvus::grpc::Entities* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void GetEntityByID(::grpc::ServerContext* /*context*/, const ::milvus::grpc::EntityIdentity* /*request*/, ::milvus::grpc::Entities* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_GetEntityIDs : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_GetEntityIDs() { - ::grpc::Service::experimental().MarkMethodCallback(16, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::GetEntityIDsParam, ::milvus::grpc::EntityIds>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::GetEntityIDsParam* request, - ::milvus::grpc::EntityIds* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->GetEntityIDs(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_GetEntityIDs( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::GetEntityIDsParam, ::milvus::grpc::EntityIds>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::GetEntityIDsParam, ::milvus::grpc::EntityIds>*>( - ::grpc::Service::experimental().GetHandler(16)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_GetEntityIDs() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetEntityIDs(::grpc::ServerContext* /*context*/, const ::milvus::grpc::GetEntityIDsParam* /*request*/, ::milvus::grpc::EntityIds* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void GetEntityIDs(::grpc::ServerContext* /*context*/, const ::milvus::grpc::GetEntityIDsParam* /*request*/, ::milvus::grpc::EntityIds* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_Search : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_Search() { - ::grpc::Service::experimental().MarkMethodCallback(17, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::SearchParam, ::milvus::grpc::QueryResult>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::SearchParam* request, - ::milvus::grpc::QueryResult* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->Search(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_Search( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::SearchParam, ::milvus::grpc::QueryResult>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::SearchParam, ::milvus::grpc::QueryResult>*>( - ::grpc::Service::experimental().GetHandler(17)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_Search() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::QueryResult* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_SearchInSegment : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_SearchInSegment() { - ::grpc::Service::experimental().MarkMethodCallback(18, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::SearchInSegmentParam, ::milvus::grpc::QueryResult>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::SearchInSegmentParam* request, - ::milvus::grpc::QueryResult* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->SearchInSegment(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_SearchInSegment( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::SearchInSegmentParam, ::milvus::grpc::QueryResult>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::SearchInSegmentParam, ::milvus::grpc::QueryResult>*>( - ::grpc::Service::experimental().GetHandler(18)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_SearchInSegment() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SearchInSegment(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInSegmentParam* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void SearchInSegment(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInSegmentParam* /*request*/, ::milvus::grpc::QueryResult* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_Cmd : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_Cmd() { - ::grpc::Service::experimental().MarkMethodCallback(19, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::Command, ::milvus::grpc::StringReply>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::Command* request, - ::milvus::grpc::StringReply* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->Cmd(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_Cmd( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::Command, ::milvus::grpc::StringReply>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::Command, ::milvus::grpc::StringReply>*>( - ::grpc::Service::experimental().GetHandler(19)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_Cmd() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Cmd(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Command* /*request*/, ::milvus::grpc::StringReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void Cmd(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Command* /*request*/, ::milvus::grpc::StringReply* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_DeleteByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_DeleteByID() { - ::grpc::Service::experimental().MarkMethodCallback(20, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::DeleteByIDParam, ::milvus::grpc::Status>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::DeleteByIDParam* request, - ::milvus::grpc::Status* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->DeleteByID(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_DeleteByID( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::DeleteByIDParam, ::milvus::grpc::Status>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::DeleteByIDParam, ::milvus::grpc::Status>*>( - ::grpc::Service::experimental().GetHandler(20)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_DeleteByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DeleteByID(::grpc::ServerContext* /*context*/, const ::milvus::grpc::DeleteByIDParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void DeleteByID(::grpc::ServerContext* /*context*/, const ::milvus::grpc::DeleteByIDParam* /*request*/, ::milvus::grpc::Status* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_PreloadCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_PreloadCollection() { - ::grpc::Service::experimental().MarkMethodCallback(21, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::Status>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::CollectionName* request, - ::milvus::grpc::Status* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->PreloadCollection(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_PreloadCollection( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::CollectionName, ::milvus::grpc::Status>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::Status>*>( - ::grpc::Service::experimental().GetHandler(21)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_PreloadCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status PreloadCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void PreloadCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Status* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_Flush : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_Flush() { - ::grpc::Service::experimental().MarkMethodCallback(22, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::FlushParam, ::milvus::grpc::Status>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::FlushParam* request, - ::milvus::grpc::Status* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->Flush(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_Flush( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::FlushParam, ::milvus::grpc::Status>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::FlushParam, ::milvus::grpc::Status>*>( - ::grpc::Service::experimental().GetHandler(22)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_Flush() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Flush(::grpc::ServerContext* /*context*/, const ::milvus::grpc::FlushParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void Flush(::grpc::ServerContext* /*context*/, const ::milvus::grpc::FlushParam* /*request*/, ::milvus::grpc::Status* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_Compact : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_Compact() { - ::grpc::Service::experimental().MarkMethodCallback(23, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::CompactParam, ::milvus::grpc::Status>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::CompactParam* request, - ::milvus::grpc::Status* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->Compact(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_Compact( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::CompactParam, ::milvus::grpc::Status>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::CompactParam, ::milvus::grpc::Status>*>( - ::grpc::Service::experimental().GetHandler(23)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_Compact() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Compact(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CompactParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void Compact(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CompactParam* /*request*/, ::milvus::grpc::Status* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_SearchPB : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_SearchPB() { - ::grpc::Service::experimental().MarkMethodCallback(24, - new ::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::SearchParamPB, ::milvus::grpc::QueryResult>( - [this](::grpc::ServerContext* context, - const ::milvus::grpc::SearchParamPB* request, - ::milvus::grpc::QueryResult* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->SearchPB(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_SearchPB( - ::grpc::experimental::MessageAllocator< ::milvus::grpc::SearchParamPB, ::milvus::grpc::QueryResult>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::milvus::grpc::SearchParamPB, ::milvus::grpc::QueryResult>*>( - ::grpc::Service::experimental().GetHandler(24)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_SearchPB() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SearchPB(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParamPB* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void SearchPB(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParamPB* /*request*/, ::milvus::grpc::QueryResult* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - typedef ExperimentalWithCallbackMethod_CreateCollection > > > > > > > > > > > > > > > > > > > > > > > > ExperimentalCallbackService; - template - class WithGenericMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_CreateCollection() { - ::grpc::Service::MarkMethodGeneric(0); - } - ~WithGenericMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_HasCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_HasCollection() { - ::grpc::Service::MarkMethodGeneric(1); - } - ~WithGenericMethod_HasCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status HasCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::BoolReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_DescribeCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_DescribeCollection() { - ::grpc::Service::MarkMethodGeneric(2); - } - ~WithGenericMethod_DescribeCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DescribeCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Mapping* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_CountCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_CountCollection() { - ::grpc::Service::MarkMethodGeneric(3); - } - ~WithGenericMethod_CountCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CountCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::CollectionRowCount* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_ShowCollections : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_ShowCollections() { - ::grpc::Service::MarkMethodGeneric(4); - } - ~WithGenericMethod_ShowCollections() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status ShowCollections(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Command* /*request*/, ::milvus::grpc::CollectionNameList* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_ShowCollectionInfo : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_ShowCollectionInfo() { - ::grpc::Service::MarkMethodGeneric(5); - } - ~WithGenericMethod_ShowCollectionInfo() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status ShowCollectionInfo(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::CollectionInfo* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_DropCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_DropCollection() { - ::grpc::Service::MarkMethodGeneric(6); - } - ~WithGenericMethod_DropCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DropCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_CreateIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_CreateIndex() { - ::grpc::Service::MarkMethodGeneric(7); - } - ~WithGenericMethod_CreateIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_DescribeIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_DescribeIndex() { - ::grpc::Service::MarkMethodGeneric(8); - } - ~WithGenericMethod_DescribeIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DescribeIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::IndexParam* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_DropIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_DropIndex() { - ::grpc::Service::MarkMethodGeneric(9); - } - ~WithGenericMethod_DropIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DropIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_CreatePartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_CreatePartition() { - ::grpc::Service::MarkMethodGeneric(10); - } - ~WithGenericMethod_CreatePartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreatePartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_HasPartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_HasPartition() { - ::grpc::Service::MarkMethodGeneric(11); - } - ~WithGenericMethod_HasPartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status HasPartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::BoolReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_ShowPartitions : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_ShowPartitions() { - ::grpc::Service::MarkMethodGeneric(12); - } - ~WithGenericMethod_ShowPartitions() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status ShowPartitions(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::PartitionList* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_DropPartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_DropPartition() { - ::grpc::Service::MarkMethodGeneric(13); - } - ~WithGenericMethod_DropPartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DropPartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_Insert : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_Insert() { - ::grpc::Service::MarkMethodGeneric(14); - } - ~WithGenericMethod_Insert() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Insert(::grpc::ServerContext* /*context*/, const ::milvus::grpc::InsertParam* /*request*/, ::milvus::grpc::EntityIds* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_GetEntityByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_GetEntityByID() { - ::grpc::Service::MarkMethodGeneric(15); - } - ~WithGenericMethod_GetEntityByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetEntityByID(::grpc::ServerContext* /*context*/, const ::milvus::grpc::EntityIdentity* /*request*/, ::milvus::grpc::Entities* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_GetEntityIDs : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_GetEntityIDs() { - ::grpc::Service::MarkMethodGeneric(16); - } - ~WithGenericMethod_GetEntityIDs() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetEntityIDs(::grpc::ServerContext* /*context*/, const ::milvus::grpc::GetEntityIDsParam* /*request*/, ::milvus::grpc::EntityIds* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_Search : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_Search() { - ::grpc::Service::MarkMethodGeneric(17); - } - ~WithGenericMethod_Search() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_SearchInSegment : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_SearchInSegment() { - ::grpc::Service::MarkMethodGeneric(18); - } - ~WithGenericMethod_SearchInSegment() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SearchInSegment(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInSegmentParam* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_Cmd : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_Cmd() { - ::grpc::Service::MarkMethodGeneric(19); - } - ~WithGenericMethod_Cmd() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Cmd(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Command* /*request*/, ::milvus::grpc::StringReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_DeleteByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_DeleteByID() { - ::grpc::Service::MarkMethodGeneric(20); - } - ~WithGenericMethod_DeleteByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DeleteByID(::grpc::ServerContext* /*context*/, const ::milvus::grpc::DeleteByIDParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_PreloadCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_PreloadCollection() { - ::grpc::Service::MarkMethodGeneric(21); - } - ~WithGenericMethod_PreloadCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status PreloadCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_Flush : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_Flush() { - ::grpc::Service::MarkMethodGeneric(22); - } - ~WithGenericMethod_Flush() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Flush(::grpc::ServerContext* /*context*/, const ::milvus::grpc::FlushParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_Compact : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_Compact() { - ::grpc::Service::MarkMethodGeneric(23); - } - ~WithGenericMethod_Compact() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Compact(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CompactParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_SearchPB : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_SearchPB() { - ::grpc::Service::MarkMethodGeneric(24); - } - ~WithGenericMethod_SearchPB() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SearchPB(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParamPB* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithRawMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_CreateCollection() { - ::grpc::Service::MarkMethodRaw(0); - } - ~WithRawMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCreateCollection(::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_HasCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_HasCollection() { - ::grpc::Service::MarkMethodRaw(1); - } - ~WithRawMethod_HasCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status HasCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::BoolReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestHasCollection(::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_DescribeCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_DescribeCollection() { - ::grpc::Service::MarkMethodRaw(2); - } - ~WithRawMethod_DescribeCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DescribeCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Mapping* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestDescribeCollection(::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_CountCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_CountCollection() { - ::grpc::Service::MarkMethodRaw(3); - } - ~WithRawMethod_CountCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CountCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::CollectionRowCount* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCountCollection(::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_ShowCollections : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_ShowCollections() { - ::grpc::Service::MarkMethodRaw(4); - } - ~WithRawMethod_ShowCollections() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status ShowCollections(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Command* /*request*/, ::milvus::grpc::CollectionNameList* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestShowCollections(::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_ShowCollectionInfo : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_ShowCollectionInfo() { - ::grpc::Service::MarkMethodRaw(5); - } - ~WithRawMethod_ShowCollectionInfo() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status ShowCollectionInfo(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::CollectionInfo* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestShowCollectionInfo(::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_DropCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_DropCollection() { - ::grpc::Service::MarkMethodRaw(6); - } - ~WithRawMethod_DropCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DropCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestDropCollection(::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_CreateIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_CreateIndex() { - ::grpc::Service::MarkMethodRaw(7); - } - ~WithRawMethod_CreateIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCreateIndex(::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_DescribeIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_DescribeIndex() { - ::grpc::Service::MarkMethodRaw(8); - } - ~WithRawMethod_DescribeIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DescribeIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::IndexParam* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestDescribeIndex(::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_DropIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_DropIndex() { - ::grpc::Service::MarkMethodRaw(9); - } - ~WithRawMethod_DropIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DropIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestDropIndex(::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 WithRawMethod_CreatePartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_CreatePartition() { - ::grpc::Service::MarkMethodRaw(10); - } - ~WithRawMethod_CreatePartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreatePartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCreatePartition(::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(10, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_HasPartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_HasPartition() { - ::grpc::Service::MarkMethodRaw(11); - } - ~WithRawMethod_HasPartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status HasPartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::BoolReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestHasPartition(::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(11, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_ShowPartitions : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_ShowPartitions() { - ::grpc::Service::MarkMethodRaw(12); - } - ~WithRawMethod_ShowPartitions() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status ShowPartitions(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::PartitionList* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestShowPartitions(::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(12, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_DropPartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_DropPartition() { - ::grpc::Service::MarkMethodRaw(13); - } - ~WithRawMethod_DropPartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DropPartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestDropPartition(::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(13, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_Insert : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_Insert() { - ::grpc::Service::MarkMethodRaw(14); - } - ~WithRawMethod_Insert() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Insert(::grpc::ServerContext* /*context*/, const ::milvus::grpc::InsertParam* /*request*/, ::milvus::grpc::EntityIds* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestInsert(::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(14, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_GetEntityByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_GetEntityByID() { - ::grpc::Service::MarkMethodRaw(15); - } - ~WithRawMethod_GetEntityByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetEntityByID(::grpc::ServerContext* /*context*/, const ::milvus::grpc::EntityIdentity* /*request*/, ::milvus::grpc::Entities* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestGetEntityByID(::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(15, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_GetEntityIDs : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_GetEntityIDs() { - ::grpc::Service::MarkMethodRaw(16); - } - ~WithRawMethod_GetEntityIDs() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetEntityIDs(::grpc::ServerContext* /*context*/, const ::milvus::grpc::GetEntityIDsParam* /*request*/, ::milvus::grpc::EntityIds* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestGetEntityIDs(::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(16, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_Search : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_Search() { - ::grpc::Service::MarkMethodRaw(17); - } - ~WithRawMethod_Search() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestSearch(::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(17, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_SearchInSegment : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_SearchInSegment() { - ::grpc::Service::MarkMethodRaw(18); - } - ~WithRawMethod_SearchInSegment() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SearchInSegment(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInSegmentParam* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestSearchInSegment(::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(18, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_Cmd : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_Cmd() { - ::grpc::Service::MarkMethodRaw(19); - } - ~WithRawMethod_Cmd() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Cmd(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Command* /*request*/, ::milvus::grpc::StringReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCmd(::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(19, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_DeleteByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_DeleteByID() { - ::grpc::Service::MarkMethodRaw(20); - } - ~WithRawMethod_DeleteByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DeleteByID(::grpc::ServerContext* /*context*/, const ::milvus::grpc::DeleteByIDParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestDeleteByID(::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(20, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_PreloadCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_PreloadCollection() { - ::grpc::Service::MarkMethodRaw(21); - } - ~WithRawMethod_PreloadCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status PreloadCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestPreloadCollection(::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(21, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_Flush : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_Flush() { - ::grpc::Service::MarkMethodRaw(22); - } - ~WithRawMethod_Flush() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Flush(::grpc::ServerContext* /*context*/, const ::milvus::grpc::FlushParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestFlush(::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(22, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_Compact : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_Compact() { - ::grpc::Service::MarkMethodRaw(23); - } - ~WithRawMethod_Compact() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Compact(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CompactParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestCompact(::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(23, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_SearchPB : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_SearchPB() { - ::grpc::Service::MarkMethodRaw(24); - } - ~WithRawMethod_SearchPB() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SearchPB(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParamPB* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestSearchPB(::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(24, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class ExperimentalWithRawCallbackMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_CreateCollection() { - ::grpc::Service::experimental().MarkMethodRawCallback(0, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->CreateCollection(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void CreateCollection(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_HasCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_HasCollection() { - ::grpc::Service::experimental().MarkMethodRawCallback(1, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->HasCollection(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_HasCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status HasCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::BoolReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void HasCollection(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_DescribeCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_DescribeCollection() { - ::grpc::Service::experimental().MarkMethodRawCallback(2, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->DescribeCollection(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_DescribeCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DescribeCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Mapping* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void DescribeCollection(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_CountCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_CountCollection() { - ::grpc::Service::experimental().MarkMethodRawCallback(3, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->CountCollection(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_CountCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CountCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::CollectionRowCount* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void CountCollection(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_ShowCollections : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_ShowCollections() { - ::grpc::Service::experimental().MarkMethodRawCallback(4, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->ShowCollections(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_ShowCollections() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status ShowCollections(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Command* /*request*/, ::milvus::grpc::CollectionNameList* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void ShowCollections(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_ShowCollectionInfo : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_ShowCollectionInfo() { - ::grpc::Service::experimental().MarkMethodRawCallback(5, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->ShowCollectionInfo(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_ShowCollectionInfo() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status ShowCollectionInfo(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::CollectionInfo* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void ShowCollectionInfo(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_DropCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_DropCollection() { - ::grpc::Service::experimental().MarkMethodRawCallback(6, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->DropCollection(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_DropCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DropCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void DropCollection(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_CreateIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_CreateIndex() { - ::grpc::Service::experimental().MarkMethodRawCallback(7, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->CreateIndex(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_CreateIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreateIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void CreateIndex(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_DescribeIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_DescribeIndex() { - ::grpc::Service::experimental().MarkMethodRawCallback(8, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->DescribeIndex(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_DescribeIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DescribeIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::IndexParam* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void DescribeIndex(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_DropIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_DropIndex() { - ::grpc::Service::experimental().MarkMethodRawCallback(9, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->DropIndex(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_DropIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DropIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void DropIndex(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_CreatePartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_CreatePartition() { - ::grpc::Service::experimental().MarkMethodRawCallback(10, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->CreatePartition(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_CreatePartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status CreatePartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void CreatePartition(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_HasPartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_HasPartition() { - ::grpc::Service::experimental().MarkMethodRawCallback(11, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->HasPartition(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_HasPartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status HasPartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::BoolReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void HasPartition(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_ShowPartitions : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_ShowPartitions() { - ::grpc::Service::experimental().MarkMethodRawCallback(12, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->ShowPartitions(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_ShowPartitions() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status ShowPartitions(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::PartitionList* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void ShowPartitions(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_DropPartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_DropPartition() { - ::grpc::Service::experimental().MarkMethodRawCallback(13, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->DropPartition(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_DropPartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DropPartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void DropPartition(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_Insert : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_Insert() { - ::grpc::Service::experimental().MarkMethodRawCallback(14, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->Insert(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_Insert() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Insert(::grpc::ServerContext* /*context*/, const ::milvus::grpc::InsertParam* /*request*/, ::milvus::grpc::EntityIds* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void Insert(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_GetEntityByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_GetEntityByID() { - ::grpc::Service::experimental().MarkMethodRawCallback(15, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->GetEntityByID(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_GetEntityByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetEntityByID(::grpc::ServerContext* /*context*/, const ::milvus::grpc::EntityIdentity* /*request*/, ::milvus::grpc::Entities* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void GetEntityByID(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_GetEntityIDs : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_GetEntityIDs() { - ::grpc::Service::experimental().MarkMethodRawCallback(16, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->GetEntityIDs(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_GetEntityIDs() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status GetEntityIDs(::grpc::ServerContext* /*context*/, const ::milvus::grpc::GetEntityIDsParam* /*request*/, ::milvus::grpc::EntityIds* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void GetEntityIDs(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_Search : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_Search() { - ::grpc::Service::experimental().MarkMethodRawCallback(17, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->Search(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_Search() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void Search(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_SearchInSegment : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_SearchInSegment() { - ::grpc::Service::experimental().MarkMethodRawCallback(18, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->SearchInSegment(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_SearchInSegment() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SearchInSegment(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInSegmentParam* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void SearchInSegment(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_Cmd : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_Cmd() { - ::grpc::Service::experimental().MarkMethodRawCallback(19, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->Cmd(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_Cmd() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Cmd(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Command* /*request*/, ::milvus::grpc::StringReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void Cmd(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_DeleteByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_DeleteByID() { - ::grpc::Service::experimental().MarkMethodRawCallback(20, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->DeleteByID(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_DeleteByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status DeleteByID(::grpc::ServerContext* /*context*/, const ::milvus::grpc::DeleteByIDParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void DeleteByID(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_PreloadCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_PreloadCollection() { - ::grpc::Service::experimental().MarkMethodRawCallback(21, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->PreloadCollection(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_PreloadCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status PreloadCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void PreloadCollection(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_Flush : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_Flush() { - ::grpc::Service::experimental().MarkMethodRawCallback(22, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->Flush(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_Flush() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Flush(::grpc::ServerContext* /*context*/, const ::milvus::grpc::FlushParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void Flush(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_Compact : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_Compact() { - ::grpc::Service::experimental().MarkMethodRawCallback(23, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->Compact(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_Compact() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Compact(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CompactParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void Compact(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_SearchPB : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_SearchPB() { - ::grpc::Service::experimental().MarkMethodRawCallback(24, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->SearchPB(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_SearchPB() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status SearchPB(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParamPB* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void SearchPB(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class WithStreamedUnaryMethod_CreateCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_CreateCollection() { - ::grpc::Service::MarkMethodStreamed(0, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::Mapping, ::milvus::grpc::Status>(std::bind(&WithStreamedUnaryMethod_CreateCollection::StreamedCreateCollection, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_CreateCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status CreateCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Mapping* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedCreateCollection(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::Mapping,::milvus::grpc::Status>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_HasCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_HasCollection() { - ::grpc::Service::MarkMethodStreamed(1, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::BoolReply>(std::bind(&WithStreamedUnaryMethod_HasCollection::StreamedHasCollection, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_HasCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status HasCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::BoolReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedHasCollection(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::CollectionName,::milvus::grpc::BoolReply>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_DescribeCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_DescribeCollection() { - ::grpc::Service::MarkMethodStreamed(2, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::Mapping>(std::bind(&WithStreamedUnaryMethod_DescribeCollection::StreamedDescribeCollection, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_DescribeCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status DescribeCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Mapping* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedDescribeCollection(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::CollectionName,::milvus::grpc::Mapping>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_CountCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_CountCollection() { - ::grpc::Service::MarkMethodStreamed(3, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::CollectionRowCount>(std::bind(&WithStreamedUnaryMethod_CountCollection::StreamedCountCollection, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_CountCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status CountCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::CollectionRowCount* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedCountCollection(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::CollectionName,::milvus::grpc::CollectionRowCount>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_ShowCollections : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_ShowCollections() { - ::grpc::Service::MarkMethodStreamed(4, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::Command, ::milvus::grpc::CollectionNameList>(std::bind(&WithStreamedUnaryMethod_ShowCollections::StreamedShowCollections, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_ShowCollections() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status ShowCollections(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Command* /*request*/, ::milvus::grpc::CollectionNameList* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedShowCollections(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::Command,::milvus::grpc::CollectionNameList>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_ShowCollectionInfo : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_ShowCollectionInfo() { - ::grpc::Service::MarkMethodStreamed(5, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::CollectionInfo>(std::bind(&WithStreamedUnaryMethod_ShowCollectionInfo::StreamedShowCollectionInfo, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_ShowCollectionInfo() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status ShowCollectionInfo(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::CollectionInfo* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedShowCollectionInfo(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::CollectionName,::milvus::grpc::CollectionInfo>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_DropCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_DropCollection() { - ::grpc::Service::MarkMethodStreamed(6, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::Status>(std::bind(&WithStreamedUnaryMethod_DropCollection::StreamedDropCollection, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_DropCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status DropCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedDropCollection(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::CollectionName,::milvus::grpc::Status>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_CreateIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_CreateIndex() { - ::grpc::Service::MarkMethodStreamed(7, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::IndexParam, ::milvus::grpc::Status>(std::bind(&WithStreamedUnaryMethod_CreateIndex::StreamedCreateIndex, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_CreateIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status CreateIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedCreateIndex(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::IndexParam,::milvus::grpc::Status>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_DescribeIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_DescribeIndex() { - ::grpc::Service::MarkMethodStreamed(8, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::IndexParam, ::milvus::grpc::IndexParam>(std::bind(&WithStreamedUnaryMethod_DescribeIndex::StreamedDescribeIndex, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_DescribeIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status DescribeIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::IndexParam* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedDescribeIndex(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::IndexParam,::milvus::grpc::IndexParam>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_DropIndex : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_DropIndex() { - ::grpc::Service::MarkMethodStreamed(9, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::IndexParam, ::milvus::grpc::Status>(std::bind(&WithStreamedUnaryMethod_DropIndex::StreamedDropIndex, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_DropIndex() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status DropIndex(::grpc::ServerContext* /*context*/, const ::milvus::grpc::IndexParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedDropIndex(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::IndexParam,::milvus::grpc::Status>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_CreatePartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_CreatePartition() { - ::grpc::Service::MarkMethodStreamed(10, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::PartitionParam, ::milvus::grpc::Status>(std::bind(&WithStreamedUnaryMethod_CreatePartition::StreamedCreatePartition, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_CreatePartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status CreatePartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedCreatePartition(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::PartitionParam,::milvus::grpc::Status>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_HasPartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_HasPartition() { - ::grpc::Service::MarkMethodStreamed(11, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::PartitionParam, ::milvus::grpc::BoolReply>(std::bind(&WithStreamedUnaryMethod_HasPartition::StreamedHasPartition, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_HasPartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status HasPartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::BoolReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedHasPartition(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::PartitionParam,::milvus::grpc::BoolReply>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_ShowPartitions : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_ShowPartitions() { - ::grpc::Service::MarkMethodStreamed(12, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::PartitionList>(std::bind(&WithStreamedUnaryMethod_ShowPartitions::StreamedShowPartitions, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_ShowPartitions() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status ShowPartitions(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::PartitionList* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedShowPartitions(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::CollectionName,::milvus::grpc::PartitionList>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_DropPartition : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_DropPartition() { - ::grpc::Service::MarkMethodStreamed(13, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::PartitionParam, ::milvus::grpc::Status>(std::bind(&WithStreamedUnaryMethod_DropPartition::StreamedDropPartition, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_DropPartition() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status DropPartition(::grpc::ServerContext* /*context*/, const ::milvus::grpc::PartitionParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedDropPartition(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::PartitionParam,::milvus::grpc::Status>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_Insert : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_Insert() { - ::grpc::Service::MarkMethodStreamed(14, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::InsertParam, ::milvus::grpc::EntityIds>(std::bind(&WithStreamedUnaryMethod_Insert::StreamedInsert, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_Insert() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status Insert(::grpc::ServerContext* /*context*/, const ::milvus::grpc::InsertParam* /*request*/, ::milvus::grpc::EntityIds* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedInsert(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::InsertParam,::milvus::grpc::EntityIds>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_GetEntityByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_GetEntityByID() { - ::grpc::Service::MarkMethodStreamed(15, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::EntityIdentity, ::milvus::grpc::Entities>(std::bind(&WithStreamedUnaryMethod_GetEntityByID::StreamedGetEntityByID, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_GetEntityByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status GetEntityByID(::grpc::ServerContext* /*context*/, const ::milvus::grpc::EntityIdentity* /*request*/, ::milvus::grpc::Entities* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedGetEntityByID(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::EntityIdentity,::milvus::grpc::Entities>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_GetEntityIDs : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_GetEntityIDs() { - ::grpc::Service::MarkMethodStreamed(16, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::GetEntityIDsParam, ::milvus::grpc::EntityIds>(std::bind(&WithStreamedUnaryMethod_GetEntityIDs::StreamedGetEntityIDs, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_GetEntityIDs() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status GetEntityIDs(::grpc::ServerContext* /*context*/, const ::milvus::grpc::GetEntityIDsParam* /*request*/, ::milvus::grpc::EntityIds* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedGetEntityIDs(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::GetEntityIDsParam,::milvus::grpc::EntityIds>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_Search : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_Search() { - ::grpc::Service::MarkMethodStreamed(17, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::SearchParam, ::milvus::grpc::QueryResult>(std::bind(&WithStreamedUnaryMethod_Search::StreamedSearch, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_Search() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status Search(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParam* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedSearch(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::SearchParam,::milvus::grpc::QueryResult>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_SearchInSegment : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_SearchInSegment() { - ::grpc::Service::MarkMethodStreamed(18, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::SearchInSegmentParam, ::milvus::grpc::QueryResult>(std::bind(&WithStreamedUnaryMethod_SearchInSegment::StreamedSearchInSegment, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_SearchInSegment() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status SearchInSegment(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchInSegmentParam* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedSearchInSegment(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::SearchInSegmentParam,::milvus::grpc::QueryResult>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_Cmd : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_Cmd() { - ::grpc::Service::MarkMethodStreamed(19, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::Command, ::milvus::grpc::StringReply>(std::bind(&WithStreamedUnaryMethod_Cmd::StreamedCmd, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_Cmd() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status Cmd(::grpc::ServerContext* /*context*/, const ::milvus::grpc::Command* /*request*/, ::milvus::grpc::StringReply* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedCmd(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::Command,::milvus::grpc::StringReply>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_DeleteByID : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_DeleteByID() { - ::grpc::Service::MarkMethodStreamed(20, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::DeleteByIDParam, ::milvus::grpc::Status>(std::bind(&WithStreamedUnaryMethod_DeleteByID::StreamedDeleteByID, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_DeleteByID() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status DeleteByID(::grpc::ServerContext* /*context*/, const ::milvus::grpc::DeleteByIDParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedDeleteByID(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::DeleteByIDParam,::milvus::grpc::Status>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_PreloadCollection : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_PreloadCollection() { - ::grpc::Service::MarkMethodStreamed(21, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::CollectionName, ::milvus::grpc::Status>(std::bind(&WithStreamedUnaryMethod_PreloadCollection::StreamedPreloadCollection, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_PreloadCollection() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status PreloadCollection(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CollectionName* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedPreloadCollection(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::CollectionName,::milvus::grpc::Status>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_Flush : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_Flush() { - ::grpc::Service::MarkMethodStreamed(22, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::FlushParam, ::milvus::grpc::Status>(std::bind(&WithStreamedUnaryMethod_Flush::StreamedFlush, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_Flush() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status Flush(::grpc::ServerContext* /*context*/, const ::milvus::grpc::FlushParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedFlush(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::FlushParam,::milvus::grpc::Status>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_Compact : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_Compact() { - ::grpc::Service::MarkMethodStreamed(23, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::CompactParam, ::milvus::grpc::Status>(std::bind(&WithStreamedUnaryMethod_Compact::StreamedCompact, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_Compact() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status Compact(::grpc::ServerContext* /*context*/, const ::milvus::grpc::CompactParam* /*request*/, ::milvus::grpc::Status* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedCompact(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::CompactParam,::milvus::grpc::Status>* server_unary_streamer) = 0; - }; - template - class WithStreamedUnaryMethod_SearchPB : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_SearchPB() { - ::grpc::Service::MarkMethodStreamed(24, - new ::grpc::internal::StreamedUnaryHandler< ::milvus::grpc::SearchParamPB, ::milvus::grpc::QueryResult>(std::bind(&WithStreamedUnaryMethod_SearchPB::StreamedSearchPB, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_SearchPB() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status SearchPB(::grpc::ServerContext* /*context*/, const ::milvus::grpc::SearchParamPB* /*request*/, ::milvus::grpc::QueryResult* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedSearchPB(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::milvus::grpc::SearchParamPB,::milvus::grpc::QueryResult>* server_unary_streamer) = 0; - }; - typedef WithStreamedUnaryMethod_CreateCollection > > > > > > > > > > > > > > > > > > > > > > > > StreamedUnaryService; - typedef Service SplitStreamedService; - typedef WithStreamedUnaryMethod_CreateCollection > > > > > > > > > > > > > > > > > > > > > > > > StreamedService; -}; - -} // namespace grpc -} // namespace milvus - - -#endif // GRPC_message_2eproto__INCLUDED diff --git a/proxy/src/grpc/message.pb.cc b/proxy/src/grpc/message.pb.cc deleted file mode 100644 index 72a3d4b7b7..0000000000 --- a/proxy/src/grpc/message.pb.cc +++ /dev/null @@ -1,19734 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -#include "message.pb.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -// @@protoc_insertion_point(includes) -#include -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_BooleanQuery_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_CompareExpr_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_Entities_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_FieldMeta_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_KeyValuePair_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_Mapping_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_RangeQuery_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_RowData_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Schema_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_SearchParam_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Status_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_TermQuery_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_VectorFieldParam_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_VectorParam_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_VectorQuery_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_VectorRecord_message_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_VectorRowRecord_message_2eproto; -namespace milvus { -namespace grpc { -class StatusDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _Status_default_instance_; -class KeyValuePairDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _KeyValuePair_default_instance_; -class CollectionNameDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _CollectionName_default_instance_; -class CollectionNameListDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _CollectionNameList_default_instance_; -class FieldNameDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _FieldName_default_instance_; -class MappingDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _Mapping_default_instance_; -class MappingListDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _MappingList_default_instance_; -class PartitionParamDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _PartitionParam_default_instance_; -class PartitionListDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _PartitionList_default_instance_; -class VectorRowRecordDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _VectorRowRecord_default_instance_; -class EntityIdsDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _EntityIds_default_instance_; -class VectorRecordDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _VectorRecord_default_instance_; -class VectorParamDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _VectorParam_default_instance_; -class FieldMetaDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _FieldMeta_default_instance_; -class SchemaDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _Schema_default_instance_; -class RowDataDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _RowData_default_instance_; -class InsertParamDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _InsertParam_default_instance_; -class SearchParamDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _SearchParam_default_instance_; -class SearchInSegmentParamDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _SearchInSegmentParam_default_instance_; -class EntitiesDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _Entities_default_instance_; -class QueryResultDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _QueryResult_default_instance_; -class StringReplyDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _StringReply_default_instance_; -class BoolReplyDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _BoolReply_default_instance_; -class CollectionRowCountDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _CollectionRowCount_default_instance_; -class CommandDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _Command_default_instance_; -class IndexParamDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _IndexParam_default_instance_; -class FlushParamDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _FlushParam_default_instance_; -class CompactParamDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _CompactParam_default_instance_; -class DeleteByIDParamDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _DeleteByIDParam_default_instance_; -class CollectionInfoDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _CollectionInfo_default_instance_; -class GetEntityIDsParamDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _GetEntityIDsParam_default_instance_; -class EntityIdentityDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _EntityIdentity_default_instance_; -class VectorFieldParamDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _VectorFieldParam_default_instance_; -class FieldTypeDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; - int data_type_; - const ::milvus::grpc::VectorFieldParam* vector_param_; -} _FieldType_default_instance_; -class FieldParamDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _FieldParam_default_instance_; -class VectorFieldRecordDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _VectorFieldRecord_default_instance_; -class TermQueryDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _TermQuery_default_instance_; -class CompareExprDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _CompareExpr_default_instance_; -class RangeQueryDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _RangeQuery_default_instance_; -class VectorQueryDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _VectorQuery_default_instance_; -class BooleanQueryDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _BooleanQuery_default_instance_; -class GeneralQueryDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; - const ::milvus::grpc::BooleanQuery* boolean_query_; - const ::milvus::grpc::TermQuery* term_query_; - const ::milvus::grpc::RangeQuery* range_query_; - const ::milvus::grpc::VectorQuery* vector_query_; -} _GeneralQuery_default_instance_; -class SearchParamPBDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _SearchParamPB_default_instance_; -class InsertOrDeleteMsgDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _InsertOrDeleteMsg_default_instance_; -class SearchMsgDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _SearchMsg_default_instance_; -class TimeSyncMsgDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _TimeSyncMsg_default_instance_; -class Key2SegMsgDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _Key2SegMsg_default_instance_; -} // namespace grpc -} // namespace milvus -static void InitDefaultsscc_info_BoolReply_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_BoolReply_default_instance_; - new (ptr) ::milvus::grpc::BoolReply(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::BoolReply::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_BoolReply_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_BoolReply_message_2eproto}, { - &scc_info_Status_message_2eproto.base,}}; - -static void InitDefaultsscc_info_BooleanQuery_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_BooleanQuery_default_instance_; - new (ptr) ::milvus::grpc::BooleanQuery(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - { - void* ptr = &::milvus::grpc::_GeneralQuery_default_instance_; - new (ptr) ::milvus::grpc::GeneralQuery(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::BooleanQuery::InitAsDefaultInstance(); - ::milvus::grpc::GeneralQuery::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_BooleanQuery_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsscc_info_BooleanQuery_message_2eproto}, { - &scc_info_TermQuery_message_2eproto.base, - &scc_info_RangeQuery_message_2eproto.base, - &scc_info_VectorQuery_message_2eproto.base,}}; - -static void InitDefaultsscc_info_CollectionInfo_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_CollectionInfo_default_instance_; - new (ptr) ::milvus::grpc::CollectionInfo(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::CollectionInfo::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_CollectionInfo_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_CollectionInfo_message_2eproto}, { - &scc_info_Status_message_2eproto.base,}}; - -static void InitDefaultsscc_info_CollectionName_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_CollectionName_default_instance_; - new (ptr) ::milvus::grpc::CollectionName(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::CollectionName::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_CollectionName_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_CollectionName_message_2eproto}, {}}; - -static void InitDefaultsscc_info_CollectionNameList_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_CollectionNameList_default_instance_; - new (ptr) ::milvus::grpc::CollectionNameList(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::CollectionNameList::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_CollectionNameList_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_CollectionNameList_message_2eproto}, { - &scc_info_Status_message_2eproto.base,}}; - -static void InitDefaultsscc_info_CollectionRowCount_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_CollectionRowCount_default_instance_; - new (ptr) ::milvus::grpc::CollectionRowCount(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::CollectionRowCount::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_CollectionRowCount_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_CollectionRowCount_message_2eproto}, { - &scc_info_Status_message_2eproto.base,}}; - -static void InitDefaultsscc_info_Command_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_Command_default_instance_; - new (ptr) ::milvus::grpc::Command(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::Command::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Command_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_Command_message_2eproto}, {}}; - -static void InitDefaultsscc_info_CompactParam_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_CompactParam_default_instance_; - new (ptr) ::milvus::grpc::CompactParam(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::CompactParam::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_CompactParam_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_CompactParam_message_2eproto}, {}}; - -static void InitDefaultsscc_info_CompareExpr_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_CompareExpr_default_instance_; - new (ptr) ::milvus::grpc::CompareExpr(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::CompareExpr::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_CompareExpr_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_CompareExpr_message_2eproto}, {}}; - -static void InitDefaultsscc_info_DeleteByIDParam_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_DeleteByIDParam_default_instance_; - new (ptr) ::milvus::grpc::DeleteByIDParam(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::DeleteByIDParam::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_DeleteByIDParam_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_DeleteByIDParam_message_2eproto}, {}}; - -static void InitDefaultsscc_info_Entities_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_Entities_default_instance_; - new (ptr) ::milvus::grpc::Entities(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::Entities::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_Entities_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_Entities_message_2eproto}, { - &scc_info_Status_message_2eproto.base, - &scc_info_RowData_message_2eproto.base,}}; - -static void InitDefaultsscc_info_EntityIdentity_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_EntityIdentity_default_instance_; - new (ptr) ::milvus::grpc::EntityIdentity(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::EntityIdentity::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_EntityIdentity_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_EntityIdentity_message_2eproto}, {}}; - -static void InitDefaultsscc_info_EntityIds_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_EntityIds_default_instance_; - new (ptr) ::milvus::grpc::EntityIds(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::EntityIds::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_EntityIds_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_EntityIds_message_2eproto}, { - &scc_info_Status_message_2eproto.base,}}; - -static void InitDefaultsscc_info_FieldMeta_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_FieldMeta_default_instance_; - new (ptr) ::milvus::grpc::FieldMeta(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::FieldMeta::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_FieldMeta_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_FieldMeta_message_2eproto}, {}}; - -static void InitDefaultsscc_info_FieldName_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_FieldName_default_instance_; - new (ptr) ::milvus::grpc::FieldName(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::FieldName::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_FieldName_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_FieldName_message_2eproto}, {}}; - -static void InitDefaultsscc_info_FieldParam_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_FieldParam_default_instance_; - new (ptr) ::milvus::grpc::FieldParam(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::FieldParam::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_FieldParam_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_FieldParam_message_2eproto}, { - &scc_info_KeyValuePair_message_2eproto.base,}}; - -static void InitDefaultsscc_info_FieldType_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_FieldType_default_instance_; - new (ptr) ::milvus::grpc::FieldType(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::FieldType::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_FieldType_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_FieldType_message_2eproto}, { - &scc_info_VectorFieldParam_message_2eproto.base,}}; - -static void InitDefaultsscc_info_FlushParam_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_FlushParam_default_instance_; - new (ptr) ::milvus::grpc::FlushParam(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::FlushParam::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_FlushParam_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_FlushParam_message_2eproto}, {}}; - -static void InitDefaultsscc_info_GetEntityIDsParam_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_GetEntityIDsParam_default_instance_; - new (ptr) ::milvus::grpc::GetEntityIDsParam(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::GetEntityIDsParam::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_GetEntityIDsParam_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_GetEntityIDsParam_message_2eproto}, {}}; - -static void InitDefaultsscc_info_IndexParam_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_IndexParam_default_instance_; - new (ptr) ::milvus::grpc::IndexParam(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::IndexParam::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_IndexParam_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_IndexParam_message_2eproto}, { - &scc_info_Status_message_2eproto.base, - &scc_info_KeyValuePair_message_2eproto.base,}}; - -static void InitDefaultsscc_info_InsertOrDeleteMsg_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_InsertOrDeleteMsg_default_instance_; - new (ptr) ::milvus::grpc::InsertOrDeleteMsg(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::InsertOrDeleteMsg::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_InsertOrDeleteMsg_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_InsertOrDeleteMsg_message_2eproto}, { - &scc_info_RowData_message_2eproto.base, - &scc_info_KeyValuePair_message_2eproto.base,}}; - -static void InitDefaultsscc_info_InsertParam_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_InsertParam_default_instance_; - new (ptr) ::milvus::grpc::InsertParam(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::InsertParam::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_InsertParam_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsscc_info_InsertParam_message_2eproto}, { - &scc_info_Schema_message_2eproto.base, - &scc_info_RowData_message_2eproto.base, - &scc_info_KeyValuePair_message_2eproto.base,}}; - -static void InitDefaultsscc_info_Key2SegMsg_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_Key2SegMsg_default_instance_; - new (ptr) ::milvus::grpc::Key2SegMsg(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::Key2SegMsg::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Key2SegMsg_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_Key2SegMsg_message_2eproto}, {}}; - -static void InitDefaultsscc_info_KeyValuePair_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_KeyValuePair_default_instance_; - new (ptr) ::milvus::grpc::KeyValuePair(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::KeyValuePair::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_KeyValuePair_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_KeyValuePair_message_2eproto}, {}}; - -static void InitDefaultsscc_info_Mapping_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_Mapping_default_instance_; - new (ptr) ::milvus::grpc::Mapping(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::Mapping::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_Mapping_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsscc_info_Mapping_message_2eproto}, { - &scc_info_Status_message_2eproto.base, - &scc_info_Schema_message_2eproto.base, - &scc_info_KeyValuePair_message_2eproto.base,}}; - -static void InitDefaultsscc_info_MappingList_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_MappingList_default_instance_; - new (ptr) ::milvus::grpc::MappingList(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::MappingList::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_MappingList_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_MappingList_message_2eproto}, { - &scc_info_Status_message_2eproto.base, - &scc_info_Mapping_message_2eproto.base,}}; - -static void InitDefaultsscc_info_PartitionList_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_PartitionList_default_instance_; - new (ptr) ::milvus::grpc::PartitionList(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::PartitionList::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_PartitionList_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_PartitionList_message_2eproto}, { - &scc_info_Status_message_2eproto.base,}}; - -static void InitDefaultsscc_info_PartitionParam_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_PartitionParam_default_instance_; - new (ptr) ::milvus::grpc::PartitionParam(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::PartitionParam::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PartitionParam_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_PartitionParam_message_2eproto}, {}}; - -static void InitDefaultsscc_info_QueryResult_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_QueryResult_default_instance_; - new (ptr) ::milvus::grpc::QueryResult(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::QueryResult::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_QueryResult_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsscc_info_QueryResult_message_2eproto}, { - &scc_info_Status_message_2eproto.base, - &scc_info_Entities_message_2eproto.base, - &scc_info_KeyValuePair_message_2eproto.base,}}; - -static void InitDefaultsscc_info_RangeQuery_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_RangeQuery_default_instance_; - new (ptr) ::milvus::grpc::RangeQuery(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::RangeQuery::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_RangeQuery_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_RangeQuery_message_2eproto}, { - &scc_info_CompareExpr_message_2eproto.base, - &scc_info_KeyValuePair_message_2eproto.base,}}; - -static void InitDefaultsscc_info_RowData_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_RowData_default_instance_; - new (ptr) ::milvus::grpc::RowData(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::RowData::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_RowData_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_RowData_message_2eproto}, {}}; - -static void InitDefaultsscc_info_Schema_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_Schema_default_instance_; - new (ptr) ::milvus::grpc::Schema(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::Schema::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Schema_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_Schema_message_2eproto}, { - &scc_info_FieldMeta_message_2eproto.base,}}; - -static void InitDefaultsscc_info_SearchInSegmentParam_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_SearchInSegmentParam_default_instance_; - new (ptr) ::milvus::grpc::SearchInSegmentParam(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::SearchInSegmentParam::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_SearchInSegmentParam_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_SearchInSegmentParam_message_2eproto}, { - &scc_info_SearchParam_message_2eproto.base,}}; - -static void InitDefaultsscc_info_SearchMsg_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_SearchMsg_default_instance_; - new (ptr) ::milvus::grpc::SearchMsg(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::SearchMsg::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_SearchMsg_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_SearchMsg_message_2eproto}, { - &scc_info_VectorRowRecord_message_2eproto.base, - &scc_info_KeyValuePair_message_2eproto.base,}}; - -static void InitDefaultsscc_info_SearchParam_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_SearchParam_default_instance_; - new (ptr) ::milvus::grpc::SearchParam(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::SearchParam::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_SearchParam_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_SearchParam_message_2eproto}, { - &scc_info_VectorParam_message_2eproto.base, - &scc_info_KeyValuePair_message_2eproto.base,}}; - -static void InitDefaultsscc_info_SearchParamPB_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_SearchParamPB_default_instance_; - new (ptr) ::milvus::grpc::SearchParamPB(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::SearchParamPB::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_SearchParamPB_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_SearchParamPB_message_2eproto}, { - &scc_info_BooleanQuery_message_2eproto.base, - &scc_info_KeyValuePair_message_2eproto.base,}}; - -static void InitDefaultsscc_info_Status_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_Status_default_instance_; - new (ptr) ::milvus::grpc::Status(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::Status::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Status_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_Status_message_2eproto}, {}}; - -static void InitDefaultsscc_info_StringReply_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_StringReply_default_instance_; - new (ptr) ::milvus::grpc::StringReply(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::StringReply::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_StringReply_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_StringReply_message_2eproto}, { - &scc_info_Status_message_2eproto.base,}}; - -static void InitDefaultsscc_info_TermQuery_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_TermQuery_default_instance_; - new (ptr) ::milvus::grpc::TermQuery(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::TermQuery::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_TermQuery_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_TermQuery_message_2eproto}, { - &scc_info_KeyValuePair_message_2eproto.base,}}; - -static void InitDefaultsscc_info_TimeSyncMsg_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_TimeSyncMsg_default_instance_; - new (ptr) ::milvus::grpc::TimeSyncMsg(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::TimeSyncMsg::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TimeSyncMsg_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_TimeSyncMsg_message_2eproto}, {}}; - -static void InitDefaultsscc_info_VectorFieldParam_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_VectorFieldParam_default_instance_; - new (ptr) ::milvus::grpc::VectorFieldParam(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::VectorFieldParam::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_VectorFieldParam_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_VectorFieldParam_message_2eproto}, {}}; - -static void InitDefaultsscc_info_VectorFieldRecord_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_VectorFieldRecord_default_instance_; - new (ptr) ::milvus::grpc::VectorFieldRecord(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::VectorFieldRecord::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_VectorFieldRecord_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_VectorFieldRecord_message_2eproto}, { - &scc_info_VectorRowRecord_message_2eproto.base,}}; - -static void InitDefaultsscc_info_VectorParam_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_VectorParam_default_instance_; - new (ptr) ::milvus::grpc::VectorParam(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::VectorParam::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_VectorParam_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_VectorParam_message_2eproto}, { - &scc_info_VectorRecord_message_2eproto.base,}}; - -static void InitDefaultsscc_info_VectorQuery_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_VectorQuery_default_instance_; - new (ptr) ::milvus::grpc::VectorQuery(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::VectorQuery::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_VectorQuery_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_VectorQuery_message_2eproto}, { - &scc_info_VectorRowRecord_message_2eproto.base, - &scc_info_KeyValuePair_message_2eproto.base,}}; - -static void InitDefaultsscc_info_VectorRecord_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_VectorRecord_default_instance_; - new (ptr) ::milvus::grpc::VectorRecord(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::VectorRecord::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_VectorRecord_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_VectorRecord_message_2eproto}, { - &scc_info_VectorRowRecord_message_2eproto.base,}}; - -static void InitDefaultsscc_info_VectorRowRecord_message_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::milvus::grpc::_VectorRowRecord_default_instance_; - new (ptr) ::milvus::grpc::VectorRowRecord(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::milvus::grpc::VectorRowRecord::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_VectorRowRecord_message_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_VectorRowRecord_message_2eproto}, {}}; - -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_message_2eproto[47]; -static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_message_2eproto[6]; -static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_message_2eproto = nullptr; - -const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_message_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Status, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Status, error_code_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Status, reason_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::KeyValuePair, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::KeyValuePair, key_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::KeyValuePair, value_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CollectionName, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CollectionName, collection_name_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CollectionNameList, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CollectionNameList, status_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CollectionNameList, collection_names_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FieldName, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FieldName, collection_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FieldName, field_name_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Mapping, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Mapping, status_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Mapping, collection_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Mapping, schema_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Mapping, extra_params_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::MappingList, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::MappingList, status_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::MappingList, mapping_list_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::PartitionParam, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::PartitionParam, collection_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::PartitionParam, tag_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::PartitionList, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::PartitionList, status_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::PartitionList, partition_tag_array_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorRowRecord, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorRowRecord, float_data_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorRowRecord, binary_data_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::EntityIds, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::EntityIds, status_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::EntityIds, entity_id_array_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorRecord, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorRecord, records_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorParam, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorParam, json_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorParam, row_record_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FieldMeta, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FieldMeta, field_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FieldMeta, type_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FieldMeta, dim_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Schema, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Schema, field_metas_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::RowData, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::RowData, blob_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertParam, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertParam, collection_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertParam, schema_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertParam, rows_data_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertParam, entity_id_array_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertParam, partition_tag_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertParam, extra_params_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchParam, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchParam, collection_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchParam, vector_param_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchParam, dsl_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchParam, partition_tag_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchParam, extra_params_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchInSegmentParam, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchInSegmentParam, file_id_array_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchInSegmentParam, search_param_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Entities, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Entities, status_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Entities, ids_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Entities, valid_row_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Entities, rows_data_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::QueryResult, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::QueryResult, status_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::QueryResult, entities_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::QueryResult, row_num_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::QueryResult, scores_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::QueryResult, distances_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::QueryResult, extra_params_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::QueryResult, query_id_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::QueryResult, client_id_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::StringReply, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::StringReply, status_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::StringReply, string_reply_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::BoolReply, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::BoolReply, status_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::BoolReply, bool_reply_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CollectionRowCount, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CollectionRowCount, status_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CollectionRowCount, collection_row_count_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Command, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Command, cmd_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::IndexParam, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::IndexParam, status_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::IndexParam, collection_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::IndexParam, field_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::IndexParam, index_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::IndexParam, extra_params_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FlushParam, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FlushParam, collection_name_array_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CompactParam, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CompactParam, collection_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CompactParam, threshold_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::DeleteByIDParam, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::DeleteByIDParam, collection_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::DeleteByIDParam, id_array_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CollectionInfo, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CollectionInfo, status_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CollectionInfo, json_info_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::GetEntityIDsParam, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::GetEntityIDsParam, collection_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::GetEntityIDsParam, segment_id_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::EntityIdentity, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::EntityIdentity, collection_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::EntityIdentity, id_array_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::EntityIdentity, field_names_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorFieldParam, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorFieldParam, dimension_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FieldType, _internal_metadata_), - ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FieldType, _oneof_case_[0]), - ~0u, // no _weak_field_map_ - offsetof(::milvus::grpc::FieldTypeDefaultTypeInternal, data_type_), - offsetof(::milvus::grpc::FieldTypeDefaultTypeInternal, vector_param_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FieldType, value_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FieldParam, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FieldParam, id_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FieldParam, name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FieldParam, type_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FieldParam, index_params_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::FieldParam, extra_params_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorFieldRecord, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorFieldRecord, value_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, field_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, int_value_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, double_value_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, value_num_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, boost_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::TermQuery, extra_params_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CompareExpr, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CompareExpr, operator__), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::CompareExpr, operand_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::RangeQuery, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::RangeQuery, field_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::RangeQuery, operand_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::RangeQuery, boost_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::RangeQuery, extra_params_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorQuery, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorQuery, field_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorQuery, query_boost_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorQuery, records_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorQuery, topk_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::VectorQuery, extra_params_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::BooleanQuery, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::BooleanQuery, occur_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::BooleanQuery, general_query_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::GeneralQuery, _internal_metadata_), - ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::GeneralQuery, _oneof_case_[0]), - ~0u, // no _weak_field_map_ - offsetof(::milvus::grpc::GeneralQueryDefaultTypeInternal, boolean_query_), - offsetof(::milvus::grpc::GeneralQueryDefaultTypeInternal, term_query_), - offsetof(::milvus::grpc::GeneralQueryDefaultTypeInternal, range_query_), - offsetof(::milvus::grpc::GeneralQueryDefaultTypeInternal, vector_query_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::GeneralQuery, query_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchParamPB, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchParamPB, collection_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchParamPB, partition_tag_array_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchParamPB, general_query_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchParamPB, extra_params_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertOrDeleteMsg, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertOrDeleteMsg, collection_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertOrDeleteMsg, rows_data_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertOrDeleteMsg, uid_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertOrDeleteMsg, partition_tag_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertOrDeleteMsg, timestamp_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertOrDeleteMsg, segment_id_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertOrDeleteMsg, channel_id_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertOrDeleteMsg, op_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertOrDeleteMsg, client_id_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::InsertOrDeleteMsg, extra_params_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchMsg, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchMsg, collection_name_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchMsg, records_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchMsg, partition_tag_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchMsg, uid_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchMsg, timestamp_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchMsg, client_id_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchMsg, extra_params_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchMsg, json_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::SearchMsg, dsl_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::TimeSyncMsg, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::TimeSyncMsg, peer_id_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::TimeSyncMsg, timestamp_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::TimeSyncMsg, sync_type_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Key2SegMsg, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Key2SegMsg, uid_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Key2SegMsg, timestamp_), - PROTOBUF_FIELD_OFFSET(::milvus::grpc::Key2SegMsg, segment_id_), -}; -static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, sizeof(::milvus::grpc::Status)}, - { 7, -1, sizeof(::milvus::grpc::KeyValuePair)}, - { 14, -1, sizeof(::milvus::grpc::CollectionName)}, - { 20, -1, sizeof(::milvus::grpc::CollectionNameList)}, - { 27, -1, sizeof(::milvus::grpc::FieldName)}, - { 34, -1, sizeof(::milvus::grpc::Mapping)}, - { 43, -1, sizeof(::milvus::grpc::MappingList)}, - { 50, -1, sizeof(::milvus::grpc::PartitionParam)}, - { 57, -1, sizeof(::milvus::grpc::PartitionList)}, - { 64, -1, sizeof(::milvus::grpc::VectorRowRecord)}, - { 71, -1, sizeof(::milvus::grpc::EntityIds)}, - { 78, -1, sizeof(::milvus::grpc::VectorRecord)}, - { 84, -1, sizeof(::milvus::grpc::VectorParam)}, - { 91, -1, sizeof(::milvus::grpc::FieldMeta)}, - { 99, -1, sizeof(::milvus::grpc::Schema)}, - { 105, -1, sizeof(::milvus::grpc::RowData)}, - { 111, -1, sizeof(::milvus::grpc::InsertParam)}, - { 122, -1, sizeof(::milvus::grpc::SearchParam)}, - { 132, -1, sizeof(::milvus::grpc::SearchInSegmentParam)}, - { 139, -1, sizeof(::milvus::grpc::Entities)}, - { 148, -1, sizeof(::milvus::grpc::QueryResult)}, - { 161, -1, sizeof(::milvus::grpc::StringReply)}, - { 168, -1, sizeof(::milvus::grpc::BoolReply)}, - { 175, -1, sizeof(::milvus::grpc::CollectionRowCount)}, - { 182, -1, sizeof(::milvus::grpc::Command)}, - { 188, -1, sizeof(::milvus::grpc::IndexParam)}, - { 198, -1, sizeof(::milvus::grpc::FlushParam)}, - { 204, -1, sizeof(::milvus::grpc::CompactParam)}, - { 211, -1, sizeof(::milvus::grpc::DeleteByIDParam)}, - { 218, -1, sizeof(::milvus::grpc::CollectionInfo)}, - { 225, -1, sizeof(::milvus::grpc::GetEntityIDsParam)}, - { 232, -1, sizeof(::milvus::grpc::EntityIdentity)}, - { 240, -1, sizeof(::milvus::grpc::VectorFieldParam)}, - { 246, -1, sizeof(::milvus::grpc::FieldType)}, - { 254, -1, sizeof(::milvus::grpc::FieldParam)}, - { 264, -1, sizeof(::milvus::grpc::VectorFieldRecord)}, - { 270, -1, sizeof(::milvus::grpc::TermQuery)}, - { 281, -1, sizeof(::milvus::grpc::CompareExpr)}, - { 288, -1, sizeof(::milvus::grpc::RangeQuery)}, - { 297, -1, sizeof(::milvus::grpc::VectorQuery)}, - { 307, -1, sizeof(::milvus::grpc::BooleanQuery)}, - { 314, -1, sizeof(::milvus::grpc::GeneralQuery)}, - { 324, -1, sizeof(::milvus::grpc::SearchParamPB)}, - { 333, -1, sizeof(::milvus::grpc::InsertOrDeleteMsg)}, - { 348, -1, sizeof(::milvus::grpc::SearchMsg)}, - { 362, -1, sizeof(::milvus::grpc::TimeSyncMsg)}, - { 370, -1, sizeof(::milvus::grpc::Key2SegMsg)}, -}; - -static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&::milvus::grpc::_Status_default_instance_), - reinterpret_cast(&::milvus::grpc::_KeyValuePair_default_instance_), - reinterpret_cast(&::milvus::grpc::_CollectionName_default_instance_), - reinterpret_cast(&::milvus::grpc::_CollectionNameList_default_instance_), - reinterpret_cast(&::milvus::grpc::_FieldName_default_instance_), - reinterpret_cast(&::milvus::grpc::_Mapping_default_instance_), - reinterpret_cast(&::milvus::grpc::_MappingList_default_instance_), - reinterpret_cast(&::milvus::grpc::_PartitionParam_default_instance_), - reinterpret_cast(&::milvus::grpc::_PartitionList_default_instance_), - reinterpret_cast(&::milvus::grpc::_VectorRowRecord_default_instance_), - reinterpret_cast(&::milvus::grpc::_EntityIds_default_instance_), - reinterpret_cast(&::milvus::grpc::_VectorRecord_default_instance_), - reinterpret_cast(&::milvus::grpc::_VectorParam_default_instance_), - reinterpret_cast(&::milvus::grpc::_FieldMeta_default_instance_), - reinterpret_cast(&::milvus::grpc::_Schema_default_instance_), - reinterpret_cast(&::milvus::grpc::_RowData_default_instance_), - reinterpret_cast(&::milvus::grpc::_InsertParam_default_instance_), - reinterpret_cast(&::milvus::grpc::_SearchParam_default_instance_), - reinterpret_cast(&::milvus::grpc::_SearchInSegmentParam_default_instance_), - reinterpret_cast(&::milvus::grpc::_Entities_default_instance_), - reinterpret_cast(&::milvus::grpc::_QueryResult_default_instance_), - reinterpret_cast(&::milvus::grpc::_StringReply_default_instance_), - reinterpret_cast(&::milvus::grpc::_BoolReply_default_instance_), - reinterpret_cast(&::milvus::grpc::_CollectionRowCount_default_instance_), - reinterpret_cast(&::milvus::grpc::_Command_default_instance_), - reinterpret_cast(&::milvus::grpc::_IndexParam_default_instance_), - reinterpret_cast(&::milvus::grpc::_FlushParam_default_instance_), - reinterpret_cast(&::milvus::grpc::_CompactParam_default_instance_), - reinterpret_cast(&::milvus::grpc::_DeleteByIDParam_default_instance_), - reinterpret_cast(&::milvus::grpc::_CollectionInfo_default_instance_), - reinterpret_cast(&::milvus::grpc::_GetEntityIDsParam_default_instance_), - reinterpret_cast(&::milvus::grpc::_EntityIdentity_default_instance_), - reinterpret_cast(&::milvus::grpc::_VectorFieldParam_default_instance_), - reinterpret_cast(&::milvus::grpc::_FieldType_default_instance_), - reinterpret_cast(&::milvus::grpc::_FieldParam_default_instance_), - reinterpret_cast(&::milvus::grpc::_VectorFieldRecord_default_instance_), - reinterpret_cast(&::milvus::grpc::_TermQuery_default_instance_), - reinterpret_cast(&::milvus::grpc::_CompareExpr_default_instance_), - reinterpret_cast(&::milvus::grpc::_RangeQuery_default_instance_), - reinterpret_cast(&::milvus::grpc::_VectorQuery_default_instance_), - reinterpret_cast(&::milvus::grpc::_BooleanQuery_default_instance_), - reinterpret_cast(&::milvus::grpc::_GeneralQuery_default_instance_), - reinterpret_cast(&::milvus::grpc::_SearchParamPB_default_instance_), - reinterpret_cast(&::milvus::grpc::_InsertOrDeleteMsg_default_instance_), - reinterpret_cast(&::milvus::grpc::_SearchMsg_default_instance_), - reinterpret_cast(&::milvus::grpc::_TimeSyncMsg_default_instance_), - reinterpret_cast(&::milvus::grpc::_Key2SegMsg_default_instance_), -}; - -const char descriptor_table_protodef_message_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\rmessage.proto\022\013milvus.grpc\"D\n\006Status\022*" - "\n\nerror_code\030\001 \001(\0162\026.milvus.grpc.ErrorCo" - "de\022\016\n\006reason\030\002 \001(\t\"*\n\014KeyValuePair\022\013\n\003ke" - "y\030\001 \001(\t\022\r\n\005value\030\002 \001(\t\")\n\016CollectionName" - "\022\027\n\017collection_name\030\001 \001(\t\"S\n\022CollectionN" - "ameList\022#\n\006status\030\001 \001(\0132\023.milvus.grpc.St" - "atus\022\030\n\020collection_names\030\002 \003(\t\"8\n\tFieldN" - "ame\022\027\n\017collection_name\030\001 \001(\t\022\022\n\nfield_na" - "me\030\002 \001(\t\"\235\001\n\007Mapping\022#\n\006status\030\001 \001(\0132\023.m" - "ilvus.grpc.Status\022\027\n\017collection_name\030\002 \001" - "(\t\022#\n\006schema\030\003 \001(\0132\023.milvus.grpc.Schema\022" - "/\n\014extra_params\030\004 \003(\0132\031.milvus.grpc.KeyV" - "aluePair\"^\n\013MappingList\022#\n\006status\030\001 \001(\0132" - "\023.milvus.grpc.Status\022*\n\014mapping_list\030\002 \003" - "(\0132\024.milvus.grpc.Mapping\"6\n\016PartitionPar" - "am\022\027\n\017collection_name\030\001 \001(\t\022\013\n\003tag\030\002 \001(\t" - "\"Q\n\rPartitionList\022#\n\006status\030\001 \001(\0132\023.milv" - "us.grpc.Status\022\033\n\023partition_tag_array\030\002 " - "\003(\t\":\n\017VectorRowRecord\022\022\n\nfloat_data\030\001 \003" - "(\002\022\023\n\013binary_data\030\002 \001(\014\"I\n\tEntityIds\022#\n\006" - "status\030\001 \001(\0132\023.milvus.grpc.Status\022\027\n\017ent" - "ity_id_array\030\002 \003(\003\"=\n\014VectorRecord\022-\n\007re" - "cords\030\001 \003(\0132\034.milvus.grpc.VectorRowRecor" - "d\"J\n\013VectorParam\022\014\n\004json\030\001 \001(\t\022-\n\nrow_re" - "cord\030\002 \001(\0132\031.milvus.grpc.VectorRecord\"Q\n" - "\tFieldMeta\022\022\n\nfield_name\030\001 \001(\t\022#\n\004type\030\002" - " \001(\0162\025.milvus.grpc.DataType\022\013\n\003dim\030\003 \001(\003" - "\"5\n\006Schema\022+\n\013field_metas\030\001 \003(\0132\026.milvus" - ".grpc.FieldMeta\"\027\n\007RowData\022\014\n\004blob\030\001 \001(\014" - "\"\325\001\n\013InsertParam\022\027\n\017collection_name\030\001 \001(" - "\t\022#\n\006schema\030\002 \001(\0132\023.milvus.grpc.Schema\022\'" - "\n\trows_data\030\003 \003(\0132\024.milvus.grpc.RowData\022" - "\027\n\017entity_id_array\030\004 \003(\003\022\025\n\rpartition_ta" - "g\030\005 \001(\t\022/\n\014extra_params\030\006 \003(\0132\031.milvus.g" - "rpc.KeyValuePair\"\253\001\n\013SearchParam\022\027\n\017coll" - "ection_name\030\001 \001(\t\022.\n\014vector_param\030\002 \003(\0132" - "\030.milvus.grpc.VectorParam\022\013\n\003dsl\030\003 \001(\t\022\025" - "\n\rpartition_tag\030\004 \003(\t\022/\n\014extra_params\030\005 " - "\003(\0132\031.milvus.grpc.KeyValuePair\"]\n\024Search" - "InSegmentParam\022\025\n\rfile_id_array\030\001 \003(\t\022.\n" - "\014search_param\030\002 \001(\0132\030.milvus.grpc.Search" - "Param\"x\n\010Entities\022#\n\006status\030\001 \001(\0132\023.milv" - "us.grpc.Status\022\013\n\003ids\030\002 \003(\003\022\021\n\tvalid_row" - "\030\003 \003(\010\022\'\n\trows_data\030\004 \003(\0132\024.milvus.grpc." - "RowData\"\345\001\n\013QueryResult\022#\n\006status\030\001 \001(\0132" - "\023.milvus.grpc.Status\022\'\n\010entities\030\002 \001(\0132\025" - ".milvus.grpc.Entities\022\017\n\007row_num\030\003 \001(\003\022\016" - "\n\006scores\030\004 \003(\002\022\021\n\tdistances\030\005 \003(\002\022/\n\014ext" - "ra_params\030\006 \003(\0132\031.milvus.grpc.KeyValuePa" - "ir\022\020\n\010query_id\030\007 \001(\003\022\021\n\tclient_id\030\010 \001(\003\"" - "H\n\013StringReply\022#\n\006status\030\001 \001(\0132\023.milvus." - "grpc.Status\022\024\n\014string_reply\030\002 \001(\t\"D\n\tBoo" - "lReply\022#\n\006status\030\001 \001(\0132\023.milvus.grpc.Sta" - "tus\022\022\n\nbool_reply\030\002 \001(\010\"W\n\022CollectionRow" - "Count\022#\n\006status\030\001 \001(\0132\023.milvus.grpc.Stat" - "us\022\034\n\024collection_row_count\030\002 \001(\003\"\026\n\007Comm" - "and\022\013\n\003cmd\030\001 \001(\t\"\243\001\n\nIndexParam\022#\n\006statu" - "s\030\001 \001(\0132\023.milvus.grpc.Status\022\027\n\017collecti" - "on_name\030\002 \001(\t\022\022\n\nfield_name\030\003 \001(\t\022\022\n\nind" - "ex_name\030\004 \001(\t\022/\n\014extra_params\030\005 \003(\0132\031.mi" - "lvus.grpc.KeyValuePair\"+\n\nFlushParam\022\035\n\025" - "collection_name_array\030\001 \003(\t\":\n\014CompactPa" - "ram\022\027\n\017collection_name\030\001 \001(\t\022\021\n\tthreshol" - "d\030\002 \001(\001\"<\n\017DeleteByIDParam\022\027\n\017collection" - "_name\030\001 \001(\t\022\020\n\010id_array\030\002 \003(\003\"H\n\016Collect" - "ionInfo\022#\n\006status\030\001 \001(\0132\023.milvus.grpc.St" - "atus\022\021\n\tjson_info\030\002 \001(\t\"@\n\021GetEntityIDsP" - "aram\022\027\n\017collection_name\030\001 \001(\t\022\022\n\nsegment" - "_id\030\002 \001(\003\"P\n\016EntityIdentity\022\027\n\017collectio" - "n_name\030\001 \001(\t\022\020\n\010id_array\030\002 \003(\003\022\023\n\013field_" - "names\030\003 \003(\t\"%\n\020VectorFieldParam\022\021\n\tdimen" - "sion\030\001 \001(\003\"w\n\tFieldType\022*\n\tdata_type\030\001 \001" - "(\0162\025.milvus.grpc.DataTypeH\000\0225\n\014vector_pa" - "ram\030\002 \001(\0132\035.milvus.grpc.VectorFieldParam" - "H\000B\007\n\005value\"\255\001\n\nFieldParam\022\n\n\002id\030\001 \001(\004\022\014" - "\n\004name\030\002 \001(\t\022#\n\004type\030\003 \001(\0162\025.milvus.grpc" - ".DataType\022/\n\014index_params\030\004 \003(\0132\031.milvus" - ".grpc.KeyValuePair\022/\n\014extra_params\030\005 \003(\013" - "2\031.milvus.grpc.KeyValuePair\"@\n\021VectorFie" - "ldRecord\022+\n\005value\030\001 \003(\0132\034.milvus.grpc.Ve" - "ctorRowRecord\"\233\001\n\tTermQuery\022\022\n\nfield_nam" - "e\030\001 \001(\t\022\021\n\tint_value\030\002 \003(\003\022\024\n\014double_val" - "ue\030\003 \003(\001\022\021\n\tvalue_num\030\004 \001(\003\022\r\n\005boost\030\005 \001" - "(\002\022/\n\014extra_params\030\006 \003(\0132\031.milvus.grpc.K" - "eyValuePair\"N\n\013CompareExpr\022.\n\010operator\030\001" - " \001(\0162\034.milvus.grpc.CompareOperator\022\017\n\007op" - "erand\030\002 \001(\t\"\213\001\n\nRangeQuery\022\022\n\nfield_name" - "\030\001 \001(\t\022)\n\007operand\030\002 \003(\0132\030.milvus.grpc.Co" - "mpareExpr\022\r\n\005boost\030\003 \001(\002\022/\n\014extra_params" - "\030\004 \003(\0132\031.milvus.grpc.KeyValuePair\"\244\001\n\013Ve" - "ctorQuery\022\022\n\nfield_name\030\001 \001(\t\022\023\n\013query_b" - "oost\030\002 \001(\002\022-\n\007records\030\003 \003(\0132\034.milvus.grp" - "c.VectorRowRecord\022\014\n\004topk\030\004 \001(\003\022/\n\014extra" - "_params\030\005 \003(\0132\031.milvus.grpc.KeyValuePair" - "\"c\n\014BooleanQuery\022!\n\005occur\030\001 \001(\0162\022.milvus" - ".grpc.Occur\0220\n\rgeneral_query\030\002 \003(\0132\031.mil" - "vus.grpc.GeneralQuery\"\333\001\n\014GeneralQuery\0222" - "\n\rboolean_query\030\001 \001(\0132\031.milvus.grpc.Bool" - "eanQueryH\000\022,\n\nterm_query\030\002 \001(\0132\026.milvus." - "grpc.TermQueryH\000\022.\n\013range_query\030\003 \001(\0132\027." - "milvus.grpc.RangeQueryH\000\0220\n\014vector_query" - "\030\004 \001(\0132\030.milvus.grpc.VectorQueryH\000B\007\n\005qu" - "ery\"\250\001\n\rSearchParamPB\022\027\n\017collection_name" - "\030\001 \001(\t\022\033\n\023partition_tag_array\030\002 \003(\t\0220\n\rg" - "eneral_query\030\003 \001(\0132\031.milvus.grpc.General" - "Query\022/\n\014extra_params\030\004 \003(\0132\031.milvus.grp" - "c.KeyValuePair\"\231\002\n\021InsertOrDeleteMsg\022\027\n\017" - "collection_name\030\001 \001(\t\022\'\n\trows_data\030\002 \001(\013" - "2\024.milvus.grpc.RowData\022\013\n\003uid\030\003 \001(\003\022\025\n\rp" - "artition_tag\030\004 \001(\t\022\021\n\ttimestamp\030\005 \001(\004\022\022\n" - "\nsegment_id\030\006 \001(\003\022\022\n\nchannel_id\030\007 \001(\003\022\037\n" - "\002op\030\010 \001(\0162\023.milvus.grpc.OpType\022\021\n\tclient" - "_id\030\t \001(\003\022/\n\014extra_params\030\n \003(\0132\031.milvus" - ".grpc.KeyValuePair\"\351\001\n\tSearchMsg\022\027\n\017coll" - "ection_name\030\001 \001(\t\022-\n\007records\030\002 \001(\0132\034.mil" - "vus.grpc.VectorRowRecord\022\025\n\rpartition_ta" - "g\030\003 \003(\t\022\013\n\003uid\030\004 \001(\003\022\021\n\ttimestamp\030\005 \001(\004\022" - "\021\n\tclient_id\030\006 \001(\003\022/\n\014extra_params\030\007 \003(\013" - "2\031.milvus.grpc.KeyValuePair\022\014\n\004json\030\010 \003(" - "\t\022\013\n\003dsl\030\t \001(\t\"[\n\013TimeSyncMsg\022\017\n\007peer_Id" - "\030\001 \001(\003\022\021\n\tTimestamp\030\002 \001(\004\022(\n\tsync_type\030\003" - " \001(\0162\025.milvus.grpc.SyncType\"@\n\nKey2SegMs" - "g\022\013\n\003uid\030\001 \001(\003\022\021\n\ttimestamp\030\002 \001(\004\022\022\n\nseg" - "ment_id\030\003 \003(\003*\242\004\n\tErrorCode\022\013\n\007SUCCESS\020\000" - "\022\024\n\020UNEXPECTED_ERROR\020\001\022\022\n\016CONNECT_FAILED" - "\020\002\022\025\n\021PERMISSION_DENIED\020\003\022\031\n\025COLLECTION_" - "NOT_EXISTS\020\004\022\024\n\020ILLEGAL_ARGUMENT\020\005\022\025\n\021IL" - "LEGAL_DIMENSION\020\007\022\026\n\022ILLEGAL_INDEX_TYPE\020" - "\010\022\033\n\027ILLEGAL_COLLECTION_NAME\020\t\022\020\n\014ILLEGA" - "L_TOPK\020\n\022\025\n\021ILLEGAL_ROWRECORD\020\013\022\025\n\021ILLEG" - "AL_VECTOR_ID\020\014\022\031\n\025ILLEGAL_SEARCH_RESULT\020" - "\r\022\022\n\016FILE_NOT_FOUND\020\016\022\017\n\013META_FAILED\020\017\022\020" - "\n\014CACHE_FAILED\020\020\022\030\n\024CANNOT_CREATE_FOLDER" - "\020\021\022\026\n\022CANNOT_CREATE_FILE\020\022\022\030\n\024CANNOT_DEL" - "ETE_FOLDER\020\023\022\026\n\022CANNOT_DELETE_FILE\020\024\022\025\n\021" - "BUILD_INDEX_ERROR\020\025\022\021\n\rILLEGAL_NLIST\020\026\022\027" - "\n\023ILLEGAL_METRIC_TYPE\020\027\022\021\n\rOUT_OF_MEMORY" - "\020\030*\221\001\n\010DataType\022\010\n\004NONE\020\000\022\010\n\004BOOL\020\001\022\010\n\004I" - "NT8\020\002\022\t\n\005INT16\020\003\022\t\n\005INT32\020\004\022\t\n\005INT64\020\005\022\t" - "\n\005FLOAT\020\n\022\n\n\006DOUBLE\020\013\022\n\n\006STRING\020\024\022\021\n\rVEC" - "TOR_BINARY\020d\022\020\n\014VECTOR_FLOAT\020e*C\n\017Compar" - "eOperator\022\006\n\002LT\020\000\022\007\n\003LTE\020\001\022\006\n\002EQ\020\002\022\006\n\002GT" - "\020\003\022\007\n\003GTE\020\004\022\006\n\002NE\020\005*8\n\005Occur\022\013\n\007INVALID\020" - "\000\022\010\n\004MUST\020\001\022\n\n\006SHOULD\020\002\022\014\n\010MUST_NOT\020\003* \n" - "\006OpType\022\n\n\006INSERT\020\000\022\n\n\006DELETE\020\001*\037\n\010SyncT" - "ype\022\010\n\004READ\020\000\022\t\n\005WRITE\020\0012\333\r\n\rMilvusServi" - "ce\022\?\n\020CreateCollection\022\024.milvus.grpc.Map" - "ping\032\023.milvus.grpc.Status\"\000\022F\n\rHasCollec" - "tion\022\033.milvus.grpc.CollectionName\032\026.milv" - "us.grpc.BoolReply\"\000\022I\n\022DescribeCollectio" - "n\022\033.milvus.grpc.CollectionName\032\024.milvus." - "grpc.Mapping\"\000\022Q\n\017CountCollection\022\033.milv" - "us.grpc.CollectionName\032\037.milvus.grpc.Col" - "lectionRowCount\"\000\022J\n\017ShowCollections\022\024.m" - "ilvus.grpc.Command\032\037.milvus.grpc.Collect" - "ionNameList\"\000\022P\n\022ShowCollectionInfo\022\033.mi" - "lvus.grpc.CollectionName\032\033.milvus.grpc.C" - "ollectionInfo\"\000\022D\n\016DropCollection\022\033.milv" - "us.grpc.CollectionName\032\023.milvus.grpc.Sta" - "tus\"\000\022=\n\013CreateIndex\022\027.milvus.grpc.Index" - "Param\032\023.milvus.grpc.Status\"\000\022C\n\rDescribe" - "Index\022\027.milvus.grpc.IndexParam\032\027.milvus." - "grpc.IndexParam\"\000\022;\n\tDropIndex\022\027.milvus." - "grpc.IndexParam\032\023.milvus.grpc.Status\"\000\022E" - "\n\017CreatePartition\022\033.milvus.grpc.Partitio" - "nParam\032\023.milvus.grpc.Status\"\000\022E\n\014HasPart" - "ition\022\033.milvus.grpc.PartitionParam\032\026.mil" - "vus.grpc.BoolReply\"\000\022K\n\016ShowPartitions\022\033" - ".milvus.grpc.CollectionName\032\032.milvus.grp" - "c.PartitionList\"\000\022C\n\rDropPartition\022\033.mil" - "vus.grpc.PartitionParam\032\023.milvus.grpc.St" - "atus\"\000\022<\n\006Insert\022\030.milvus.grpc.InsertPar" - "am\032\026.milvus.grpc.EntityIds\"\000\022E\n\rGetEntit" - "yByID\022\033.milvus.grpc.EntityIdentity\032\025.mil" - "vus.grpc.Entities\"\000\022H\n\014GetEntityIDs\022\036.mi" - "lvus.grpc.GetEntityIDsParam\032\026.milvus.grp" - "c.EntityIds\"\000\022>\n\006Search\022\030.milvus.grpc.Se" - "archParam\032\030.milvus.grpc.QueryResult\"\000\022P\n" - "\017SearchInSegment\022!.milvus.grpc.SearchInS" - "egmentParam\032\030.milvus.grpc.QueryResult\"\000\022" - "7\n\003Cmd\022\024.milvus.grpc.Command\032\030.milvus.gr" - "pc.StringReply\"\000\022A\n\nDeleteByID\022\034.milvus." - "grpc.DeleteByIDParam\032\023.milvus.grpc.Statu" - "s\"\000\022G\n\021PreloadCollection\022\033.milvus.grpc.C" - "ollectionName\032\023.milvus.grpc.Status\"\000\0227\n\005" - "Flush\022\027.milvus.grpc.FlushParam\032\023.milvus." - "grpc.Status\"\000\022;\n\007Compact\022\031.milvus.grpc.C" - "ompactParam\032\023.milvus.grpc.Status\"\000\022B\n\010Se" - "archPB\022\032.milvus.grpc.SearchParamPB\032\030.mil" - "vus.grpc.QueryResult\"\000B\007Z\005msgpbb\006proto3" - ; -static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_message_2eproto_deps[1] = { -}; -static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_message_2eproto_sccs[46] = { - &scc_info_BoolReply_message_2eproto.base, - &scc_info_BooleanQuery_message_2eproto.base, - &scc_info_CollectionInfo_message_2eproto.base, - &scc_info_CollectionName_message_2eproto.base, - &scc_info_CollectionNameList_message_2eproto.base, - &scc_info_CollectionRowCount_message_2eproto.base, - &scc_info_Command_message_2eproto.base, - &scc_info_CompactParam_message_2eproto.base, - &scc_info_CompareExpr_message_2eproto.base, - &scc_info_DeleteByIDParam_message_2eproto.base, - &scc_info_Entities_message_2eproto.base, - &scc_info_EntityIdentity_message_2eproto.base, - &scc_info_EntityIds_message_2eproto.base, - &scc_info_FieldMeta_message_2eproto.base, - &scc_info_FieldName_message_2eproto.base, - &scc_info_FieldParam_message_2eproto.base, - &scc_info_FieldType_message_2eproto.base, - &scc_info_FlushParam_message_2eproto.base, - &scc_info_GetEntityIDsParam_message_2eproto.base, - &scc_info_IndexParam_message_2eproto.base, - &scc_info_InsertOrDeleteMsg_message_2eproto.base, - &scc_info_InsertParam_message_2eproto.base, - &scc_info_Key2SegMsg_message_2eproto.base, - &scc_info_KeyValuePair_message_2eproto.base, - &scc_info_Mapping_message_2eproto.base, - &scc_info_MappingList_message_2eproto.base, - &scc_info_PartitionList_message_2eproto.base, - &scc_info_PartitionParam_message_2eproto.base, - &scc_info_QueryResult_message_2eproto.base, - &scc_info_RangeQuery_message_2eproto.base, - &scc_info_RowData_message_2eproto.base, - &scc_info_Schema_message_2eproto.base, - &scc_info_SearchInSegmentParam_message_2eproto.base, - &scc_info_SearchMsg_message_2eproto.base, - &scc_info_SearchParam_message_2eproto.base, - &scc_info_SearchParamPB_message_2eproto.base, - &scc_info_Status_message_2eproto.base, - &scc_info_StringReply_message_2eproto.base, - &scc_info_TermQuery_message_2eproto.base, - &scc_info_TimeSyncMsg_message_2eproto.base, - &scc_info_VectorFieldParam_message_2eproto.base, - &scc_info_VectorFieldRecord_message_2eproto.base, - &scc_info_VectorParam_message_2eproto.base, - &scc_info_VectorQuery_message_2eproto.base, - &scc_info_VectorRecord_message_2eproto.base, - &scc_info_VectorRowRecord_message_2eproto.base, -}; -static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_message_2eproto_once; -static bool descriptor_table_message_2eproto_initialized = false; -const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_message_2eproto = { - &descriptor_table_message_2eproto_initialized, descriptor_table_protodef_message_2eproto, "message.proto", 7599, - &descriptor_table_message_2eproto_once, descriptor_table_message_2eproto_sccs, descriptor_table_message_2eproto_deps, 46, 0, - schemas, file_default_instances, TableStruct_message_2eproto::offsets, - file_level_metadata_message_2eproto, 47, file_level_enum_descriptors_message_2eproto, file_level_service_descriptors_message_2eproto, -}; - -// Force running AddDescriptors() at dynamic initialization time. -static bool dynamic_init_dummy_message_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_message_2eproto), true); -namespace milvus { -namespace grpc { -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ErrorCode_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_message_2eproto); - return file_level_enum_descriptors_message_2eproto[0]; -} -bool ErrorCode_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: - return true; - default: - return false; - } -} - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataType_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_message_2eproto); - return file_level_enum_descriptors_message_2eproto[1]; -} -bool DataType_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 10: - case 11: - case 20: - case 100: - case 101: - return true; - default: - return false; - } -} - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* CompareOperator_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_message_2eproto); - return file_level_enum_descriptors_message_2eproto[2]; -} -bool CompareOperator_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - return true; - default: - return false; - } -} - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Occur_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_message_2eproto); - return file_level_enum_descriptors_message_2eproto[3]; -} -bool Occur_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - return true; - default: - return false; - } -} - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* OpType_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_message_2eproto); - return file_level_enum_descriptors_message_2eproto[4]; -} -bool OpType_IsValid(int value) { - switch (value) { - case 0: - case 1: - return true; - default: - return false; - } -} - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SyncType_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_message_2eproto); - return file_level_enum_descriptors_message_2eproto[5]; -} -bool SyncType_IsValid(int value) { - switch (value) { - case 0: - case 1: - return true; - default: - return false; - } -} - - -// =================================================================== - -void Status::InitAsDefaultInstance() { -} -class Status::_Internal { - public: -}; - -Status::Status() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.Status) -} -Status::Status(const Status& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - reason_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.reason().empty()) { - reason_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.reason_); - } - error_code_ = from.error_code_; - // @@protoc_insertion_point(copy_constructor:milvus.grpc.Status) -} - -void Status::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Status_message_2eproto.base); - reason_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - error_code_ = 0; -} - -Status::~Status() { - // @@protoc_insertion_point(destructor:milvus.grpc.Status) - SharedDtor(); -} - -void Status::SharedDtor() { - reason_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void Status::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const Status& Status::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Status_message_2eproto.base); - return *internal_default_instance(); -} - - -void Status::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.Status) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - reason_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - error_code_ = 0; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* Status::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.ErrorCode error_code = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - set_error_code(static_cast<::milvus::grpc::ErrorCode>(val)); - } else goto handle_unusual; - continue; - // string reason = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_reason(), ptr, ctx, "milvus.grpc.Status.reason"); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool Status::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.Status) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.ErrorCode error_code = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { - int value = 0; - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - set_error_code(static_cast< ::milvus::grpc::ErrorCode >(value)); - } else { - goto handle_unusual; - } - break; - } - - // string reason = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_reason())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->reason().data(), static_cast(this->reason().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.Status.reason")); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.Status) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.Status) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void Status::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.Status) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.ErrorCode error_code = 1; - if (this->error_code() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( - 1, this->error_code(), output); - } - - // string reason = 2; - if (this->reason().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->reason().data(), static_cast(this->reason().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.Status.reason"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 2, this->reason(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.Status) -} - -::PROTOBUF_NAMESPACE_ID::uint8* Status::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.Status) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.ErrorCode error_code = 1; - if (this->error_code() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 1, this->error_code(), target); - } - - // string reason = 2; - if (this->reason().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->reason().data(), static_cast(this->reason().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.Status.reason"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 2, this->reason(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.Status) - return target; -} - -size_t Status::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.Status) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string reason = 2; - if (this->reason().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->reason()); - } - - // .milvus.grpc.ErrorCode error_code = 1; - if (this->error_code() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->error_code()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Status::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.Status) - GOOGLE_DCHECK_NE(&from, this); - const Status* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.Status) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.Status) - MergeFrom(*source); - } -} - -void Status::MergeFrom(const Status& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.Status) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.reason().size() > 0) { - - reason_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.reason_); - } - if (from.error_code() != 0) { - set_error_code(from.error_code()); - } -} - -void Status::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.Status) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Status::CopyFrom(const Status& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.Status) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Status::IsInitialized() const { - return true; -} - -void Status::InternalSwap(Status* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - reason_.Swap(&other->reason_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(error_code_, other->error_code_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Status::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void KeyValuePair::InitAsDefaultInstance() { -} -class KeyValuePair::_Internal { - public: -}; - -KeyValuePair::KeyValuePair() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.KeyValuePair) -} -KeyValuePair::KeyValuePair(const KeyValuePair& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.key().empty()) { - key_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.key_); - } - value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.value().empty()) { - value_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value_); - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.KeyValuePair) -} - -void KeyValuePair::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_KeyValuePair_message_2eproto.base); - key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -KeyValuePair::~KeyValuePair() { - // @@protoc_insertion_point(destructor:milvus.grpc.KeyValuePair) - SharedDtor(); -} - -void KeyValuePair::SharedDtor() { - key_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void KeyValuePair::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const KeyValuePair& KeyValuePair::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_KeyValuePair_message_2eproto.base); - return *internal_default_instance(); -} - - -void KeyValuePair::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.KeyValuePair) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - key_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - value_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* KeyValuePair::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string key = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_key(), ptr, ctx, "milvus.grpc.KeyValuePair.key"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string value = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_value(), ptr, ctx, "milvus.grpc.KeyValuePair.value"); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool KeyValuePair::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.KeyValuePair) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string key = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_key())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->key().data(), static_cast(this->key().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.KeyValuePair.key")); - } else { - goto handle_unusual; - } - break; - } - - // string value = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_value())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->value().data(), static_cast(this->value().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.KeyValuePair.value")); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.KeyValuePair) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.KeyValuePair) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void KeyValuePair::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.KeyValuePair) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string key = 1; - if (this->key().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->key().data(), static_cast(this->key().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.KeyValuePair.key"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->key(), output); - } - - // string value = 2; - if (this->value().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->value().data(), static_cast(this->value().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.KeyValuePair.value"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 2, this->value(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.KeyValuePair) -} - -::PROTOBUF_NAMESPACE_ID::uint8* KeyValuePair::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.KeyValuePair) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string key = 1; - if (this->key().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->key().data(), static_cast(this->key().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.KeyValuePair.key"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->key(), target); - } - - // string value = 2; - if (this->value().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->value().data(), static_cast(this->value().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.KeyValuePair.value"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 2, this->value(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.KeyValuePair) - return target; -} - -size_t KeyValuePair::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.KeyValuePair) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string key = 1; - if (this->key().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->key()); - } - - // string value = 2; - if (this->value().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->value()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void KeyValuePair::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.KeyValuePair) - GOOGLE_DCHECK_NE(&from, this); - const KeyValuePair* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.KeyValuePair) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.KeyValuePair) - MergeFrom(*source); - } -} - -void KeyValuePair::MergeFrom(const KeyValuePair& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.KeyValuePair) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.key().size() > 0) { - - key_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.key_); - } - if (from.value().size() > 0) { - - value_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.value_); - } -} - -void KeyValuePair::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.KeyValuePair) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void KeyValuePair::CopyFrom(const KeyValuePair& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.KeyValuePair) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool KeyValuePair::IsInitialized() const { - return true; -} - -void KeyValuePair::InternalSwap(KeyValuePair* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - key_.Swap(&other->key_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - value_.Swap(&other->value_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} - -::PROTOBUF_NAMESPACE_ID::Metadata KeyValuePair::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void CollectionName::InitAsDefaultInstance() { -} -class CollectionName::_Internal { - public: -}; - -CollectionName::CollectionName() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.CollectionName) -} -CollectionName::CollectionName(const CollectionName& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.collection_name().empty()) { - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.CollectionName) -} - -void CollectionName::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_CollectionName_message_2eproto.base); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -CollectionName::~CollectionName() { - // @@protoc_insertion_point(destructor:milvus.grpc.CollectionName) - SharedDtor(); -} - -void CollectionName::SharedDtor() { - collection_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void CollectionName::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const CollectionName& CollectionName::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_CollectionName_message_2eproto.base); - return *internal_default_instance(); -} - - -void CollectionName::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.CollectionName) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* CollectionName::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string collection_name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_collection_name(), ptr, ctx, "milvus.grpc.CollectionName.collection_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool CollectionName::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.CollectionName) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string collection_name = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_collection_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.CollectionName.collection_name")); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.CollectionName) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.CollectionName) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void CollectionName::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.CollectionName) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.CollectionName.collection_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->collection_name(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.CollectionName) -} - -::PROTOBUF_NAMESPACE_ID::uint8* CollectionName::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.CollectionName) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.CollectionName.collection_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->collection_name(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.CollectionName) - return target; -} - -size_t CollectionName::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.CollectionName) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_name()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void CollectionName::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.CollectionName) - GOOGLE_DCHECK_NE(&from, this); - const CollectionName* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.CollectionName) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.CollectionName) - MergeFrom(*source); - } -} - -void CollectionName::MergeFrom(const CollectionName& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.CollectionName) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.collection_name().size() > 0) { - - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } -} - -void CollectionName::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.CollectionName) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void CollectionName::CopyFrom(const CollectionName& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.CollectionName) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool CollectionName::IsInitialized() const { - return true; -} - -void CollectionName::InternalSwap(CollectionName* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - collection_name_.Swap(&other->collection_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} - -::PROTOBUF_NAMESPACE_ID::Metadata CollectionName::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void CollectionNameList::InitAsDefaultInstance() { - ::milvus::grpc::_CollectionNameList_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>( - ::milvus::grpc::Status::internal_default_instance()); -} -class CollectionNameList::_Internal { - public: - static const ::milvus::grpc::Status& status(const CollectionNameList* msg); -}; - -const ::milvus::grpc::Status& -CollectionNameList::_Internal::status(const CollectionNameList* msg) { - return *msg->status_; -} -CollectionNameList::CollectionNameList() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.CollectionNameList) -} -CollectionNameList::CollectionNameList(const CollectionNameList& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - collection_names_(from.collection_names_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_status()) { - status_ = new ::milvus::grpc::Status(*from.status_); - } else { - status_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.CollectionNameList) -} - -void CollectionNameList::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_CollectionNameList_message_2eproto.base); - status_ = nullptr; -} - -CollectionNameList::~CollectionNameList() { - // @@protoc_insertion_point(destructor:milvus.grpc.CollectionNameList) - SharedDtor(); -} - -void CollectionNameList::SharedDtor() { - if (this != internal_default_instance()) delete status_; -} - -void CollectionNameList::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const CollectionNameList& CollectionNameList::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_CollectionNameList_message_2eproto.base); - return *internal_default_instance(); -} - - -void CollectionNameList::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.CollectionNameList) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - collection_names_.Clear(); - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* CollectionNameList::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.Status status = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_status(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated string collection_names = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_collection_names(), ptr, ctx, "milvus.grpc.CollectionNameList.collection_names"); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool CollectionNameList::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.CollectionNameList) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.Status status = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_status())); - } else { - goto handle_unusual; - } - break; - } - - // repeated string collection_names = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->add_collection_names())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_names(this->collection_names_size() - 1).data(), - static_cast(this->collection_names(this->collection_names_size() - 1).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.CollectionNameList.collection_names")); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.CollectionNameList) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.CollectionNameList) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void CollectionNameList::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.CollectionNameList) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::status(this), output); - } - - // repeated string collection_names = 2; - for (int i = 0, n = this->collection_names_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_names(i).data(), static_cast(this->collection_names(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.CollectionNameList.collection_names"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString( - 2, this->collection_names(i), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.CollectionNameList) -} - -::PROTOBUF_NAMESPACE_ID::uint8* CollectionNameList::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.CollectionNameList) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::status(this), target); - } - - // repeated string collection_names = 2; - for (int i = 0, n = this->collection_names_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_names(i).data(), static_cast(this->collection_names(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.CollectionNameList.collection_names"); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteStringToArray(2, this->collection_names(i), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.CollectionNameList) - return target; -} - -size_t CollectionNameList::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.CollectionNameList) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated string collection_names = 2; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->collection_names_size()); - for (int i = 0, n = this->collection_names_size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_names(i)); - } - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *status_); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void CollectionNameList::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.CollectionNameList) - GOOGLE_DCHECK_NE(&from, this); - const CollectionNameList* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.CollectionNameList) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.CollectionNameList) - MergeFrom(*source); - } -} - -void CollectionNameList::MergeFrom(const CollectionNameList& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.CollectionNameList) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - collection_names_.MergeFrom(from.collection_names_); - if (from.has_status()) { - mutable_status()->::milvus::grpc::Status::MergeFrom(from.status()); - } -} - -void CollectionNameList::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.CollectionNameList) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void CollectionNameList::CopyFrom(const CollectionNameList& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.CollectionNameList) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool CollectionNameList::IsInitialized() const { - return true; -} - -void CollectionNameList::InternalSwap(CollectionNameList* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - collection_names_.InternalSwap(CastToBase(&other->collection_names_)); - swap(status_, other->status_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata CollectionNameList::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void FieldName::InitAsDefaultInstance() { -} -class FieldName::_Internal { - public: -}; - -FieldName::FieldName() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.FieldName) -} -FieldName::FieldName(const FieldName& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.collection_name().empty()) { - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.field_name().empty()) { - field_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.field_name_); - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.FieldName) -} - -void FieldName::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_FieldName_message_2eproto.base); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -FieldName::~FieldName() { - // @@protoc_insertion_point(destructor:milvus.grpc.FieldName) - SharedDtor(); -} - -void FieldName::SharedDtor() { - collection_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - field_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void FieldName::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const FieldName& FieldName::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_FieldName_message_2eproto.base); - return *internal_default_instance(); -} - - -void FieldName::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.FieldName) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - field_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* FieldName::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string collection_name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_collection_name(), ptr, ctx, "milvus.grpc.FieldName.collection_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string field_name = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_field_name(), ptr, ctx, "milvus.grpc.FieldName.field_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool FieldName::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.FieldName) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string collection_name = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_collection_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.FieldName.collection_name")); - } else { - goto handle_unusual; - } - break; - } - - // string field_name = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_field_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.FieldName.field_name")); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.FieldName) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.FieldName) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void FieldName::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.FieldName) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.FieldName.collection_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->collection_name(), output); - } - - // string field_name = 2; - if (this->field_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.FieldName.field_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 2, this->field_name(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.FieldName) -} - -::PROTOBUF_NAMESPACE_ID::uint8* FieldName::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.FieldName) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.FieldName.collection_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->collection_name(), target); - } - - // string field_name = 2; - if (this->field_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.FieldName.field_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 2, this->field_name(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.FieldName) - return target; -} - -size_t FieldName::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.FieldName) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_name()); - } - - // string field_name = 2; - if (this->field_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->field_name()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void FieldName::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.FieldName) - GOOGLE_DCHECK_NE(&from, this); - const FieldName* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.FieldName) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.FieldName) - MergeFrom(*source); - } -} - -void FieldName::MergeFrom(const FieldName& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.FieldName) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.collection_name().size() > 0) { - - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - if (from.field_name().size() > 0) { - - field_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.field_name_); - } -} - -void FieldName::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.FieldName) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void FieldName::CopyFrom(const FieldName& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.FieldName) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool FieldName::IsInitialized() const { - return true; -} - -void FieldName::InternalSwap(FieldName* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - collection_name_.Swap(&other->collection_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - field_name_.Swap(&other->field_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} - -::PROTOBUF_NAMESPACE_ID::Metadata FieldName::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void Mapping::InitAsDefaultInstance() { - ::milvus::grpc::_Mapping_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>( - ::milvus::grpc::Status::internal_default_instance()); - ::milvus::grpc::_Mapping_default_instance_._instance.get_mutable()->schema_ = const_cast< ::milvus::grpc::Schema*>( - ::milvus::grpc::Schema::internal_default_instance()); -} -class Mapping::_Internal { - public: - static const ::milvus::grpc::Status& status(const Mapping* msg); - static const ::milvus::grpc::Schema& schema(const Mapping* msg); -}; - -const ::milvus::grpc::Status& -Mapping::_Internal::status(const Mapping* msg) { - return *msg->status_; -} -const ::milvus::grpc::Schema& -Mapping::_Internal::schema(const Mapping* msg) { - return *msg->schema_; -} -Mapping::Mapping() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.Mapping) -} -Mapping::Mapping(const Mapping& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - extra_params_(from.extra_params_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.collection_name().empty()) { - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - if (from.has_status()) { - status_ = new ::milvus::grpc::Status(*from.status_); - } else { - status_ = nullptr; - } - if (from.has_schema()) { - schema_ = new ::milvus::grpc::Schema(*from.schema_); - } else { - schema_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.Mapping) -} - -void Mapping::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Mapping_message_2eproto.base); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&status_, 0, static_cast( - reinterpret_cast(&schema_) - - reinterpret_cast(&status_)) + sizeof(schema_)); -} - -Mapping::~Mapping() { - // @@protoc_insertion_point(destructor:milvus.grpc.Mapping) - SharedDtor(); -} - -void Mapping::SharedDtor() { - collection_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete status_; - if (this != internal_default_instance()) delete schema_; -} - -void Mapping::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const Mapping& Mapping::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Mapping_message_2eproto.base); - return *internal_default_instance(); -} - - -void Mapping::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.Mapping) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - extra_params_.Clear(); - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; - if (GetArenaNoVirtual() == nullptr && schema_ != nullptr) { - delete schema_; - } - schema_ = nullptr; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* Mapping::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.Status status = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_status(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string collection_name = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_collection_name(), ptr, ctx, "milvus.grpc.Mapping.collection_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .milvus.grpc.Schema schema = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ctx->ParseMessage(mutable_schema(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_extra_params(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 34); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool Mapping::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.Mapping) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.Status status = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_status())); - } else { - goto handle_unusual; - } - break; - } - - // string collection_name = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_collection_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.Mapping.collection_name")); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.Schema schema = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_schema())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_extra_params())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.Mapping) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.Mapping) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void Mapping::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.Mapping) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::status(this), output); - } - - // string collection_name = 2; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.Mapping.collection_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 2, this->collection_name(), output); - } - - // .milvus.grpc.Schema schema = 3; - if (this->has_schema()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 3, _Internal::schema(this), output); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 4, - this->extra_params(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.Mapping) -} - -::PROTOBUF_NAMESPACE_ID::uint8* Mapping::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.Mapping) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::status(this), target); - } - - // string collection_name = 2; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.Mapping.collection_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 2, this->collection_name(), target); - } - - // .milvus.grpc.Schema schema = 3; - if (this->has_schema()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 3, _Internal::schema(this), target); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 4, this->extra_params(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.Mapping) - return target; -} - -size_t Mapping::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.Mapping) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - { - unsigned int count = static_cast(this->extra_params_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->extra_params(static_cast(i))); - } - } - - // string collection_name = 2; - if (this->collection_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_name()); - } - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *status_); - } - - // .milvus.grpc.Schema schema = 3; - if (this->has_schema()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *schema_); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Mapping::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.Mapping) - GOOGLE_DCHECK_NE(&from, this); - const Mapping* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.Mapping) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.Mapping) - MergeFrom(*source); - } -} - -void Mapping::MergeFrom(const Mapping& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.Mapping) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - extra_params_.MergeFrom(from.extra_params_); - if (from.collection_name().size() > 0) { - - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - if (from.has_status()) { - mutable_status()->::milvus::grpc::Status::MergeFrom(from.status()); - } - if (from.has_schema()) { - mutable_schema()->::milvus::grpc::Schema::MergeFrom(from.schema()); - } -} - -void Mapping::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.Mapping) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Mapping::CopyFrom(const Mapping& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.Mapping) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Mapping::IsInitialized() const { - return true; -} - -void Mapping::InternalSwap(Mapping* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&extra_params_)->InternalSwap(CastToBase(&other->extra_params_)); - collection_name_.Swap(&other->collection_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(status_, other->status_); - swap(schema_, other->schema_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Mapping::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void MappingList::InitAsDefaultInstance() { - ::milvus::grpc::_MappingList_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>( - ::milvus::grpc::Status::internal_default_instance()); -} -class MappingList::_Internal { - public: - static const ::milvus::grpc::Status& status(const MappingList* msg); -}; - -const ::milvus::grpc::Status& -MappingList::_Internal::status(const MappingList* msg) { - return *msg->status_; -} -MappingList::MappingList() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.MappingList) -} -MappingList::MappingList(const MappingList& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - mapping_list_(from.mapping_list_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_status()) { - status_ = new ::milvus::grpc::Status(*from.status_); - } else { - status_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.MappingList) -} - -void MappingList::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_MappingList_message_2eproto.base); - status_ = nullptr; -} - -MappingList::~MappingList() { - // @@protoc_insertion_point(destructor:milvus.grpc.MappingList) - SharedDtor(); -} - -void MappingList::SharedDtor() { - if (this != internal_default_instance()) delete status_; -} - -void MappingList::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const MappingList& MappingList::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MappingList_message_2eproto.base); - return *internal_default_instance(); -} - - -void MappingList::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.MappingList) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - mapping_list_.Clear(); - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* MappingList::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.Status status = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_status(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.Mapping mapping_list = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_mapping_list(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool MappingList::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.MappingList) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.Status status = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_status())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.Mapping mapping_list = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_mapping_list())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.MappingList) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.MappingList) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void MappingList::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.MappingList) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::status(this), output); - } - - // repeated .milvus.grpc.Mapping mapping_list = 2; - for (unsigned int i = 0, - n = static_cast(this->mapping_list_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, - this->mapping_list(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.MappingList) -} - -::PROTOBUF_NAMESPACE_ID::uint8* MappingList::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.MappingList) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::status(this), target); - } - - // repeated .milvus.grpc.Mapping mapping_list = 2; - for (unsigned int i = 0, - n = static_cast(this->mapping_list_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 2, this->mapping_list(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.MappingList) - return target; -} - -size_t MappingList::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.MappingList) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .milvus.grpc.Mapping mapping_list = 2; - { - unsigned int count = static_cast(this->mapping_list_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->mapping_list(static_cast(i))); - } - } - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *status_); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void MappingList::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.MappingList) - GOOGLE_DCHECK_NE(&from, this); - const MappingList* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.MappingList) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.MappingList) - MergeFrom(*source); - } -} - -void MappingList::MergeFrom(const MappingList& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.MappingList) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - mapping_list_.MergeFrom(from.mapping_list_); - if (from.has_status()) { - mutable_status()->::milvus::grpc::Status::MergeFrom(from.status()); - } -} - -void MappingList::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.MappingList) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void MappingList::CopyFrom(const MappingList& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.MappingList) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool MappingList::IsInitialized() const { - return true; -} - -void MappingList::InternalSwap(MappingList* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&mapping_list_)->InternalSwap(CastToBase(&other->mapping_list_)); - swap(status_, other->status_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata MappingList::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void PartitionParam::InitAsDefaultInstance() { -} -class PartitionParam::_Internal { - public: -}; - -PartitionParam::PartitionParam() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.PartitionParam) -} -PartitionParam::PartitionParam(const PartitionParam& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.collection_name().empty()) { - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - tag_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.tag().empty()) { - tag_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.tag_); - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.PartitionParam) -} - -void PartitionParam::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PartitionParam_message_2eproto.base); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - tag_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -PartitionParam::~PartitionParam() { - // @@protoc_insertion_point(destructor:milvus.grpc.PartitionParam) - SharedDtor(); -} - -void PartitionParam::SharedDtor() { - collection_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - tag_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void PartitionParam::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const PartitionParam& PartitionParam::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PartitionParam_message_2eproto.base); - return *internal_default_instance(); -} - - -void PartitionParam::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.PartitionParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - tag_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* PartitionParam::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string collection_name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_collection_name(), ptr, ctx, "milvus.grpc.PartitionParam.collection_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string tag = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_tag(), ptr, ctx, "milvus.grpc.PartitionParam.tag"); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool PartitionParam::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.PartitionParam) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string collection_name = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_collection_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.PartitionParam.collection_name")); - } else { - goto handle_unusual; - } - break; - } - - // string tag = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_tag())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->tag().data(), static_cast(this->tag().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.PartitionParam.tag")); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.PartitionParam) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.PartitionParam) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void PartitionParam::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.PartitionParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.PartitionParam.collection_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->collection_name(), output); - } - - // string tag = 2; - if (this->tag().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->tag().data(), static_cast(this->tag().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.PartitionParam.tag"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 2, this->tag(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.PartitionParam) -} - -::PROTOBUF_NAMESPACE_ID::uint8* PartitionParam::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.PartitionParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.PartitionParam.collection_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->collection_name(), target); - } - - // string tag = 2; - if (this->tag().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->tag().data(), static_cast(this->tag().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.PartitionParam.tag"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 2, this->tag(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.PartitionParam) - return target; -} - -size_t PartitionParam::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.PartitionParam) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_name()); - } - - // string tag = 2; - if (this->tag().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->tag()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void PartitionParam::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.PartitionParam) - GOOGLE_DCHECK_NE(&from, this); - const PartitionParam* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.PartitionParam) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.PartitionParam) - MergeFrom(*source); - } -} - -void PartitionParam::MergeFrom(const PartitionParam& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.PartitionParam) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.collection_name().size() > 0) { - - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - if (from.tag().size() > 0) { - - tag_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.tag_); - } -} - -void PartitionParam::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.PartitionParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void PartitionParam::CopyFrom(const PartitionParam& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.PartitionParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool PartitionParam::IsInitialized() const { - return true; -} - -void PartitionParam::InternalSwap(PartitionParam* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - collection_name_.Swap(&other->collection_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - tag_.Swap(&other->tag_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} - -::PROTOBUF_NAMESPACE_ID::Metadata PartitionParam::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void PartitionList::InitAsDefaultInstance() { - ::milvus::grpc::_PartitionList_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>( - ::milvus::grpc::Status::internal_default_instance()); -} -class PartitionList::_Internal { - public: - static const ::milvus::grpc::Status& status(const PartitionList* msg); -}; - -const ::milvus::grpc::Status& -PartitionList::_Internal::status(const PartitionList* msg) { - return *msg->status_; -} -PartitionList::PartitionList() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.PartitionList) -} -PartitionList::PartitionList(const PartitionList& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - partition_tag_array_(from.partition_tag_array_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_status()) { - status_ = new ::milvus::grpc::Status(*from.status_); - } else { - status_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.PartitionList) -} - -void PartitionList::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PartitionList_message_2eproto.base); - status_ = nullptr; -} - -PartitionList::~PartitionList() { - // @@protoc_insertion_point(destructor:milvus.grpc.PartitionList) - SharedDtor(); -} - -void PartitionList::SharedDtor() { - if (this != internal_default_instance()) delete status_; -} - -void PartitionList::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const PartitionList& PartitionList::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PartitionList_message_2eproto.base); - return *internal_default_instance(); -} - - -void PartitionList::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.PartitionList) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - partition_tag_array_.Clear(); - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* PartitionList::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.Status status = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_status(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated string partition_tag_array = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_partition_tag_array(), ptr, ctx, "milvus.grpc.PartitionList.partition_tag_array"); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool PartitionList::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.PartitionList) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.Status status = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_status())); - } else { - goto handle_unusual; - } - break; - } - - // repeated string partition_tag_array = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->add_partition_tag_array())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag_array(this->partition_tag_array_size() - 1).data(), - static_cast(this->partition_tag_array(this->partition_tag_array_size() - 1).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.PartitionList.partition_tag_array")); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.PartitionList) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.PartitionList) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void PartitionList::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.PartitionList) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::status(this), output); - } - - // repeated string partition_tag_array = 2; - for (int i = 0, n = this->partition_tag_array_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag_array(i).data(), static_cast(this->partition_tag_array(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.PartitionList.partition_tag_array"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString( - 2, this->partition_tag_array(i), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.PartitionList) -} - -::PROTOBUF_NAMESPACE_ID::uint8* PartitionList::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.PartitionList) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::status(this), target); - } - - // repeated string partition_tag_array = 2; - for (int i = 0, n = this->partition_tag_array_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag_array(i).data(), static_cast(this->partition_tag_array(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.PartitionList.partition_tag_array"); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteStringToArray(2, this->partition_tag_array(i), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.PartitionList) - return target; -} - -size_t PartitionList::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.PartitionList) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated string partition_tag_array = 2; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->partition_tag_array_size()); - for (int i = 0, n = this->partition_tag_array_size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->partition_tag_array(i)); - } - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *status_); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void PartitionList::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.PartitionList) - GOOGLE_DCHECK_NE(&from, this); - const PartitionList* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.PartitionList) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.PartitionList) - MergeFrom(*source); - } -} - -void PartitionList::MergeFrom(const PartitionList& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.PartitionList) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - partition_tag_array_.MergeFrom(from.partition_tag_array_); - if (from.has_status()) { - mutable_status()->::milvus::grpc::Status::MergeFrom(from.status()); - } -} - -void PartitionList::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.PartitionList) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void PartitionList::CopyFrom(const PartitionList& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.PartitionList) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool PartitionList::IsInitialized() const { - return true; -} - -void PartitionList::InternalSwap(PartitionList* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - partition_tag_array_.InternalSwap(CastToBase(&other->partition_tag_array_)); - swap(status_, other->status_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata PartitionList::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void VectorRowRecord::InitAsDefaultInstance() { -} -class VectorRowRecord::_Internal { - public: -}; - -VectorRowRecord::VectorRowRecord() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.VectorRowRecord) -} -VectorRowRecord::VectorRowRecord(const VectorRowRecord& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - float_data_(from.float_data_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - binary_data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.binary_data().empty()) { - binary_data_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.binary_data_); - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.VectorRowRecord) -} - -void VectorRowRecord::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_VectorRowRecord_message_2eproto.base); - binary_data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -VectorRowRecord::~VectorRowRecord() { - // @@protoc_insertion_point(destructor:milvus.grpc.VectorRowRecord) - SharedDtor(); -} - -void VectorRowRecord::SharedDtor() { - binary_data_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void VectorRowRecord::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const VectorRowRecord& VectorRowRecord::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_VectorRowRecord_message_2eproto.base); - return *internal_default_instance(); -} - - -void VectorRowRecord::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.VectorRowRecord) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - float_data_.Clear(); - binary_data_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* VectorRowRecord::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // repeated float float_data = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(mutable_float_data(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 13) { - add_float_data(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr)); - ptr += sizeof(float); - } else goto handle_unusual; - continue; - // bytes binary_data = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_binary_data(), ptr, ctx); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool VectorRowRecord::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.VectorRowRecord) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated float float_data = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< - float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( - input, this->mutable_float_data()))); - } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (13 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< - float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( - 1, 10u, input, this->mutable_float_data()))); - } else { - goto handle_unusual; - } - break; - } - - // bytes binary_data = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( - input, this->mutable_binary_data())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.VectorRowRecord) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.VectorRowRecord) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void VectorRowRecord::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.VectorRowRecord) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated float float_data = 1; - if (this->float_data_size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(1, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); - output->WriteVarint32(_float_data_cached_byte_size_.load( - std::memory_order_relaxed)); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatArray( - this->float_data().data(), this->float_data_size(), output); - } - - // bytes binary_data = 2; - if (this->binary_data().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( - 2, this->binary_data(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.VectorRowRecord) -} - -::PROTOBUF_NAMESPACE_ID::uint8* VectorRowRecord::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.VectorRowRecord) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated float float_data = 1; - if (this->float_data_size() > 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( - 1, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, - target); - target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( - _float_data_cached_byte_size_.load(std::memory_order_relaxed), - target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteFloatNoTagToArray(this->float_data_, target); - } - - // bytes binary_data = 2; - if (this->binary_data().size() > 0) { - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( - 2, this->binary_data(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.VectorRowRecord) - return target; -} - -size_t VectorRowRecord::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.VectorRowRecord) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated float float_data = 1; - { - unsigned int count = static_cast(this->float_data_size()); - size_t data_size = 4UL * count; - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _float_data_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // bytes binary_data = 2; - if (this->binary_data().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->binary_data()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void VectorRowRecord::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.VectorRowRecord) - GOOGLE_DCHECK_NE(&from, this); - const VectorRowRecord* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.VectorRowRecord) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.VectorRowRecord) - MergeFrom(*source); - } -} - -void VectorRowRecord::MergeFrom(const VectorRowRecord& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.VectorRowRecord) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - float_data_.MergeFrom(from.float_data_); - if (from.binary_data().size() > 0) { - - binary_data_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.binary_data_); - } -} - -void VectorRowRecord::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.VectorRowRecord) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void VectorRowRecord::CopyFrom(const VectorRowRecord& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.VectorRowRecord) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool VectorRowRecord::IsInitialized() const { - return true; -} - -void VectorRowRecord::InternalSwap(VectorRowRecord* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - float_data_.InternalSwap(&other->float_data_); - binary_data_.Swap(&other->binary_data_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} - -::PROTOBUF_NAMESPACE_ID::Metadata VectorRowRecord::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void EntityIds::InitAsDefaultInstance() { - ::milvus::grpc::_EntityIds_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>( - ::milvus::grpc::Status::internal_default_instance()); -} -class EntityIds::_Internal { - public: - static const ::milvus::grpc::Status& status(const EntityIds* msg); -}; - -const ::milvus::grpc::Status& -EntityIds::_Internal::status(const EntityIds* msg) { - return *msg->status_; -} -EntityIds::EntityIds() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.EntityIds) -} -EntityIds::EntityIds(const EntityIds& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - entity_id_array_(from.entity_id_array_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_status()) { - status_ = new ::milvus::grpc::Status(*from.status_); - } else { - status_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.EntityIds) -} - -void EntityIds::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_EntityIds_message_2eproto.base); - status_ = nullptr; -} - -EntityIds::~EntityIds() { - // @@protoc_insertion_point(destructor:milvus.grpc.EntityIds) - SharedDtor(); -} - -void EntityIds::SharedDtor() { - if (this != internal_default_instance()) delete status_; -} - -void EntityIds::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const EntityIds& EntityIds::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_EntityIds_message_2eproto.base); - return *internal_default_instance(); -} - - -void EntityIds::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.EntityIds) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - entity_id_array_.Clear(); - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* EntityIds::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.Status status = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_status(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated int64 entity_id_array = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(mutable_entity_id_array(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16) { - add_entity_id_array(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool EntityIds::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.EntityIds) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.Status status = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_status())); - } else { - goto handle_unusual; - } - break; - } - - // repeated int64 entity_id_array = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, this->mutable_entity_id_array()))); - } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - 1, 18u, input, this->mutable_entity_id_array()))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.EntityIds) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.EntityIds) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void EntityIds::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.EntityIds) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::status(this), output); - } - - // repeated int64 entity_id_array = 2; - if (this->entity_id_array_size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(2, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); - output->WriteVarint32(_entity_id_array_cached_byte_size_.load( - std::memory_order_relaxed)); - } - for (int i = 0, n = this->entity_id_array_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64NoTag( - this->entity_id_array(i), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.EntityIds) -} - -::PROTOBUF_NAMESPACE_ID::uint8* EntityIds::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.EntityIds) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::status(this), target); - } - - // repeated int64 entity_id_array = 2; - if (this->entity_id_array_size() > 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( - 2, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, - target); - target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( - _entity_id_array_cached_byte_size_.load(std::memory_order_relaxed), - target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteInt64NoTagToArray(this->entity_id_array_, target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.EntityIds) - return target; -} - -size_t EntityIds::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.EntityIds) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated int64 entity_id_array = 2; - { - size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - Int64Size(this->entity_id_array_); - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _entity_id_array_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *status_); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void EntityIds::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.EntityIds) - GOOGLE_DCHECK_NE(&from, this); - const EntityIds* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.EntityIds) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.EntityIds) - MergeFrom(*source); - } -} - -void EntityIds::MergeFrom(const EntityIds& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.EntityIds) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - entity_id_array_.MergeFrom(from.entity_id_array_); - if (from.has_status()) { - mutable_status()->::milvus::grpc::Status::MergeFrom(from.status()); - } -} - -void EntityIds::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.EntityIds) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void EntityIds::CopyFrom(const EntityIds& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.EntityIds) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool EntityIds::IsInitialized() const { - return true; -} - -void EntityIds::InternalSwap(EntityIds* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - entity_id_array_.InternalSwap(&other->entity_id_array_); - swap(status_, other->status_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata EntityIds::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void VectorRecord::InitAsDefaultInstance() { -} -class VectorRecord::_Internal { - public: -}; - -VectorRecord::VectorRecord() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.VectorRecord) -} -VectorRecord::VectorRecord(const VectorRecord& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - records_(from.records_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:milvus.grpc.VectorRecord) -} - -void VectorRecord::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_VectorRecord_message_2eproto.base); -} - -VectorRecord::~VectorRecord() { - // @@protoc_insertion_point(destructor:milvus.grpc.VectorRecord) - SharedDtor(); -} - -void VectorRecord::SharedDtor() { -} - -void VectorRecord::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const VectorRecord& VectorRecord::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_VectorRecord_message_2eproto.base); - return *internal_default_instance(); -} - - -void VectorRecord::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.VectorRecord) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - records_.Clear(); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* VectorRecord::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // repeated .milvus.grpc.VectorRowRecord records = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_records(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool VectorRecord::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.VectorRecord) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated .milvus.grpc.VectorRowRecord records = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_records())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.VectorRecord) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.VectorRecord) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void VectorRecord::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.VectorRecord) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated .milvus.grpc.VectorRowRecord records = 1; - for (unsigned int i = 0, - n = static_cast(this->records_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, - this->records(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.VectorRecord) -} - -::PROTOBUF_NAMESPACE_ID::uint8* VectorRecord::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.VectorRecord) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated .milvus.grpc.VectorRowRecord records = 1; - for (unsigned int i = 0, - n = static_cast(this->records_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, this->records(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.VectorRecord) - return target; -} - -size_t VectorRecord::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.VectorRecord) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .milvus.grpc.VectorRowRecord records = 1; - { - unsigned int count = static_cast(this->records_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->records(static_cast(i))); - } - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void VectorRecord::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.VectorRecord) - GOOGLE_DCHECK_NE(&from, this); - const VectorRecord* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.VectorRecord) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.VectorRecord) - MergeFrom(*source); - } -} - -void VectorRecord::MergeFrom(const VectorRecord& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.VectorRecord) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - records_.MergeFrom(from.records_); -} - -void VectorRecord::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.VectorRecord) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void VectorRecord::CopyFrom(const VectorRecord& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.VectorRecord) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool VectorRecord::IsInitialized() const { - return true; -} - -void VectorRecord::InternalSwap(VectorRecord* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&records_)->InternalSwap(CastToBase(&other->records_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata VectorRecord::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void VectorParam::InitAsDefaultInstance() { - ::milvus::grpc::_VectorParam_default_instance_._instance.get_mutable()->row_record_ = const_cast< ::milvus::grpc::VectorRecord*>( - ::milvus::grpc::VectorRecord::internal_default_instance()); -} -class VectorParam::_Internal { - public: - static const ::milvus::grpc::VectorRecord& row_record(const VectorParam* msg); -}; - -const ::milvus::grpc::VectorRecord& -VectorParam::_Internal::row_record(const VectorParam* msg) { - return *msg->row_record_; -} -VectorParam::VectorParam() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.VectorParam) -} -VectorParam::VectorParam(const VectorParam& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - json_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.json().empty()) { - json_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.json_); - } - if (from.has_row_record()) { - row_record_ = new ::milvus::grpc::VectorRecord(*from.row_record_); - } else { - row_record_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.VectorParam) -} - -void VectorParam::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_VectorParam_message_2eproto.base); - json_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - row_record_ = nullptr; -} - -VectorParam::~VectorParam() { - // @@protoc_insertion_point(destructor:milvus.grpc.VectorParam) - SharedDtor(); -} - -void VectorParam::SharedDtor() { - json_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete row_record_; -} - -void VectorParam::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const VectorParam& VectorParam::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_VectorParam_message_2eproto.base); - return *internal_default_instance(); -} - - -void VectorParam::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.VectorParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - json_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (GetArenaNoVirtual() == nullptr && row_record_ != nullptr) { - delete row_record_; - } - row_record_ = nullptr; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* VectorParam::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string json = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_json(), ptr, ctx, "milvus.grpc.VectorParam.json"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .milvus.grpc.VectorRecord row_record = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(mutable_row_record(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool VectorParam::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.VectorParam) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string json = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_json())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->json().data(), static_cast(this->json().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.VectorParam.json")); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.VectorRecord row_record = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_row_record())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.VectorParam) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.VectorParam) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void VectorParam::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.VectorParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string json = 1; - if (this->json().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->json().data(), static_cast(this->json().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.VectorParam.json"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->json(), output); - } - - // .milvus.grpc.VectorRecord row_record = 2; - if (this->has_row_record()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, _Internal::row_record(this), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.VectorParam) -} - -::PROTOBUF_NAMESPACE_ID::uint8* VectorParam::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.VectorParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string json = 1; - if (this->json().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->json().data(), static_cast(this->json().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.VectorParam.json"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->json(), target); - } - - // .milvus.grpc.VectorRecord row_record = 2; - if (this->has_row_record()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 2, _Internal::row_record(this), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.VectorParam) - return target; -} - -size_t VectorParam::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.VectorParam) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string json = 1; - if (this->json().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->json()); - } - - // .milvus.grpc.VectorRecord row_record = 2; - if (this->has_row_record()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *row_record_); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void VectorParam::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.VectorParam) - GOOGLE_DCHECK_NE(&from, this); - const VectorParam* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.VectorParam) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.VectorParam) - MergeFrom(*source); - } -} - -void VectorParam::MergeFrom(const VectorParam& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.VectorParam) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.json().size() > 0) { - - json_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.json_); - } - if (from.has_row_record()) { - mutable_row_record()->::milvus::grpc::VectorRecord::MergeFrom(from.row_record()); - } -} - -void VectorParam::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.VectorParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void VectorParam::CopyFrom(const VectorParam& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.VectorParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool VectorParam::IsInitialized() const { - return true; -} - -void VectorParam::InternalSwap(VectorParam* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - json_.Swap(&other->json_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(row_record_, other->row_record_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata VectorParam::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void FieldMeta::InitAsDefaultInstance() { -} -class FieldMeta::_Internal { - public: -}; - -FieldMeta::FieldMeta() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.FieldMeta) -} -FieldMeta::FieldMeta(const FieldMeta& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.field_name().empty()) { - field_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.field_name_); - } - ::memcpy(&dim_, &from.dim_, - static_cast(reinterpret_cast(&type_) - - reinterpret_cast(&dim_)) + sizeof(type_)); - // @@protoc_insertion_point(copy_constructor:milvus.grpc.FieldMeta) -} - -void FieldMeta::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_FieldMeta_message_2eproto.base); - field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&dim_, 0, static_cast( - reinterpret_cast(&type_) - - reinterpret_cast(&dim_)) + sizeof(type_)); -} - -FieldMeta::~FieldMeta() { - // @@protoc_insertion_point(destructor:milvus.grpc.FieldMeta) - SharedDtor(); -} - -void FieldMeta::SharedDtor() { - field_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void FieldMeta::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const FieldMeta& FieldMeta::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_FieldMeta_message_2eproto.base); - return *internal_default_instance(); -} - - -void FieldMeta::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.FieldMeta) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - field_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&dim_, 0, static_cast( - reinterpret_cast(&type_) - - reinterpret_cast(&dim_)) + sizeof(type_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* FieldMeta::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string field_name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_field_name(), ptr, ctx, "milvus.grpc.FieldMeta.field_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .milvus.grpc.DataType type = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - set_type(static_cast<::milvus::grpc::DataType>(val)); - } else goto handle_unusual; - continue; - // int64 dim = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - dim_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool FieldMeta::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.FieldMeta) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string field_name = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_field_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.FieldMeta.field_name")); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.DataType type = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - int value = 0; - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - set_type(static_cast< ::milvus::grpc::DataType >(value)); - } else { - goto handle_unusual; - } - break; - } - - // int64 dim = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &dim_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.FieldMeta) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.FieldMeta) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void FieldMeta::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.FieldMeta) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string field_name = 1; - if (this->field_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.FieldMeta.field_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->field_name(), output); - } - - // .milvus.grpc.DataType type = 2; - if (this->type() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( - 2, this->type(), output); - } - - // int64 dim = 3; - if (this->dim() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->dim(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.FieldMeta) -} - -::PROTOBUF_NAMESPACE_ID::uint8* FieldMeta::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.FieldMeta) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string field_name = 1; - if (this->field_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.FieldMeta.field_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->field_name(), target); - } - - // .milvus.grpc.DataType type = 2; - if (this->type() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 2, this->type(), target); - } - - // int64 dim = 3; - if (this->dim() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->dim(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.FieldMeta) - return target; -} - -size_t FieldMeta::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.FieldMeta) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string field_name = 1; - if (this->field_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->field_name()); - } - - // int64 dim = 3; - if (this->dim() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->dim()); - } - - // .milvus.grpc.DataType type = 2; - if (this->type() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->type()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void FieldMeta::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.FieldMeta) - GOOGLE_DCHECK_NE(&from, this); - const FieldMeta* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.FieldMeta) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.FieldMeta) - MergeFrom(*source); - } -} - -void FieldMeta::MergeFrom(const FieldMeta& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.FieldMeta) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.field_name().size() > 0) { - - field_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.field_name_); - } - if (from.dim() != 0) { - set_dim(from.dim()); - } - if (from.type() != 0) { - set_type(from.type()); - } -} - -void FieldMeta::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.FieldMeta) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void FieldMeta::CopyFrom(const FieldMeta& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.FieldMeta) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool FieldMeta::IsInitialized() const { - return true; -} - -void FieldMeta::InternalSwap(FieldMeta* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - field_name_.Swap(&other->field_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(dim_, other->dim_); - swap(type_, other->type_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata FieldMeta::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void Schema::InitAsDefaultInstance() { -} -class Schema::_Internal { - public: -}; - -Schema::Schema() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.Schema) -} -Schema::Schema(const Schema& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - field_metas_(from.field_metas_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:milvus.grpc.Schema) -} - -void Schema::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Schema_message_2eproto.base); -} - -Schema::~Schema() { - // @@protoc_insertion_point(destructor:milvus.grpc.Schema) - SharedDtor(); -} - -void Schema::SharedDtor() { -} - -void Schema::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const Schema& Schema::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Schema_message_2eproto.base); - return *internal_default_instance(); -} - - -void Schema::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.Schema) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - field_metas_.Clear(); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* Schema::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // repeated .milvus.grpc.FieldMeta field_metas = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_field_metas(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool Schema::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.Schema) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated .milvus.grpc.FieldMeta field_metas = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_field_metas())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.Schema) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.Schema) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void Schema::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.Schema) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated .milvus.grpc.FieldMeta field_metas = 1; - for (unsigned int i = 0, - n = static_cast(this->field_metas_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, - this->field_metas(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.Schema) -} - -::PROTOBUF_NAMESPACE_ID::uint8* Schema::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.Schema) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated .milvus.grpc.FieldMeta field_metas = 1; - for (unsigned int i = 0, - n = static_cast(this->field_metas_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, this->field_metas(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.Schema) - return target; -} - -size_t Schema::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.Schema) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .milvus.grpc.FieldMeta field_metas = 1; - { - unsigned int count = static_cast(this->field_metas_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->field_metas(static_cast(i))); - } - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Schema::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.Schema) - GOOGLE_DCHECK_NE(&from, this); - const Schema* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.Schema) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.Schema) - MergeFrom(*source); - } -} - -void Schema::MergeFrom(const Schema& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.Schema) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - field_metas_.MergeFrom(from.field_metas_); -} - -void Schema::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.Schema) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Schema::CopyFrom(const Schema& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.Schema) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Schema::IsInitialized() const { - return true; -} - -void Schema::InternalSwap(Schema* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&field_metas_)->InternalSwap(CastToBase(&other->field_metas_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Schema::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void RowData::InitAsDefaultInstance() { -} -class RowData::_Internal { - public: -}; - -RowData::RowData() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.RowData) -} -RowData::RowData(const RowData& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - blob_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.blob().empty()) { - blob_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.blob_); - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.RowData) -} - -void RowData::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_RowData_message_2eproto.base); - blob_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -RowData::~RowData() { - // @@protoc_insertion_point(destructor:milvus.grpc.RowData) - SharedDtor(); -} - -void RowData::SharedDtor() { - blob_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void RowData::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const RowData& RowData::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RowData_message_2eproto.base); - return *internal_default_instance(); -} - - -void RowData::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.RowData) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - blob_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* RowData::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // bytes blob = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_blob(), ptr, ctx); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool RowData::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.RowData) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // bytes blob = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( - input, this->mutable_blob())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.RowData) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.RowData) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void RowData::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.RowData) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // bytes blob = 1; - if (this->blob().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( - 1, this->blob(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.RowData) -} - -::PROTOBUF_NAMESPACE_ID::uint8* RowData::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.RowData) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // bytes blob = 1; - if (this->blob().size() > 0) { - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( - 1, this->blob(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.RowData) - return target; -} - -size_t RowData::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.RowData) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bytes blob = 1; - if (this->blob().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->blob()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void RowData::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.RowData) - GOOGLE_DCHECK_NE(&from, this); - const RowData* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.RowData) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.RowData) - MergeFrom(*source); - } -} - -void RowData::MergeFrom(const RowData& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.RowData) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.blob().size() > 0) { - - blob_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.blob_); - } -} - -void RowData::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.RowData) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void RowData::CopyFrom(const RowData& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.RowData) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool RowData::IsInitialized() const { - return true; -} - -void RowData::InternalSwap(RowData* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - blob_.Swap(&other->blob_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} - -::PROTOBUF_NAMESPACE_ID::Metadata RowData::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void InsertParam::InitAsDefaultInstance() { - ::milvus::grpc::_InsertParam_default_instance_._instance.get_mutable()->schema_ = const_cast< ::milvus::grpc::Schema*>( - ::milvus::grpc::Schema::internal_default_instance()); -} -class InsertParam::_Internal { - public: - static const ::milvus::grpc::Schema& schema(const InsertParam* msg); -}; - -const ::milvus::grpc::Schema& -InsertParam::_Internal::schema(const InsertParam* msg) { - return *msg->schema_; -} -InsertParam::InsertParam() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.InsertParam) -} -InsertParam::InsertParam(const InsertParam& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - rows_data_(from.rows_data_), - entity_id_array_(from.entity_id_array_), - extra_params_(from.extra_params_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.collection_name().empty()) { - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - partition_tag_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.partition_tag().empty()) { - partition_tag_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.partition_tag_); - } - if (from.has_schema()) { - schema_ = new ::milvus::grpc::Schema(*from.schema_); - } else { - schema_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.InsertParam) -} - -void InsertParam::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_InsertParam_message_2eproto.base); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - partition_tag_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - schema_ = nullptr; -} - -InsertParam::~InsertParam() { - // @@protoc_insertion_point(destructor:milvus.grpc.InsertParam) - SharedDtor(); -} - -void InsertParam::SharedDtor() { - collection_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - partition_tag_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete schema_; -} - -void InsertParam::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const InsertParam& InsertParam::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_InsertParam_message_2eproto.base); - return *internal_default_instance(); -} - - -void InsertParam::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.InsertParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - rows_data_.Clear(); - entity_id_array_.Clear(); - extra_params_.Clear(); - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - partition_tag_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (GetArenaNoVirtual() == nullptr && schema_ != nullptr) { - delete schema_; - } - schema_ = nullptr; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* InsertParam::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string collection_name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_collection_name(), ptr, ctx, "milvus.grpc.InsertParam.collection_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .milvus.grpc.Schema schema = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(mutable_schema(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.RowData rows_data = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_rows_data(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 26); - } else goto handle_unusual; - continue; - // repeated int64 entity_id_array = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(mutable_entity_id_array(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32) { - add_entity_id_array(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string partition_tag = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_partition_tag(), ptr, ctx, "milvus.grpc.InsertParam.partition_tag"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_extra_params(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 50); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool InsertParam::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.InsertParam) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string collection_name = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_collection_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.InsertParam.collection_name")); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.Schema schema = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_schema())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.RowData rows_data = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_rows_data())); - } else { - goto handle_unusual; - } - break; - } - - // repeated int64 entity_id_array = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, this->mutable_entity_id_array()))); - } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - 1, 34u, input, this->mutable_entity_id_array()))); - } else { - goto handle_unusual; - } - break; - } - - // string partition_tag = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_partition_tag())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag().data(), static_cast(this->partition_tag().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.InsertParam.partition_tag")); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - case 6: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_extra_params())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.InsertParam) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.InsertParam) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void InsertParam::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.InsertParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.InsertParam.collection_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->collection_name(), output); - } - - // .milvus.grpc.Schema schema = 2; - if (this->has_schema()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, _Internal::schema(this), output); - } - - // repeated .milvus.grpc.RowData rows_data = 3; - for (unsigned int i = 0, - n = static_cast(this->rows_data_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 3, - this->rows_data(static_cast(i)), - output); - } - - // repeated int64 entity_id_array = 4; - if (this->entity_id_array_size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(4, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); - output->WriteVarint32(_entity_id_array_cached_byte_size_.load( - std::memory_order_relaxed)); - } - for (int i = 0, n = this->entity_id_array_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64NoTag( - this->entity_id_array(i), output); - } - - // string partition_tag = 5; - if (this->partition_tag().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag().data(), static_cast(this->partition_tag().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.InsertParam.partition_tag"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 5, this->partition_tag(), output); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 6, - this->extra_params(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.InsertParam) -} - -::PROTOBUF_NAMESPACE_ID::uint8* InsertParam::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.InsertParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.InsertParam.collection_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->collection_name(), target); - } - - // .milvus.grpc.Schema schema = 2; - if (this->has_schema()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 2, _Internal::schema(this), target); - } - - // repeated .milvus.grpc.RowData rows_data = 3; - for (unsigned int i = 0, - n = static_cast(this->rows_data_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 3, this->rows_data(static_cast(i)), target); - } - - // repeated int64 entity_id_array = 4; - if (this->entity_id_array_size() > 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( - 4, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, - target); - target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( - _entity_id_array_cached_byte_size_.load(std::memory_order_relaxed), - target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteInt64NoTagToArray(this->entity_id_array_, target); - } - - // string partition_tag = 5; - if (this->partition_tag().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag().data(), static_cast(this->partition_tag().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.InsertParam.partition_tag"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 5, this->partition_tag(), target); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 6, this->extra_params(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.InsertParam) - return target; -} - -size_t InsertParam::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.InsertParam) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .milvus.grpc.RowData rows_data = 3; - { - unsigned int count = static_cast(this->rows_data_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->rows_data(static_cast(i))); - } - } - - // repeated int64 entity_id_array = 4; - { - size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - Int64Size(this->entity_id_array_); - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _entity_id_array_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - { - unsigned int count = static_cast(this->extra_params_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->extra_params(static_cast(i))); - } - } - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_name()); - } - - // string partition_tag = 5; - if (this->partition_tag().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->partition_tag()); - } - - // .milvus.grpc.Schema schema = 2; - if (this->has_schema()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *schema_); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void InsertParam::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.InsertParam) - GOOGLE_DCHECK_NE(&from, this); - const InsertParam* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.InsertParam) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.InsertParam) - MergeFrom(*source); - } -} - -void InsertParam::MergeFrom(const InsertParam& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.InsertParam) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - rows_data_.MergeFrom(from.rows_data_); - entity_id_array_.MergeFrom(from.entity_id_array_); - extra_params_.MergeFrom(from.extra_params_); - if (from.collection_name().size() > 0) { - - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - if (from.partition_tag().size() > 0) { - - partition_tag_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.partition_tag_); - } - if (from.has_schema()) { - mutable_schema()->::milvus::grpc::Schema::MergeFrom(from.schema()); - } -} - -void InsertParam::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.InsertParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void InsertParam::CopyFrom(const InsertParam& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.InsertParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool InsertParam::IsInitialized() const { - return true; -} - -void InsertParam::InternalSwap(InsertParam* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&rows_data_)->InternalSwap(CastToBase(&other->rows_data_)); - entity_id_array_.InternalSwap(&other->entity_id_array_); - CastToBase(&extra_params_)->InternalSwap(CastToBase(&other->extra_params_)); - collection_name_.Swap(&other->collection_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - partition_tag_.Swap(&other->partition_tag_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(schema_, other->schema_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata InsertParam::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void SearchParam::InitAsDefaultInstance() { -} -class SearchParam::_Internal { - public: -}; - -SearchParam::SearchParam() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.SearchParam) -} -SearchParam::SearchParam(const SearchParam& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - vector_param_(from.vector_param_), - partition_tag_(from.partition_tag_), - extra_params_(from.extra_params_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.collection_name().empty()) { - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - dsl_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.dsl().empty()) { - dsl_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.dsl_); - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.SearchParam) -} - -void SearchParam::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SearchParam_message_2eproto.base); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - dsl_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -SearchParam::~SearchParam() { - // @@protoc_insertion_point(destructor:milvus.grpc.SearchParam) - SharedDtor(); -} - -void SearchParam::SharedDtor() { - collection_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - dsl_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void SearchParam::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const SearchParam& SearchParam::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SearchParam_message_2eproto.base); - return *internal_default_instance(); -} - - -void SearchParam::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.SearchParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - vector_param_.Clear(); - partition_tag_.Clear(); - extra_params_.Clear(); - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - dsl_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* SearchParam::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string collection_name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_collection_name(), ptr, ctx, "milvus.grpc.SearchParam.collection_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.VectorParam vector_param = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_vector_param(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18); - } else goto handle_unusual; - continue; - // string dsl = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_dsl(), ptr, ctx, "milvus.grpc.SearchParam.dsl"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated string partition_tag = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { - ptr -= 1; - do { - ptr += 1; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_partition_tag(), ptr, ctx, "milvus.grpc.SearchParam.partition_tag"); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 34); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_extra_params(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 42); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool SearchParam::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.SearchParam) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string collection_name = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_collection_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.SearchParam.collection_name")); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.VectorParam vector_param = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_vector_param())); - } else { - goto handle_unusual; - } - break; - } - - // string dsl = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_dsl())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->dsl().data(), static_cast(this->dsl().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.SearchParam.dsl")); - } else { - goto handle_unusual; - } - break; - } - - // repeated string partition_tag = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->add_partition_tag())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag(this->partition_tag_size() - 1).data(), - static_cast(this->partition_tag(this->partition_tag_size() - 1).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.SearchParam.partition_tag")); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_extra_params())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.SearchParam) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.SearchParam) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void SearchParam::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.SearchParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchParam.collection_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->collection_name(), output); - } - - // repeated .milvus.grpc.VectorParam vector_param = 2; - for (unsigned int i = 0, - n = static_cast(this->vector_param_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, - this->vector_param(static_cast(i)), - output); - } - - // string dsl = 3; - if (this->dsl().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->dsl().data(), static_cast(this->dsl().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchParam.dsl"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 3, this->dsl(), output); - } - - // repeated string partition_tag = 4; - for (int i = 0, n = this->partition_tag_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag(i).data(), static_cast(this->partition_tag(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchParam.partition_tag"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString( - 4, this->partition_tag(i), output); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 5, - this->extra_params(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.SearchParam) -} - -::PROTOBUF_NAMESPACE_ID::uint8* SearchParam::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.SearchParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchParam.collection_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->collection_name(), target); - } - - // repeated .milvus.grpc.VectorParam vector_param = 2; - for (unsigned int i = 0, - n = static_cast(this->vector_param_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 2, this->vector_param(static_cast(i)), target); - } - - // string dsl = 3; - if (this->dsl().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->dsl().data(), static_cast(this->dsl().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchParam.dsl"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 3, this->dsl(), target); - } - - // repeated string partition_tag = 4; - for (int i = 0, n = this->partition_tag_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag(i).data(), static_cast(this->partition_tag(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchParam.partition_tag"); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteStringToArray(4, this->partition_tag(i), target); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 5, this->extra_params(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.SearchParam) - return target; -} - -size_t SearchParam::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.SearchParam) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .milvus.grpc.VectorParam vector_param = 2; - { - unsigned int count = static_cast(this->vector_param_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->vector_param(static_cast(i))); - } - } - - // repeated string partition_tag = 4; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->partition_tag_size()); - for (int i = 0, n = this->partition_tag_size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->partition_tag(i)); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - { - unsigned int count = static_cast(this->extra_params_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->extra_params(static_cast(i))); - } - } - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_name()); - } - - // string dsl = 3; - if (this->dsl().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->dsl()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void SearchParam::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.SearchParam) - GOOGLE_DCHECK_NE(&from, this); - const SearchParam* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.SearchParam) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.SearchParam) - MergeFrom(*source); - } -} - -void SearchParam::MergeFrom(const SearchParam& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.SearchParam) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - vector_param_.MergeFrom(from.vector_param_); - partition_tag_.MergeFrom(from.partition_tag_); - extra_params_.MergeFrom(from.extra_params_); - if (from.collection_name().size() > 0) { - - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - if (from.dsl().size() > 0) { - - dsl_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.dsl_); - } -} - -void SearchParam::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.SearchParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void SearchParam::CopyFrom(const SearchParam& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.SearchParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool SearchParam::IsInitialized() const { - return true; -} - -void SearchParam::InternalSwap(SearchParam* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&vector_param_)->InternalSwap(CastToBase(&other->vector_param_)); - partition_tag_.InternalSwap(CastToBase(&other->partition_tag_)); - CastToBase(&extra_params_)->InternalSwap(CastToBase(&other->extra_params_)); - collection_name_.Swap(&other->collection_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - dsl_.Swap(&other->dsl_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} - -::PROTOBUF_NAMESPACE_ID::Metadata SearchParam::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void SearchInSegmentParam::InitAsDefaultInstance() { - ::milvus::grpc::_SearchInSegmentParam_default_instance_._instance.get_mutable()->search_param_ = const_cast< ::milvus::grpc::SearchParam*>( - ::milvus::grpc::SearchParam::internal_default_instance()); -} -class SearchInSegmentParam::_Internal { - public: - static const ::milvus::grpc::SearchParam& search_param(const SearchInSegmentParam* msg); -}; - -const ::milvus::grpc::SearchParam& -SearchInSegmentParam::_Internal::search_param(const SearchInSegmentParam* msg) { - return *msg->search_param_; -} -SearchInSegmentParam::SearchInSegmentParam() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.SearchInSegmentParam) -} -SearchInSegmentParam::SearchInSegmentParam(const SearchInSegmentParam& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - file_id_array_(from.file_id_array_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_search_param()) { - search_param_ = new ::milvus::grpc::SearchParam(*from.search_param_); - } else { - search_param_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.SearchInSegmentParam) -} - -void SearchInSegmentParam::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SearchInSegmentParam_message_2eproto.base); - search_param_ = nullptr; -} - -SearchInSegmentParam::~SearchInSegmentParam() { - // @@protoc_insertion_point(destructor:milvus.grpc.SearchInSegmentParam) - SharedDtor(); -} - -void SearchInSegmentParam::SharedDtor() { - if (this != internal_default_instance()) delete search_param_; -} - -void SearchInSegmentParam::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const SearchInSegmentParam& SearchInSegmentParam::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SearchInSegmentParam_message_2eproto.base); - return *internal_default_instance(); -} - - -void SearchInSegmentParam::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.SearchInSegmentParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - file_id_array_.Clear(); - if (GetArenaNoVirtual() == nullptr && search_param_ != nullptr) { - delete search_param_; - } - search_param_ = nullptr; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* SearchInSegmentParam::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // repeated string file_id_array = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr -= 1; - do { - ptr += 1; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_file_id_array(), ptr, ctx, "milvus.grpc.SearchInSegmentParam.file_id_array"); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10); - } else goto handle_unusual; - continue; - // .milvus.grpc.SearchParam search_param = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(mutable_search_param(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool SearchInSegmentParam::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.SearchInSegmentParam) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated string file_id_array = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->add_file_id_array())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->file_id_array(this->file_id_array_size() - 1).data(), - static_cast(this->file_id_array(this->file_id_array_size() - 1).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.SearchInSegmentParam.file_id_array")); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.SearchParam search_param = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_search_param())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.SearchInSegmentParam) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.SearchInSegmentParam) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void SearchInSegmentParam::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.SearchInSegmentParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated string file_id_array = 1; - for (int i = 0, n = this->file_id_array_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->file_id_array(i).data(), static_cast(this->file_id_array(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchInSegmentParam.file_id_array"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString( - 1, this->file_id_array(i), output); - } - - // .milvus.grpc.SearchParam search_param = 2; - if (this->has_search_param()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, _Internal::search_param(this), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.SearchInSegmentParam) -} - -::PROTOBUF_NAMESPACE_ID::uint8* SearchInSegmentParam::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.SearchInSegmentParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated string file_id_array = 1; - for (int i = 0, n = this->file_id_array_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->file_id_array(i).data(), static_cast(this->file_id_array(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchInSegmentParam.file_id_array"); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteStringToArray(1, this->file_id_array(i), target); - } - - // .milvus.grpc.SearchParam search_param = 2; - if (this->has_search_param()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 2, _Internal::search_param(this), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.SearchInSegmentParam) - return target; -} - -size_t SearchInSegmentParam::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.SearchInSegmentParam) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated string file_id_array = 1; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->file_id_array_size()); - for (int i = 0, n = this->file_id_array_size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->file_id_array(i)); - } - - // .milvus.grpc.SearchParam search_param = 2; - if (this->has_search_param()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *search_param_); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void SearchInSegmentParam::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.SearchInSegmentParam) - GOOGLE_DCHECK_NE(&from, this); - const SearchInSegmentParam* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.SearchInSegmentParam) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.SearchInSegmentParam) - MergeFrom(*source); - } -} - -void SearchInSegmentParam::MergeFrom(const SearchInSegmentParam& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.SearchInSegmentParam) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - file_id_array_.MergeFrom(from.file_id_array_); - if (from.has_search_param()) { - mutable_search_param()->::milvus::grpc::SearchParam::MergeFrom(from.search_param()); - } -} - -void SearchInSegmentParam::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.SearchInSegmentParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void SearchInSegmentParam::CopyFrom(const SearchInSegmentParam& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.SearchInSegmentParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool SearchInSegmentParam::IsInitialized() const { - return true; -} - -void SearchInSegmentParam::InternalSwap(SearchInSegmentParam* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - file_id_array_.InternalSwap(CastToBase(&other->file_id_array_)); - swap(search_param_, other->search_param_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata SearchInSegmentParam::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void Entities::InitAsDefaultInstance() { - ::milvus::grpc::_Entities_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>( - ::milvus::grpc::Status::internal_default_instance()); -} -class Entities::_Internal { - public: - static const ::milvus::grpc::Status& status(const Entities* msg); -}; - -const ::milvus::grpc::Status& -Entities::_Internal::status(const Entities* msg) { - return *msg->status_; -} -Entities::Entities() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.Entities) -} -Entities::Entities(const Entities& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - ids_(from.ids_), - valid_row_(from.valid_row_), - rows_data_(from.rows_data_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_status()) { - status_ = new ::milvus::grpc::Status(*from.status_); - } else { - status_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.Entities) -} - -void Entities::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Entities_message_2eproto.base); - status_ = nullptr; -} - -Entities::~Entities() { - // @@protoc_insertion_point(destructor:milvus.grpc.Entities) - SharedDtor(); -} - -void Entities::SharedDtor() { - if (this != internal_default_instance()) delete status_; -} - -void Entities::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const Entities& Entities::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Entities_message_2eproto.base); - return *internal_default_instance(); -} - - -void Entities::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.Entities) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ids_.Clear(); - valid_row_.Clear(); - rows_data_.Clear(); - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* Entities::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.Status status = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_status(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated int64 ids = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(mutable_ids(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16) { - add_ids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated bool valid_row = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedBoolParser(mutable_valid_row(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24) { - add_valid_row(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.RowData rows_data = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_rows_data(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 34); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool Entities::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.Entities) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.Status status = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_status())); - } else { - goto handle_unusual; - } - break; - } - - // repeated int64 ids = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, this->mutable_ids()))); - } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - 1, 18u, input, this->mutable_ids()))); - } else { - goto handle_unusual; - } - break; - } - - // repeated bool valid_row = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< - bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( - input, this->mutable_valid_row()))); - } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< - bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( - 1, 26u, input, this->mutable_valid_row()))); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.RowData rows_data = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_rows_data())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.Entities) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.Entities) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void Entities::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.Entities) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::status(this), output); - } - - // repeated int64 ids = 2; - if (this->ids_size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(2, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); - output->WriteVarint32(_ids_cached_byte_size_.load( - std::memory_order_relaxed)); - } - for (int i = 0, n = this->ids_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64NoTag( - this->ids(i), output); - } - - // repeated bool valid_row = 3; - if (this->valid_row_size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(3, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); - output->WriteVarint32(_valid_row_cached_byte_size_.load( - std::memory_order_relaxed)); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolArray( - this->valid_row().data(), this->valid_row_size(), output); - } - - // repeated .milvus.grpc.RowData rows_data = 4; - for (unsigned int i = 0, - n = static_cast(this->rows_data_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 4, - this->rows_data(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.Entities) -} - -::PROTOBUF_NAMESPACE_ID::uint8* Entities::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.Entities) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::status(this), target); - } - - // repeated int64 ids = 2; - if (this->ids_size() > 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( - 2, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, - target); - target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( - _ids_cached_byte_size_.load(std::memory_order_relaxed), - target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteInt64NoTagToArray(this->ids_, target); - } - - // repeated bool valid_row = 3; - if (this->valid_row_size() > 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( - 3, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, - target); - target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( - _valid_row_cached_byte_size_.load(std::memory_order_relaxed), - target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteBoolNoTagToArray(this->valid_row_, target); - } - - // repeated .milvus.grpc.RowData rows_data = 4; - for (unsigned int i = 0, - n = static_cast(this->rows_data_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 4, this->rows_data(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.Entities) - return target; -} - -size_t Entities::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.Entities) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated int64 ids = 2; - { - size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - Int64Size(this->ids_); - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _ids_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // repeated bool valid_row = 3; - { - unsigned int count = static_cast(this->valid_row_size()); - size_t data_size = 1UL * count; - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _valid_row_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // repeated .milvus.grpc.RowData rows_data = 4; - { - unsigned int count = static_cast(this->rows_data_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->rows_data(static_cast(i))); - } - } - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *status_); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Entities::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.Entities) - GOOGLE_DCHECK_NE(&from, this); - const Entities* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.Entities) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.Entities) - MergeFrom(*source); - } -} - -void Entities::MergeFrom(const Entities& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.Entities) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - ids_.MergeFrom(from.ids_); - valid_row_.MergeFrom(from.valid_row_); - rows_data_.MergeFrom(from.rows_data_); - if (from.has_status()) { - mutable_status()->::milvus::grpc::Status::MergeFrom(from.status()); - } -} - -void Entities::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.Entities) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Entities::CopyFrom(const Entities& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.Entities) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Entities::IsInitialized() const { - return true; -} - -void Entities::InternalSwap(Entities* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - ids_.InternalSwap(&other->ids_); - valid_row_.InternalSwap(&other->valid_row_); - CastToBase(&rows_data_)->InternalSwap(CastToBase(&other->rows_data_)); - swap(status_, other->status_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Entities::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void QueryResult::InitAsDefaultInstance() { - ::milvus::grpc::_QueryResult_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>( - ::milvus::grpc::Status::internal_default_instance()); - ::milvus::grpc::_QueryResult_default_instance_._instance.get_mutable()->entities_ = const_cast< ::milvus::grpc::Entities*>( - ::milvus::grpc::Entities::internal_default_instance()); -} -class QueryResult::_Internal { - public: - static const ::milvus::grpc::Status& status(const QueryResult* msg); - static const ::milvus::grpc::Entities& entities(const QueryResult* msg); -}; - -const ::milvus::grpc::Status& -QueryResult::_Internal::status(const QueryResult* msg) { - return *msg->status_; -} -const ::milvus::grpc::Entities& -QueryResult::_Internal::entities(const QueryResult* msg) { - return *msg->entities_; -} -QueryResult::QueryResult() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.QueryResult) -} -QueryResult::QueryResult(const QueryResult& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - scores_(from.scores_), - distances_(from.distances_), - extra_params_(from.extra_params_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_status()) { - status_ = new ::milvus::grpc::Status(*from.status_); - } else { - status_ = nullptr; - } - if (from.has_entities()) { - entities_ = new ::milvus::grpc::Entities(*from.entities_); - } else { - entities_ = nullptr; - } - ::memcpy(&row_num_, &from.row_num_, - static_cast(reinterpret_cast(&client_id_) - - reinterpret_cast(&row_num_)) + sizeof(client_id_)); - // @@protoc_insertion_point(copy_constructor:milvus.grpc.QueryResult) -} - -void QueryResult::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_QueryResult_message_2eproto.base); - ::memset(&status_, 0, static_cast( - reinterpret_cast(&client_id_) - - reinterpret_cast(&status_)) + sizeof(client_id_)); -} - -QueryResult::~QueryResult() { - // @@protoc_insertion_point(destructor:milvus.grpc.QueryResult) - SharedDtor(); -} - -void QueryResult::SharedDtor() { - if (this != internal_default_instance()) delete status_; - if (this != internal_default_instance()) delete entities_; -} - -void QueryResult::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const QueryResult& QueryResult::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_QueryResult_message_2eproto.base); - return *internal_default_instance(); -} - - -void QueryResult::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.QueryResult) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - scores_.Clear(); - distances_.Clear(); - extra_params_.Clear(); - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; - if (GetArenaNoVirtual() == nullptr && entities_ != nullptr) { - delete entities_; - } - entities_ = nullptr; - ::memset(&row_num_, 0, static_cast( - reinterpret_cast(&client_id_) - - reinterpret_cast(&row_num_)) + sizeof(client_id_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* QueryResult::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.Status status = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_status(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .milvus.grpc.Entities entities = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(mutable_entities(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 row_num = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - row_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated float scores = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(mutable_scores(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 37) { - add_scores(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr)); - ptr += sizeof(float); - } else goto handle_unusual; - continue; - // repeated float distances = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(mutable_distances(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 45) { - add_distances(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr)); - ptr += sizeof(float); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_extra_params(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 50); - } else goto handle_unusual; - continue; - // int64 query_id = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { - query_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 client_id = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { - client_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool QueryResult::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.QueryResult) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.Status status = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_status())); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.Entities entities = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_entities())); - } else { - goto handle_unusual; - } - break; - } - - // int64 row_num = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &row_num_))); - } else { - goto handle_unusual; - } - break; - } - - // repeated float scores = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< - float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( - input, this->mutable_scores()))); - } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (37 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< - float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( - 1, 34u, input, this->mutable_scores()))); - } else { - goto handle_unusual; - } - break; - } - - // repeated float distances = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< - float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( - input, this->mutable_distances()))); - } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (45 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< - float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( - 1, 42u, input, this->mutable_distances()))); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - case 6: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_extra_params())); - } else { - goto handle_unusual; - } - break; - } - - // int64 query_id = 7; - case 7: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &query_id_))); - } else { - goto handle_unusual; - } - break; - } - - // int64 client_id = 8; - case 8: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (64 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &client_id_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.QueryResult) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.QueryResult) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void QueryResult::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.QueryResult) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::status(this), output); - } - - // .milvus.grpc.Entities entities = 2; - if (this->has_entities()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, _Internal::entities(this), output); - } - - // int64 row_num = 3; - if (this->row_num() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->row_num(), output); - } - - // repeated float scores = 4; - if (this->scores_size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(4, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); - output->WriteVarint32(_scores_cached_byte_size_.load( - std::memory_order_relaxed)); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatArray( - this->scores().data(), this->scores_size(), output); - } - - // repeated float distances = 5; - if (this->distances_size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(5, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); - output->WriteVarint32(_distances_cached_byte_size_.load( - std::memory_order_relaxed)); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatArray( - this->distances().data(), this->distances_size(), output); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 6, - this->extra_params(static_cast(i)), - output); - } - - // int64 query_id = 7; - if (this->query_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(7, this->query_id(), output); - } - - // int64 client_id = 8; - if (this->client_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(8, this->client_id(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.QueryResult) -} - -::PROTOBUF_NAMESPACE_ID::uint8* QueryResult::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.QueryResult) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::status(this), target); - } - - // .milvus.grpc.Entities entities = 2; - if (this->has_entities()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 2, _Internal::entities(this), target); - } - - // int64 row_num = 3; - if (this->row_num() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->row_num(), target); - } - - // repeated float scores = 4; - if (this->scores_size() > 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( - 4, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, - target); - target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( - _scores_cached_byte_size_.load(std::memory_order_relaxed), - target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteFloatNoTagToArray(this->scores_, target); - } - - // repeated float distances = 5; - if (this->distances_size() > 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( - 5, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, - target); - target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( - _distances_cached_byte_size_.load(std::memory_order_relaxed), - target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteFloatNoTagToArray(this->distances_, target); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 6, this->extra_params(static_cast(i)), target); - } - - // int64 query_id = 7; - if (this->query_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(7, this->query_id(), target); - } - - // int64 client_id = 8; - if (this->client_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(8, this->client_id(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.QueryResult) - return target; -} - -size_t QueryResult::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.QueryResult) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated float scores = 4; - { - unsigned int count = static_cast(this->scores_size()); - size_t data_size = 4UL * count; - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _scores_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // repeated float distances = 5; - { - unsigned int count = static_cast(this->distances_size()); - size_t data_size = 4UL * count; - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _distances_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - { - unsigned int count = static_cast(this->extra_params_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->extra_params(static_cast(i))); - } - } - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *status_); - } - - // .milvus.grpc.Entities entities = 2; - if (this->has_entities()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *entities_); - } - - // int64 row_num = 3; - if (this->row_num() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->row_num()); - } - - // int64 query_id = 7; - if (this->query_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->query_id()); - } - - // int64 client_id = 8; - if (this->client_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->client_id()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void QueryResult::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.QueryResult) - GOOGLE_DCHECK_NE(&from, this); - const QueryResult* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.QueryResult) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.QueryResult) - MergeFrom(*source); - } -} - -void QueryResult::MergeFrom(const QueryResult& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.QueryResult) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - scores_.MergeFrom(from.scores_); - distances_.MergeFrom(from.distances_); - extra_params_.MergeFrom(from.extra_params_); - if (from.has_status()) { - mutable_status()->::milvus::grpc::Status::MergeFrom(from.status()); - } - if (from.has_entities()) { - mutable_entities()->::milvus::grpc::Entities::MergeFrom(from.entities()); - } - if (from.row_num() != 0) { - set_row_num(from.row_num()); - } - if (from.query_id() != 0) { - set_query_id(from.query_id()); - } - if (from.client_id() != 0) { - set_client_id(from.client_id()); - } -} - -void QueryResult::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.QueryResult) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void QueryResult::CopyFrom(const QueryResult& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.QueryResult) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool QueryResult::IsInitialized() const { - return true; -} - -void QueryResult::InternalSwap(QueryResult* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - scores_.InternalSwap(&other->scores_); - distances_.InternalSwap(&other->distances_); - CastToBase(&extra_params_)->InternalSwap(CastToBase(&other->extra_params_)); - swap(status_, other->status_); - swap(entities_, other->entities_); - swap(row_num_, other->row_num_); - swap(query_id_, other->query_id_); - swap(client_id_, other->client_id_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata QueryResult::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void StringReply::InitAsDefaultInstance() { - ::milvus::grpc::_StringReply_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>( - ::milvus::grpc::Status::internal_default_instance()); -} -class StringReply::_Internal { - public: - static const ::milvus::grpc::Status& status(const StringReply* msg); -}; - -const ::milvus::grpc::Status& -StringReply::_Internal::status(const StringReply* msg) { - return *msg->status_; -} -StringReply::StringReply() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.StringReply) -} -StringReply::StringReply(const StringReply& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - string_reply_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.string_reply().empty()) { - string_reply_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.string_reply_); - } - if (from.has_status()) { - status_ = new ::milvus::grpc::Status(*from.status_); - } else { - status_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.StringReply) -} - -void StringReply::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_StringReply_message_2eproto.base); - string_reply_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - status_ = nullptr; -} - -StringReply::~StringReply() { - // @@protoc_insertion_point(destructor:milvus.grpc.StringReply) - SharedDtor(); -} - -void StringReply::SharedDtor() { - string_reply_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete status_; -} - -void StringReply::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const StringReply& StringReply::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_StringReply_message_2eproto.base); - return *internal_default_instance(); -} - - -void StringReply::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.StringReply) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - string_reply_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* StringReply::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.Status status = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_status(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string string_reply = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_string_reply(), ptr, ctx, "milvus.grpc.StringReply.string_reply"); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool StringReply::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.StringReply) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.Status status = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_status())); - } else { - goto handle_unusual; - } - break; - } - - // string string_reply = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_string_reply())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->string_reply().data(), static_cast(this->string_reply().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.StringReply.string_reply")); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.StringReply) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.StringReply) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void StringReply::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.StringReply) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::status(this), output); - } - - // string string_reply = 2; - if (this->string_reply().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->string_reply().data(), static_cast(this->string_reply().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.StringReply.string_reply"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 2, this->string_reply(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.StringReply) -} - -::PROTOBUF_NAMESPACE_ID::uint8* StringReply::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.StringReply) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::status(this), target); - } - - // string string_reply = 2; - if (this->string_reply().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->string_reply().data(), static_cast(this->string_reply().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.StringReply.string_reply"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 2, this->string_reply(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.StringReply) - return target; -} - -size_t StringReply::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.StringReply) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string string_reply = 2; - if (this->string_reply().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->string_reply()); - } - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *status_); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void StringReply::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.StringReply) - GOOGLE_DCHECK_NE(&from, this); - const StringReply* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.StringReply) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.StringReply) - MergeFrom(*source); - } -} - -void StringReply::MergeFrom(const StringReply& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.StringReply) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.string_reply().size() > 0) { - - string_reply_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.string_reply_); - } - if (from.has_status()) { - mutable_status()->::milvus::grpc::Status::MergeFrom(from.status()); - } -} - -void StringReply::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.StringReply) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void StringReply::CopyFrom(const StringReply& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.StringReply) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool StringReply::IsInitialized() const { - return true; -} - -void StringReply::InternalSwap(StringReply* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - string_reply_.Swap(&other->string_reply_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(status_, other->status_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata StringReply::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void BoolReply::InitAsDefaultInstance() { - ::milvus::grpc::_BoolReply_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>( - ::milvus::grpc::Status::internal_default_instance()); -} -class BoolReply::_Internal { - public: - static const ::milvus::grpc::Status& status(const BoolReply* msg); -}; - -const ::milvus::grpc::Status& -BoolReply::_Internal::status(const BoolReply* msg) { - return *msg->status_; -} -BoolReply::BoolReply() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.BoolReply) -} -BoolReply::BoolReply(const BoolReply& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_status()) { - status_ = new ::milvus::grpc::Status(*from.status_); - } else { - status_ = nullptr; - } - bool_reply_ = from.bool_reply_; - // @@protoc_insertion_point(copy_constructor:milvus.grpc.BoolReply) -} - -void BoolReply::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_BoolReply_message_2eproto.base); - ::memset(&status_, 0, static_cast( - reinterpret_cast(&bool_reply_) - - reinterpret_cast(&status_)) + sizeof(bool_reply_)); -} - -BoolReply::~BoolReply() { - // @@protoc_insertion_point(destructor:milvus.grpc.BoolReply) - SharedDtor(); -} - -void BoolReply::SharedDtor() { - if (this != internal_default_instance()) delete status_; -} - -void BoolReply::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const BoolReply& BoolReply::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_BoolReply_message_2eproto.base); - return *internal_default_instance(); -} - - -void BoolReply::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.BoolReply) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; - bool_reply_ = false; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* BoolReply::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.Status status = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_status(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool bool_reply = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - bool_reply_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool BoolReply::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.BoolReply) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.Status status = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_status())); - } else { - goto handle_unusual; - } - break; - } - - // bool bool_reply = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( - input, &bool_reply_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.BoolReply) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.BoolReply) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void BoolReply::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.BoolReply) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::status(this), output); - } - - // bool bool_reply = 2; - if (this->bool_reply() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(2, this->bool_reply(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.BoolReply) -} - -::PROTOBUF_NAMESPACE_ID::uint8* BoolReply::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.BoolReply) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::status(this), target); - } - - // bool bool_reply = 2; - if (this->bool_reply() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->bool_reply(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.BoolReply) - return target; -} - -size_t BoolReply::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.BoolReply) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *status_); - } - - // bool bool_reply = 2; - if (this->bool_reply() != 0) { - total_size += 1 + 1; - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void BoolReply::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.BoolReply) - GOOGLE_DCHECK_NE(&from, this); - const BoolReply* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.BoolReply) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.BoolReply) - MergeFrom(*source); - } -} - -void BoolReply::MergeFrom(const BoolReply& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.BoolReply) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.has_status()) { - mutable_status()->::milvus::grpc::Status::MergeFrom(from.status()); - } - if (from.bool_reply() != 0) { - set_bool_reply(from.bool_reply()); - } -} - -void BoolReply::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.BoolReply) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void BoolReply::CopyFrom(const BoolReply& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.BoolReply) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool BoolReply::IsInitialized() const { - return true; -} - -void BoolReply::InternalSwap(BoolReply* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(status_, other->status_); - swap(bool_reply_, other->bool_reply_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata BoolReply::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void CollectionRowCount::InitAsDefaultInstance() { - ::milvus::grpc::_CollectionRowCount_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>( - ::milvus::grpc::Status::internal_default_instance()); -} -class CollectionRowCount::_Internal { - public: - static const ::milvus::grpc::Status& status(const CollectionRowCount* msg); -}; - -const ::milvus::grpc::Status& -CollectionRowCount::_Internal::status(const CollectionRowCount* msg) { - return *msg->status_; -} -CollectionRowCount::CollectionRowCount() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.CollectionRowCount) -} -CollectionRowCount::CollectionRowCount(const CollectionRowCount& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_status()) { - status_ = new ::milvus::grpc::Status(*from.status_); - } else { - status_ = nullptr; - } - collection_row_count_ = from.collection_row_count_; - // @@protoc_insertion_point(copy_constructor:milvus.grpc.CollectionRowCount) -} - -void CollectionRowCount::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_CollectionRowCount_message_2eproto.base); - ::memset(&status_, 0, static_cast( - reinterpret_cast(&collection_row_count_) - - reinterpret_cast(&status_)) + sizeof(collection_row_count_)); -} - -CollectionRowCount::~CollectionRowCount() { - // @@protoc_insertion_point(destructor:milvus.grpc.CollectionRowCount) - SharedDtor(); -} - -void CollectionRowCount::SharedDtor() { - if (this != internal_default_instance()) delete status_; -} - -void CollectionRowCount::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const CollectionRowCount& CollectionRowCount::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_CollectionRowCount_message_2eproto.base); - return *internal_default_instance(); -} - - -void CollectionRowCount::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.CollectionRowCount) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; - collection_row_count_ = PROTOBUF_LONGLONG(0); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* CollectionRowCount::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.Status status = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_status(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 collection_row_count = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - collection_row_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool CollectionRowCount::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.CollectionRowCount) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.Status status = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_status())); - } else { - goto handle_unusual; - } - break; - } - - // int64 collection_row_count = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &collection_row_count_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.CollectionRowCount) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.CollectionRowCount) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void CollectionRowCount::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.CollectionRowCount) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::status(this), output); - } - - // int64 collection_row_count = 2; - if (this->collection_row_count() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(2, this->collection_row_count(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.CollectionRowCount) -} - -::PROTOBUF_NAMESPACE_ID::uint8* CollectionRowCount::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.CollectionRowCount) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::status(this), target); - } - - // int64 collection_row_count = 2; - if (this->collection_row_count() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->collection_row_count(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.CollectionRowCount) - return target; -} - -size_t CollectionRowCount::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.CollectionRowCount) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *status_); - } - - // int64 collection_row_count = 2; - if (this->collection_row_count() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->collection_row_count()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void CollectionRowCount::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.CollectionRowCount) - GOOGLE_DCHECK_NE(&from, this); - const CollectionRowCount* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.CollectionRowCount) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.CollectionRowCount) - MergeFrom(*source); - } -} - -void CollectionRowCount::MergeFrom(const CollectionRowCount& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.CollectionRowCount) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.has_status()) { - mutable_status()->::milvus::grpc::Status::MergeFrom(from.status()); - } - if (from.collection_row_count() != 0) { - set_collection_row_count(from.collection_row_count()); - } -} - -void CollectionRowCount::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.CollectionRowCount) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void CollectionRowCount::CopyFrom(const CollectionRowCount& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.CollectionRowCount) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool CollectionRowCount::IsInitialized() const { - return true; -} - -void CollectionRowCount::InternalSwap(CollectionRowCount* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(status_, other->status_); - swap(collection_row_count_, other->collection_row_count_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata CollectionRowCount::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void Command::InitAsDefaultInstance() { -} -class Command::_Internal { - public: -}; - -Command::Command() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.Command) -} -Command::Command(const Command& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - cmd_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.cmd().empty()) { - cmd_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.cmd_); - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.Command) -} - -void Command::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Command_message_2eproto.base); - cmd_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -Command::~Command() { - // @@protoc_insertion_point(destructor:milvus.grpc.Command) - SharedDtor(); -} - -void Command::SharedDtor() { - cmd_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void Command::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const Command& Command::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Command_message_2eproto.base); - return *internal_default_instance(); -} - - -void Command::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.Command) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - cmd_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* Command::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string cmd = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_cmd(), ptr, ctx, "milvus.grpc.Command.cmd"); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool Command::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.Command) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string cmd = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_cmd())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->cmd().data(), static_cast(this->cmd().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.Command.cmd")); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.Command) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.Command) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void Command::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.Command) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string cmd = 1; - if (this->cmd().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->cmd().data(), static_cast(this->cmd().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.Command.cmd"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->cmd(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.Command) -} - -::PROTOBUF_NAMESPACE_ID::uint8* Command::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.Command) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string cmd = 1; - if (this->cmd().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->cmd().data(), static_cast(this->cmd().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.Command.cmd"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->cmd(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.Command) - return target; -} - -size_t Command::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.Command) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string cmd = 1; - if (this->cmd().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->cmd()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Command::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.Command) - GOOGLE_DCHECK_NE(&from, this); - const Command* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.Command) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.Command) - MergeFrom(*source); - } -} - -void Command::MergeFrom(const Command& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.Command) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.cmd().size() > 0) { - - cmd_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.cmd_); - } -} - -void Command::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.Command) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Command::CopyFrom(const Command& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.Command) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Command::IsInitialized() const { - return true; -} - -void Command::InternalSwap(Command* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - cmd_.Swap(&other->cmd_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Command::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void IndexParam::InitAsDefaultInstance() { - ::milvus::grpc::_IndexParam_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>( - ::milvus::grpc::Status::internal_default_instance()); -} -class IndexParam::_Internal { - public: - static const ::milvus::grpc::Status& status(const IndexParam* msg); -}; - -const ::milvus::grpc::Status& -IndexParam::_Internal::status(const IndexParam* msg) { - return *msg->status_; -} -IndexParam::IndexParam() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.IndexParam) -} -IndexParam::IndexParam(const IndexParam& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - extra_params_(from.extra_params_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.collection_name().empty()) { - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.field_name().empty()) { - field_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.field_name_); - } - index_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.index_name().empty()) { - index_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.index_name_); - } - if (from.has_status()) { - status_ = new ::milvus::grpc::Status(*from.status_); - } else { - status_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.IndexParam) -} - -void IndexParam::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_IndexParam_message_2eproto.base); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - index_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - status_ = nullptr; -} - -IndexParam::~IndexParam() { - // @@protoc_insertion_point(destructor:milvus.grpc.IndexParam) - SharedDtor(); -} - -void IndexParam::SharedDtor() { - collection_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - field_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - index_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete status_; -} - -void IndexParam::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const IndexParam& IndexParam::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_IndexParam_message_2eproto.base); - return *internal_default_instance(); -} - - -void IndexParam::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.IndexParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - extra_params_.Clear(); - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - field_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - index_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* IndexParam::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.Status status = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_status(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string collection_name = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_collection_name(), ptr, ctx, "milvus.grpc.IndexParam.collection_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string field_name = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_field_name(), ptr, ctx, "milvus.grpc.IndexParam.field_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string index_name = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_index_name(), ptr, ctx, "milvus.grpc.IndexParam.index_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_extra_params(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 42); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool IndexParam::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.IndexParam) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.Status status = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_status())); - } else { - goto handle_unusual; - } - break; - } - - // string collection_name = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_collection_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.IndexParam.collection_name")); - } else { - goto handle_unusual; - } - break; - } - - // string field_name = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_field_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.IndexParam.field_name")); - } else { - goto handle_unusual; - } - break; - } - - // string index_name = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_index_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->index_name().data(), static_cast(this->index_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.IndexParam.index_name")); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_extra_params())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.IndexParam) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.IndexParam) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void IndexParam::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.IndexParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::status(this), output); - } - - // string collection_name = 2; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.IndexParam.collection_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 2, this->collection_name(), output); - } - - // string field_name = 3; - if (this->field_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.IndexParam.field_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 3, this->field_name(), output); - } - - // string index_name = 4; - if (this->index_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->index_name().data(), static_cast(this->index_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.IndexParam.index_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 4, this->index_name(), output); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 5, - this->extra_params(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.IndexParam) -} - -::PROTOBUF_NAMESPACE_ID::uint8* IndexParam::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.IndexParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::status(this), target); - } - - // string collection_name = 2; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.IndexParam.collection_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 2, this->collection_name(), target); - } - - // string field_name = 3; - if (this->field_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.IndexParam.field_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 3, this->field_name(), target); - } - - // string index_name = 4; - if (this->index_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->index_name().data(), static_cast(this->index_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.IndexParam.index_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 4, this->index_name(), target); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 5, this->extra_params(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.IndexParam) - return target; -} - -size_t IndexParam::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.IndexParam) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - { - unsigned int count = static_cast(this->extra_params_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->extra_params(static_cast(i))); - } - } - - // string collection_name = 2; - if (this->collection_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_name()); - } - - // string field_name = 3; - if (this->field_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->field_name()); - } - - // string index_name = 4; - if (this->index_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->index_name()); - } - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *status_); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void IndexParam::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.IndexParam) - GOOGLE_DCHECK_NE(&from, this); - const IndexParam* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.IndexParam) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.IndexParam) - MergeFrom(*source); - } -} - -void IndexParam::MergeFrom(const IndexParam& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.IndexParam) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - extra_params_.MergeFrom(from.extra_params_); - if (from.collection_name().size() > 0) { - - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - if (from.field_name().size() > 0) { - - field_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.field_name_); - } - if (from.index_name().size() > 0) { - - index_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.index_name_); - } - if (from.has_status()) { - mutable_status()->::milvus::grpc::Status::MergeFrom(from.status()); - } -} - -void IndexParam::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.IndexParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void IndexParam::CopyFrom(const IndexParam& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.IndexParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool IndexParam::IsInitialized() const { - return true; -} - -void IndexParam::InternalSwap(IndexParam* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&extra_params_)->InternalSwap(CastToBase(&other->extra_params_)); - collection_name_.Swap(&other->collection_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - field_name_.Swap(&other->field_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - index_name_.Swap(&other->index_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(status_, other->status_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata IndexParam::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void FlushParam::InitAsDefaultInstance() { -} -class FlushParam::_Internal { - public: -}; - -FlushParam::FlushParam() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.FlushParam) -} -FlushParam::FlushParam(const FlushParam& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - collection_name_array_(from.collection_name_array_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:milvus.grpc.FlushParam) -} - -void FlushParam::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_FlushParam_message_2eproto.base); -} - -FlushParam::~FlushParam() { - // @@protoc_insertion_point(destructor:milvus.grpc.FlushParam) - SharedDtor(); -} - -void FlushParam::SharedDtor() { -} - -void FlushParam::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const FlushParam& FlushParam::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_FlushParam_message_2eproto.base); - return *internal_default_instance(); -} - - -void FlushParam::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.FlushParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - collection_name_array_.Clear(); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* FlushParam::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // repeated string collection_name_array = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr -= 1; - do { - ptr += 1; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_collection_name_array(), ptr, ctx, "milvus.grpc.FlushParam.collection_name_array"); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool FlushParam::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.FlushParam) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated string collection_name_array = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->add_collection_name_array())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name_array(this->collection_name_array_size() - 1).data(), - static_cast(this->collection_name_array(this->collection_name_array_size() - 1).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.FlushParam.collection_name_array")); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.FlushParam) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.FlushParam) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void FlushParam::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.FlushParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated string collection_name_array = 1; - for (int i = 0, n = this->collection_name_array_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name_array(i).data(), static_cast(this->collection_name_array(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.FlushParam.collection_name_array"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString( - 1, this->collection_name_array(i), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.FlushParam) -} - -::PROTOBUF_NAMESPACE_ID::uint8* FlushParam::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.FlushParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated string collection_name_array = 1; - for (int i = 0, n = this->collection_name_array_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name_array(i).data(), static_cast(this->collection_name_array(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.FlushParam.collection_name_array"); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteStringToArray(1, this->collection_name_array(i), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.FlushParam) - return target; -} - -size_t FlushParam::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.FlushParam) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated string collection_name_array = 1; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->collection_name_array_size()); - for (int i = 0, n = this->collection_name_array_size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_name_array(i)); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void FlushParam::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.FlushParam) - GOOGLE_DCHECK_NE(&from, this); - const FlushParam* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.FlushParam) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.FlushParam) - MergeFrom(*source); - } -} - -void FlushParam::MergeFrom(const FlushParam& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.FlushParam) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - collection_name_array_.MergeFrom(from.collection_name_array_); -} - -void FlushParam::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.FlushParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void FlushParam::CopyFrom(const FlushParam& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.FlushParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool FlushParam::IsInitialized() const { - return true; -} - -void FlushParam::InternalSwap(FlushParam* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - collection_name_array_.InternalSwap(CastToBase(&other->collection_name_array_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata FlushParam::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void CompactParam::InitAsDefaultInstance() { -} -class CompactParam::_Internal { - public: -}; - -CompactParam::CompactParam() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.CompactParam) -} -CompactParam::CompactParam(const CompactParam& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.collection_name().empty()) { - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - threshold_ = from.threshold_; - // @@protoc_insertion_point(copy_constructor:milvus.grpc.CompactParam) -} - -void CompactParam::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_CompactParam_message_2eproto.base); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - threshold_ = 0; -} - -CompactParam::~CompactParam() { - // @@protoc_insertion_point(destructor:milvus.grpc.CompactParam) - SharedDtor(); -} - -void CompactParam::SharedDtor() { - collection_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void CompactParam::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const CompactParam& CompactParam::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_CompactParam_message_2eproto.base); - return *internal_default_instance(); -} - - -void CompactParam::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.CompactParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - threshold_ = 0; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* CompactParam::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string collection_name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_collection_name(), ptr, ctx, "milvus.grpc.CompactParam.collection_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // double threshold = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 17)) { - threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(double); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool CompactParam::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.CompactParam) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string collection_name = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_collection_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.CompactParam.collection_name")); - } else { - goto handle_unusual; - } - break; - } - - // double threshold = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (17 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - double, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_DOUBLE>( - input, &threshold_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.CompactParam) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.CompactParam) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void CompactParam::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.CompactParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.CompactParam.collection_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->collection_name(), output); - } - - // double threshold = 2; - if (!(this->threshold() <= 0 && this->threshold() >= 0)) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDouble(2, this->threshold(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.CompactParam) -} - -::PROTOBUF_NAMESPACE_ID::uint8* CompactParam::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.CompactParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.CompactParam.collection_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->collection_name(), target); - } - - // double threshold = 2; - if (!(this->threshold() <= 0 && this->threshold() >= 0)) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(2, this->threshold(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.CompactParam) - return target; -} - -size_t CompactParam::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.CompactParam) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_name()); - } - - // double threshold = 2; - if (!(this->threshold() <= 0 && this->threshold() >= 0)) { - total_size += 1 + 8; - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void CompactParam::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.CompactParam) - GOOGLE_DCHECK_NE(&from, this); - const CompactParam* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.CompactParam) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.CompactParam) - MergeFrom(*source); - } -} - -void CompactParam::MergeFrom(const CompactParam& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.CompactParam) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.collection_name().size() > 0) { - - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - if (!(from.threshold() <= 0 && from.threshold() >= 0)) { - set_threshold(from.threshold()); - } -} - -void CompactParam::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.CompactParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void CompactParam::CopyFrom(const CompactParam& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.CompactParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool CompactParam::IsInitialized() const { - return true; -} - -void CompactParam::InternalSwap(CompactParam* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - collection_name_.Swap(&other->collection_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(threshold_, other->threshold_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata CompactParam::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void DeleteByIDParam::InitAsDefaultInstance() { -} -class DeleteByIDParam::_Internal { - public: -}; - -DeleteByIDParam::DeleteByIDParam() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.DeleteByIDParam) -} -DeleteByIDParam::DeleteByIDParam(const DeleteByIDParam& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - id_array_(from.id_array_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.collection_name().empty()) { - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.DeleteByIDParam) -} - -void DeleteByIDParam::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_DeleteByIDParam_message_2eproto.base); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -DeleteByIDParam::~DeleteByIDParam() { - // @@protoc_insertion_point(destructor:milvus.grpc.DeleteByIDParam) - SharedDtor(); -} - -void DeleteByIDParam::SharedDtor() { - collection_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void DeleteByIDParam::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const DeleteByIDParam& DeleteByIDParam::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_DeleteByIDParam_message_2eproto.base); - return *internal_default_instance(); -} - - -void DeleteByIDParam::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.DeleteByIDParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - id_array_.Clear(); - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* DeleteByIDParam::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string collection_name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_collection_name(), ptr, ctx, "milvus.grpc.DeleteByIDParam.collection_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated int64 id_array = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(mutable_id_array(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16) { - add_id_array(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool DeleteByIDParam::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.DeleteByIDParam) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string collection_name = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_collection_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.DeleteByIDParam.collection_name")); - } else { - goto handle_unusual; - } - break; - } - - // repeated int64 id_array = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, this->mutable_id_array()))); - } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - 1, 18u, input, this->mutable_id_array()))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.DeleteByIDParam) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.DeleteByIDParam) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void DeleteByIDParam::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.DeleteByIDParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.DeleteByIDParam.collection_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->collection_name(), output); - } - - // repeated int64 id_array = 2; - if (this->id_array_size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(2, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); - output->WriteVarint32(_id_array_cached_byte_size_.load( - std::memory_order_relaxed)); - } - for (int i = 0, n = this->id_array_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64NoTag( - this->id_array(i), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.DeleteByIDParam) -} - -::PROTOBUF_NAMESPACE_ID::uint8* DeleteByIDParam::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.DeleteByIDParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.DeleteByIDParam.collection_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->collection_name(), target); - } - - // repeated int64 id_array = 2; - if (this->id_array_size() > 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( - 2, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, - target); - target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( - _id_array_cached_byte_size_.load(std::memory_order_relaxed), - target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteInt64NoTagToArray(this->id_array_, target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.DeleteByIDParam) - return target; -} - -size_t DeleteByIDParam::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.DeleteByIDParam) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated int64 id_array = 2; - { - size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - Int64Size(this->id_array_); - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _id_array_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_name()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void DeleteByIDParam::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.DeleteByIDParam) - GOOGLE_DCHECK_NE(&from, this); - const DeleteByIDParam* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.DeleteByIDParam) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.DeleteByIDParam) - MergeFrom(*source); - } -} - -void DeleteByIDParam::MergeFrom(const DeleteByIDParam& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.DeleteByIDParam) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - id_array_.MergeFrom(from.id_array_); - if (from.collection_name().size() > 0) { - - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } -} - -void DeleteByIDParam::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.DeleteByIDParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void DeleteByIDParam::CopyFrom(const DeleteByIDParam& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.DeleteByIDParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool DeleteByIDParam::IsInitialized() const { - return true; -} - -void DeleteByIDParam::InternalSwap(DeleteByIDParam* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - id_array_.InternalSwap(&other->id_array_); - collection_name_.Swap(&other->collection_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} - -::PROTOBUF_NAMESPACE_ID::Metadata DeleteByIDParam::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void CollectionInfo::InitAsDefaultInstance() { - ::milvus::grpc::_CollectionInfo_default_instance_._instance.get_mutable()->status_ = const_cast< ::milvus::grpc::Status*>( - ::milvus::grpc::Status::internal_default_instance()); -} -class CollectionInfo::_Internal { - public: - static const ::milvus::grpc::Status& status(const CollectionInfo* msg); -}; - -const ::milvus::grpc::Status& -CollectionInfo::_Internal::status(const CollectionInfo* msg) { - return *msg->status_; -} -CollectionInfo::CollectionInfo() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.CollectionInfo) -} -CollectionInfo::CollectionInfo(const CollectionInfo& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - json_info_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.json_info().empty()) { - json_info_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.json_info_); - } - if (from.has_status()) { - status_ = new ::milvus::grpc::Status(*from.status_); - } else { - status_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.CollectionInfo) -} - -void CollectionInfo::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_CollectionInfo_message_2eproto.base); - json_info_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - status_ = nullptr; -} - -CollectionInfo::~CollectionInfo() { - // @@protoc_insertion_point(destructor:milvus.grpc.CollectionInfo) - SharedDtor(); -} - -void CollectionInfo::SharedDtor() { - json_info_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete status_; -} - -void CollectionInfo::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const CollectionInfo& CollectionInfo::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_CollectionInfo_message_2eproto.base); - return *internal_default_instance(); -} - - -void CollectionInfo::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.CollectionInfo) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - json_info_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* CollectionInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.Status status = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_status(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string json_info = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_json_info(), ptr, ctx, "milvus.grpc.CollectionInfo.json_info"); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool CollectionInfo::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.CollectionInfo) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.Status status = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_status())); - } else { - goto handle_unusual; - } - break; - } - - // string json_info = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_json_info())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->json_info().data(), static_cast(this->json_info().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.CollectionInfo.json_info")); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.CollectionInfo) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.CollectionInfo) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void CollectionInfo::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.CollectionInfo) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::status(this), output); - } - - // string json_info = 2; - if (this->json_info().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->json_info().data(), static_cast(this->json_info().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.CollectionInfo.json_info"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 2, this->json_info(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.CollectionInfo) -} - -::PROTOBUF_NAMESPACE_ID::uint8* CollectionInfo::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.CollectionInfo) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::status(this), target); - } - - // string json_info = 2; - if (this->json_info().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->json_info().data(), static_cast(this->json_info().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.CollectionInfo.json_info"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 2, this->json_info(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.CollectionInfo) - return target; -} - -size_t CollectionInfo::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.CollectionInfo) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string json_info = 2; - if (this->json_info().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->json_info()); - } - - // .milvus.grpc.Status status = 1; - if (this->has_status()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *status_); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void CollectionInfo::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.CollectionInfo) - GOOGLE_DCHECK_NE(&from, this); - const CollectionInfo* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.CollectionInfo) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.CollectionInfo) - MergeFrom(*source); - } -} - -void CollectionInfo::MergeFrom(const CollectionInfo& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.CollectionInfo) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.json_info().size() > 0) { - - json_info_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.json_info_); - } - if (from.has_status()) { - mutable_status()->::milvus::grpc::Status::MergeFrom(from.status()); - } -} - -void CollectionInfo::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.CollectionInfo) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void CollectionInfo::CopyFrom(const CollectionInfo& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.CollectionInfo) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool CollectionInfo::IsInitialized() const { - return true; -} - -void CollectionInfo::InternalSwap(CollectionInfo* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - json_info_.Swap(&other->json_info_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(status_, other->status_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata CollectionInfo::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void GetEntityIDsParam::InitAsDefaultInstance() { -} -class GetEntityIDsParam::_Internal { - public: -}; - -GetEntityIDsParam::GetEntityIDsParam() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.GetEntityIDsParam) -} -GetEntityIDsParam::GetEntityIDsParam(const GetEntityIDsParam& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.collection_name().empty()) { - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - segment_id_ = from.segment_id_; - // @@protoc_insertion_point(copy_constructor:milvus.grpc.GetEntityIDsParam) -} - -void GetEntityIDsParam::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_GetEntityIDsParam_message_2eproto.base); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - segment_id_ = PROTOBUF_LONGLONG(0); -} - -GetEntityIDsParam::~GetEntityIDsParam() { - // @@protoc_insertion_point(destructor:milvus.grpc.GetEntityIDsParam) - SharedDtor(); -} - -void GetEntityIDsParam::SharedDtor() { - collection_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void GetEntityIDsParam::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const GetEntityIDsParam& GetEntityIDsParam::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_GetEntityIDsParam_message_2eproto.base); - return *internal_default_instance(); -} - - -void GetEntityIDsParam::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.GetEntityIDsParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - segment_id_ = PROTOBUF_LONGLONG(0); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* GetEntityIDsParam::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string collection_name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_collection_name(), ptr, ctx, "milvus.grpc.GetEntityIDsParam.collection_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 segment_id = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - segment_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool GetEntityIDsParam::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.GetEntityIDsParam) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string collection_name = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_collection_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.GetEntityIDsParam.collection_name")); - } else { - goto handle_unusual; - } - break; - } - - // int64 segment_id = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &segment_id_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.GetEntityIDsParam) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.GetEntityIDsParam) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void GetEntityIDsParam::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.GetEntityIDsParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.GetEntityIDsParam.collection_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->collection_name(), output); - } - - // int64 segment_id = 2; - if (this->segment_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(2, this->segment_id(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.GetEntityIDsParam) -} - -::PROTOBUF_NAMESPACE_ID::uint8* GetEntityIDsParam::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.GetEntityIDsParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.GetEntityIDsParam.collection_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->collection_name(), target); - } - - // int64 segment_id = 2; - if (this->segment_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->segment_id(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.GetEntityIDsParam) - return target; -} - -size_t GetEntityIDsParam::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.GetEntityIDsParam) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_name()); - } - - // int64 segment_id = 2; - if (this->segment_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->segment_id()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void GetEntityIDsParam::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.GetEntityIDsParam) - GOOGLE_DCHECK_NE(&from, this); - const GetEntityIDsParam* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.GetEntityIDsParam) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.GetEntityIDsParam) - MergeFrom(*source); - } -} - -void GetEntityIDsParam::MergeFrom(const GetEntityIDsParam& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.GetEntityIDsParam) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.collection_name().size() > 0) { - - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - if (from.segment_id() != 0) { - set_segment_id(from.segment_id()); - } -} - -void GetEntityIDsParam::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.GetEntityIDsParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void GetEntityIDsParam::CopyFrom(const GetEntityIDsParam& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.GetEntityIDsParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool GetEntityIDsParam::IsInitialized() const { - return true; -} - -void GetEntityIDsParam::InternalSwap(GetEntityIDsParam* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - collection_name_.Swap(&other->collection_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(segment_id_, other->segment_id_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata GetEntityIDsParam::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void EntityIdentity::InitAsDefaultInstance() { -} -class EntityIdentity::_Internal { - public: -}; - -EntityIdentity::EntityIdentity() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.EntityIdentity) -} -EntityIdentity::EntityIdentity(const EntityIdentity& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - id_array_(from.id_array_), - field_names_(from.field_names_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.collection_name().empty()) { - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.EntityIdentity) -} - -void EntityIdentity::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_EntityIdentity_message_2eproto.base); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -EntityIdentity::~EntityIdentity() { - // @@protoc_insertion_point(destructor:milvus.grpc.EntityIdentity) - SharedDtor(); -} - -void EntityIdentity::SharedDtor() { - collection_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void EntityIdentity::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const EntityIdentity& EntityIdentity::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_EntityIdentity_message_2eproto.base); - return *internal_default_instance(); -} - - -void EntityIdentity::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.EntityIdentity) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - id_array_.Clear(); - field_names_.Clear(); - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* EntityIdentity::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string collection_name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_collection_name(), ptr, ctx, "milvus.grpc.EntityIdentity.collection_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated int64 id_array = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(mutable_id_array(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16) { - add_id_array(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated string field_names = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr -= 1; - do { - ptr += 1; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_field_names(), ptr, ctx, "milvus.grpc.EntityIdentity.field_names"); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 26); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool EntityIdentity::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.EntityIdentity) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string collection_name = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_collection_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.EntityIdentity.collection_name")); - } else { - goto handle_unusual; - } - break; - } - - // repeated int64 id_array = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, this->mutable_id_array()))); - } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - 1, 18u, input, this->mutable_id_array()))); - } else { - goto handle_unusual; - } - break; - } - - // repeated string field_names = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->add_field_names())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_names(this->field_names_size() - 1).data(), - static_cast(this->field_names(this->field_names_size() - 1).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.EntityIdentity.field_names")); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.EntityIdentity) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.EntityIdentity) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void EntityIdentity::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.EntityIdentity) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.EntityIdentity.collection_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->collection_name(), output); - } - - // repeated int64 id_array = 2; - if (this->id_array_size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(2, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); - output->WriteVarint32(_id_array_cached_byte_size_.load( - std::memory_order_relaxed)); - } - for (int i = 0, n = this->id_array_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64NoTag( - this->id_array(i), output); - } - - // repeated string field_names = 3; - for (int i = 0, n = this->field_names_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_names(i).data(), static_cast(this->field_names(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.EntityIdentity.field_names"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString( - 3, this->field_names(i), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.EntityIdentity) -} - -::PROTOBUF_NAMESPACE_ID::uint8* EntityIdentity::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.EntityIdentity) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.EntityIdentity.collection_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->collection_name(), target); - } - - // repeated int64 id_array = 2; - if (this->id_array_size() > 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( - 2, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, - target); - target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( - _id_array_cached_byte_size_.load(std::memory_order_relaxed), - target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteInt64NoTagToArray(this->id_array_, target); - } - - // repeated string field_names = 3; - for (int i = 0, n = this->field_names_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_names(i).data(), static_cast(this->field_names(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.EntityIdentity.field_names"); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteStringToArray(3, this->field_names(i), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.EntityIdentity) - return target; -} - -size_t EntityIdentity::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.EntityIdentity) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated int64 id_array = 2; - { - size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - Int64Size(this->id_array_); - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _id_array_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // repeated string field_names = 3; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->field_names_size()); - for (int i = 0, n = this->field_names_size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->field_names(i)); - } - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_name()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void EntityIdentity::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.EntityIdentity) - GOOGLE_DCHECK_NE(&from, this); - const EntityIdentity* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.EntityIdentity) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.EntityIdentity) - MergeFrom(*source); - } -} - -void EntityIdentity::MergeFrom(const EntityIdentity& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.EntityIdentity) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - id_array_.MergeFrom(from.id_array_); - field_names_.MergeFrom(from.field_names_); - if (from.collection_name().size() > 0) { - - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } -} - -void EntityIdentity::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.EntityIdentity) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void EntityIdentity::CopyFrom(const EntityIdentity& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.EntityIdentity) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool EntityIdentity::IsInitialized() const { - return true; -} - -void EntityIdentity::InternalSwap(EntityIdentity* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - id_array_.InternalSwap(&other->id_array_); - field_names_.InternalSwap(CastToBase(&other->field_names_)); - collection_name_.Swap(&other->collection_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} - -::PROTOBUF_NAMESPACE_ID::Metadata EntityIdentity::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void VectorFieldParam::InitAsDefaultInstance() { -} -class VectorFieldParam::_Internal { - public: -}; - -VectorFieldParam::VectorFieldParam() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.VectorFieldParam) -} -VectorFieldParam::VectorFieldParam(const VectorFieldParam& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - dimension_ = from.dimension_; - // @@protoc_insertion_point(copy_constructor:milvus.grpc.VectorFieldParam) -} - -void VectorFieldParam::SharedCtor() { - dimension_ = PROTOBUF_LONGLONG(0); -} - -VectorFieldParam::~VectorFieldParam() { - // @@protoc_insertion_point(destructor:milvus.grpc.VectorFieldParam) - SharedDtor(); -} - -void VectorFieldParam::SharedDtor() { -} - -void VectorFieldParam::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const VectorFieldParam& VectorFieldParam::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_VectorFieldParam_message_2eproto.base); - return *internal_default_instance(); -} - - -void VectorFieldParam::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.VectorFieldParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - dimension_ = PROTOBUF_LONGLONG(0); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* VectorFieldParam::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // int64 dimension = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - dimension_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool VectorFieldParam::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.VectorFieldParam) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // int64 dimension = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &dimension_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.VectorFieldParam) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.VectorFieldParam) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void VectorFieldParam::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.VectorFieldParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // int64 dimension = 1; - if (this->dimension() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(1, this->dimension(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.VectorFieldParam) -} - -::PROTOBUF_NAMESPACE_ID::uint8* VectorFieldParam::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.VectorFieldParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // int64 dimension = 1; - if (this->dimension() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->dimension(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.VectorFieldParam) - return target; -} - -size_t VectorFieldParam::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.VectorFieldParam) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // int64 dimension = 1; - if (this->dimension() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->dimension()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void VectorFieldParam::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.VectorFieldParam) - GOOGLE_DCHECK_NE(&from, this); - const VectorFieldParam* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.VectorFieldParam) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.VectorFieldParam) - MergeFrom(*source); - } -} - -void VectorFieldParam::MergeFrom(const VectorFieldParam& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.VectorFieldParam) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.dimension() != 0) { - set_dimension(from.dimension()); - } -} - -void VectorFieldParam::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.VectorFieldParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void VectorFieldParam::CopyFrom(const VectorFieldParam& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.VectorFieldParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool VectorFieldParam::IsInitialized() const { - return true; -} - -void VectorFieldParam::InternalSwap(VectorFieldParam* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(dimension_, other->dimension_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata VectorFieldParam::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void FieldType::InitAsDefaultInstance() { - ::milvus::grpc::_FieldType_default_instance_.data_type_ = 0; - ::milvus::grpc::_FieldType_default_instance_.vector_param_ = const_cast< ::milvus::grpc::VectorFieldParam*>( - ::milvus::grpc::VectorFieldParam::internal_default_instance()); -} -class FieldType::_Internal { - public: - static const ::milvus::grpc::VectorFieldParam& vector_param(const FieldType* msg); -}; - -const ::milvus::grpc::VectorFieldParam& -FieldType::_Internal::vector_param(const FieldType* msg) { - return *msg->value_.vector_param_; -} -void FieldType::set_allocated_vector_param(::milvus::grpc::VectorFieldParam* vector_param) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - clear_value(); - if (vector_param) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - vector_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, vector_param, submessage_arena); - } - set_has_vector_param(); - value_.vector_param_ = vector_param; - } - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.FieldType.vector_param) -} -FieldType::FieldType() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.FieldType) -} -FieldType::FieldType(const FieldType& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - clear_has_value(); - switch (from.value_case()) { - case kDataType: { - set_data_type(from.data_type()); - break; - } - case kVectorParam: { - mutable_vector_param()->::milvus::grpc::VectorFieldParam::MergeFrom(from.vector_param()); - break; - } - case VALUE_NOT_SET: { - break; - } - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.FieldType) -} - -void FieldType::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_FieldType_message_2eproto.base); - clear_has_value(); -} - -FieldType::~FieldType() { - // @@protoc_insertion_point(destructor:milvus.grpc.FieldType) - SharedDtor(); -} - -void FieldType::SharedDtor() { - if (has_value()) { - clear_value(); - } -} - -void FieldType::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const FieldType& FieldType::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_FieldType_message_2eproto.base); - return *internal_default_instance(); -} - - -void FieldType::clear_value() { -// @@protoc_insertion_point(one_of_clear_start:milvus.grpc.FieldType) - switch (value_case()) { - case kDataType: { - // No need to clear - break; - } - case kVectorParam: { - delete value_.vector_param_; - break; - } - case VALUE_NOT_SET: { - break; - } - } - _oneof_case_[0] = VALUE_NOT_SET; -} - - -void FieldType::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.FieldType) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - clear_value(); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* FieldType::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.DataType data_type = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - set_data_type(static_cast<::milvus::grpc::DataType>(val)); - } else goto handle_unusual; - continue; - // .milvus.grpc.VectorFieldParam vector_param = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(mutable_vector_param(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool FieldType::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.FieldType) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.DataType data_type = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { - int value = 0; - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - set_data_type(static_cast< ::milvus::grpc::DataType >(value)); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.VectorFieldParam vector_param = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_vector_param())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.FieldType) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.FieldType) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void FieldType::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.FieldType) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.DataType data_type = 1; - if (has_data_type()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( - 1, this->data_type(), output); - } - - // .milvus.grpc.VectorFieldParam vector_param = 2; - if (has_vector_param()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, _Internal::vector_param(this), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.FieldType) -} - -::PROTOBUF_NAMESPACE_ID::uint8* FieldType::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.FieldType) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.DataType data_type = 1; - if (has_data_type()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 1, this->data_type(), target); - } - - // .milvus.grpc.VectorFieldParam vector_param = 2; - if (has_vector_param()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 2, _Internal::vector_param(this), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.FieldType) - return target; -} - -size_t FieldType::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.FieldType) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - switch (value_case()) { - // .milvus.grpc.DataType data_type = 1; - case kDataType: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->data_type()); - break; - } - // .milvus.grpc.VectorFieldParam vector_param = 2; - case kVectorParam: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *value_.vector_param_); - break; - } - case VALUE_NOT_SET: { - break; - } - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void FieldType::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.FieldType) - GOOGLE_DCHECK_NE(&from, this); - const FieldType* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.FieldType) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.FieldType) - MergeFrom(*source); - } -} - -void FieldType::MergeFrom(const FieldType& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.FieldType) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - switch (from.value_case()) { - case kDataType: { - set_data_type(from.data_type()); - break; - } - case kVectorParam: { - mutable_vector_param()->::milvus::grpc::VectorFieldParam::MergeFrom(from.vector_param()); - break; - } - case VALUE_NOT_SET: { - break; - } - } -} - -void FieldType::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.FieldType) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void FieldType::CopyFrom(const FieldType& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.FieldType) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool FieldType::IsInitialized() const { - return true; -} - -void FieldType::InternalSwap(FieldType* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(value_, other->value_); - swap(_oneof_case_[0], other->_oneof_case_[0]); -} - -::PROTOBUF_NAMESPACE_ID::Metadata FieldType::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void FieldParam::InitAsDefaultInstance() { -} -class FieldParam::_Internal { - public: -}; - -FieldParam::FieldParam() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.FieldParam) -} -FieldParam::FieldParam(const FieldParam& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - index_params_(from.index_params_), - extra_params_(from.extra_params_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.name().empty()) { - name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_); - } - ::memcpy(&id_, &from.id_, - static_cast(reinterpret_cast(&type_) - - reinterpret_cast(&id_)) + sizeof(type_)); - // @@protoc_insertion_point(copy_constructor:milvus.grpc.FieldParam) -} - -void FieldParam::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_FieldParam_message_2eproto.base); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&id_, 0, static_cast( - reinterpret_cast(&type_) - - reinterpret_cast(&id_)) + sizeof(type_)); -} - -FieldParam::~FieldParam() { - // @@protoc_insertion_point(destructor:milvus.grpc.FieldParam) - SharedDtor(); -} - -void FieldParam::SharedDtor() { - name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void FieldParam::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const FieldParam& FieldParam::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_FieldParam_message_2eproto.base); - return *internal_default_instance(); -} - - -void FieldParam::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.FieldParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - index_params_.Clear(); - extra_params_.Clear(); - name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&id_, 0, static_cast( - reinterpret_cast(&type_) - - reinterpret_cast(&id_)) + sizeof(type_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* FieldParam::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // uint64 id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string name = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_name(), ptr, ctx, "milvus.grpc.FieldParam.name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .milvus.grpc.DataType type = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - set_type(static_cast<::milvus::grpc::DataType>(val)); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.KeyValuePair index_params = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_index_params(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 34); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_extra_params(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 42); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool FieldParam::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.FieldParam) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // uint64 id = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &id_))); - } else { - goto handle_unusual; - } - break; - } - - // string name = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), static_cast(this->name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.FieldParam.name")); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.DataType type = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { - int value = 0; - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - set_type(static_cast< ::milvus::grpc::DataType >(value)); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.KeyValuePair index_params = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_index_params())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_extra_params())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.FieldParam) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.FieldParam) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void FieldParam::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.FieldParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint64 id = 1; - if (this->id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(1, this->id(), output); - } - - // string name = 2; - if (this->name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), static_cast(this->name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.FieldParam.name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 2, this->name(), output); - } - - // .milvus.grpc.DataType type = 3; - if (this->type() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( - 3, this->type(), output); - } - - // repeated .milvus.grpc.KeyValuePair index_params = 4; - for (unsigned int i = 0, - n = static_cast(this->index_params_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 4, - this->index_params(static_cast(i)), - output); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 5, - this->extra_params(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.FieldParam) -} - -::PROTOBUF_NAMESPACE_ID::uint8* FieldParam::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.FieldParam) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint64 id = 1; - if (this->id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->id(), target); - } - - // string name = 2; - if (this->name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->name().data(), static_cast(this->name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.FieldParam.name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 2, this->name(), target); - } - - // .milvus.grpc.DataType type = 3; - if (this->type() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 3, this->type(), target); - } - - // repeated .milvus.grpc.KeyValuePair index_params = 4; - for (unsigned int i = 0, - n = static_cast(this->index_params_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 4, this->index_params(static_cast(i)), target); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 5, this->extra_params(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.FieldParam) - return target; -} - -size_t FieldParam::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.FieldParam) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .milvus.grpc.KeyValuePair index_params = 4; - { - unsigned int count = static_cast(this->index_params_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->index_params(static_cast(i))); - } - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - { - unsigned int count = static_cast(this->extra_params_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->extra_params(static_cast(i))); - } - } - - // string name = 2; - if (this->name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->name()); - } - - // uint64 id = 1; - if (this->id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->id()); - } - - // .milvus.grpc.DataType type = 3; - if (this->type() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->type()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void FieldParam::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.FieldParam) - GOOGLE_DCHECK_NE(&from, this); - const FieldParam* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.FieldParam) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.FieldParam) - MergeFrom(*source); - } -} - -void FieldParam::MergeFrom(const FieldParam& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.FieldParam) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - index_params_.MergeFrom(from.index_params_); - extra_params_.MergeFrom(from.extra_params_); - if (from.name().size() > 0) { - - name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_); - } - if (from.id() != 0) { - set_id(from.id()); - } - if (from.type() != 0) { - set_type(from.type()); - } -} - -void FieldParam::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.FieldParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void FieldParam::CopyFrom(const FieldParam& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.FieldParam) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool FieldParam::IsInitialized() const { - return true; -} - -void FieldParam::InternalSwap(FieldParam* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&index_params_)->InternalSwap(CastToBase(&other->index_params_)); - CastToBase(&extra_params_)->InternalSwap(CastToBase(&other->extra_params_)); - name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(id_, other->id_); - swap(type_, other->type_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata FieldParam::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void VectorFieldRecord::InitAsDefaultInstance() { -} -class VectorFieldRecord::_Internal { - public: -}; - -VectorFieldRecord::VectorFieldRecord() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.VectorFieldRecord) -} -VectorFieldRecord::VectorFieldRecord(const VectorFieldRecord& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - value_(from.value_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:milvus.grpc.VectorFieldRecord) -} - -void VectorFieldRecord::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_VectorFieldRecord_message_2eproto.base); -} - -VectorFieldRecord::~VectorFieldRecord() { - // @@protoc_insertion_point(destructor:milvus.grpc.VectorFieldRecord) - SharedDtor(); -} - -void VectorFieldRecord::SharedDtor() { -} - -void VectorFieldRecord::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const VectorFieldRecord& VectorFieldRecord::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_VectorFieldRecord_message_2eproto.base); - return *internal_default_instance(); -} - - -void VectorFieldRecord::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.VectorFieldRecord) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - value_.Clear(); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* VectorFieldRecord::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // repeated .milvus.grpc.VectorRowRecord value = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_value(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool VectorFieldRecord::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.VectorFieldRecord) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated .milvus.grpc.VectorRowRecord value = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_value())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.VectorFieldRecord) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.VectorFieldRecord) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void VectorFieldRecord::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.VectorFieldRecord) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated .milvus.grpc.VectorRowRecord value = 1; - for (unsigned int i = 0, - n = static_cast(this->value_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, - this->value(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.VectorFieldRecord) -} - -::PROTOBUF_NAMESPACE_ID::uint8* VectorFieldRecord::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.VectorFieldRecord) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated .milvus.grpc.VectorRowRecord value = 1; - for (unsigned int i = 0, - n = static_cast(this->value_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, this->value(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.VectorFieldRecord) - return target; -} - -size_t VectorFieldRecord::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.VectorFieldRecord) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .milvus.grpc.VectorRowRecord value = 1; - { - unsigned int count = static_cast(this->value_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->value(static_cast(i))); - } - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void VectorFieldRecord::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.VectorFieldRecord) - GOOGLE_DCHECK_NE(&from, this); - const VectorFieldRecord* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.VectorFieldRecord) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.VectorFieldRecord) - MergeFrom(*source); - } -} - -void VectorFieldRecord::MergeFrom(const VectorFieldRecord& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.VectorFieldRecord) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - value_.MergeFrom(from.value_); -} - -void VectorFieldRecord::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.VectorFieldRecord) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void VectorFieldRecord::CopyFrom(const VectorFieldRecord& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.VectorFieldRecord) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool VectorFieldRecord::IsInitialized() const { - return true; -} - -void VectorFieldRecord::InternalSwap(VectorFieldRecord* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&value_)->InternalSwap(CastToBase(&other->value_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata VectorFieldRecord::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void TermQuery::InitAsDefaultInstance() { -} -class TermQuery::_Internal { - public: -}; - -TermQuery::TermQuery() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.TermQuery) -} -TermQuery::TermQuery(const TermQuery& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - int_value_(from.int_value_), - double_value_(from.double_value_), - extra_params_(from.extra_params_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.field_name().empty()) { - field_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.field_name_); - } - ::memcpy(&value_num_, &from.value_num_, - static_cast(reinterpret_cast(&boost_) - - reinterpret_cast(&value_num_)) + sizeof(boost_)); - // @@protoc_insertion_point(copy_constructor:milvus.grpc.TermQuery) -} - -void TermQuery::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TermQuery_message_2eproto.base); - field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&value_num_, 0, static_cast( - reinterpret_cast(&boost_) - - reinterpret_cast(&value_num_)) + sizeof(boost_)); -} - -TermQuery::~TermQuery() { - // @@protoc_insertion_point(destructor:milvus.grpc.TermQuery) - SharedDtor(); -} - -void TermQuery::SharedDtor() { - field_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void TermQuery::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const TermQuery& TermQuery::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TermQuery_message_2eproto.base); - return *internal_default_instance(); -} - - -void TermQuery::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.TermQuery) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - int_value_.Clear(); - double_value_.Clear(); - extra_params_.Clear(); - field_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&value_num_, 0, static_cast( - reinterpret_cast(&boost_) - - reinterpret_cast(&value_num_)) + sizeof(boost_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* TermQuery::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string field_name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_field_name(), ptr, ctx, "milvus.grpc.TermQuery.field_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated int64 int_value = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(mutable_int_value(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16) { - add_int_value(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated double double_value = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(mutable_double_value(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 25) { - add_double_value(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr)); - ptr += sizeof(double); - } else goto handle_unusual; - continue; - // int64 value_num = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - value_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // float boost = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 45)) { - boost_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(float); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_extra_params(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 50); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool TermQuery::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.TermQuery) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string field_name = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_field_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.TermQuery.field_name")); - } else { - goto handle_unusual; - } - break; - } - - // repeated int64 int_value = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, this->mutable_int_value()))); - } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - 1, 18u, input, this->mutable_int_value()))); - } else { - goto handle_unusual; - } - break; - } - - // repeated double double_value = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< - double, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_DOUBLE>( - input, this->mutable_double_value()))); - } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (25 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< - double, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_DOUBLE>( - 1, 26u, input, this->mutable_double_value()))); - } else { - goto handle_unusual; - } - break; - } - - // int64 value_num = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &value_num_))); - } else { - goto handle_unusual; - } - break; - } - - // float boost = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (45 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( - input, &boost_))); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - case 6: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_extra_params())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.TermQuery) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.TermQuery) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void TermQuery::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.TermQuery) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string field_name = 1; - if (this->field_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.TermQuery.field_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->field_name(), output); - } - - // repeated int64 int_value = 2; - if (this->int_value_size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(2, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); - output->WriteVarint32(_int_value_cached_byte_size_.load( - std::memory_order_relaxed)); - } - for (int i = 0, n = this->int_value_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64NoTag( - this->int_value(i), output); - } - - // repeated double double_value = 3; - if (this->double_value_size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(3, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); - output->WriteVarint32(_double_value_cached_byte_size_.load( - std::memory_order_relaxed)); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleArray( - this->double_value().data(), this->double_value_size(), output); - } - - // int64 value_num = 4; - if (this->value_num() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(4, this->value_num(), output); - } - - // float boost = 5; - if (!(this->boost() <= 0 && this->boost() >= 0)) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(5, this->boost(), output); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 6, - this->extra_params(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.TermQuery) -} - -::PROTOBUF_NAMESPACE_ID::uint8* TermQuery::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.TermQuery) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string field_name = 1; - if (this->field_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.TermQuery.field_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->field_name(), target); - } - - // repeated int64 int_value = 2; - if (this->int_value_size() > 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( - 2, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, - target); - target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( - _int_value_cached_byte_size_.load(std::memory_order_relaxed), - target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteInt64NoTagToArray(this->int_value_, target); - } - - // repeated double double_value = 3; - if (this->double_value_size() > 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( - 3, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, - target); - target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( - _double_value_cached_byte_size_.load(std::memory_order_relaxed), - target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteDoubleNoTagToArray(this->double_value_, target); - } - - // int64 value_num = 4; - if (this->value_num() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->value_num(), target); - } - - // float boost = 5; - if (!(this->boost() <= 0 && this->boost() >= 0)) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(5, this->boost(), target); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 6, this->extra_params(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.TermQuery) - return target; -} - -size_t TermQuery::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.TermQuery) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated int64 int_value = 2; - { - size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - Int64Size(this->int_value_); - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _int_value_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // repeated double double_value = 3; - { - unsigned int count = static_cast(this->double_value_size()); - size_t data_size = 8UL * count; - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _double_value_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - { - unsigned int count = static_cast(this->extra_params_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->extra_params(static_cast(i))); - } - } - - // string field_name = 1; - if (this->field_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->field_name()); - } - - // int64 value_num = 4; - if (this->value_num() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->value_num()); - } - - // float boost = 5; - if (!(this->boost() <= 0 && this->boost() >= 0)) { - total_size += 1 + 4; - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void TermQuery::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.TermQuery) - GOOGLE_DCHECK_NE(&from, this); - const TermQuery* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.TermQuery) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.TermQuery) - MergeFrom(*source); - } -} - -void TermQuery::MergeFrom(const TermQuery& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.TermQuery) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - int_value_.MergeFrom(from.int_value_); - double_value_.MergeFrom(from.double_value_); - extra_params_.MergeFrom(from.extra_params_); - if (from.field_name().size() > 0) { - - field_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.field_name_); - } - if (from.value_num() != 0) { - set_value_num(from.value_num()); - } - if (!(from.boost() <= 0 && from.boost() >= 0)) { - set_boost(from.boost()); - } -} - -void TermQuery::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.TermQuery) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void TermQuery::CopyFrom(const TermQuery& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.TermQuery) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool TermQuery::IsInitialized() const { - return true; -} - -void TermQuery::InternalSwap(TermQuery* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - int_value_.InternalSwap(&other->int_value_); - double_value_.InternalSwap(&other->double_value_); - CastToBase(&extra_params_)->InternalSwap(CastToBase(&other->extra_params_)); - field_name_.Swap(&other->field_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(value_num_, other->value_num_); - swap(boost_, other->boost_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata TermQuery::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void CompareExpr::InitAsDefaultInstance() { -} -class CompareExpr::_Internal { - public: -}; - -CompareExpr::CompareExpr() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.CompareExpr) -} -CompareExpr::CompareExpr(const CompareExpr& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - operand_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.operand().empty()) { - operand_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.operand_); - } - operator__ = from.operator__; - // @@protoc_insertion_point(copy_constructor:milvus.grpc.CompareExpr) -} - -void CompareExpr::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_CompareExpr_message_2eproto.base); - operand_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - operator__ = 0; -} - -CompareExpr::~CompareExpr() { - // @@protoc_insertion_point(destructor:milvus.grpc.CompareExpr) - SharedDtor(); -} - -void CompareExpr::SharedDtor() { - operand_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void CompareExpr::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const CompareExpr& CompareExpr::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_CompareExpr_message_2eproto.base); - return *internal_default_instance(); -} - - -void CompareExpr::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.CompareExpr) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - operand_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - operator__ = 0; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* CompareExpr::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.CompareOperator operator = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - set_operator_(static_cast<::milvus::grpc::CompareOperator>(val)); - } else goto handle_unusual; - continue; - // string operand = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_operand(), ptr, ctx, "milvus.grpc.CompareExpr.operand"); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool CompareExpr::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.CompareExpr) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.CompareOperator operator = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { - int value = 0; - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - set_operator_(static_cast< ::milvus::grpc::CompareOperator >(value)); - } else { - goto handle_unusual; - } - break; - } - - // string operand = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_operand())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->operand().data(), static_cast(this->operand().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.CompareExpr.operand")); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.CompareExpr) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.CompareExpr) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void CompareExpr::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.CompareExpr) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.CompareOperator operator = 1; - if (this->operator_() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( - 1, this->operator_(), output); - } - - // string operand = 2; - if (this->operand().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->operand().data(), static_cast(this->operand().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.CompareExpr.operand"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 2, this->operand(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.CompareExpr) -} - -::PROTOBUF_NAMESPACE_ID::uint8* CompareExpr::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.CompareExpr) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.CompareOperator operator = 1; - if (this->operator_() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 1, this->operator_(), target); - } - - // string operand = 2; - if (this->operand().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->operand().data(), static_cast(this->operand().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.CompareExpr.operand"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 2, this->operand(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.CompareExpr) - return target; -} - -size_t CompareExpr::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.CompareExpr) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string operand = 2; - if (this->operand().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->operand()); - } - - // .milvus.grpc.CompareOperator operator = 1; - if (this->operator_() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->operator_()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void CompareExpr::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.CompareExpr) - GOOGLE_DCHECK_NE(&from, this); - const CompareExpr* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.CompareExpr) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.CompareExpr) - MergeFrom(*source); - } -} - -void CompareExpr::MergeFrom(const CompareExpr& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.CompareExpr) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.operand().size() > 0) { - - operand_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.operand_); - } - if (from.operator_() != 0) { - set_operator_(from.operator_()); - } -} - -void CompareExpr::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.CompareExpr) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void CompareExpr::CopyFrom(const CompareExpr& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.CompareExpr) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool CompareExpr::IsInitialized() const { - return true; -} - -void CompareExpr::InternalSwap(CompareExpr* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - operand_.Swap(&other->operand_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(operator__, other->operator__); -} - -::PROTOBUF_NAMESPACE_ID::Metadata CompareExpr::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void RangeQuery::InitAsDefaultInstance() { -} -class RangeQuery::_Internal { - public: -}; - -RangeQuery::RangeQuery() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.RangeQuery) -} -RangeQuery::RangeQuery(const RangeQuery& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - operand_(from.operand_), - extra_params_(from.extra_params_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.field_name().empty()) { - field_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.field_name_); - } - boost_ = from.boost_; - // @@protoc_insertion_point(copy_constructor:milvus.grpc.RangeQuery) -} - -void RangeQuery::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_RangeQuery_message_2eproto.base); - field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - boost_ = 0; -} - -RangeQuery::~RangeQuery() { - // @@protoc_insertion_point(destructor:milvus.grpc.RangeQuery) - SharedDtor(); -} - -void RangeQuery::SharedDtor() { - field_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void RangeQuery::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const RangeQuery& RangeQuery::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RangeQuery_message_2eproto.base); - return *internal_default_instance(); -} - - -void RangeQuery::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.RangeQuery) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - operand_.Clear(); - extra_params_.Clear(); - field_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - boost_ = 0; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* RangeQuery::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string field_name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_field_name(), ptr, ctx, "milvus.grpc.RangeQuery.field_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.CompareExpr operand = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_operand(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18); - } else goto handle_unusual; - continue; - // float boost = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 29)) { - boost_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(float); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_extra_params(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 34); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool RangeQuery::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.RangeQuery) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string field_name = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_field_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.RangeQuery.field_name")); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.CompareExpr operand = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_operand())); - } else { - goto handle_unusual; - } - break; - } - - // float boost = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (29 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( - input, &boost_))); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_extra_params())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.RangeQuery) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.RangeQuery) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void RangeQuery::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.RangeQuery) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string field_name = 1; - if (this->field_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.RangeQuery.field_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->field_name(), output); - } - - // repeated .milvus.grpc.CompareExpr operand = 2; - for (unsigned int i = 0, - n = static_cast(this->operand_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, - this->operand(static_cast(i)), - output); - } - - // float boost = 3; - if (!(this->boost() <= 0 && this->boost() >= 0)) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(3, this->boost(), output); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 4, - this->extra_params(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.RangeQuery) -} - -::PROTOBUF_NAMESPACE_ID::uint8* RangeQuery::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.RangeQuery) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string field_name = 1; - if (this->field_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.RangeQuery.field_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->field_name(), target); - } - - // repeated .milvus.grpc.CompareExpr operand = 2; - for (unsigned int i = 0, - n = static_cast(this->operand_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 2, this->operand(static_cast(i)), target); - } - - // float boost = 3; - if (!(this->boost() <= 0 && this->boost() >= 0)) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->boost(), target); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 4, this->extra_params(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.RangeQuery) - return target; -} - -size_t RangeQuery::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.RangeQuery) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .milvus.grpc.CompareExpr operand = 2; - { - unsigned int count = static_cast(this->operand_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->operand(static_cast(i))); - } - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - { - unsigned int count = static_cast(this->extra_params_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->extra_params(static_cast(i))); - } - } - - // string field_name = 1; - if (this->field_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->field_name()); - } - - // float boost = 3; - if (!(this->boost() <= 0 && this->boost() >= 0)) { - total_size += 1 + 4; - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void RangeQuery::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.RangeQuery) - GOOGLE_DCHECK_NE(&from, this); - const RangeQuery* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.RangeQuery) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.RangeQuery) - MergeFrom(*source); - } -} - -void RangeQuery::MergeFrom(const RangeQuery& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.RangeQuery) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - operand_.MergeFrom(from.operand_); - extra_params_.MergeFrom(from.extra_params_); - if (from.field_name().size() > 0) { - - field_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.field_name_); - } - if (!(from.boost() <= 0 && from.boost() >= 0)) { - set_boost(from.boost()); - } -} - -void RangeQuery::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.RangeQuery) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void RangeQuery::CopyFrom(const RangeQuery& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.RangeQuery) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool RangeQuery::IsInitialized() const { - return true; -} - -void RangeQuery::InternalSwap(RangeQuery* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&operand_)->InternalSwap(CastToBase(&other->operand_)); - CastToBase(&extra_params_)->InternalSwap(CastToBase(&other->extra_params_)); - field_name_.Swap(&other->field_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(boost_, other->boost_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata RangeQuery::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void VectorQuery::InitAsDefaultInstance() { -} -class VectorQuery::_Internal { - public: -}; - -VectorQuery::VectorQuery() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.VectorQuery) -} -VectorQuery::VectorQuery(const VectorQuery& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - records_(from.records_), - extra_params_(from.extra_params_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.field_name().empty()) { - field_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.field_name_); - } - ::memcpy(&topk_, &from.topk_, - static_cast(reinterpret_cast(&query_boost_) - - reinterpret_cast(&topk_)) + sizeof(query_boost_)); - // @@protoc_insertion_point(copy_constructor:milvus.grpc.VectorQuery) -} - -void VectorQuery::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_VectorQuery_message_2eproto.base); - field_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&topk_, 0, static_cast( - reinterpret_cast(&query_boost_) - - reinterpret_cast(&topk_)) + sizeof(query_boost_)); -} - -VectorQuery::~VectorQuery() { - // @@protoc_insertion_point(destructor:milvus.grpc.VectorQuery) - SharedDtor(); -} - -void VectorQuery::SharedDtor() { - field_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void VectorQuery::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const VectorQuery& VectorQuery::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_VectorQuery_message_2eproto.base); - return *internal_default_instance(); -} - - -void VectorQuery::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.VectorQuery) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - records_.Clear(); - extra_params_.Clear(); - field_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&topk_, 0, static_cast( - reinterpret_cast(&query_boost_) - - reinterpret_cast(&topk_)) + sizeof(query_boost_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* VectorQuery::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string field_name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_field_name(), ptr, ctx, "milvus.grpc.VectorQuery.field_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // float query_boost = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 21)) { - query_boost_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(float); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.VectorRowRecord records = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_records(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 26); - } else goto handle_unusual; - continue; - // int64 topk = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - topk_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_extra_params(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 42); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool VectorQuery::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.VectorQuery) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string field_name = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_field_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.VectorQuery.field_name")); - } else { - goto handle_unusual; - } - break; - } - - // float query_boost = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (21 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( - input, &query_boost_))); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.VectorRowRecord records = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_records())); - } else { - goto handle_unusual; - } - break; - } - - // int64 topk = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &topk_))); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_extra_params())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.VectorQuery) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.VectorQuery) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void VectorQuery::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.VectorQuery) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string field_name = 1; - if (this->field_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.VectorQuery.field_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->field_name(), output); - } - - // float query_boost = 2; - if (!(this->query_boost() <= 0 && this->query_boost() >= 0)) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(2, this->query_boost(), output); - } - - // repeated .milvus.grpc.VectorRowRecord records = 3; - for (unsigned int i = 0, - n = static_cast(this->records_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 3, - this->records(static_cast(i)), - output); - } - - // int64 topk = 4; - if (this->topk() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(4, this->topk(), output); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 5, - this->extra_params(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.VectorQuery) -} - -::PROTOBUF_NAMESPACE_ID::uint8* VectorQuery::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.VectorQuery) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string field_name = 1; - if (this->field_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->field_name().data(), static_cast(this->field_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.VectorQuery.field_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->field_name(), target); - } - - // float query_boost = 2; - if (!(this->query_boost() <= 0 && this->query_boost() >= 0)) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->query_boost(), target); - } - - // repeated .milvus.grpc.VectorRowRecord records = 3; - for (unsigned int i = 0, - n = static_cast(this->records_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 3, this->records(static_cast(i)), target); - } - - // int64 topk = 4; - if (this->topk() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->topk(), target); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 5, this->extra_params(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.VectorQuery) - return target; -} - -size_t VectorQuery::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.VectorQuery) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .milvus.grpc.VectorRowRecord records = 3; - { - unsigned int count = static_cast(this->records_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->records(static_cast(i))); - } - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - { - unsigned int count = static_cast(this->extra_params_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->extra_params(static_cast(i))); - } - } - - // string field_name = 1; - if (this->field_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->field_name()); - } - - // int64 topk = 4; - if (this->topk() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->topk()); - } - - // float query_boost = 2; - if (!(this->query_boost() <= 0 && this->query_boost() >= 0)) { - total_size += 1 + 4; - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void VectorQuery::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.VectorQuery) - GOOGLE_DCHECK_NE(&from, this); - const VectorQuery* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.VectorQuery) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.VectorQuery) - MergeFrom(*source); - } -} - -void VectorQuery::MergeFrom(const VectorQuery& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.VectorQuery) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - records_.MergeFrom(from.records_); - extra_params_.MergeFrom(from.extra_params_); - if (from.field_name().size() > 0) { - - field_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.field_name_); - } - if (from.topk() != 0) { - set_topk(from.topk()); - } - if (!(from.query_boost() <= 0 && from.query_boost() >= 0)) { - set_query_boost(from.query_boost()); - } -} - -void VectorQuery::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.VectorQuery) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void VectorQuery::CopyFrom(const VectorQuery& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.VectorQuery) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool VectorQuery::IsInitialized() const { - return true; -} - -void VectorQuery::InternalSwap(VectorQuery* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&records_)->InternalSwap(CastToBase(&other->records_)); - CastToBase(&extra_params_)->InternalSwap(CastToBase(&other->extra_params_)); - field_name_.Swap(&other->field_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(topk_, other->topk_); - swap(query_boost_, other->query_boost_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata VectorQuery::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void BooleanQuery::InitAsDefaultInstance() { -} -class BooleanQuery::_Internal { - public: -}; - -BooleanQuery::BooleanQuery() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.BooleanQuery) -} -BooleanQuery::BooleanQuery(const BooleanQuery& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - general_query_(from.general_query_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - occur_ = from.occur_; - // @@protoc_insertion_point(copy_constructor:milvus.grpc.BooleanQuery) -} - -void BooleanQuery::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_BooleanQuery_message_2eproto.base); - occur_ = 0; -} - -BooleanQuery::~BooleanQuery() { - // @@protoc_insertion_point(destructor:milvus.grpc.BooleanQuery) - SharedDtor(); -} - -void BooleanQuery::SharedDtor() { -} - -void BooleanQuery::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const BooleanQuery& BooleanQuery::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_BooleanQuery_message_2eproto.base); - return *internal_default_instance(); -} - - -void BooleanQuery::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.BooleanQuery) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - general_query_.Clear(); - occur_ = 0; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* BooleanQuery::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.Occur occur = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - set_occur(static_cast<::milvus::grpc::Occur>(val)); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.GeneralQuery general_query = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_general_query(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool BooleanQuery::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.BooleanQuery) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.Occur occur = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { - int value = 0; - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - set_occur(static_cast< ::milvus::grpc::Occur >(value)); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.GeneralQuery general_query = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_general_query())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.BooleanQuery) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.BooleanQuery) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void BooleanQuery::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.BooleanQuery) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Occur occur = 1; - if (this->occur() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( - 1, this->occur(), output); - } - - // repeated .milvus.grpc.GeneralQuery general_query = 2; - for (unsigned int i = 0, - n = static_cast(this->general_query_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, - this->general_query(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.BooleanQuery) -} - -::PROTOBUF_NAMESPACE_ID::uint8* BooleanQuery::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.BooleanQuery) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.Occur occur = 1; - if (this->occur() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 1, this->occur(), target); - } - - // repeated .milvus.grpc.GeneralQuery general_query = 2; - for (unsigned int i = 0, - n = static_cast(this->general_query_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 2, this->general_query(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.BooleanQuery) - return target; -} - -size_t BooleanQuery::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.BooleanQuery) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .milvus.grpc.GeneralQuery general_query = 2; - { - unsigned int count = static_cast(this->general_query_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->general_query(static_cast(i))); - } - } - - // .milvus.grpc.Occur occur = 1; - if (this->occur() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->occur()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void BooleanQuery::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.BooleanQuery) - GOOGLE_DCHECK_NE(&from, this); - const BooleanQuery* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.BooleanQuery) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.BooleanQuery) - MergeFrom(*source); - } -} - -void BooleanQuery::MergeFrom(const BooleanQuery& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.BooleanQuery) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - general_query_.MergeFrom(from.general_query_); - if (from.occur() != 0) { - set_occur(from.occur()); - } -} - -void BooleanQuery::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.BooleanQuery) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void BooleanQuery::CopyFrom(const BooleanQuery& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.BooleanQuery) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool BooleanQuery::IsInitialized() const { - return true; -} - -void BooleanQuery::InternalSwap(BooleanQuery* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&general_query_)->InternalSwap(CastToBase(&other->general_query_)); - swap(occur_, other->occur_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata BooleanQuery::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void GeneralQuery::InitAsDefaultInstance() { - ::milvus::grpc::_GeneralQuery_default_instance_.boolean_query_ = const_cast< ::milvus::grpc::BooleanQuery*>( - ::milvus::grpc::BooleanQuery::internal_default_instance()); - ::milvus::grpc::_GeneralQuery_default_instance_.term_query_ = const_cast< ::milvus::grpc::TermQuery*>( - ::milvus::grpc::TermQuery::internal_default_instance()); - ::milvus::grpc::_GeneralQuery_default_instance_.range_query_ = const_cast< ::milvus::grpc::RangeQuery*>( - ::milvus::grpc::RangeQuery::internal_default_instance()); - ::milvus::grpc::_GeneralQuery_default_instance_.vector_query_ = const_cast< ::milvus::grpc::VectorQuery*>( - ::milvus::grpc::VectorQuery::internal_default_instance()); -} -class GeneralQuery::_Internal { - public: - static const ::milvus::grpc::BooleanQuery& boolean_query(const GeneralQuery* msg); - static const ::milvus::grpc::TermQuery& term_query(const GeneralQuery* msg); - static const ::milvus::grpc::RangeQuery& range_query(const GeneralQuery* msg); - static const ::milvus::grpc::VectorQuery& vector_query(const GeneralQuery* msg); -}; - -const ::milvus::grpc::BooleanQuery& -GeneralQuery::_Internal::boolean_query(const GeneralQuery* msg) { - return *msg->query_.boolean_query_; -} -const ::milvus::grpc::TermQuery& -GeneralQuery::_Internal::term_query(const GeneralQuery* msg) { - return *msg->query_.term_query_; -} -const ::milvus::grpc::RangeQuery& -GeneralQuery::_Internal::range_query(const GeneralQuery* msg) { - return *msg->query_.range_query_; -} -const ::milvus::grpc::VectorQuery& -GeneralQuery::_Internal::vector_query(const GeneralQuery* msg) { - return *msg->query_.vector_query_; -} -void GeneralQuery::set_allocated_boolean_query(::milvus::grpc::BooleanQuery* boolean_query) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - clear_query(); - if (boolean_query) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - boolean_query = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, boolean_query, submessage_arena); - } - set_has_boolean_query(); - query_.boolean_query_ = boolean_query; - } - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.GeneralQuery.boolean_query) -} -void GeneralQuery::set_allocated_term_query(::milvus::grpc::TermQuery* term_query) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - clear_query(); - if (term_query) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - term_query = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, term_query, submessage_arena); - } - set_has_term_query(); - query_.term_query_ = term_query; - } - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.GeneralQuery.term_query) -} -void GeneralQuery::set_allocated_range_query(::milvus::grpc::RangeQuery* range_query) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - clear_query(); - if (range_query) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - range_query = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, range_query, submessage_arena); - } - set_has_range_query(); - query_.range_query_ = range_query; - } - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.GeneralQuery.range_query) -} -void GeneralQuery::set_allocated_vector_query(::milvus::grpc::VectorQuery* vector_query) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - clear_query(); - if (vector_query) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - vector_query = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, vector_query, submessage_arena); - } - set_has_vector_query(); - query_.vector_query_ = vector_query; - } - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.GeneralQuery.vector_query) -} -GeneralQuery::GeneralQuery() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.GeneralQuery) -} -GeneralQuery::GeneralQuery(const GeneralQuery& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - clear_has_query(); - switch (from.query_case()) { - case kBooleanQuery: { - mutable_boolean_query()->::milvus::grpc::BooleanQuery::MergeFrom(from.boolean_query()); - break; - } - case kTermQuery: { - mutable_term_query()->::milvus::grpc::TermQuery::MergeFrom(from.term_query()); - break; - } - case kRangeQuery: { - mutable_range_query()->::milvus::grpc::RangeQuery::MergeFrom(from.range_query()); - break; - } - case kVectorQuery: { - mutable_vector_query()->::milvus::grpc::VectorQuery::MergeFrom(from.vector_query()); - break; - } - case QUERY_NOT_SET: { - break; - } - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.GeneralQuery) -} - -void GeneralQuery::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_BooleanQuery_message_2eproto.base); - clear_has_query(); -} - -GeneralQuery::~GeneralQuery() { - // @@protoc_insertion_point(destructor:milvus.grpc.GeneralQuery) - SharedDtor(); -} - -void GeneralQuery::SharedDtor() { - if (has_query()) { - clear_query(); - } -} - -void GeneralQuery::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const GeneralQuery& GeneralQuery::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_BooleanQuery_message_2eproto.base); - return *internal_default_instance(); -} - - -void GeneralQuery::clear_query() { -// @@protoc_insertion_point(one_of_clear_start:milvus.grpc.GeneralQuery) - switch (query_case()) { - case kBooleanQuery: { - delete query_.boolean_query_; - break; - } - case kTermQuery: { - delete query_.term_query_; - break; - } - case kRangeQuery: { - delete query_.range_query_; - break; - } - case kVectorQuery: { - delete query_.vector_query_; - break; - } - case QUERY_NOT_SET: { - break; - } - } - _oneof_case_[0] = QUERY_NOT_SET; -} - - -void GeneralQuery::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.GeneralQuery) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - clear_query(); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* GeneralQuery::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .milvus.grpc.BooleanQuery boolean_query = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(mutable_boolean_query(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .milvus.grpc.TermQuery term_query = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(mutable_term_query(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .milvus.grpc.RangeQuery range_query = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ctx->ParseMessage(mutable_range_query(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .milvus.grpc.VectorQuery vector_query = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { - ptr = ctx->ParseMessage(mutable_vector_query(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool GeneralQuery::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.GeneralQuery) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // .milvus.grpc.BooleanQuery boolean_query = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_boolean_query())); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.TermQuery term_query = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_term_query())); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.RangeQuery range_query = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_range_query())); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.VectorQuery vector_query = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_vector_query())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.GeneralQuery) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.GeneralQuery) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void GeneralQuery::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.GeneralQuery) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.BooleanQuery boolean_query = 1; - if (has_boolean_query()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, _Internal::boolean_query(this), output); - } - - // .milvus.grpc.TermQuery term_query = 2; - if (has_term_query()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, _Internal::term_query(this), output); - } - - // .milvus.grpc.RangeQuery range_query = 3; - if (has_range_query()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 3, _Internal::range_query(this), output); - } - - // .milvus.grpc.VectorQuery vector_query = 4; - if (has_vector_query()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 4, _Internal::vector_query(this), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.GeneralQuery) -} - -::PROTOBUF_NAMESPACE_ID::uint8* GeneralQuery::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.GeneralQuery) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .milvus.grpc.BooleanQuery boolean_query = 1; - if (has_boolean_query()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 1, _Internal::boolean_query(this), target); - } - - // .milvus.grpc.TermQuery term_query = 2; - if (has_term_query()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 2, _Internal::term_query(this), target); - } - - // .milvus.grpc.RangeQuery range_query = 3; - if (has_range_query()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 3, _Internal::range_query(this), target); - } - - // .milvus.grpc.VectorQuery vector_query = 4; - if (has_vector_query()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 4, _Internal::vector_query(this), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.GeneralQuery) - return target; -} - -size_t GeneralQuery::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.GeneralQuery) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - switch (query_case()) { - // .milvus.grpc.BooleanQuery boolean_query = 1; - case kBooleanQuery: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *query_.boolean_query_); - break; - } - // .milvus.grpc.TermQuery term_query = 2; - case kTermQuery: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *query_.term_query_); - break; - } - // .milvus.grpc.RangeQuery range_query = 3; - case kRangeQuery: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *query_.range_query_); - break; - } - // .milvus.grpc.VectorQuery vector_query = 4; - case kVectorQuery: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *query_.vector_query_); - break; - } - case QUERY_NOT_SET: { - break; - } - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void GeneralQuery::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.GeneralQuery) - GOOGLE_DCHECK_NE(&from, this); - const GeneralQuery* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.GeneralQuery) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.GeneralQuery) - MergeFrom(*source); - } -} - -void GeneralQuery::MergeFrom(const GeneralQuery& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.GeneralQuery) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - switch (from.query_case()) { - case kBooleanQuery: { - mutable_boolean_query()->::milvus::grpc::BooleanQuery::MergeFrom(from.boolean_query()); - break; - } - case kTermQuery: { - mutable_term_query()->::milvus::grpc::TermQuery::MergeFrom(from.term_query()); - break; - } - case kRangeQuery: { - mutable_range_query()->::milvus::grpc::RangeQuery::MergeFrom(from.range_query()); - break; - } - case kVectorQuery: { - mutable_vector_query()->::milvus::grpc::VectorQuery::MergeFrom(from.vector_query()); - break; - } - case QUERY_NOT_SET: { - break; - } - } -} - -void GeneralQuery::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.GeneralQuery) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void GeneralQuery::CopyFrom(const GeneralQuery& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.GeneralQuery) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool GeneralQuery::IsInitialized() const { - return true; -} - -void GeneralQuery::InternalSwap(GeneralQuery* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(query_, other->query_); - swap(_oneof_case_[0], other->_oneof_case_[0]); -} - -::PROTOBUF_NAMESPACE_ID::Metadata GeneralQuery::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void SearchParamPB::InitAsDefaultInstance() { - ::milvus::grpc::_SearchParamPB_default_instance_._instance.get_mutable()->general_query_ = const_cast< ::milvus::grpc::GeneralQuery*>( - ::milvus::grpc::GeneralQuery::internal_default_instance()); -} -class SearchParamPB::_Internal { - public: - static const ::milvus::grpc::GeneralQuery& general_query(const SearchParamPB* msg); -}; - -const ::milvus::grpc::GeneralQuery& -SearchParamPB::_Internal::general_query(const SearchParamPB* msg) { - return *msg->general_query_; -} -SearchParamPB::SearchParamPB() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.SearchParamPB) -} -SearchParamPB::SearchParamPB(const SearchParamPB& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - partition_tag_array_(from.partition_tag_array_), - extra_params_(from.extra_params_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.collection_name().empty()) { - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - if (from.has_general_query()) { - general_query_ = new ::milvus::grpc::GeneralQuery(*from.general_query_); - } else { - general_query_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:milvus.grpc.SearchParamPB) -} - -void SearchParamPB::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SearchParamPB_message_2eproto.base); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - general_query_ = nullptr; -} - -SearchParamPB::~SearchParamPB() { - // @@protoc_insertion_point(destructor:milvus.grpc.SearchParamPB) - SharedDtor(); -} - -void SearchParamPB::SharedDtor() { - collection_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete general_query_; -} - -void SearchParamPB::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const SearchParamPB& SearchParamPB::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SearchParamPB_message_2eproto.base); - return *internal_default_instance(); -} - - -void SearchParamPB::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.SearchParamPB) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - partition_tag_array_.Clear(); - extra_params_.Clear(); - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (GetArenaNoVirtual() == nullptr && general_query_ != nullptr) { - delete general_query_; - } - general_query_ = nullptr; - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* SearchParamPB::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string collection_name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_collection_name(), ptr, ctx, "milvus.grpc.SearchParamPB.collection_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated string partition_tag_array = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_partition_tag_array(), ptr, ctx, "milvus.grpc.SearchParamPB.partition_tag_array"); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18); - } else goto handle_unusual; - continue; - // .milvus.grpc.GeneralQuery general_query = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ctx->ParseMessage(mutable_general_query(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_extra_params(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 34); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool SearchParamPB::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.SearchParamPB) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string collection_name = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_collection_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.SearchParamPB.collection_name")); - } else { - goto handle_unusual; - } - break; - } - - // repeated string partition_tag_array = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->add_partition_tag_array())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag_array(this->partition_tag_array_size() - 1).data(), - static_cast(this->partition_tag_array(this->partition_tag_array_size() - 1).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.SearchParamPB.partition_tag_array")); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.GeneralQuery general_query = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_general_query())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_extra_params())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.SearchParamPB) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.SearchParamPB) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void SearchParamPB::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.SearchParamPB) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchParamPB.collection_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->collection_name(), output); - } - - // repeated string partition_tag_array = 2; - for (int i = 0, n = this->partition_tag_array_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag_array(i).data(), static_cast(this->partition_tag_array(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchParamPB.partition_tag_array"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString( - 2, this->partition_tag_array(i), output); - } - - // .milvus.grpc.GeneralQuery general_query = 3; - if (this->has_general_query()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 3, _Internal::general_query(this), output); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 4, - this->extra_params(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.SearchParamPB) -} - -::PROTOBUF_NAMESPACE_ID::uint8* SearchParamPB::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.SearchParamPB) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchParamPB.collection_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->collection_name(), target); - } - - // repeated string partition_tag_array = 2; - for (int i = 0, n = this->partition_tag_array_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag_array(i).data(), static_cast(this->partition_tag_array(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchParamPB.partition_tag_array"); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteStringToArray(2, this->partition_tag_array(i), target); - } - - // .milvus.grpc.GeneralQuery general_query = 3; - if (this->has_general_query()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 3, _Internal::general_query(this), target); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 4, this->extra_params(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.SearchParamPB) - return target; -} - -size_t SearchParamPB::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.SearchParamPB) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated string partition_tag_array = 2; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->partition_tag_array_size()); - for (int i = 0, n = this->partition_tag_array_size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->partition_tag_array(i)); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - { - unsigned int count = static_cast(this->extra_params_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->extra_params(static_cast(i))); - } - } - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_name()); - } - - // .milvus.grpc.GeneralQuery general_query = 3; - if (this->has_general_query()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *general_query_); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void SearchParamPB::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.SearchParamPB) - GOOGLE_DCHECK_NE(&from, this); - const SearchParamPB* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.SearchParamPB) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.SearchParamPB) - MergeFrom(*source); - } -} - -void SearchParamPB::MergeFrom(const SearchParamPB& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.SearchParamPB) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - partition_tag_array_.MergeFrom(from.partition_tag_array_); - extra_params_.MergeFrom(from.extra_params_); - if (from.collection_name().size() > 0) { - - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - if (from.has_general_query()) { - mutable_general_query()->::milvus::grpc::GeneralQuery::MergeFrom(from.general_query()); - } -} - -void SearchParamPB::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.SearchParamPB) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void SearchParamPB::CopyFrom(const SearchParamPB& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.SearchParamPB) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool SearchParamPB::IsInitialized() const { - return true; -} - -void SearchParamPB::InternalSwap(SearchParamPB* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - partition_tag_array_.InternalSwap(CastToBase(&other->partition_tag_array_)); - CastToBase(&extra_params_)->InternalSwap(CastToBase(&other->extra_params_)); - collection_name_.Swap(&other->collection_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(general_query_, other->general_query_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata SearchParamPB::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void InsertOrDeleteMsg::InitAsDefaultInstance() { - ::milvus::grpc::_InsertOrDeleteMsg_default_instance_._instance.get_mutable()->rows_data_ = const_cast< ::milvus::grpc::RowData*>( - ::milvus::grpc::RowData::internal_default_instance()); -} -class InsertOrDeleteMsg::_Internal { - public: - static const ::milvus::grpc::RowData& rows_data(const InsertOrDeleteMsg* msg); -}; - -const ::milvus::grpc::RowData& -InsertOrDeleteMsg::_Internal::rows_data(const InsertOrDeleteMsg* msg) { - return *msg->rows_data_; -} -InsertOrDeleteMsg::InsertOrDeleteMsg() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.InsertOrDeleteMsg) -} -InsertOrDeleteMsg::InsertOrDeleteMsg(const InsertOrDeleteMsg& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - extra_params_(from.extra_params_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.collection_name().empty()) { - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - partition_tag_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.partition_tag().empty()) { - partition_tag_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.partition_tag_); - } - if (from.has_rows_data()) { - rows_data_ = new ::milvus::grpc::RowData(*from.rows_data_); - } else { - rows_data_ = nullptr; - } - ::memcpy(&uid_, &from.uid_, - static_cast(reinterpret_cast(&op_) - - reinterpret_cast(&uid_)) + sizeof(op_)); - // @@protoc_insertion_point(copy_constructor:milvus.grpc.InsertOrDeleteMsg) -} - -void InsertOrDeleteMsg::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_InsertOrDeleteMsg_message_2eproto.base); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - partition_tag_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&rows_data_, 0, static_cast( - reinterpret_cast(&op_) - - reinterpret_cast(&rows_data_)) + sizeof(op_)); -} - -InsertOrDeleteMsg::~InsertOrDeleteMsg() { - // @@protoc_insertion_point(destructor:milvus.grpc.InsertOrDeleteMsg) - SharedDtor(); -} - -void InsertOrDeleteMsg::SharedDtor() { - collection_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - partition_tag_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete rows_data_; -} - -void InsertOrDeleteMsg::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const InsertOrDeleteMsg& InsertOrDeleteMsg::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_InsertOrDeleteMsg_message_2eproto.base); - return *internal_default_instance(); -} - - -void InsertOrDeleteMsg::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.InsertOrDeleteMsg) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - extra_params_.Clear(); - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - partition_tag_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (GetArenaNoVirtual() == nullptr && rows_data_ != nullptr) { - delete rows_data_; - } - rows_data_ = nullptr; - ::memset(&uid_, 0, static_cast( - reinterpret_cast(&op_) - - reinterpret_cast(&uid_)) + sizeof(op_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* InsertOrDeleteMsg::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string collection_name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_collection_name(), ptr, ctx, "milvus.grpc.InsertOrDeleteMsg.collection_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .milvus.grpc.RowData rows_data = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(mutable_rows_data(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 uid = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - uid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string partition_tag = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_partition_tag(), ptr, ctx, "milvus.grpc.InsertOrDeleteMsg.partition_tag"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 timestamp = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 segment_id = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - segment_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 channel_id = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { - channel_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .milvus.grpc.OpType op = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - set_op(static_cast<::milvus::grpc::OpType>(val)); - } else goto handle_unusual; - continue; - // int64 client_id = 9; - case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) { - client_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.KeyValuePair extra_params = 10; - case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_extra_params(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 82); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool InsertOrDeleteMsg::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.InsertOrDeleteMsg) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string collection_name = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_collection_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.InsertOrDeleteMsg.collection_name")); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.RowData rows_data = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_rows_data())); - } else { - goto handle_unusual; - } - break; - } - - // int64 uid = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &uid_))); - } else { - goto handle_unusual; - } - break; - } - - // string partition_tag = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_partition_tag())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag().data(), static_cast(this->partition_tag().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.InsertOrDeleteMsg.partition_tag")); - } else { - goto handle_unusual; - } - break; - } - - // uint64 timestamp = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, ×tamp_))); - } else { - goto handle_unusual; - } - break; - } - - // int64 segment_id = 6; - case 6: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (48 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &segment_id_))); - } else { - goto handle_unusual; - } - break; - } - - // int64 channel_id = 7; - case 7: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &channel_id_))); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.OpType op = 8; - case 8: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (64 & 0xFF)) { - int value = 0; - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - set_op(static_cast< ::milvus::grpc::OpType >(value)); - } else { - goto handle_unusual; - } - break; - } - - // int64 client_id = 9; - case 9: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (72 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &client_id_))); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 10; - case 10: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (82 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_extra_params())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.InsertOrDeleteMsg) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.InsertOrDeleteMsg) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void InsertOrDeleteMsg::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.InsertOrDeleteMsg) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.InsertOrDeleteMsg.collection_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->collection_name(), output); - } - - // .milvus.grpc.RowData rows_data = 2; - if (this->has_rows_data()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, _Internal::rows_data(this), output); - } - - // int64 uid = 3; - if (this->uid() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->uid(), output); - } - - // string partition_tag = 4; - if (this->partition_tag().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag().data(), static_cast(this->partition_tag().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.InsertOrDeleteMsg.partition_tag"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 4, this->partition_tag(), output); - } - - // uint64 timestamp = 5; - if (this->timestamp() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(5, this->timestamp(), output); - } - - // int64 segment_id = 6; - if (this->segment_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(6, this->segment_id(), output); - } - - // int64 channel_id = 7; - if (this->channel_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(7, this->channel_id(), output); - } - - // .milvus.grpc.OpType op = 8; - if (this->op() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( - 8, this->op(), output); - } - - // int64 client_id = 9; - if (this->client_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(9, this->client_id(), output); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 10; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 10, - this->extra_params(static_cast(i)), - output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.InsertOrDeleteMsg) -} - -::PROTOBUF_NAMESPACE_ID::uint8* InsertOrDeleteMsg::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.InsertOrDeleteMsg) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.InsertOrDeleteMsg.collection_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->collection_name(), target); - } - - // .milvus.grpc.RowData rows_data = 2; - if (this->has_rows_data()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 2, _Internal::rows_data(this), target); - } - - // int64 uid = 3; - if (this->uid() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->uid(), target); - } - - // string partition_tag = 4; - if (this->partition_tag().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag().data(), static_cast(this->partition_tag().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.InsertOrDeleteMsg.partition_tag"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 4, this->partition_tag(), target); - } - - // uint64 timestamp = 5; - if (this->timestamp() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(5, this->timestamp(), target); - } - - // int64 segment_id = 6; - if (this->segment_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(6, this->segment_id(), target); - } - - // int64 channel_id = 7; - if (this->channel_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(7, this->channel_id(), target); - } - - // .milvus.grpc.OpType op = 8; - if (this->op() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 8, this->op(), target); - } - - // int64 client_id = 9; - if (this->client_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(9, this->client_id(), target); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 10; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 10, this->extra_params(static_cast(i)), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.InsertOrDeleteMsg) - return target; -} - -size_t InsertOrDeleteMsg::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.InsertOrDeleteMsg) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .milvus.grpc.KeyValuePair extra_params = 10; - { - unsigned int count = static_cast(this->extra_params_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->extra_params(static_cast(i))); - } - } - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_name()); - } - - // string partition_tag = 4; - if (this->partition_tag().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->partition_tag()); - } - - // .milvus.grpc.RowData rows_data = 2; - if (this->has_rows_data()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *rows_data_); - } - - // int64 uid = 3; - if (this->uid() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->uid()); - } - - // uint64 timestamp = 5; - if (this->timestamp() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->timestamp()); - } - - // int64 segment_id = 6; - if (this->segment_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->segment_id()); - } - - // int64 channel_id = 7; - if (this->channel_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->channel_id()); - } - - // int64 client_id = 9; - if (this->client_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->client_id()); - } - - // .milvus.grpc.OpType op = 8; - if (this->op() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->op()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void InsertOrDeleteMsg::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.InsertOrDeleteMsg) - GOOGLE_DCHECK_NE(&from, this); - const InsertOrDeleteMsg* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.InsertOrDeleteMsg) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.InsertOrDeleteMsg) - MergeFrom(*source); - } -} - -void InsertOrDeleteMsg::MergeFrom(const InsertOrDeleteMsg& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.InsertOrDeleteMsg) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - extra_params_.MergeFrom(from.extra_params_); - if (from.collection_name().size() > 0) { - - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - if (from.partition_tag().size() > 0) { - - partition_tag_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.partition_tag_); - } - if (from.has_rows_data()) { - mutable_rows_data()->::milvus::grpc::RowData::MergeFrom(from.rows_data()); - } - if (from.uid() != 0) { - set_uid(from.uid()); - } - if (from.timestamp() != 0) { - set_timestamp(from.timestamp()); - } - if (from.segment_id() != 0) { - set_segment_id(from.segment_id()); - } - if (from.channel_id() != 0) { - set_channel_id(from.channel_id()); - } - if (from.client_id() != 0) { - set_client_id(from.client_id()); - } - if (from.op() != 0) { - set_op(from.op()); - } -} - -void InsertOrDeleteMsg::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.InsertOrDeleteMsg) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void InsertOrDeleteMsg::CopyFrom(const InsertOrDeleteMsg& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.InsertOrDeleteMsg) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool InsertOrDeleteMsg::IsInitialized() const { - return true; -} - -void InsertOrDeleteMsg::InternalSwap(InsertOrDeleteMsg* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - CastToBase(&extra_params_)->InternalSwap(CastToBase(&other->extra_params_)); - collection_name_.Swap(&other->collection_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - partition_tag_.Swap(&other->partition_tag_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(rows_data_, other->rows_data_); - swap(uid_, other->uid_); - swap(timestamp_, other->timestamp_); - swap(segment_id_, other->segment_id_); - swap(channel_id_, other->channel_id_); - swap(client_id_, other->client_id_); - swap(op_, other->op_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata InsertOrDeleteMsg::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void SearchMsg::InitAsDefaultInstance() { - ::milvus::grpc::_SearchMsg_default_instance_._instance.get_mutable()->records_ = const_cast< ::milvus::grpc::VectorRowRecord*>( - ::milvus::grpc::VectorRowRecord::internal_default_instance()); -} -class SearchMsg::_Internal { - public: - static const ::milvus::grpc::VectorRowRecord& records(const SearchMsg* msg); -}; - -const ::milvus::grpc::VectorRowRecord& -SearchMsg::_Internal::records(const SearchMsg* msg) { - return *msg->records_; -} -SearchMsg::SearchMsg() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.SearchMsg) -} -SearchMsg::SearchMsg(const SearchMsg& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - partition_tag_(from.partition_tag_), - extra_params_(from.extra_params_), - json_(from.json_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.collection_name().empty()) { - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - dsl_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from.dsl().empty()) { - dsl_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.dsl_); - } - if (from.has_records()) { - records_ = new ::milvus::grpc::VectorRowRecord(*from.records_); - } else { - records_ = nullptr; - } - ::memcpy(&uid_, &from.uid_, - static_cast(reinterpret_cast(&client_id_) - - reinterpret_cast(&uid_)) + sizeof(client_id_)); - // @@protoc_insertion_point(copy_constructor:milvus.grpc.SearchMsg) -} - -void SearchMsg::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SearchMsg_message_2eproto.base); - collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - dsl_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&records_, 0, static_cast( - reinterpret_cast(&client_id_) - - reinterpret_cast(&records_)) + sizeof(client_id_)); -} - -SearchMsg::~SearchMsg() { - // @@protoc_insertion_point(destructor:milvus.grpc.SearchMsg) - SharedDtor(); -} - -void SearchMsg::SharedDtor() { - collection_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - dsl_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete records_; -} - -void SearchMsg::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const SearchMsg& SearchMsg::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SearchMsg_message_2eproto.base); - return *internal_default_instance(); -} - - -void SearchMsg::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.SearchMsg) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - partition_tag_.Clear(); - extra_params_.Clear(); - json_.Clear(); - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - dsl_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (GetArenaNoVirtual() == nullptr && records_ != nullptr) { - delete records_; - } - records_ = nullptr; - ::memset(&uid_, 0, static_cast( - reinterpret_cast(&client_id_) - - reinterpret_cast(&uid_)) + sizeof(client_id_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* SearchMsg::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string collection_name = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_collection_name(), ptr, ctx, "milvus.grpc.SearchMsg.collection_name"); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .milvus.grpc.VectorRowRecord records = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(mutable_records(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated string partition_tag = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr -= 1; - do { - ptr += 1; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_partition_tag(), ptr, ctx, "milvus.grpc.SearchMsg.partition_tag"); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 26); - } else goto handle_unusual; - continue; - // int64 uid = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - uid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 timestamp = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int64 client_id = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - client_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .milvus.grpc.KeyValuePair extra_params = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(add_extra_params(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 58); - } else goto handle_unusual; - continue; - // repeated string json = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { - ptr -= 1; - do { - ptr += 1; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_json(), ptr, ctx, "milvus.grpc.SearchMsg.json"); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 66); - } else goto handle_unusual; - continue; - // string dsl = 9; - case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_dsl(), ptr, ctx, "milvus.grpc.SearchMsg.dsl"); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool SearchMsg::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.SearchMsg) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // string collection_name = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_collection_name())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.SearchMsg.collection_name")); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.VectorRowRecord records = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, mutable_records())); - } else { - goto handle_unusual; - } - break; - } - - // repeated string partition_tag = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->add_partition_tag())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag(this->partition_tag_size() - 1).data(), - static_cast(this->partition_tag(this->partition_tag_size() - 1).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.SearchMsg.partition_tag")); - } else { - goto handle_unusual; - } - break; - } - - // int64 uid = 4; - case 4: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &uid_))); - } else { - goto handle_unusual; - } - break; - } - - // uint64 timestamp = 5; - case 5: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, ×tamp_))); - } else { - goto handle_unusual; - } - break; - } - - // int64 client_id = 6; - case 6: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (48 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &client_id_))); - } else { - goto handle_unusual; - } - break; - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 7; - case 7: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (58 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( - input, add_extra_params())); - } else { - goto handle_unusual; - } - break; - } - - // repeated string json = 8; - case 8: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (66 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->add_json())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->json(this->json_size() - 1).data(), - static_cast(this->json(this->json_size() - 1).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.SearchMsg.json")); - } else { - goto handle_unusual; - } - break; - } - - // string dsl = 9; - case 9: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (74 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_dsl())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->dsl().data(), static_cast(this->dsl().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "milvus.grpc.SearchMsg.dsl")); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.SearchMsg) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.SearchMsg) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void SearchMsg::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.SearchMsg) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchMsg.collection_name"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->collection_name(), output); - } - - // .milvus.grpc.VectorRowRecord records = 2; - if (this->has_records()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 2, _Internal::records(this), output); - } - - // repeated string partition_tag = 3; - for (int i = 0, n = this->partition_tag_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag(i).data(), static_cast(this->partition_tag(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchMsg.partition_tag"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString( - 3, this->partition_tag(i), output); - } - - // int64 uid = 4; - if (this->uid() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(4, this->uid(), output); - } - - // uint64 timestamp = 5; - if (this->timestamp() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(5, this->timestamp(), output); - } - - // int64 client_id = 6; - if (this->client_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(6, this->client_id(), output); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 7; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( - 7, - this->extra_params(static_cast(i)), - output); - } - - // repeated string json = 8; - for (int i = 0, n = this->json_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->json(i).data(), static_cast(this->json(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchMsg.json"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString( - 8, this->json(i), output); - } - - // string dsl = 9; - if (this->dsl().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->dsl().data(), static_cast(this->dsl().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchMsg.dsl"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 9, this->dsl(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.SearchMsg) -} - -::PROTOBUF_NAMESPACE_ID::uint8* SearchMsg::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.SearchMsg) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->collection_name().data(), static_cast(this->collection_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchMsg.collection_name"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 1, this->collection_name(), target); - } - - // .milvus.grpc.VectorRowRecord records = 2; - if (this->has_records()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 2, _Internal::records(this), target); - } - - // repeated string partition_tag = 3; - for (int i = 0, n = this->partition_tag_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->partition_tag(i).data(), static_cast(this->partition_tag(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchMsg.partition_tag"); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteStringToArray(3, this->partition_tag(i), target); - } - - // int64 uid = 4; - if (this->uid() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->uid(), target); - } - - // uint64 timestamp = 5; - if (this->timestamp() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(5, this->timestamp(), target); - } - - // int64 client_id = 6; - if (this->client_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(6, this->client_id(), target); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 7; - for (unsigned int i = 0, - n = static_cast(this->extra_params_size()); i < n; i++) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessageToArray( - 7, this->extra_params(static_cast(i)), target); - } - - // repeated string json = 8; - for (int i = 0, n = this->json_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->json(i).data(), static_cast(this->json(i).length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchMsg.json"); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteStringToArray(8, this->json(i), target); - } - - // string dsl = 9; - if (this->dsl().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->dsl().data(), static_cast(this->dsl().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "milvus.grpc.SearchMsg.dsl"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 9, this->dsl(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.SearchMsg) - return target; -} - -size_t SearchMsg::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.SearchMsg) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated string partition_tag = 3; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->partition_tag_size()); - for (int i = 0, n = this->partition_tag_size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->partition_tag(i)); - } - - // repeated .milvus.grpc.KeyValuePair extra_params = 7; - { - unsigned int count = static_cast(this->extra_params_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - this->extra_params(static_cast(i))); - } - } - - // repeated string json = 8; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->json_size()); - for (int i = 0, n = this->json_size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->json(i)); - } - - // string collection_name = 1; - if (this->collection_name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->collection_name()); - } - - // string dsl = 9; - if (this->dsl().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->dsl()); - } - - // .milvus.grpc.VectorRowRecord records = 2; - if (this->has_records()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *records_); - } - - // int64 uid = 4; - if (this->uid() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->uid()); - } - - // uint64 timestamp = 5; - if (this->timestamp() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->timestamp()); - } - - // int64 client_id = 6; - if (this->client_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->client_id()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void SearchMsg::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.SearchMsg) - GOOGLE_DCHECK_NE(&from, this); - const SearchMsg* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.SearchMsg) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.SearchMsg) - MergeFrom(*source); - } -} - -void SearchMsg::MergeFrom(const SearchMsg& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.SearchMsg) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - partition_tag_.MergeFrom(from.partition_tag_); - extra_params_.MergeFrom(from.extra_params_); - json_.MergeFrom(from.json_); - if (from.collection_name().size() > 0) { - - collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); - } - if (from.dsl().size() > 0) { - - dsl_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.dsl_); - } - if (from.has_records()) { - mutable_records()->::milvus::grpc::VectorRowRecord::MergeFrom(from.records()); - } - if (from.uid() != 0) { - set_uid(from.uid()); - } - if (from.timestamp() != 0) { - set_timestamp(from.timestamp()); - } - if (from.client_id() != 0) { - set_client_id(from.client_id()); - } -} - -void SearchMsg::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.SearchMsg) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void SearchMsg::CopyFrom(const SearchMsg& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.SearchMsg) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool SearchMsg::IsInitialized() const { - return true; -} - -void SearchMsg::InternalSwap(SearchMsg* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - partition_tag_.InternalSwap(CastToBase(&other->partition_tag_)); - CastToBase(&extra_params_)->InternalSwap(CastToBase(&other->extra_params_)); - json_.InternalSwap(CastToBase(&other->json_)); - collection_name_.Swap(&other->collection_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - dsl_.Swap(&other->dsl_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(records_, other->records_); - swap(uid_, other->uid_); - swap(timestamp_, other->timestamp_); - swap(client_id_, other->client_id_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata SearchMsg::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void TimeSyncMsg::InitAsDefaultInstance() { -} -class TimeSyncMsg::_Internal { - public: -}; - -TimeSyncMsg::TimeSyncMsg() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.TimeSyncMsg) -} -TimeSyncMsg::TimeSyncMsg(const TimeSyncMsg& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::memcpy(&peer_id_, &from.peer_id_, - static_cast(reinterpret_cast(&sync_type_) - - reinterpret_cast(&peer_id_)) + sizeof(sync_type_)); - // @@protoc_insertion_point(copy_constructor:milvus.grpc.TimeSyncMsg) -} - -void TimeSyncMsg::SharedCtor() { - ::memset(&peer_id_, 0, static_cast( - reinterpret_cast(&sync_type_) - - reinterpret_cast(&peer_id_)) + sizeof(sync_type_)); -} - -TimeSyncMsg::~TimeSyncMsg() { - // @@protoc_insertion_point(destructor:milvus.grpc.TimeSyncMsg) - SharedDtor(); -} - -void TimeSyncMsg::SharedDtor() { -} - -void TimeSyncMsg::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const TimeSyncMsg& TimeSyncMsg::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TimeSyncMsg_message_2eproto.base); - return *internal_default_instance(); -} - - -void TimeSyncMsg::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.TimeSyncMsg) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&peer_id_, 0, static_cast( - reinterpret_cast(&sync_type_) - - reinterpret_cast(&peer_id_)) + sizeof(sync_type_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* TimeSyncMsg::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // int64 peer_Id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - peer_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 Timestamp = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .milvus.grpc.SyncType sync_type = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - set_sync_type(static_cast<::milvus::grpc::SyncType>(val)); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool TimeSyncMsg::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.TimeSyncMsg) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // int64 peer_Id = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &peer_id_))); - } else { - goto handle_unusual; - } - break; - } - - // uint64 Timestamp = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, ×tamp_))); - } else { - goto handle_unusual; - } - break; - } - - // .milvus.grpc.SyncType sync_type = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { - int value = 0; - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( - input, &value))); - set_sync_type(static_cast< ::milvus::grpc::SyncType >(value)); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.TimeSyncMsg) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.TimeSyncMsg) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void TimeSyncMsg::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.TimeSyncMsg) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // int64 peer_Id = 1; - if (this->peer_id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(1, this->peer_id(), output); - } - - // uint64 Timestamp = 2; - if (this->timestamp() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(2, this->timestamp(), output); - } - - // .milvus.grpc.SyncType sync_type = 3; - if (this->sync_type() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( - 3, this->sync_type(), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.TimeSyncMsg) -} - -::PROTOBUF_NAMESPACE_ID::uint8* TimeSyncMsg::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.TimeSyncMsg) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // int64 peer_Id = 1; - if (this->peer_id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->peer_id(), target); - } - - // uint64 Timestamp = 2; - if (this->timestamp() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->timestamp(), target); - } - - // .milvus.grpc.SyncType sync_type = 3; - if (this->sync_type() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 3, this->sync_type(), target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.TimeSyncMsg) - return target; -} - -size_t TimeSyncMsg::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.TimeSyncMsg) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // int64 peer_Id = 1; - if (this->peer_id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->peer_id()); - } - - // uint64 Timestamp = 2; - if (this->timestamp() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->timestamp()); - } - - // .milvus.grpc.SyncType sync_type = 3; - if (this->sync_type() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->sync_type()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void TimeSyncMsg::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.TimeSyncMsg) - GOOGLE_DCHECK_NE(&from, this); - const TimeSyncMsg* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.TimeSyncMsg) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.TimeSyncMsg) - MergeFrom(*source); - } -} - -void TimeSyncMsg::MergeFrom(const TimeSyncMsg& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.TimeSyncMsg) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.peer_id() != 0) { - set_peer_id(from.peer_id()); - } - if (from.timestamp() != 0) { - set_timestamp(from.timestamp()); - } - if (from.sync_type() != 0) { - set_sync_type(from.sync_type()); - } -} - -void TimeSyncMsg::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.TimeSyncMsg) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void TimeSyncMsg::CopyFrom(const TimeSyncMsg& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.TimeSyncMsg) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool TimeSyncMsg::IsInitialized() const { - return true; -} - -void TimeSyncMsg::InternalSwap(TimeSyncMsg* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(peer_id_, other->peer_id_); - swap(timestamp_, other->timestamp_); - swap(sync_type_, other->sync_type_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata TimeSyncMsg::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void Key2SegMsg::InitAsDefaultInstance() { -} -class Key2SegMsg::_Internal { - public: -}; - -Key2SegMsg::Key2SegMsg() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:milvus.grpc.Key2SegMsg) -} -Key2SegMsg::Key2SegMsg(const Key2SegMsg& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - segment_id_(from.segment_id_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::memcpy(&uid_, &from.uid_, - static_cast(reinterpret_cast(×tamp_) - - reinterpret_cast(&uid_)) + sizeof(timestamp_)); - // @@protoc_insertion_point(copy_constructor:milvus.grpc.Key2SegMsg) -} - -void Key2SegMsg::SharedCtor() { - ::memset(&uid_, 0, static_cast( - reinterpret_cast(×tamp_) - - reinterpret_cast(&uid_)) + sizeof(timestamp_)); -} - -Key2SegMsg::~Key2SegMsg() { - // @@protoc_insertion_point(destructor:milvus.grpc.Key2SegMsg) - SharedDtor(); -} - -void Key2SegMsg::SharedDtor() { -} - -void Key2SegMsg::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const Key2SegMsg& Key2SegMsg::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Key2SegMsg_message_2eproto.base); - return *internal_default_instance(); -} - - -void Key2SegMsg::Clear() { -// @@protoc_insertion_point(message_clear_start:milvus.grpc.Key2SegMsg) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - segment_id_.Clear(); - ::memset(&uid_, 0, static_cast( - reinterpret_cast(×tamp_) - - reinterpret_cast(&uid_)) + sizeof(timestamp_)); - _internal_metadata_.Clear(); -} - -#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* Key2SegMsg::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // int64 uid = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - uid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 timestamp = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated int64 segment_id = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(mutable_segment_id(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24) { - add_segment_id(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} -#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool Key2SegMsg::MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - // @@protoc_insertion_point(parse_start:milvus.grpc.Key2SegMsg) - for (;;) { - ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) goto handle_unusual; - switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // int64 uid = 1; - case 1: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, &uid_))); - } else { - goto handle_unusual; - } - break; - } - - // uint64 timestamp = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { - - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, ×tamp_))); - } else { - goto handle_unusual; - } - break; - } - - // repeated int64 segment_id = 3; - case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - input, this->mutable_segment_id()))); - } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { - DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< - ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( - 1, 26u, input, this->mutable_segment_id()))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( - input, tag, _internal_metadata_.mutable_unknown_fields())); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:milvus.grpc.Key2SegMsg) - return true; -failure: - // @@protoc_insertion_point(parse_failure:milvus.grpc.Key2SegMsg) - return false; -#undef DO_ -} -#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - -void Key2SegMsg::SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:milvus.grpc.Key2SegMsg) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // int64 uid = 1; - if (this->uid() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(1, this->uid(), output); - } - - // uint64 timestamp = 2; - if (this->timestamp() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(2, this->timestamp(), output); - } - - // repeated int64 segment_id = 3; - if (this->segment_id_size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(3, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); - output->WriteVarint32(_segment_id_cached_byte_size_.load( - std::memory_order_relaxed)); - } - for (int i = 0, n = this->segment_id_size(); i < n; i++) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64NoTag( - this->segment_id(i), output); - } - - if (_internal_metadata_.have_unknown_fields()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( - _internal_metadata_.unknown_fields(), output); - } - // @@protoc_insertion_point(serialize_end:milvus.grpc.Key2SegMsg) -} - -::PROTOBUF_NAMESPACE_ID::uint8* Key2SegMsg::InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:milvus.grpc.Key2SegMsg) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // int64 uid = 1; - if (this->uid() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->uid(), target); - } - - // uint64 timestamp = 2; - if (this->timestamp() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->timestamp(), target); - } - - // repeated int64 segment_id = 3; - if (this->segment_id_size() > 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( - 3, - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, - target); - target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( - _segment_id_cached_byte_size_.load(std::memory_order_relaxed), - target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - WriteInt64NoTagToArray(this->segment_id_, target); - } - - if (_internal_metadata_.have_unknown_fields()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target); - } - // @@protoc_insertion_point(serialize_to_array_end:milvus.grpc.Key2SegMsg) - return target; -} - -size_t Key2SegMsg::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:milvus.grpc.Key2SegMsg) - size_t total_size = 0; - - if (_internal_metadata_.have_unknown_fields()) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( - _internal_metadata_.unknown_fields()); - } - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated int64 segment_id = 3; - { - size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - Int64Size(this->segment_id_); - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _segment_id_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // int64 uid = 1; - if (this->uid() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->uid()); - } - - // uint64 timestamp = 2; - if (this->timestamp() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->timestamp()); - } - - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Key2SegMsg::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:milvus.grpc.Key2SegMsg) - GOOGLE_DCHECK_NE(&from, this); - const Key2SegMsg* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:milvus.grpc.Key2SegMsg) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:milvus.grpc.Key2SegMsg) - MergeFrom(*source); - } -} - -void Key2SegMsg::MergeFrom(const Key2SegMsg& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:milvus.grpc.Key2SegMsg) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - segment_id_.MergeFrom(from.segment_id_); - if (from.uid() != 0) { - set_uid(from.uid()); - } - if (from.timestamp() != 0) { - set_timestamp(from.timestamp()); - } -} - -void Key2SegMsg::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:milvus.grpc.Key2SegMsg) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Key2SegMsg::CopyFrom(const Key2SegMsg& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:milvus.grpc.Key2SegMsg) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Key2SegMsg::IsInitialized() const { - return true; -} - -void Key2SegMsg::InternalSwap(Key2SegMsg* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - segment_id_.InternalSwap(&other->segment_id_); - swap(uid_, other->uid_); - swap(timestamp_, other->timestamp_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Key2SegMsg::GetMetadata() const { - return GetMetadataStatic(); -} - - -// @@protoc_insertion_point(namespace_scope) -} // namespace grpc -} // namespace milvus -PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::milvus::grpc::Status* Arena::CreateMaybeMessage< ::milvus::grpc::Status >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::Status >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::KeyValuePair* Arena::CreateMaybeMessage< ::milvus::grpc::KeyValuePair >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::KeyValuePair >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::CollectionName* Arena::CreateMaybeMessage< ::milvus::grpc::CollectionName >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::CollectionName >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::CollectionNameList* Arena::CreateMaybeMessage< ::milvus::grpc::CollectionNameList >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::CollectionNameList >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::FieldName* Arena::CreateMaybeMessage< ::milvus::grpc::FieldName >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::FieldName >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::Mapping* Arena::CreateMaybeMessage< ::milvus::grpc::Mapping >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::Mapping >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::MappingList* Arena::CreateMaybeMessage< ::milvus::grpc::MappingList >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::MappingList >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::PartitionParam* Arena::CreateMaybeMessage< ::milvus::grpc::PartitionParam >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::PartitionParam >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::PartitionList* Arena::CreateMaybeMessage< ::milvus::grpc::PartitionList >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::PartitionList >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::VectorRowRecord* Arena::CreateMaybeMessage< ::milvus::grpc::VectorRowRecord >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::VectorRowRecord >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::EntityIds* Arena::CreateMaybeMessage< ::milvus::grpc::EntityIds >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::EntityIds >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::VectorRecord* Arena::CreateMaybeMessage< ::milvus::grpc::VectorRecord >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::VectorRecord >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::VectorParam* Arena::CreateMaybeMessage< ::milvus::grpc::VectorParam >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::VectorParam >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::FieldMeta* Arena::CreateMaybeMessage< ::milvus::grpc::FieldMeta >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::FieldMeta >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::Schema* Arena::CreateMaybeMessage< ::milvus::grpc::Schema >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::Schema >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::RowData* Arena::CreateMaybeMessage< ::milvus::grpc::RowData >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::RowData >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::InsertParam* Arena::CreateMaybeMessage< ::milvus::grpc::InsertParam >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::InsertParam >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::SearchParam* Arena::CreateMaybeMessage< ::milvus::grpc::SearchParam >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::SearchParam >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::SearchInSegmentParam* Arena::CreateMaybeMessage< ::milvus::grpc::SearchInSegmentParam >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::SearchInSegmentParam >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::Entities* Arena::CreateMaybeMessage< ::milvus::grpc::Entities >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::Entities >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::QueryResult* Arena::CreateMaybeMessage< ::milvus::grpc::QueryResult >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::QueryResult >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::StringReply* Arena::CreateMaybeMessage< ::milvus::grpc::StringReply >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::StringReply >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::BoolReply* Arena::CreateMaybeMessage< ::milvus::grpc::BoolReply >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::BoolReply >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::CollectionRowCount* Arena::CreateMaybeMessage< ::milvus::grpc::CollectionRowCount >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::CollectionRowCount >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::Command* Arena::CreateMaybeMessage< ::milvus::grpc::Command >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::Command >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::IndexParam* Arena::CreateMaybeMessage< ::milvus::grpc::IndexParam >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::IndexParam >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::FlushParam* Arena::CreateMaybeMessage< ::milvus::grpc::FlushParam >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::FlushParam >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::CompactParam* Arena::CreateMaybeMessage< ::milvus::grpc::CompactParam >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::CompactParam >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::DeleteByIDParam* Arena::CreateMaybeMessage< ::milvus::grpc::DeleteByIDParam >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::DeleteByIDParam >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::CollectionInfo* Arena::CreateMaybeMessage< ::milvus::grpc::CollectionInfo >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::CollectionInfo >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::GetEntityIDsParam* Arena::CreateMaybeMessage< ::milvus::grpc::GetEntityIDsParam >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::GetEntityIDsParam >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::EntityIdentity* Arena::CreateMaybeMessage< ::milvus::grpc::EntityIdentity >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::EntityIdentity >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::VectorFieldParam* Arena::CreateMaybeMessage< ::milvus::grpc::VectorFieldParam >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::VectorFieldParam >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::FieldType* Arena::CreateMaybeMessage< ::milvus::grpc::FieldType >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::FieldType >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::FieldParam* Arena::CreateMaybeMessage< ::milvus::grpc::FieldParam >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::FieldParam >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::VectorFieldRecord* Arena::CreateMaybeMessage< ::milvus::grpc::VectorFieldRecord >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::VectorFieldRecord >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::TermQuery* Arena::CreateMaybeMessage< ::milvus::grpc::TermQuery >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::TermQuery >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::CompareExpr* Arena::CreateMaybeMessage< ::milvus::grpc::CompareExpr >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::CompareExpr >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::RangeQuery* Arena::CreateMaybeMessage< ::milvus::grpc::RangeQuery >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::RangeQuery >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::VectorQuery* Arena::CreateMaybeMessage< ::milvus::grpc::VectorQuery >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::VectorQuery >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::BooleanQuery* Arena::CreateMaybeMessage< ::milvus::grpc::BooleanQuery >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::BooleanQuery >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::GeneralQuery* Arena::CreateMaybeMessage< ::milvus::grpc::GeneralQuery >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::GeneralQuery >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::SearchParamPB* Arena::CreateMaybeMessage< ::milvus::grpc::SearchParamPB >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::SearchParamPB >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::InsertOrDeleteMsg* Arena::CreateMaybeMessage< ::milvus::grpc::InsertOrDeleteMsg >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::InsertOrDeleteMsg >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::SearchMsg* Arena::CreateMaybeMessage< ::milvus::grpc::SearchMsg >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::SearchMsg >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::TimeSyncMsg* Arena::CreateMaybeMessage< ::milvus::grpc::TimeSyncMsg >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::TimeSyncMsg >(arena); -} -template<> PROTOBUF_NOINLINE ::milvus::grpc::Key2SegMsg* Arena::CreateMaybeMessage< ::milvus::grpc::Key2SegMsg >(Arena* arena) { - return Arena::CreateInternal< ::milvus::grpc::Key2SegMsg >(arena); -} -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) -#include diff --git a/proxy/src/grpc/message.pb.h b/proxy/src/grpc/message.pb.h deleted file mode 100644 index bbe90573a1..0000000000 --- a/proxy/src/grpc/message.pb.h +++ /dev/null @@ -1,13531 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: message.proto - -#ifndef GOOGLE_PROTOBUF_INCLUDED_message_2eproto -#define GOOGLE_PROTOBUF_INCLUDED_message_2eproto - -#include -#include - -#include -#if PROTOBUF_VERSION < 3009000 -#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 -#if 3009000 < 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 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: export -#include // IWYU pragma: export -#include -#include -// @@protoc_insertion_point(includes) -#include -#define PROTOBUF_INTERNAL_EXPORT_message_2eproto -PROTOBUF_NAMESPACE_OPEN -namespace internal { -class AnyMetadata; -} // namespace internal -PROTOBUF_NAMESPACE_CLOSE - -// Internal implementation detail -- do not use these members. -struct TableStruct_message_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[47] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; - static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; -}; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_message_2eproto; -namespace milvus { -namespace grpc { -class BoolReply; -class BoolReplyDefaultTypeInternal; -extern BoolReplyDefaultTypeInternal _BoolReply_default_instance_; -class BooleanQuery; -class BooleanQueryDefaultTypeInternal; -extern BooleanQueryDefaultTypeInternal _BooleanQuery_default_instance_; -class CollectionInfo; -class CollectionInfoDefaultTypeInternal; -extern CollectionInfoDefaultTypeInternal _CollectionInfo_default_instance_; -class CollectionName; -class CollectionNameDefaultTypeInternal; -extern CollectionNameDefaultTypeInternal _CollectionName_default_instance_; -class CollectionNameList; -class CollectionNameListDefaultTypeInternal; -extern CollectionNameListDefaultTypeInternal _CollectionNameList_default_instance_; -class CollectionRowCount; -class CollectionRowCountDefaultTypeInternal; -extern CollectionRowCountDefaultTypeInternal _CollectionRowCount_default_instance_; -class Command; -class CommandDefaultTypeInternal; -extern CommandDefaultTypeInternal _Command_default_instance_; -class CompactParam; -class CompactParamDefaultTypeInternal; -extern CompactParamDefaultTypeInternal _CompactParam_default_instance_; -class CompareExpr; -class CompareExprDefaultTypeInternal; -extern CompareExprDefaultTypeInternal _CompareExpr_default_instance_; -class DeleteByIDParam; -class DeleteByIDParamDefaultTypeInternal; -extern DeleteByIDParamDefaultTypeInternal _DeleteByIDParam_default_instance_; -class Entities; -class EntitiesDefaultTypeInternal; -extern EntitiesDefaultTypeInternal _Entities_default_instance_; -class EntityIdentity; -class EntityIdentityDefaultTypeInternal; -extern EntityIdentityDefaultTypeInternal _EntityIdentity_default_instance_; -class EntityIds; -class EntityIdsDefaultTypeInternal; -extern EntityIdsDefaultTypeInternal _EntityIds_default_instance_; -class FieldMeta; -class FieldMetaDefaultTypeInternal; -extern FieldMetaDefaultTypeInternal _FieldMeta_default_instance_; -class FieldName; -class FieldNameDefaultTypeInternal; -extern FieldNameDefaultTypeInternal _FieldName_default_instance_; -class FieldParam; -class FieldParamDefaultTypeInternal; -extern FieldParamDefaultTypeInternal _FieldParam_default_instance_; -class FieldType; -class FieldTypeDefaultTypeInternal; -extern FieldTypeDefaultTypeInternal _FieldType_default_instance_; -class FlushParam; -class FlushParamDefaultTypeInternal; -extern FlushParamDefaultTypeInternal _FlushParam_default_instance_; -class GeneralQuery; -class GeneralQueryDefaultTypeInternal; -extern GeneralQueryDefaultTypeInternal _GeneralQuery_default_instance_; -class GetEntityIDsParam; -class GetEntityIDsParamDefaultTypeInternal; -extern GetEntityIDsParamDefaultTypeInternal _GetEntityIDsParam_default_instance_; -class IndexParam; -class IndexParamDefaultTypeInternal; -extern IndexParamDefaultTypeInternal _IndexParam_default_instance_; -class InsertOrDeleteMsg; -class InsertOrDeleteMsgDefaultTypeInternal; -extern InsertOrDeleteMsgDefaultTypeInternal _InsertOrDeleteMsg_default_instance_; -class InsertParam; -class InsertParamDefaultTypeInternal; -extern InsertParamDefaultTypeInternal _InsertParam_default_instance_; -class Key2SegMsg; -class Key2SegMsgDefaultTypeInternal; -extern Key2SegMsgDefaultTypeInternal _Key2SegMsg_default_instance_; -class KeyValuePair; -class KeyValuePairDefaultTypeInternal; -extern KeyValuePairDefaultTypeInternal _KeyValuePair_default_instance_; -class Mapping; -class MappingDefaultTypeInternal; -extern MappingDefaultTypeInternal _Mapping_default_instance_; -class MappingList; -class MappingListDefaultTypeInternal; -extern MappingListDefaultTypeInternal _MappingList_default_instance_; -class PartitionList; -class PartitionListDefaultTypeInternal; -extern PartitionListDefaultTypeInternal _PartitionList_default_instance_; -class PartitionParam; -class PartitionParamDefaultTypeInternal; -extern PartitionParamDefaultTypeInternal _PartitionParam_default_instance_; -class QueryResult; -class QueryResultDefaultTypeInternal; -extern QueryResultDefaultTypeInternal _QueryResult_default_instance_; -class RangeQuery; -class RangeQueryDefaultTypeInternal; -extern RangeQueryDefaultTypeInternal _RangeQuery_default_instance_; -class RowData; -class RowDataDefaultTypeInternal; -extern RowDataDefaultTypeInternal _RowData_default_instance_; -class Schema; -class SchemaDefaultTypeInternal; -extern SchemaDefaultTypeInternal _Schema_default_instance_; -class SearchInSegmentParam; -class SearchInSegmentParamDefaultTypeInternal; -extern SearchInSegmentParamDefaultTypeInternal _SearchInSegmentParam_default_instance_; -class SearchMsg; -class SearchMsgDefaultTypeInternal; -extern SearchMsgDefaultTypeInternal _SearchMsg_default_instance_; -class SearchParam; -class SearchParamDefaultTypeInternal; -extern SearchParamDefaultTypeInternal _SearchParam_default_instance_; -class SearchParamPB; -class SearchParamPBDefaultTypeInternal; -extern SearchParamPBDefaultTypeInternal _SearchParamPB_default_instance_; -class Status; -class StatusDefaultTypeInternal; -extern StatusDefaultTypeInternal _Status_default_instance_; -class StringReply; -class StringReplyDefaultTypeInternal; -extern StringReplyDefaultTypeInternal _StringReply_default_instance_; -class TermQuery; -class TermQueryDefaultTypeInternal; -extern TermQueryDefaultTypeInternal _TermQuery_default_instance_; -class TimeSyncMsg; -class TimeSyncMsgDefaultTypeInternal; -extern TimeSyncMsgDefaultTypeInternal _TimeSyncMsg_default_instance_; -class VectorFieldParam; -class VectorFieldParamDefaultTypeInternal; -extern VectorFieldParamDefaultTypeInternal _VectorFieldParam_default_instance_; -class VectorFieldRecord; -class VectorFieldRecordDefaultTypeInternal; -extern VectorFieldRecordDefaultTypeInternal _VectorFieldRecord_default_instance_; -class VectorParam; -class VectorParamDefaultTypeInternal; -extern VectorParamDefaultTypeInternal _VectorParam_default_instance_; -class VectorQuery; -class VectorQueryDefaultTypeInternal; -extern VectorQueryDefaultTypeInternal _VectorQuery_default_instance_; -class VectorRecord; -class VectorRecordDefaultTypeInternal; -extern VectorRecordDefaultTypeInternal _VectorRecord_default_instance_; -class VectorRowRecord; -class VectorRowRecordDefaultTypeInternal; -extern VectorRowRecordDefaultTypeInternal _VectorRowRecord_default_instance_; -} // namespace grpc -} // namespace milvus -PROTOBUF_NAMESPACE_OPEN -template<> ::milvus::grpc::BoolReply* Arena::CreateMaybeMessage<::milvus::grpc::BoolReply>(Arena*); -template<> ::milvus::grpc::BooleanQuery* Arena::CreateMaybeMessage<::milvus::grpc::BooleanQuery>(Arena*); -template<> ::milvus::grpc::CollectionInfo* Arena::CreateMaybeMessage<::milvus::grpc::CollectionInfo>(Arena*); -template<> ::milvus::grpc::CollectionName* Arena::CreateMaybeMessage<::milvus::grpc::CollectionName>(Arena*); -template<> ::milvus::grpc::CollectionNameList* Arena::CreateMaybeMessage<::milvus::grpc::CollectionNameList>(Arena*); -template<> ::milvus::grpc::CollectionRowCount* Arena::CreateMaybeMessage<::milvus::grpc::CollectionRowCount>(Arena*); -template<> ::milvus::grpc::Command* Arena::CreateMaybeMessage<::milvus::grpc::Command>(Arena*); -template<> ::milvus::grpc::CompactParam* Arena::CreateMaybeMessage<::milvus::grpc::CompactParam>(Arena*); -template<> ::milvus::grpc::CompareExpr* Arena::CreateMaybeMessage<::milvus::grpc::CompareExpr>(Arena*); -template<> ::milvus::grpc::DeleteByIDParam* Arena::CreateMaybeMessage<::milvus::grpc::DeleteByIDParam>(Arena*); -template<> ::milvus::grpc::Entities* Arena::CreateMaybeMessage<::milvus::grpc::Entities>(Arena*); -template<> ::milvus::grpc::EntityIdentity* Arena::CreateMaybeMessage<::milvus::grpc::EntityIdentity>(Arena*); -template<> ::milvus::grpc::EntityIds* Arena::CreateMaybeMessage<::milvus::grpc::EntityIds>(Arena*); -template<> ::milvus::grpc::FieldMeta* Arena::CreateMaybeMessage<::milvus::grpc::FieldMeta>(Arena*); -template<> ::milvus::grpc::FieldName* Arena::CreateMaybeMessage<::milvus::grpc::FieldName>(Arena*); -template<> ::milvus::grpc::FieldParam* Arena::CreateMaybeMessage<::milvus::grpc::FieldParam>(Arena*); -template<> ::milvus::grpc::FieldType* Arena::CreateMaybeMessage<::milvus::grpc::FieldType>(Arena*); -template<> ::milvus::grpc::FlushParam* Arena::CreateMaybeMessage<::milvus::grpc::FlushParam>(Arena*); -template<> ::milvus::grpc::GeneralQuery* Arena::CreateMaybeMessage<::milvus::grpc::GeneralQuery>(Arena*); -template<> ::milvus::grpc::GetEntityIDsParam* Arena::CreateMaybeMessage<::milvus::grpc::GetEntityIDsParam>(Arena*); -template<> ::milvus::grpc::IndexParam* Arena::CreateMaybeMessage<::milvus::grpc::IndexParam>(Arena*); -template<> ::milvus::grpc::InsertOrDeleteMsg* Arena::CreateMaybeMessage<::milvus::grpc::InsertOrDeleteMsg>(Arena*); -template<> ::milvus::grpc::InsertParam* Arena::CreateMaybeMessage<::milvus::grpc::InsertParam>(Arena*); -template<> ::milvus::grpc::Key2SegMsg* Arena::CreateMaybeMessage<::milvus::grpc::Key2SegMsg>(Arena*); -template<> ::milvus::grpc::KeyValuePair* Arena::CreateMaybeMessage<::milvus::grpc::KeyValuePair>(Arena*); -template<> ::milvus::grpc::Mapping* Arena::CreateMaybeMessage<::milvus::grpc::Mapping>(Arena*); -template<> ::milvus::grpc::MappingList* Arena::CreateMaybeMessage<::milvus::grpc::MappingList>(Arena*); -template<> ::milvus::grpc::PartitionList* Arena::CreateMaybeMessage<::milvus::grpc::PartitionList>(Arena*); -template<> ::milvus::grpc::PartitionParam* Arena::CreateMaybeMessage<::milvus::grpc::PartitionParam>(Arena*); -template<> ::milvus::grpc::QueryResult* Arena::CreateMaybeMessage<::milvus::grpc::QueryResult>(Arena*); -template<> ::milvus::grpc::RangeQuery* Arena::CreateMaybeMessage<::milvus::grpc::RangeQuery>(Arena*); -template<> ::milvus::grpc::RowData* Arena::CreateMaybeMessage<::milvus::grpc::RowData>(Arena*); -template<> ::milvus::grpc::Schema* Arena::CreateMaybeMessage<::milvus::grpc::Schema>(Arena*); -template<> ::milvus::grpc::SearchInSegmentParam* Arena::CreateMaybeMessage<::milvus::grpc::SearchInSegmentParam>(Arena*); -template<> ::milvus::grpc::SearchMsg* Arena::CreateMaybeMessage<::milvus::grpc::SearchMsg>(Arena*); -template<> ::milvus::grpc::SearchParam* Arena::CreateMaybeMessage<::milvus::grpc::SearchParam>(Arena*); -template<> ::milvus::grpc::SearchParamPB* Arena::CreateMaybeMessage<::milvus::grpc::SearchParamPB>(Arena*); -template<> ::milvus::grpc::Status* Arena::CreateMaybeMessage<::milvus::grpc::Status>(Arena*); -template<> ::milvus::grpc::StringReply* Arena::CreateMaybeMessage<::milvus::grpc::StringReply>(Arena*); -template<> ::milvus::grpc::TermQuery* Arena::CreateMaybeMessage<::milvus::grpc::TermQuery>(Arena*); -template<> ::milvus::grpc::TimeSyncMsg* Arena::CreateMaybeMessage<::milvus::grpc::TimeSyncMsg>(Arena*); -template<> ::milvus::grpc::VectorFieldParam* Arena::CreateMaybeMessage<::milvus::grpc::VectorFieldParam>(Arena*); -template<> ::milvus::grpc::VectorFieldRecord* Arena::CreateMaybeMessage<::milvus::grpc::VectorFieldRecord>(Arena*); -template<> ::milvus::grpc::VectorParam* Arena::CreateMaybeMessage<::milvus::grpc::VectorParam>(Arena*); -template<> ::milvus::grpc::VectorQuery* Arena::CreateMaybeMessage<::milvus::grpc::VectorQuery>(Arena*); -template<> ::milvus::grpc::VectorRecord* Arena::CreateMaybeMessage<::milvus::grpc::VectorRecord>(Arena*); -template<> ::milvus::grpc::VectorRowRecord* Arena::CreateMaybeMessage<::milvus::grpc::VectorRowRecord>(Arena*); -PROTOBUF_NAMESPACE_CLOSE -namespace milvus { -namespace grpc { - -enum ErrorCode : int { - SUCCESS = 0, - UNEXPECTED_ERROR = 1, - CONNECT_FAILED = 2, - PERMISSION_DENIED = 3, - COLLECTION_NOT_EXISTS = 4, - ILLEGAL_ARGUMENT = 5, - ILLEGAL_DIMENSION = 7, - ILLEGAL_INDEX_TYPE = 8, - ILLEGAL_COLLECTION_NAME = 9, - ILLEGAL_TOPK = 10, - ILLEGAL_ROWRECORD = 11, - ILLEGAL_VECTOR_ID = 12, - ILLEGAL_SEARCH_RESULT = 13, - FILE_NOT_FOUND = 14, - META_FAILED = 15, - CACHE_FAILED = 16, - CANNOT_CREATE_FOLDER = 17, - CANNOT_CREATE_FILE = 18, - CANNOT_DELETE_FOLDER = 19, - CANNOT_DELETE_FILE = 20, - BUILD_INDEX_ERROR = 21, - ILLEGAL_NLIST = 22, - ILLEGAL_METRIC_TYPE = 23, - OUT_OF_MEMORY = 24, - ErrorCode_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - ErrorCode_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool ErrorCode_IsValid(int value); -constexpr ErrorCode ErrorCode_MIN = SUCCESS; -constexpr ErrorCode ErrorCode_MAX = OUT_OF_MEMORY; -constexpr int ErrorCode_ARRAYSIZE = ErrorCode_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ErrorCode_descriptor(); -template -inline const std::string& ErrorCode_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function ErrorCode_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - ErrorCode_descriptor(), enum_t_value); -} -inline bool ErrorCode_Parse( - const std::string& name, ErrorCode* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - ErrorCode_descriptor(), name, value); -} -enum DataType : int { - NONE = 0, - BOOL = 1, - INT8 = 2, - INT16 = 3, - INT32 = 4, - INT64 = 5, - FLOAT = 10, - DOUBLE = 11, - STRING = 20, - VECTOR_BINARY = 100, - VECTOR_FLOAT = 101, - DataType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - DataType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool DataType_IsValid(int value); -constexpr DataType DataType_MIN = NONE; -constexpr DataType DataType_MAX = VECTOR_FLOAT; -constexpr int DataType_ARRAYSIZE = DataType_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataType_descriptor(); -template -inline const std::string& DataType_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function DataType_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - DataType_descriptor(), enum_t_value); -} -inline bool DataType_Parse( - const std::string& name, DataType* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - DataType_descriptor(), name, value); -} -enum CompareOperator : int { - LT = 0, - LTE = 1, - EQ = 2, - GT = 3, - GTE = 4, - NE = 5, - CompareOperator_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - CompareOperator_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool CompareOperator_IsValid(int value); -constexpr CompareOperator CompareOperator_MIN = LT; -constexpr CompareOperator CompareOperator_MAX = NE; -constexpr int CompareOperator_ARRAYSIZE = CompareOperator_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* CompareOperator_descriptor(); -template -inline const std::string& CompareOperator_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function CompareOperator_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - CompareOperator_descriptor(), enum_t_value); -} -inline bool CompareOperator_Parse( - const std::string& name, CompareOperator* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - CompareOperator_descriptor(), name, value); -} -enum Occur : int { - INVALID = 0, - MUST = 1, - SHOULD = 2, - MUST_NOT = 3, - Occur_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - Occur_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool Occur_IsValid(int value); -constexpr Occur Occur_MIN = INVALID; -constexpr Occur Occur_MAX = MUST_NOT; -constexpr int Occur_ARRAYSIZE = Occur_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Occur_descriptor(); -template -inline const std::string& Occur_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Occur_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - Occur_descriptor(), enum_t_value); -} -inline bool Occur_Parse( - const std::string& name, Occur* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - Occur_descriptor(), name, value); -} -enum OpType : int { - INSERT = 0, - DELETE = 1, - OpType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - OpType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool OpType_IsValid(int value); -constexpr OpType OpType_MIN = INSERT; -constexpr OpType OpType_MAX = DELETE; -constexpr int OpType_ARRAYSIZE = OpType_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* OpType_descriptor(); -template -inline const std::string& OpType_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function OpType_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - OpType_descriptor(), enum_t_value); -} -inline bool OpType_Parse( - const std::string& name, OpType* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - OpType_descriptor(), name, value); -} -enum SyncType : int { - READ = 0, - WRITE = 1, - SyncType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - SyncType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool SyncType_IsValid(int value); -constexpr SyncType SyncType_MIN = READ; -constexpr SyncType SyncType_MAX = WRITE; -constexpr int SyncType_ARRAYSIZE = SyncType_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SyncType_descriptor(); -template -inline const std::string& SyncType_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function SyncType_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - SyncType_descriptor(), enum_t_value); -} -inline bool SyncType_Parse( - const std::string& name, SyncType* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - SyncType_descriptor(), name, value); -} -// =================================================================== - -class Status : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.Status) */ { - public: - Status(); - virtual ~Status(); - - Status(const Status& from); - Status(Status&& from) noexcept - : Status() { - *this = ::std::move(from); - } - - inline Status& operator=(const Status& from) { - CopyFrom(from); - return *this; - } - inline Status& operator=(Status&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const Status& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const Status* internal_default_instance() { - return reinterpret_cast( - &_Status_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - friend void swap(Status& a, Status& b) { - a.Swap(&b); - } - inline void Swap(Status* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline Status* New() const final { - return CreateMaybeMessage(nullptr); - } - - Status* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const Status& from); - void MergeFrom(const Status& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Status* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.Status"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kReasonFieldNumber = 2, - kErrorCodeFieldNumber = 1, - }; - // string reason = 2; - void clear_reason(); - const std::string& reason() const; - void set_reason(const std::string& value); - void set_reason(std::string&& value); - void set_reason(const char* value); - void set_reason(const char* value, size_t size); - std::string* mutable_reason(); - std::string* release_reason(); - void set_allocated_reason(std::string* reason); - - // .milvus.grpc.ErrorCode error_code = 1; - void clear_error_code(); - ::milvus::grpc::ErrorCode error_code() const; - void set_error_code(::milvus::grpc::ErrorCode value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.Status) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr reason_; - int error_code_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class KeyValuePair : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.KeyValuePair) */ { - public: - KeyValuePair(); - virtual ~KeyValuePair(); - - KeyValuePair(const KeyValuePair& from); - KeyValuePair(KeyValuePair&& from) noexcept - : KeyValuePair() { - *this = ::std::move(from); - } - - inline KeyValuePair& operator=(const KeyValuePair& from) { - CopyFrom(from); - return *this; - } - inline KeyValuePair& operator=(KeyValuePair&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const KeyValuePair& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const KeyValuePair* internal_default_instance() { - return reinterpret_cast( - &_KeyValuePair_default_instance_); - } - static constexpr int kIndexInFileMessages = - 1; - - friend void swap(KeyValuePair& a, KeyValuePair& b) { - a.Swap(&b); - } - inline void Swap(KeyValuePair* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline KeyValuePair* New() const final { - return CreateMaybeMessage(nullptr); - } - - KeyValuePair* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const KeyValuePair& from); - void MergeFrom(const KeyValuePair& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(KeyValuePair* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.KeyValuePair"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kKeyFieldNumber = 1, - kValueFieldNumber = 2, - }; - // string key = 1; - void clear_key(); - const std::string& key() const; - void set_key(const std::string& value); - void set_key(std::string&& value); - void set_key(const char* value); - void set_key(const char* value, size_t size); - std::string* mutable_key(); - std::string* release_key(); - void set_allocated_key(std::string* key); - - // string value = 2; - void clear_value(); - const std::string& value() const; - void set_value(const std::string& value); - void set_value(std::string&& value); - void set_value(const char* value); - void set_value(const char* value, size_t size); - std::string* mutable_value(); - std::string* release_value(); - void set_allocated_value(std::string* value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.KeyValuePair) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class CollectionName : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.CollectionName) */ { - public: - CollectionName(); - virtual ~CollectionName(); - - CollectionName(const CollectionName& from); - CollectionName(CollectionName&& from) noexcept - : CollectionName() { - *this = ::std::move(from); - } - - inline CollectionName& operator=(const CollectionName& from) { - CopyFrom(from); - return *this; - } - inline CollectionName& operator=(CollectionName&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const CollectionName& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const CollectionName* internal_default_instance() { - return reinterpret_cast( - &_CollectionName_default_instance_); - } - static constexpr int kIndexInFileMessages = - 2; - - friend void swap(CollectionName& a, CollectionName& b) { - a.Swap(&b); - } - inline void Swap(CollectionName* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline CollectionName* New() const final { - return CreateMaybeMessage(nullptr); - } - - CollectionName* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const CollectionName& from); - void MergeFrom(const CollectionName& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(CollectionName* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.CollectionName"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kCollectionNameFieldNumber = 1, - }; - // string collection_name = 1; - void clear_collection_name(); - const std::string& collection_name() const; - void set_collection_name(const std::string& value); - void set_collection_name(std::string&& value); - void set_collection_name(const char* value); - void set_collection_name(const char* value, size_t size); - std::string* mutable_collection_name(); - std::string* release_collection_name(); - void set_allocated_collection_name(std::string* collection_name); - - // @@protoc_insertion_point(class_scope:milvus.grpc.CollectionName) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr collection_name_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class CollectionNameList : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.CollectionNameList) */ { - public: - CollectionNameList(); - virtual ~CollectionNameList(); - - CollectionNameList(const CollectionNameList& from); - CollectionNameList(CollectionNameList&& from) noexcept - : CollectionNameList() { - *this = ::std::move(from); - } - - inline CollectionNameList& operator=(const CollectionNameList& from) { - CopyFrom(from); - return *this; - } - inline CollectionNameList& operator=(CollectionNameList&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const CollectionNameList& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const CollectionNameList* internal_default_instance() { - return reinterpret_cast( - &_CollectionNameList_default_instance_); - } - static constexpr int kIndexInFileMessages = - 3; - - friend void swap(CollectionNameList& a, CollectionNameList& b) { - a.Swap(&b); - } - inline void Swap(CollectionNameList* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline CollectionNameList* New() const final { - return CreateMaybeMessage(nullptr); - } - - CollectionNameList* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const CollectionNameList& from); - void MergeFrom(const CollectionNameList& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(CollectionNameList* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.CollectionNameList"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kCollectionNamesFieldNumber = 2, - kStatusFieldNumber = 1, - }; - // repeated string collection_names = 2; - int collection_names_size() const; - void clear_collection_names(); - const std::string& collection_names(int index) const; - std::string* mutable_collection_names(int index); - void set_collection_names(int index, const std::string& value); - void set_collection_names(int index, std::string&& value); - void set_collection_names(int index, const char* value); - void set_collection_names(int index, const char* value, size_t size); - std::string* add_collection_names(); - void add_collection_names(const std::string& value); - void add_collection_names(std::string&& value); - void add_collection_names(const char* value); - void add_collection_names(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& collection_names() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_collection_names(); - - // .milvus.grpc.Status status = 1; - bool has_status() const; - void clear_status(); - const ::milvus::grpc::Status& status() const; - ::milvus::grpc::Status* release_status(); - ::milvus::grpc::Status* mutable_status(); - void set_allocated_status(::milvus::grpc::Status* status); - - // @@protoc_insertion_point(class_scope:milvus.grpc.CollectionNameList) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField collection_names_; - ::milvus::grpc::Status* status_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class FieldName : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.FieldName) */ { - public: - FieldName(); - virtual ~FieldName(); - - FieldName(const FieldName& from); - FieldName(FieldName&& from) noexcept - : FieldName() { - *this = ::std::move(from); - } - - inline FieldName& operator=(const FieldName& from) { - CopyFrom(from); - return *this; - } - inline FieldName& operator=(FieldName&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const FieldName& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const FieldName* internal_default_instance() { - return reinterpret_cast( - &_FieldName_default_instance_); - } - static constexpr int kIndexInFileMessages = - 4; - - friend void swap(FieldName& a, FieldName& b) { - a.Swap(&b); - } - inline void Swap(FieldName* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline FieldName* New() const final { - return CreateMaybeMessage(nullptr); - } - - FieldName* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const FieldName& from); - void MergeFrom(const FieldName& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(FieldName* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.FieldName"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kCollectionNameFieldNumber = 1, - kFieldNameFieldNumber = 2, - }; - // string collection_name = 1; - void clear_collection_name(); - const std::string& collection_name() const; - void set_collection_name(const std::string& value); - void set_collection_name(std::string&& value); - void set_collection_name(const char* value); - void set_collection_name(const char* value, size_t size); - std::string* mutable_collection_name(); - std::string* release_collection_name(); - void set_allocated_collection_name(std::string* collection_name); - - // string field_name = 2; - void clear_field_name(); - const std::string& field_name() const; - void set_field_name(const std::string& value); - void set_field_name(std::string&& value); - void set_field_name(const char* value); - void set_field_name(const char* value, size_t size); - std::string* mutable_field_name(); - std::string* release_field_name(); - void set_allocated_field_name(std::string* field_name); - - // @@protoc_insertion_point(class_scope:milvus.grpc.FieldName) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr collection_name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr field_name_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class Mapping : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.Mapping) */ { - public: - Mapping(); - virtual ~Mapping(); - - Mapping(const Mapping& from); - Mapping(Mapping&& from) noexcept - : Mapping() { - *this = ::std::move(from); - } - - inline Mapping& operator=(const Mapping& from) { - CopyFrom(from); - return *this; - } - inline Mapping& operator=(Mapping&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const Mapping& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const Mapping* internal_default_instance() { - return reinterpret_cast( - &_Mapping_default_instance_); - } - static constexpr int kIndexInFileMessages = - 5; - - friend void swap(Mapping& a, Mapping& b) { - a.Swap(&b); - } - inline void Swap(Mapping* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline Mapping* New() const final { - return CreateMaybeMessage(nullptr); - } - - Mapping* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const Mapping& from); - void MergeFrom(const Mapping& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Mapping* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.Mapping"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kExtraParamsFieldNumber = 4, - kCollectionNameFieldNumber = 2, - kStatusFieldNumber = 1, - kSchemaFieldNumber = 3, - }; - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - int extra_params_size() const; - void clear_extra_params(); - ::milvus::grpc::KeyValuePair* mutable_extra_params(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* - mutable_extra_params(); - const ::milvus::grpc::KeyValuePair& extra_params(int index) const; - ::milvus::grpc::KeyValuePair* add_extra_params(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& - extra_params() const; - - // string collection_name = 2; - void clear_collection_name(); - const std::string& collection_name() const; - void set_collection_name(const std::string& value); - void set_collection_name(std::string&& value); - void set_collection_name(const char* value); - void set_collection_name(const char* value, size_t size); - std::string* mutable_collection_name(); - std::string* release_collection_name(); - void set_allocated_collection_name(std::string* collection_name); - - // .milvus.grpc.Status status = 1; - bool has_status() const; - void clear_status(); - const ::milvus::grpc::Status& status() const; - ::milvus::grpc::Status* release_status(); - ::milvus::grpc::Status* mutable_status(); - void set_allocated_status(::milvus::grpc::Status* status); - - // .milvus.grpc.Schema schema = 3; - bool has_schema() const; - void clear_schema(); - const ::milvus::grpc::Schema& schema() const; - ::milvus::grpc::Schema* release_schema(); - ::milvus::grpc::Schema* mutable_schema(); - void set_allocated_schema(::milvus::grpc::Schema* schema); - - // @@protoc_insertion_point(class_scope:milvus.grpc.Mapping) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair > extra_params_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr collection_name_; - ::milvus::grpc::Status* status_; - ::milvus::grpc::Schema* schema_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class MappingList : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.MappingList) */ { - public: - MappingList(); - virtual ~MappingList(); - - MappingList(const MappingList& from); - MappingList(MappingList&& from) noexcept - : MappingList() { - *this = ::std::move(from); - } - - inline MappingList& operator=(const MappingList& from) { - CopyFrom(from); - return *this; - } - inline MappingList& operator=(MappingList&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const MappingList& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const MappingList* internal_default_instance() { - return reinterpret_cast( - &_MappingList_default_instance_); - } - static constexpr int kIndexInFileMessages = - 6; - - friend void swap(MappingList& a, MappingList& b) { - a.Swap(&b); - } - inline void Swap(MappingList* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline MappingList* New() const final { - return CreateMaybeMessage(nullptr); - } - - MappingList* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const MappingList& from); - void MergeFrom(const MappingList& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(MappingList* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.MappingList"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kMappingListFieldNumber = 2, - kStatusFieldNumber = 1, - }; - // repeated .milvus.grpc.Mapping mapping_list = 2; - int mapping_list_size() const; - void clear_mapping_list(); - ::milvus::grpc::Mapping* mutable_mapping_list(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::Mapping >* - mutable_mapping_list(); - const ::milvus::grpc::Mapping& mapping_list(int index) const; - ::milvus::grpc::Mapping* add_mapping_list(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::Mapping >& - mapping_list() const; - - // .milvus.grpc.Status status = 1; - bool has_status() const; - void clear_status(); - const ::milvus::grpc::Status& status() const; - ::milvus::grpc::Status* release_status(); - ::milvus::grpc::Status* mutable_status(); - void set_allocated_status(::milvus::grpc::Status* status); - - // @@protoc_insertion_point(class_scope:milvus.grpc.MappingList) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::Mapping > mapping_list_; - ::milvus::grpc::Status* status_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class PartitionParam : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.PartitionParam) */ { - public: - PartitionParam(); - virtual ~PartitionParam(); - - PartitionParam(const PartitionParam& from); - PartitionParam(PartitionParam&& from) noexcept - : PartitionParam() { - *this = ::std::move(from); - } - - inline PartitionParam& operator=(const PartitionParam& from) { - CopyFrom(from); - return *this; - } - inline PartitionParam& operator=(PartitionParam&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const PartitionParam& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const PartitionParam* internal_default_instance() { - return reinterpret_cast( - &_PartitionParam_default_instance_); - } - static constexpr int kIndexInFileMessages = - 7; - - friend void swap(PartitionParam& a, PartitionParam& b) { - a.Swap(&b); - } - inline void Swap(PartitionParam* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline PartitionParam* New() const final { - return CreateMaybeMessage(nullptr); - } - - PartitionParam* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const PartitionParam& from); - void MergeFrom(const PartitionParam& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(PartitionParam* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.PartitionParam"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kCollectionNameFieldNumber = 1, - kTagFieldNumber = 2, - }; - // string collection_name = 1; - void clear_collection_name(); - const std::string& collection_name() const; - void set_collection_name(const std::string& value); - void set_collection_name(std::string&& value); - void set_collection_name(const char* value); - void set_collection_name(const char* value, size_t size); - std::string* mutable_collection_name(); - std::string* release_collection_name(); - void set_allocated_collection_name(std::string* collection_name); - - // string tag = 2; - void clear_tag(); - const std::string& tag() const; - void set_tag(const std::string& value); - void set_tag(std::string&& value); - void set_tag(const char* value); - void set_tag(const char* value, size_t size); - std::string* mutable_tag(); - std::string* release_tag(); - void set_allocated_tag(std::string* tag); - - // @@protoc_insertion_point(class_scope:milvus.grpc.PartitionParam) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr collection_name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr tag_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class PartitionList : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.PartitionList) */ { - public: - PartitionList(); - virtual ~PartitionList(); - - PartitionList(const PartitionList& from); - PartitionList(PartitionList&& from) noexcept - : PartitionList() { - *this = ::std::move(from); - } - - inline PartitionList& operator=(const PartitionList& from) { - CopyFrom(from); - return *this; - } - inline PartitionList& operator=(PartitionList&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const PartitionList& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const PartitionList* internal_default_instance() { - return reinterpret_cast( - &_PartitionList_default_instance_); - } - static constexpr int kIndexInFileMessages = - 8; - - friend void swap(PartitionList& a, PartitionList& b) { - a.Swap(&b); - } - inline void Swap(PartitionList* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline PartitionList* New() const final { - return CreateMaybeMessage(nullptr); - } - - PartitionList* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const PartitionList& from); - void MergeFrom(const PartitionList& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(PartitionList* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.PartitionList"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kPartitionTagArrayFieldNumber = 2, - kStatusFieldNumber = 1, - }; - // repeated string partition_tag_array = 2; - int partition_tag_array_size() const; - void clear_partition_tag_array(); - const std::string& partition_tag_array(int index) const; - std::string* mutable_partition_tag_array(int index); - void set_partition_tag_array(int index, const std::string& value); - void set_partition_tag_array(int index, std::string&& value); - void set_partition_tag_array(int index, const char* value); - void set_partition_tag_array(int index, const char* value, size_t size); - std::string* add_partition_tag_array(); - void add_partition_tag_array(const std::string& value); - void add_partition_tag_array(std::string&& value); - void add_partition_tag_array(const char* value); - void add_partition_tag_array(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& partition_tag_array() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_partition_tag_array(); - - // .milvus.grpc.Status status = 1; - bool has_status() const; - void clear_status(); - const ::milvus::grpc::Status& status() const; - ::milvus::grpc::Status* release_status(); - ::milvus::grpc::Status* mutable_status(); - void set_allocated_status(::milvus::grpc::Status* status); - - // @@protoc_insertion_point(class_scope:milvus.grpc.PartitionList) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField partition_tag_array_; - ::milvus::grpc::Status* status_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class VectorRowRecord : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.VectorRowRecord) */ { - public: - VectorRowRecord(); - virtual ~VectorRowRecord(); - - VectorRowRecord(const VectorRowRecord& from); - VectorRowRecord(VectorRowRecord&& from) noexcept - : VectorRowRecord() { - *this = ::std::move(from); - } - - inline VectorRowRecord& operator=(const VectorRowRecord& from) { - CopyFrom(from); - return *this; - } - inline VectorRowRecord& operator=(VectorRowRecord&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const VectorRowRecord& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const VectorRowRecord* internal_default_instance() { - return reinterpret_cast( - &_VectorRowRecord_default_instance_); - } - static constexpr int kIndexInFileMessages = - 9; - - friend void swap(VectorRowRecord& a, VectorRowRecord& b) { - a.Swap(&b); - } - inline void Swap(VectorRowRecord* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline VectorRowRecord* New() const final { - return CreateMaybeMessage(nullptr); - } - - VectorRowRecord* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const VectorRowRecord& from); - void MergeFrom(const VectorRowRecord& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(VectorRowRecord* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.VectorRowRecord"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kFloatDataFieldNumber = 1, - kBinaryDataFieldNumber = 2, - }; - // repeated float float_data = 1; - int float_data_size() const; - void clear_float_data(); - float float_data(int index) const; - void set_float_data(int index, float value); - void add_float_data(float value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >& - float_data() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >* - mutable_float_data(); - - // bytes binary_data = 2; - void clear_binary_data(); - const std::string& binary_data() const; - void set_binary_data(const std::string& value); - void set_binary_data(std::string&& value); - void set_binary_data(const char* value); - void set_binary_data(const void* value, size_t size); - std::string* mutable_binary_data(); - std::string* release_binary_data(); - void set_allocated_binary_data(std::string* binary_data); - - // @@protoc_insertion_point(class_scope:milvus.grpc.VectorRowRecord) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > float_data_; - mutable std::atomic _float_data_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr binary_data_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class EntityIds : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.EntityIds) */ { - public: - EntityIds(); - virtual ~EntityIds(); - - EntityIds(const EntityIds& from); - EntityIds(EntityIds&& from) noexcept - : EntityIds() { - *this = ::std::move(from); - } - - inline EntityIds& operator=(const EntityIds& from) { - CopyFrom(from); - return *this; - } - inline EntityIds& operator=(EntityIds&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const EntityIds& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const EntityIds* internal_default_instance() { - return reinterpret_cast( - &_EntityIds_default_instance_); - } - static constexpr int kIndexInFileMessages = - 10; - - friend void swap(EntityIds& a, EntityIds& b) { - a.Swap(&b); - } - inline void Swap(EntityIds* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline EntityIds* New() const final { - return CreateMaybeMessage(nullptr); - } - - EntityIds* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const EntityIds& from); - void MergeFrom(const EntityIds& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(EntityIds* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.EntityIds"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kEntityIdArrayFieldNumber = 2, - kStatusFieldNumber = 1, - }; - // repeated int64 entity_id_array = 2; - int entity_id_array_size() const; - void clear_entity_id_array(); - ::PROTOBUF_NAMESPACE_ID::int64 entity_id_array(int index) const; - void set_entity_id_array(int index, ::PROTOBUF_NAMESPACE_ID::int64 value); - void add_entity_id_array(::PROTOBUF_NAMESPACE_ID::int64 value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& - entity_id_array() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* - mutable_entity_id_array(); - - // .milvus.grpc.Status status = 1; - bool has_status() const; - void clear_status(); - const ::milvus::grpc::Status& status() const; - ::milvus::grpc::Status* release_status(); - ::milvus::grpc::Status* mutable_status(); - void set_allocated_status(::milvus::grpc::Status* status); - - // @@protoc_insertion_point(class_scope:milvus.grpc.EntityIds) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 > entity_id_array_; - mutable std::atomic _entity_id_array_cached_byte_size_; - ::milvus::grpc::Status* status_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class VectorRecord : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.VectorRecord) */ { - public: - VectorRecord(); - virtual ~VectorRecord(); - - VectorRecord(const VectorRecord& from); - VectorRecord(VectorRecord&& from) noexcept - : VectorRecord() { - *this = ::std::move(from); - } - - inline VectorRecord& operator=(const VectorRecord& from) { - CopyFrom(from); - return *this; - } - inline VectorRecord& operator=(VectorRecord&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const VectorRecord& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const VectorRecord* internal_default_instance() { - return reinterpret_cast( - &_VectorRecord_default_instance_); - } - static constexpr int kIndexInFileMessages = - 11; - - friend void swap(VectorRecord& a, VectorRecord& b) { - a.Swap(&b); - } - inline void Swap(VectorRecord* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline VectorRecord* New() const final { - return CreateMaybeMessage(nullptr); - } - - VectorRecord* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const VectorRecord& from); - void MergeFrom(const VectorRecord& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(VectorRecord* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.VectorRecord"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kRecordsFieldNumber = 1, - }; - // repeated .milvus.grpc.VectorRowRecord records = 1; - int records_size() const; - void clear_records(); - ::milvus::grpc::VectorRowRecord* mutable_records(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorRowRecord >* - mutable_records(); - const ::milvus::grpc::VectorRowRecord& records(int index) const; - ::milvus::grpc::VectorRowRecord* add_records(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorRowRecord >& - records() const; - - // @@protoc_insertion_point(class_scope:milvus.grpc.VectorRecord) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorRowRecord > records_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class VectorParam : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.VectorParam) */ { - public: - VectorParam(); - virtual ~VectorParam(); - - VectorParam(const VectorParam& from); - VectorParam(VectorParam&& from) noexcept - : VectorParam() { - *this = ::std::move(from); - } - - inline VectorParam& operator=(const VectorParam& from) { - CopyFrom(from); - return *this; - } - inline VectorParam& operator=(VectorParam&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const VectorParam& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const VectorParam* internal_default_instance() { - return reinterpret_cast( - &_VectorParam_default_instance_); - } - static constexpr int kIndexInFileMessages = - 12; - - friend void swap(VectorParam& a, VectorParam& b) { - a.Swap(&b); - } - inline void Swap(VectorParam* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline VectorParam* New() const final { - return CreateMaybeMessage(nullptr); - } - - VectorParam* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const VectorParam& from); - void MergeFrom(const VectorParam& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(VectorParam* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.VectorParam"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kJsonFieldNumber = 1, - kRowRecordFieldNumber = 2, - }; - // string json = 1; - void clear_json(); - const std::string& json() const; - void set_json(const std::string& value); - void set_json(std::string&& value); - void set_json(const char* value); - void set_json(const char* value, size_t size); - std::string* mutable_json(); - std::string* release_json(); - void set_allocated_json(std::string* json); - - // .milvus.grpc.VectorRecord row_record = 2; - bool has_row_record() const; - void clear_row_record(); - const ::milvus::grpc::VectorRecord& row_record() const; - ::milvus::grpc::VectorRecord* release_row_record(); - ::milvus::grpc::VectorRecord* mutable_row_record(); - void set_allocated_row_record(::milvus::grpc::VectorRecord* row_record); - - // @@protoc_insertion_point(class_scope:milvus.grpc.VectorParam) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr json_; - ::milvus::grpc::VectorRecord* row_record_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class FieldMeta : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.FieldMeta) */ { - public: - FieldMeta(); - virtual ~FieldMeta(); - - FieldMeta(const FieldMeta& from); - FieldMeta(FieldMeta&& from) noexcept - : FieldMeta() { - *this = ::std::move(from); - } - - inline FieldMeta& operator=(const FieldMeta& from) { - CopyFrom(from); - return *this; - } - inline FieldMeta& operator=(FieldMeta&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const FieldMeta& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const FieldMeta* internal_default_instance() { - return reinterpret_cast( - &_FieldMeta_default_instance_); - } - static constexpr int kIndexInFileMessages = - 13; - - friend void swap(FieldMeta& a, FieldMeta& b) { - a.Swap(&b); - } - inline void Swap(FieldMeta* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline FieldMeta* New() const final { - return CreateMaybeMessage(nullptr); - } - - FieldMeta* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const FieldMeta& from); - void MergeFrom(const FieldMeta& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(FieldMeta* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.FieldMeta"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kFieldNameFieldNumber = 1, - kDimFieldNumber = 3, - kTypeFieldNumber = 2, - }; - // string field_name = 1; - void clear_field_name(); - const std::string& field_name() const; - void set_field_name(const std::string& value); - void set_field_name(std::string&& value); - void set_field_name(const char* value); - void set_field_name(const char* value, size_t size); - std::string* mutable_field_name(); - std::string* release_field_name(); - void set_allocated_field_name(std::string* field_name); - - // int64 dim = 3; - void clear_dim(); - ::PROTOBUF_NAMESPACE_ID::int64 dim() const; - void set_dim(::PROTOBUF_NAMESPACE_ID::int64 value); - - // .milvus.grpc.DataType type = 2; - void clear_type(); - ::milvus::grpc::DataType type() const; - void set_type(::milvus::grpc::DataType value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.FieldMeta) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr field_name_; - ::PROTOBUF_NAMESPACE_ID::int64 dim_; - int type_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class Schema : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.Schema) */ { - public: - Schema(); - virtual ~Schema(); - - Schema(const Schema& from); - Schema(Schema&& from) noexcept - : Schema() { - *this = ::std::move(from); - } - - inline Schema& operator=(const Schema& from) { - CopyFrom(from); - return *this; - } - inline Schema& operator=(Schema&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const Schema& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const Schema* internal_default_instance() { - return reinterpret_cast( - &_Schema_default_instance_); - } - static constexpr int kIndexInFileMessages = - 14; - - friend void swap(Schema& a, Schema& b) { - a.Swap(&b); - } - inline void Swap(Schema* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline Schema* New() const final { - return CreateMaybeMessage(nullptr); - } - - Schema* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const Schema& from); - void MergeFrom(const Schema& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Schema* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.Schema"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kFieldMetasFieldNumber = 1, - }; - // repeated .milvus.grpc.FieldMeta field_metas = 1; - int field_metas_size() const; - void clear_field_metas(); - ::milvus::grpc::FieldMeta* mutable_field_metas(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::FieldMeta >* - mutable_field_metas(); - const ::milvus::grpc::FieldMeta& field_metas(int index) const; - ::milvus::grpc::FieldMeta* add_field_metas(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::FieldMeta >& - field_metas() const; - - // @@protoc_insertion_point(class_scope:milvus.grpc.Schema) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::FieldMeta > field_metas_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class RowData : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.RowData) */ { - public: - RowData(); - virtual ~RowData(); - - RowData(const RowData& from); - RowData(RowData&& from) noexcept - : RowData() { - *this = ::std::move(from); - } - - inline RowData& operator=(const RowData& from) { - CopyFrom(from); - return *this; - } - inline RowData& operator=(RowData&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const RowData& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const RowData* internal_default_instance() { - return reinterpret_cast( - &_RowData_default_instance_); - } - static constexpr int kIndexInFileMessages = - 15; - - friend void swap(RowData& a, RowData& b) { - a.Swap(&b); - } - inline void Swap(RowData* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline RowData* New() const final { - return CreateMaybeMessage(nullptr); - } - - RowData* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const RowData& from); - void MergeFrom(const RowData& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(RowData* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.RowData"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kBlobFieldNumber = 1, - }; - // bytes blob = 1; - void clear_blob(); - const std::string& blob() const; - void set_blob(const std::string& value); - void set_blob(std::string&& value); - void set_blob(const char* value); - void set_blob(const void* value, size_t size); - std::string* mutable_blob(); - std::string* release_blob(); - void set_allocated_blob(std::string* blob); - - // @@protoc_insertion_point(class_scope:milvus.grpc.RowData) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr blob_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class InsertParam : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.InsertParam) */ { - public: - InsertParam(); - virtual ~InsertParam(); - - InsertParam(const InsertParam& from); - InsertParam(InsertParam&& from) noexcept - : InsertParam() { - *this = ::std::move(from); - } - - inline InsertParam& operator=(const InsertParam& from) { - CopyFrom(from); - return *this; - } - inline InsertParam& operator=(InsertParam&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const InsertParam& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const InsertParam* internal_default_instance() { - return reinterpret_cast( - &_InsertParam_default_instance_); - } - static constexpr int kIndexInFileMessages = - 16; - - friend void swap(InsertParam& a, InsertParam& b) { - a.Swap(&b); - } - inline void Swap(InsertParam* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline InsertParam* New() const final { - return CreateMaybeMessage(nullptr); - } - - InsertParam* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const InsertParam& from); - void MergeFrom(const InsertParam& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(InsertParam* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.InsertParam"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kRowsDataFieldNumber = 3, - kEntityIdArrayFieldNumber = 4, - kExtraParamsFieldNumber = 6, - kCollectionNameFieldNumber = 1, - kPartitionTagFieldNumber = 5, - kSchemaFieldNumber = 2, - }; - // repeated .milvus.grpc.RowData rows_data = 3; - int rows_data_size() const; - void clear_rows_data(); - ::milvus::grpc::RowData* mutable_rows_data(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::RowData >* - mutable_rows_data(); - const ::milvus::grpc::RowData& rows_data(int index) const; - ::milvus::grpc::RowData* add_rows_data(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::RowData >& - rows_data() const; - - // repeated int64 entity_id_array = 4; - int entity_id_array_size() const; - void clear_entity_id_array(); - ::PROTOBUF_NAMESPACE_ID::int64 entity_id_array(int index) const; - void set_entity_id_array(int index, ::PROTOBUF_NAMESPACE_ID::int64 value); - void add_entity_id_array(::PROTOBUF_NAMESPACE_ID::int64 value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& - entity_id_array() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* - mutable_entity_id_array(); - - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - int extra_params_size() const; - void clear_extra_params(); - ::milvus::grpc::KeyValuePair* mutable_extra_params(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* - mutable_extra_params(); - const ::milvus::grpc::KeyValuePair& extra_params(int index) const; - ::milvus::grpc::KeyValuePair* add_extra_params(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& - extra_params() const; - - // string collection_name = 1; - void clear_collection_name(); - const std::string& collection_name() const; - void set_collection_name(const std::string& value); - void set_collection_name(std::string&& value); - void set_collection_name(const char* value); - void set_collection_name(const char* value, size_t size); - std::string* mutable_collection_name(); - std::string* release_collection_name(); - void set_allocated_collection_name(std::string* collection_name); - - // string partition_tag = 5; - void clear_partition_tag(); - const std::string& partition_tag() const; - void set_partition_tag(const std::string& value); - void set_partition_tag(std::string&& value); - void set_partition_tag(const char* value); - void set_partition_tag(const char* value, size_t size); - std::string* mutable_partition_tag(); - std::string* release_partition_tag(); - void set_allocated_partition_tag(std::string* partition_tag); - - // .milvus.grpc.Schema schema = 2; - bool has_schema() const; - void clear_schema(); - const ::milvus::grpc::Schema& schema() const; - ::milvus::grpc::Schema* release_schema(); - ::milvus::grpc::Schema* mutable_schema(); - void set_allocated_schema(::milvus::grpc::Schema* schema); - - // @@protoc_insertion_point(class_scope:milvus.grpc.InsertParam) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::RowData > rows_data_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 > entity_id_array_; - mutable std::atomic _entity_id_array_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair > extra_params_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr collection_name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr partition_tag_; - ::milvus::grpc::Schema* schema_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class SearchParam : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.SearchParam) */ { - public: - SearchParam(); - virtual ~SearchParam(); - - SearchParam(const SearchParam& from); - SearchParam(SearchParam&& from) noexcept - : SearchParam() { - *this = ::std::move(from); - } - - inline SearchParam& operator=(const SearchParam& from) { - CopyFrom(from); - return *this; - } - inline SearchParam& operator=(SearchParam&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const SearchParam& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const SearchParam* internal_default_instance() { - return reinterpret_cast( - &_SearchParam_default_instance_); - } - static constexpr int kIndexInFileMessages = - 17; - - friend void swap(SearchParam& a, SearchParam& b) { - a.Swap(&b); - } - inline void Swap(SearchParam* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline SearchParam* New() const final { - return CreateMaybeMessage(nullptr); - } - - SearchParam* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const SearchParam& from); - void MergeFrom(const SearchParam& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(SearchParam* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.SearchParam"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kVectorParamFieldNumber = 2, - kPartitionTagFieldNumber = 4, - kExtraParamsFieldNumber = 5, - kCollectionNameFieldNumber = 1, - kDslFieldNumber = 3, - }; - // repeated .milvus.grpc.VectorParam vector_param = 2; - int vector_param_size() const; - void clear_vector_param(); - ::milvus::grpc::VectorParam* mutable_vector_param(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorParam >* - mutable_vector_param(); - const ::milvus::grpc::VectorParam& vector_param(int index) const; - ::milvus::grpc::VectorParam* add_vector_param(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorParam >& - vector_param() const; - - // repeated string partition_tag = 4; - int partition_tag_size() const; - void clear_partition_tag(); - const std::string& partition_tag(int index) const; - std::string* mutable_partition_tag(int index); - void set_partition_tag(int index, const std::string& value); - void set_partition_tag(int index, std::string&& value); - void set_partition_tag(int index, const char* value); - void set_partition_tag(int index, const char* value, size_t size); - std::string* add_partition_tag(); - void add_partition_tag(const std::string& value); - void add_partition_tag(std::string&& value); - void add_partition_tag(const char* value); - void add_partition_tag(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& partition_tag() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_partition_tag(); - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - int extra_params_size() const; - void clear_extra_params(); - ::milvus::grpc::KeyValuePair* mutable_extra_params(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* - mutable_extra_params(); - const ::milvus::grpc::KeyValuePair& extra_params(int index) const; - ::milvus::grpc::KeyValuePair* add_extra_params(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& - extra_params() const; - - // string collection_name = 1; - void clear_collection_name(); - const std::string& collection_name() const; - void set_collection_name(const std::string& value); - void set_collection_name(std::string&& value); - void set_collection_name(const char* value); - void set_collection_name(const char* value, size_t size); - std::string* mutable_collection_name(); - std::string* release_collection_name(); - void set_allocated_collection_name(std::string* collection_name); - - // string dsl = 3; - void clear_dsl(); - const std::string& dsl() const; - void set_dsl(const std::string& value); - void set_dsl(std::string&& value); - void set_dsl(const char* value); - void set_dsl(const char* value, size_t size); - std::string* mutable_dsl(); - std::string* release_dsl(); - void set_allocated_dsl(std::string* dsl); - - // @@protoc_insertion_point(class_scope:milvus.grpc.SearchParam) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorParam > vector_param_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField partition_tag_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair > extra_params_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr collection_name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr dsl_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class SearchInSegmentParam : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.SearchInSegmentParam) */ { - public: - SearchInSegmentParam(); - virtual ~SearchInSegmentParam(); - - SearchInSegmentParam(const SearchInSegmentParam& from); - SearchInSegmentParam(SearchInSegmentParam&& from) noexcept - : SearchInSegmentParam() { - *this = ::std::move(from); - } - - inline SearchInSegmentParam& operator=(const SearchInSegmentParam& from) { - CopyFrom(from); - return *this; - } - inline SearchInSegmentParam& operator=(SearchInSegmentParam&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const SearchInSegmentParam& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const SearchInSegmentParam* internal_default_instance() { - return reinterpret_cast( - &_SearchInSegmentParam_default_instance_); - } - static constexpr int kIndexInFileMessages = - 18; - - friend void swap(SearchInSegmentParam& a, SearchInSegmentParam& b) { - a.Swap(&b); - } - inline void Swap(SearchInSegmentParam* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline SearchInSegmentParam* New() const final { - return CreateMaybeMessage(nullptr); - } - - SearchInSegmentParam* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const SearchInSegmentParam& from); - void MergeFrom(const SearchInSegmentParam& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(SearchInSegmentParam* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.SearchInSegmentParam"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kFileIdArrayFieldNumber = 1, - kSearchParamFieldNumber = 2, - }; - // repeated string file_id_array = 1; - int file_id_array_size() const; - void clear_file_id_array(); - const std::string& file_id_array(int index) const; - std::string* mutable_file_id_array(int index); - void set_file_id_array(int index, const std::string& value); - void set_file_id_array(int index, std::string&& value); - void set_file_id_array(int index, const char* value); - void set_file_id_array(int index, const char* value, size_t size); - std::string* add_file_id_array(); - void add_file_id_array(const std::string& value); - void add_file_id_array(std::string&& value); - void add_file_id_array(const char* value); - void add_file_id_array(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& file_id_array() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_file_id_array(); - - // .milvus.grpc.SearchParam search_param = 2; - bool has_search_param() const; - void clear_search_param(); - const ::milvus::grpc::SearchParam& search_param() const; - ::milvus::grpc::SearchParam* release_search_param(); - ::milvus::grpc::SearchParam* mutable_search_param(); - void set_allocated_search_param(::milvus::grpc::SearchParam* search_param); - - // @@protoc_insertion_point(class_scope:milvus.grpc.SearchInSegmentParam) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField file_id_array_; - ::milvus::grpc::SearchParam* search_param_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class Entities : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.Entities) */ { - public: - Entities(); - virtual ~Entities(); - - Entities(const Entities& from); - Entities(Entities&& from) noexcept - : Entities() { - *this = ::std::move(from); - } - - inline Entities& operator=(const Entities& from) { - CopyFrom(from); - return *this; - } - inline Entities& operator=(Entities&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const Entities& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const Entities* internal_default_instance() { - return reinterpret_cast( - &_Entities_default_instance_); - } - static constexpr int kIndexInFileMessages = - 19; - - friend void swap(Entities& a, Entities& b) { - a.Swap(&b); - } - inline void Swap(Entities* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline Entities* New() const final { - return CreateMaybeMessage(nullptr); - } - - Entities* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const Entities& from); - void MergeFrom(const Entities& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Entities* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.Entities"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kIdsFieldNumber = 2, - kValidRowFieldNumber = 3, - kRowsDataFieldNumber = 4, - kStatusFieldNumber = 1, - }; - // repeated int64 ids = 2; - int ids_size() const; - void clear_ids(); - ::PROTOBUF_NAMESPACE_ID::int64 ids(int index) const; - void set_ids(int index, ::PROTOBUF_NAMESPACE_ID::int64 value); - void add_ids(::PROTOBUF_NAMESPACE_ID::int64 value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& - ids() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* - mutable_ids(); - - // repeated bool valid_row = 3; - int valid_row_size() const; - void clear_valid_row(); - bool valid_row(int index) const; - void set_valid_row(int index, bool value); - void add_valid_row(bool value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >& - valid_row() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >* - mutable_valid_row(); - - // repeated .milvus.grpc.RowData rows_data = 4; - int rows_data_size() const; - void clear_rows_data(); - ::milvus::grpc::RowData* mutable_rows_data(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::RowData >* - mutable_rows_data(); - const ::milvus::grpc::RowData& rows_data(int index) const; - ::milvus::grpc::RowData* add_rows_data(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::RowData >& - rows_data() const; - - // .milvus.grpc.Status status = 1; - bool has_status() const; - void clear_status(); - const ::milvus::grpc::Status& status() const; - ::milvus::grpc::Status* release_status(); - ::milvus::grpc::Status* mutable_status(); - void set_allocated_status(::milvus::grpc::Status* status); - - // @@protoc_insertion_point(class_scope:milvus.grpc.Entities) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 > ids_; - mutable std::atomic _ids_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool > valid_row_; - mutable std::atomic _valid_row_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::RowData > rows_data_; - ::milvus::grpc::Status* status_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class QueryResult : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.QueryResult) */ { - public: - QueryResult(); - virtual ~QueryResult(); - - QueryResult(const QueryResult& from); - QueryResult(QueryResult&& from) noexcept - : QueryResult() { - *this = ::std::move(from); - } - - inline QueryResult& operator=(const QueryResult& from) { - CopyFrom(from); - return *this; - } - inline QueryResult& operator=(QueryResult&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const QueryResult& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const QueryResult* internal_default_instance() { - return reinterpret_cast( - &_QueryResult_default_instance_); - } - static constexpr int kIndexInFileMessages = - 20; - - friend void swap(QueryResult& a, QueryResult& b) { - a.Swap(&b); - } - inline void Swap(QueryResult* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline QueryResult* New() const final { - return CreateMaybeMessage(nullptr); - } - - QueryResult* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const QueryResult& from); - void MergeFrom(const QueryResult& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(QueryResult* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.QueryResult"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kScoresFieldNumber = 4, - kDistancesFieldNumber = 5, - kExtraParamsFieldNumber = 6, - kStatusFieldNumber = 1, - kEntitiesFieldNumber = 2, - kRowNumFieldNumber = 3, - kQueryIdFieldNumber = 7, - kClientIdFieldNumber = 8, - }; - // repeated float scores = 4; - int scores_size() const; - void clear_scores(); - float scores(int index) const; - void set_scores(int index, float value); - void add_scores(float value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >& - scores() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >* - mutable_scores(); - - // repeated float distances = 5; - int distances_size() const; - void clear_distances(); - float distances(int index) const; - void set_distances(int index, float value); - void add_distances(float value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >& - distances() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >* - mutable_distances(); - - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - int extra_params_size() const; - void clear_extra_params(); - ::milvus::grpc::KeyValuePair* mutable_extra_params(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* - mutable_extra_params(); - const ::milvus::grpc::KeyValuePair& extra_params(int index) const; - ::milvus::grpc::KeyValuePair* add_extra_params(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& - extra_params() const; - - // .milvus.grpc.Status status = 1; - bool has_status() const; - void clear_status(); - const ::milvus::grpc::Status& status() const; - ::milvus::grpc::Status* release_status(); - ::milvus::grpc::Status* mutable_status(); - void set_allocated_status(::milvus::grpc::Status* status); - - // .milvus.grpc.Entities entities = 2; - bool has_entities() const; - void clear_entities(); - const ::milvus::grpc::Entities& entities() const; - ::milvus::grpc::Entities* release_entities(); - ::milvus::grpc::Entities* mutable_entities(); - void set_allocated_entities(::milvus::grpc::Entities* entities); - - // int64 row_num = 3; - void clear_row_num(); - ::PROTOBUF_NAMESPACE_ID::int64 row_num() const; - void set_row_num(::PROTOBUF_NAMESPACE_ID::int64 value); - - // int64 query_id = 7; - void clear_query_id(); - ::PROTOBUF_NAMESPACE_ID::int64 query_id() const; - void set_query_id(::PROTOBUF_NAMESPACE_ID::int64 value); - - // int64 client_id = 8; - void clear_client_id(); - ::PROTOBUF_NAMESPACE_ID::int64 client_id() const; - void set_client_id(::PROTOBUF_NAMESPACE_ID::int64 value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.QueryResult) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > scores_; - mutable std::atomic _scores_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< float > distances_; - mutable std::atomic _distances_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair > extra_params_; - ::milvus::grpc::Status* status_; - ::milvus::grpc::Entities* entities_; - ::PROTOBUF_NAMESPACE_ID::int64 row_num_; - ::PROTOBUF_NAMESPACE_ID::int64 query_id_; - ::PROTOBUF_NAMESPACE_ID::int64 client_id_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class StringReply : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.StringReply) */ { - public: - StringReply(); - virtual ~StringReply(); - - StringReply(const StringReply& from); - StringReply(StringReply&& from) noexcept - : StringReply() { - *this = ::std::move(from); - } - - inline StringReply& operator=(const StringReply& from) { - CopyFrom(from); - return *this; - } - inline StringReply& operator=(StringReply&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const StringReply& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const StringReply* internal_default_instance() { - return reinterpret_cast( - &_StringReply_default_instance_); - } - static constexpr int kIndexInFileMessages = - 21; - - friend void swap(StringReply& a, StringReply& b) { - a.Swap(&b); - } - inline void Swap(StringReply* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline StringReply* New() const final { - return CreateMaybeMessage(nullptr); - } - - StringReply* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const StringReply& from); - void MergeFrom(const StringReply& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(StringReply* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.StringReply"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kStringReplyFieldNumber = 2, - kStatusFieldNumber = 1, - }; - // string string_reply = 2; - void clear_string_reply(); - const std::string& string_reply() const; - void set_string_reply(const std::string& value); - void set_string_reply(std::string&& value); - void set_string_reply(const char* value); - void set_string_reply(const char* value, size_t size); - std::string* mutable_string_reply(); - std::string* release_string_reply(); - void set_allocated_string_reply(std::string* string_reply); - - // .milvus.grpc.Status status = 1; - bool has_status() const; - void clear_status(); - const ::milvus::grpc::Status& status() const; - ::milvus::grpc::Status* release_status(); - ::milvus::grpc::Status* mutable_status(); - void set_allocated_status(::milvus::grpc::Status* status); - - // @@protoc_insertion_point(class_scope:milvus.grpc.StringReply) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr string_reply_; - ::milvus::grpc::Status* status_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class BoolReply : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.BoolReply) */ { - public: - BoolReply(); - virtual ~BoolReply(); - - BoolReply(const BoolReply& from); - BoolReply(BoolReply&& from) noexcept - : BoolReply() { - *this = ::std::move(from); - } - - inline BoolReply& operator=(const BoolReply& from) { - CopyFrom(from); - return *this; - } - inline BoolReply& operator=(BoolReply&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const BoolReply& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const BoolReply* internal_default_instance() { - return reinterpret_cast( - &_BoolReply_default_instance_); - } - static constexpr int kIndexInFileMessages = - 22; - - friend void swap(BoolReply& a, BoolReply& b) { - a.Swap(&b); - } - inline void Swap(BoolReply* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline BoolReply* New() const final { - return CreateMaybeMessage(nullptr); - } - - BoolReply* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const BoolReply& from); - void MergeFrom(const BoolReply& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(BoolReply* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.BoolReply"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kStatusFieldNumber = 1, - kBoolReplyFieldNumber = 2, - }; - // .milvus.grpc.Status status = 1; - bool has_status() const; - void clear_status(); - const ::milvus::grpc::Status& status() const; - ::milvus::grpc::Status* release_status(); - ::milvus::grpc::Status* mutable_status(); - void set_allocated_status(::milvus::grpc::Status* status); - - // bool bool_reply = 2; - void clear_bool_reply(); - bool bool_reply() const; - void set_bool_reply(bool value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.BoolReply) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::milvus::grpc::Status* status_; - bool bool_reply_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class CollectionRowCount : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.CollectionRowCount) */ { - public: - CollectionRowCount(); - virtual ~CollectionRowCount(); - - CollectionRowCount(const CollectionRowCount& from); - CollectionRowCount(CollectionRowCount&& from) noexcept - : CollectionRowCount() { - *this = ::std::move(from); - } - - inline CollectionRowCount& operator=(const CollectionRowCount& from) { - CopyFrom(from); - return *this; - } - inline CollectionRowCount& operator=(CollectionRowCount&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const CollectionRowCount& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const CollectionRowCount* internal_default_instance() { - return reinterpret_cast( - &_CollectionRowCount_default_instance_); - } - static constexpr int kIndexInFileMessages = - 23; - - friend void swap(CollectionRowCount& a, CollectionRowCount& b) { - a.Swap(&b); - } - inline void Swap(CollectionRowCount* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline CollectionRowCount* New() const final { - return CreateMaybeMessage(nullptr); - } - - CollectionRowCount* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const CollectionRowCount& from); - void MergeFrom(const CollectionRowCount& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(CollectionRowCount* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.CollectionRowCount"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kStatusFieldNumber = 1, - kCollectionRowCountFieldNumber = 2, - }; - // .milvus.grpc.Status status = 1; - bool has_status() const; - void clear_status(); - const ::milvus::grpc::Status& status() const; - ::milvus::grpc::Status* release_status(); - ::milvus::grpc::Status* mutable_status(); - void set_allocated_status(::milvus::grpc::Status* status); - - // int64 collection_row_count = 2; - void clear_collection_row_count(); - ::PROTOBUF_NAMESPACE_ID::int64 collection_row_count() const; - void set_collection_row_count(::PROTOBUF_NAMESPACE_ID::int64 value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.CollectionRowCount) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::milvus::grpc::Status* status_; - ::PROTOBUF_NAMESPACE_ID::int64 collection_row_count_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class Command : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.Command) */ { - public: - Command(); - virtual ~Command(); - - Command(const Command& from); - Command(Command&& from) noexcept - : Command() { - *this = ::std::move(from); - } - - inline Command& operator=(const Command& from) { - CopyFrom(from); - return *this; - } - inline Command& operator=(Command&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const Command& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const Command* internal_default_instance() { - return reinterpret_cast( - &_Command_default_instance_); - } - static constexpr int kIndexInFileMessages = - 24; - - friend void swap(Command& a, Command& b) { - a.Swap(&b); - } - inline void Swap(Command* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline Command* New() const final { - return CreateMaybeMessage(nullptr); - } - - Command* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const Command& from); - void MergeFrom(const Command& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Command* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.Command"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kCmdFieldNumber = 1, - }; - // string cmd = 1; - void clear_cmd(); - const std::string& cmd() const; - void set_cmd(const std::string& value); - void set_cmd(std::string&& value); - void set_cmd(const char* value); - void set_cmd(const char* value, size_t size); - std::string* mutable_cmd(); - std::string* release_cmd(); - void set_allocated_cmd(std::string* cmd); - - // @@protoc_insertion_point(class_scope:milvus.grpc.Command) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr cmd_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class IndexParam : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.IndexParam) */ { - public: - IndexParam(); - virtual ~IndexParam(); - - IndexParam(const IndexParam& from); - IndexParam(IndexParam&& from) noexcept - : IndexParam() { - *this = ::std::move(from); - } - - inline IndexParam& operator=(const IndexParam& from) { - CopyFrom(from); - return *this; - } - inline IndexParam& operator=(IndexParam&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const IndexParam& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const IndexParam* internal_default_instance() { - return reinterpret_cast( - &_IndexParam_default_instance_); - } - static constexpr int kIndexInFileMessages = - 25; - - friend void swap(IndexParam& a, IndexParam& b) { - a.Swap(&b); - } - inline void Swap(IndexParam* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline IndexParam* New() const final { - return CreateMaybeMessage(nullptr); - } - - IndexParam* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const IndexParam& from); - void MergeFrom(const IndexParam& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(IndexParam* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.IndexParam"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kExtraParamsFieldNumber = 5, - kCollectionNameFieldNumber = 2, - kFieldNameFieldNumber = 3, - kIndexNameFieldNumber = 4, - kStatusFieldNumber = 1, - }; - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - int extra_params_size() const; - void clear_extra_params(); - ::milvus::grpc::KeyValuePair* mutable_extra_params(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* - mutable_extra_params(); - const ::milvus::grpc::KeyValuePair& extra_params(int index) const; - ::milvus::grpc::KeyValuePair* add_extra_params(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& - extra_params() const; - - // string collection_name = 2; - void clear_collection_name(); - const std::string& collection_name() const; - void set_collection_name(const std::string& value); - void set_collection_name(std::string&& value); - void set_collection_name(const char* value); - void set_collection_name(const char* value, size_t size); - std::string* mutable_collection_name(); - std::string* release_collection_name(); - void set_allocated_collection_name(std::string* collection_name); - - // string field_name = 3; - void clear_field_name(); - const std::string& field_name() const; - void set_field_name(const std::string& value); - void set_field_name(std::string&& value); - void set_field_name(const char* value); - void set_field_name(const char* value, size_t size); - std::string* mutable_field_name(); - std::string* release_field_name(); - void set_allocated_field_name(std::string* field_name); - - // string index_name = 4; - void clear_index_name(); - const std::string& index_name() const; - void set_index_name(const std::string& value); - void set_index_name(std::string&& value); - void set_index_name(const char* value); - void set_index_name(const char* value, size_t size); - std::string* mutable_index_name(); - std::string* release_index_name(); - void set_allocated_index_name(std::string* index_name); - - // .milvus.grpc.Status status = 1; - bool has_status() const; - void clear_status(); - const ::milvus::grpc::Status& status() const; - ::milvus::grpc::Status* release_status(); - ::milvus::grpc::Status* mutable_status(); - void set_allocated_status(::milvus::grpc::Status* status); - - // @@protoc_insertion_point(class_scope:milvus.grpc.IndexParam) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair > extra_params_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr collection_name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr field_name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr index_name_; - ::milvus::grpc::Status* status_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class FlushParam : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.FlushParam) */ { - public: - FlushParam(); - virtual ~FlushParam(); - - FlushParam(const FlushParam& from); - FlushParam(FlushParam&& from) noexcept - : FlushParam() { - *this = ::std::move(from); - } - - inline FlushParam& operator=(const FlushParam& from) { - CopyFrom(from); - return *this; - } - inline FlushParam& operator=(FlushParam&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const FlushParam& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const FlushParam* internal_default_instance() { - return reinterpret_cast( - &_FlushParam_default_instance_); - } - static constexpr int kIndexInFileMessages = - 26; - - friend void swap(FlushParam& a, FlushParam& b) { - a.Swap(&b); - } - inline void Swap(FlushParam* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline FlushParam* New() const final { - return CreateMaybeMessage(nullptr); - } - - FlushParam* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const FlushParam& from); - void MergeFrom(const FlushParam& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(FlushParam* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.FlushParam"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kCollectionNameArrayFieldNumber = 1, - }; - // repeated string collection_name_array = 1; - int collection_name_array_size() const; - void clear_collection_name_array(); - const std::string& collection_name_array(int index) const; - std::string* mutable_collection_name_array(int index); - void set_collection_name_array(int index, const std::string& value); - void set_collection_name_array(int index, std::string&& value); - void set_collection_name_array(int index, const char* value); - void set_collection_name_array(int index, const char* value, size_t size); - std::string* add_collection_name_array(); - void add_collection_name_array(const std::string& value); - void add_collection_name_array(std::string&& value); - void add_collection_name_array(const char* value); - void add_collection_name_array(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& collection_name_array() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_collection_name_array(); - - // @@protoc_insertion_point(class_scope:milvus.grpc.FlushParam) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField collection_name_array_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class CompactParam : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.CompactParam) */ { - public: - CompactParam(); - virtual ~CompactParam(); - - CompactParam(const CompactParam& from); - CompactParam(CompactParam&& from) noexcept - : CompactParam() { - *this = ::std::move(from); - } - - inline CompactParam& operator=(const CompactParam& from) { - CopyFrom(from); - return *this; - } - inline CompactParam& operator=(CompactParam&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const CompactParam& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const CompactParam* internal_default_instance() { - return reinterpret_cast( - &_CompactParam_default_instance_); - } - static constexpr int kIndexInFileMessages = - 27; - - friend void swap(CompactParam& a, CompactParam& b) { - a.Swap(&b); - } - inline void Swap(CompactParam* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline CompactParam* New() const final { - return CreateMaybeMessage(nullptr); - } - - CompactParam* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const CompactParam& from); - void MergeFrom(const CompactParam& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(CompactParam* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.CompactParam"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kCollectionNameFieldNumber = 1, - kThresholdFieldNumber = 2, - }; - // string collection_name = 1; - void clear_collection_name(); - const std::string& collection_name() const; - void set_collection_name(const std::string& value); - void set_collection_name(std::string&& value); - void set_collection_name(const char* value); - void set_collection_name(const char* value, size_t size); - std::string* mutable_collection_name(); - std::string* release_collection_name(); - void set_allocated_collection_name(std::string* collection_name); - - // double threshold = 2; - void clear_threshold(); - double threshold() const; - void set_threshold(double value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.CompactParam) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr collection_name_; - double threshold_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class DeleteByIDParam : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.DeleteByIDParam) */ { - public: - DeleteByIDParam(); - virtual ~DeleteByIDParam(); - - DeleteByIDParam(const DeleteByIDParam& from); - DeleteByIDParam(DeleteByIDParam&& from) noexcept - : DeleteByIDParam() { - *this = ::std::move(from); - } - - inline DeleteByIDParam& operator=(const DeleteByIDParam& from) { - CopyFrom(from); - return *this; - } - inline DeleteByIDParam& operator=(DeleteByIDParam&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const DeleteByIDParam& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const DeleteByIDParam* internal_default_instance() { - return reinterpret_cast( - &_DeleteByIDParam_default_instance_); - } - static constexpr int kIndexInFileMessages = - 28; - - friend void swap(DeleteByIDParam& a, DeleteByIDParam& b) { - a.Swap(&b); - } - inline void Swap(DeleteByIDParam* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline DeleteByIDParam* New() const final { - return CreateMaybeMessage(nullptr); - } - - DeleteByIDParam* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const DeleteByIDParam& from); - void MergeFrom(const DeleteByIDParam& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(DeleteByIDParam* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.DeleteByIDParam"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kIdArrayFieldNumber = 2, - kCollectionNameFieldNumber = 1, - }; - // repeated int64 id_array = 2; - int id_array_size() const; - void clear_id_array(); - ::PROTOBUF_NAMESPACE_ID::int64 id_array(int index) const; - void set_id_array(int index, ::PROTOBUF_NAMESPACE_ID::int64 value); - void add_id_array(::PROTOBUF_NAMESPACE_ID::int64 value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& - id_array() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* - mutable_id_array(); - - // string collection_name = 1; - void clear_collection_name(); - const std::string& collection_name() const; - void set_collection_name(const std::string& value); - void set_collection_name(std::string&& value); - void set_collection_name(const char* value); - void set_collection_name(const char* value, size_t size); - std::string* mutable_collection_name(); - std::string* release_collection_name(); - void set_allocated_collection_name(std::string* collection_name); - - // @@protoc_insertion_point(class_scope:milvus.grpc.DeleteByIDParam) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 > id_array_; - mutable std::atomic _id_array_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr collection_name_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class CollectionInfo : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.CollectionInfo) */ { - public: - CollectionInfo(); - virtual ~CollectionInfo(); - - CollectionInfo(const CollectionInfo& from); - CollectionInfo(CollectionInfo&& from) noexcept - : CollectionInfo() { - *this = ::std::move(from); - } - - inline CollectionInfo& operator=(const CollectionInfo& from) { - CopyFrom(from); - return *this; - } - inline CollectionInfo& operator=(CollectionInfo&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const CollectionInfo& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const CollectionInfo* internal_default_instance() { - return reinterpret_cast( - &_CollectionInfo_default_instance_); - } - static constexpr int kIndexInFileMessages = - 29; - - friend void swap(CollectionInfo& a, CollectionInfo& b) { - a.Swap(&b); - } - inline void Swap(CollectionInfo* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline CollectionInfo* New() const final { - return CreateMaybeMessage(nullptr); - } - - CollectionInfo* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const CollectionInfo& from); - void MergeFrom(const CollectionInfo& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(CollectionInfo* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.CollectionInfo"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kJsonInfoFieldNumber = 2, - kStatusFieldNumber = 1, - }; - // string json_info = 2; - void clear_json_info(); - const std::string& json_info() const; - void set_json_info(const std::string& value); - void set_json_info(std::string&& value); - void set_json_info(const char* value); - void set_json_info(const char* value, size_t size); - std::string* mutable_json_info(); - std::string* release_json_info(); - void set_allocated_json_info(std::string* json_info); - - // .milvus.grpc.Status status = 1; - bool has_status() const; - void clear_status(); - const ::milvus::grpc::Status& status() const; - ::milvus::grpc::Status* release_status(); - ::milvus::grpc::Status* mutable_status(); - void set_allocated_status(::milvus::grpc::Status* status); - - // @@protoc_insertion_point(class_scope:milvus.grpc.CollectionInfo) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr json_info_; - ::milvus::grpc::Status* status_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class GetEntityIDsParam : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.GetEntityIDsParam) */ { - public: - GetEntityIDsParam(); - virtual ~GetEntityIDsParam(); - - GetEntityIDsParam(const GetEntityIDsParam& from); - GetEntityIDsParam(GetEntityIDsParam&& from) noexcept - : GetEntityIDsParam() { - *this = ::std::move(from); - } - - inline GetEntityIDsParam& operator=(const GetEntityIDsParam& from) { - CopyFrom(from); - return *this; - } - inline GetEntityIDsParam& operator=(GetEntityIDsParam&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const GetEntityIDsParam& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const GetEntityIDsParam* internal_default_instance() { - return reinterpret_cast( - &_GetEntityIDsParam_default_instance_); - } - static constexpr int kIndexInFileMessages = - 30; - - friend void swap(GetEntityIDsParam& a, GetEntityIDsParam& b) { - a.Swap(&b); - } - inline void Swap(GetEntityIDsParam* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline GetEntityIDsParam* New() const final { - return CreateMaybeMessage(nullptr); - } - - GetEntityIDsParam* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const GetEntityIDsParam& from); - void MergeFrom(const GetEntityIDsParam& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(GetEntityIDsParam* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.GetEntityIDsParam"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kCollectionNameFieldNumber = 1, - kSegmentIdFieldNumber = 2, - }; - // string collection_name = 1; - void clear_collection_name(); - const std::string& collection_name() const; - void set_collection_name(const std::string& value); - void set_collection_name(std::string&& value); - void set_collection_name(const char* value); - void set_collection_name(const char* value, size_t size); - std::string* mutable_collection_name(); - std::string* release_collection_name(); - void set_allocated_collection_name(std::string* collection_name); - - // int64 segment_id = 2; - void clear_segment_id(); - ::PROTOBUF_NAMESPACE_ID::int64 segment_id() const; - void set_segment_id(::PROTOBUF_NAMESPACE_ID::int64 value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.GetEntityIDsParam) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr collection_name_; - ::PROTOBUF_NAMESPACE_ID::int64 segment_id_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class EntityIdentity : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.EntityIdentity) */ { - public: - EntityIdentity(); - virtual ~EntityIdentity(); - - EntityIdentity(const EntityIdentity& from); - EntityIdentity(EntityIdentity&& from) noexcept - : EntityIdentity() { - *this = ::std::move(from); - } - - inline EntityIdentity& operator=(const EntityIdentity& from) { - CopyFrom(from); - return *this; - } - inline EntityIdentity& operator=(EntityIdentity&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const EntityIdentity& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const EntityIdentity* internal_default_instance() { - return reinterpret_cast( - &_EntityIdentity_default_instance_); - } - static constexpr int kIndexInFileMessages = - 31; - - friend void swap(EntityIdentity& a, EntityIdentity& b) { - a.Swap(&b); - } - inline void Swap(EntityIdentity* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline EntityIdentity* New() const final { - return CreateMaybeMessage(nullptr); - } - - EntityIdentity* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const EntityIdentity& from); - void MergeFrom(const EntityIdentity& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(EntityIdentity* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.EntityIdentity"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kIdArrayFieldNumber = 2, - kFieldNamesFieldNumber = 3, - kCollectionNameFieldNumber = 1, - }; - // repeated int64 id_array = 2; - int id_array_size() const; - void clear_id_array(); - ::PROTOBUF_NAMESPACE_ID::int64 id_array(int index) const; - void set_id_array(int index, ::PROTOBUF_NAMESPACE_ID::int64 value); - void add_id_array(::PROTOBUF_NAMESPACE_ID::int64 value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& - id_array() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* - mutable_id_array(); - - // repeated string field_names = 3; - int field_names_size() const; - void clear_field_names(); - const std::string& field_names(int index) const; - std::string* mutable_field_names(int index); - void set_field_names(int index, const std::string& value); - void set_field_names(int index, std::string&& value); - void set_field_names(int index, const char* value); - void set_field_names(int index, const char* value, size_t size); - std::string* add_field_names(); - void add_field_names(const std::string& value); - void add_field_names(std::string&& value); - void add_field_names(const char* value); - void add_field_names(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& field_names() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_field_names(); - - // string collection_name = 1; - void clear_collection_name(); - const std::string& collection_name() const; - void set_collection_name(const std::string& value); - void set_collection_name(std::string&& value); - void set_collection_name(const char* value); - void set_collection_name(const char* value, size_t size); - std::string* mutable_collection_name(); - std::string* release_collection_name(); - void set_allocated_collection_name(std::string* collection_name); - - // @@protoc_insertion_point(class_scope:milvus.grpc.EntityIdentity) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 > id_array_; - mutable std::atomic _id_array_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField field_names_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr collection_name_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class VectorFieldParam : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.VectorFieldParam) */ { - public: - VectorFieldParam(); - virtual ~VectorFieldParam(); - - VectorFieldParam(const VectorFieldParam& from); - VectorFieldParam(VectorFieldParam&& from) noexcept - : VectorFieldParam() { - *this = ::std::move(from); - } - - inline VectorFieldParam& operator=(const VectorFieldParam& from) { - CopyFrom(from); - return *this; - } - inline VectorFieldParam& operator=(VectorFieldParam&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const VectorFieldParam& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const VectorFieldParam* internal_default_instance() { - return reinterpret_cast( - &_VectorFieldParam_default_instance_); - } - static constexpr int kIndexInFileMessages = - 32; - - friend void swap(VectorFieldParam& a, VectorFieldParam& b) { - a.Swap(&b); - } - inline void Swap(VectorFieldParam* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline VectorFieldParam* New() const final { - return CreateMaybeMessage(nullptr); - } - - VectorFieldParam* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const VectorFieldParam& from); - void MergeFrom(const VectorFieldParam& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(VectorFieldParam* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.VectorFieldParam"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kDimensionFieldNumber = 1, - }; - // int64 dimension = 1; - void clear_dimension(); - ::PROTOBUF_NAMESPACE_ID::int64 dimension() const; - void set_dimension(::PROTOBUF_NAMESPACE_ID::int64 value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.VectorFieldParam) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::int64 dimension_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class FieldType : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.FieldType) */ { - public: - FieldType(); - virtual ~FieldType(); - - FieldType(const FieldType& from); - FieldType(FieldType&& from) noexcept - : FieldType() { - *this = ::std::move(from); - } - - inline FieldType& operator=(const FieldType& from) { - CopyFrom(from); - return *this; - } - inline FieldType& operator=(FieldType&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const FieldType& default_instance(); - - enum ValueCase { - kDataType = 1, - kVectorParam = 2, - VALUE_NOT_SET = 0, - }; - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const FieldType* internal_default_instance() { - return reinterpret_cast( - &_FieldType_default_instance_); - } - static constexpr int kIndexInFileMessages = - 33; - - friend void swap(FieldType& a, FieldType& b) { - a.Swap(&b); - } - inline void Swap(FieldType* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline FieldType* New() const final { - return CreateMaybeMessage(nullptr); - } - - FieldType* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const FieldType& from); - void MergeFrom(const FieldType& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(FieldType* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.FieldType"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kDataTypeFieldNumber = 1, - kVectorParamFieldNumber = 2, - }; - // .milvus.grpc.DataType data_type = 1; - private: - bool has_data_type() const; - public: - void clear_data_type(); - ::milvus::grpc::DataType data_type() const; - void set_data_type(::milvus::grpc::DataType value); - - // .milvus.grpc.VectorFieldParam vector_param = 2; - bool has_vector_param() const; - void clear_vector_param(); - const ::milvus::grpc::VectorFieldParam& vector_param() const; - ::milvus::grpc::VectorFieldParam* release_vector_param(); - ::milvus::grpc::VectorFieldParam* mutable_vector_param(); - void set_allocated_vector_param(::milvus::grpc::VectorFieldParam* vector_param); - - void clear_value(); - ValueCase value_case() const; - // @@protoc_insertion_point(class_scope:milvus.grpc.FieldType) - private: - class _Internal; - void set_has_data_type(); - void set_has_vector_param(); - - inline bool has_value() const; - inline void clear_has_value(); - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - union ValueUnion { - ValueUnion() {} - int data_type_; - ::milvus::grpc::VectorFieldParam* vector_param_; - } value_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; - - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class FieldParam : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.FieldParam) */ { - public: - FieldParam(); - virtual ~FieldParam(); - - FieldParam(const FieldParam& from); - FieldParam(FieldParam&& from) noexcept - : FieldParam() { - *this = ::std::move(from); - } - - inline FieldParam& operator=(const FieldParam& from) { - CopyFrom(from); - return *this; - } - inline FieldParam& operator=(FieldParam&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const FieldParam& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const FieldParam* internal_default_instance() { - return reinterpret_cast( - &_FieldParam_default_instance_); - } - static constexpr int kIndexInFileMessages = - 34; - - friend void swap(FieldParam& a, FieldParam& b) { - a.Swap(&b); - } - inline void Swap(FieldParam* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline FieldParam* New() const final { - return CreateMaybeMessage(nullptr); - } - - FieldParam* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const FieldParam& from); - void MergeFrom(const FieldParam& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(FieldParam* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.FieldParam"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kIndexParamsFieldNumber = 4, - kExtraParamsFieldNumber = 5, - kNameFieldNumber = 2, - kIdFieldNumber = 1, - kTypeFieldNumber = 3, - }; - // repeated .milvus.grpc.KeyValuePair index_params = 4; - int index_params_size() const; - void clear_index_params(); - ::milvus::grpc::KeyValuePair* mutable_index_params(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* - mutable_index_params(); - const ::milvus::grpc::KeyValuePair& index_params(int index) const; - ::milvus::grpc::KeyValuePair* add_index_params(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& - index_params() const; - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - int extra_params_size() const; - void clear_extra_params(); - ::milvus::grpc::KeyValuePair* mutable_extra_params(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* - mutable_extra_params(); - const ::milvus::grpc::KeyValuePair& extra_params(int index) const; - ::milvus::grpc::KeyValuePair* add_extra_params(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& - extra_params() const; - - // string name = 2; - void clear_name(); - const std::string& name() const; - void set_name(const std::string& value); - void set_name(std::string&& value); - void set_name(const char* value); - void set_name(const char* value, size_t size); - std::string* mutable_name(); - std::string* release_name(); - void set_allocated_name(std::string* name); - - // uint64 id = 1; - void clear_id(); - ::PROTOBUF_NAMESPACE_ID::uint64 id() const; - void set_id(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // .milvus.grpc.DataType type = 3; - void clear_type(); - ::milvus::grpc::DataType type() const; - void set_type(::milvus::grpc::DataType value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.FieldParam) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair > index_params_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair > extra_params_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::uint64 id_; - int type_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class VectorFieldRecord : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.VectorFieldRecord) */ { - public: - VectorFieldRecord(); - virtual ~VectorFieldRecord(); - - VectorFieldRecord(const VectorFieldRecord& from); - VectorFieldRecord(VectorFieldRecord&& from) noexcept - : VectorFieldRecord() { - *this = ::std::move(from); - } - - inline VectorFieldRecord& operator=(const VectorFieldRecord& from) { - CopyFrom(from); - return *this; - } - inline VectorFieldRecord& operator=(VectorFieldRecord&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const VectorFieldRecord& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const VectorFieldRecord* internal_default_instance() { - return reinterpret_cast( - &_VectorFieldRecord_default_instance_); - } - static constexpr int kIndexInFileMessages = - 35; - - friend void swap(VectorFieldRecord& a, VectorFieldRecord& b) { - a.Swap(&b); - } - inline void Swap(VectorFieldRecord* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline VectorFieldRecord* New() const final { - return CreateMaybeMessage(nullptr); - } - - VectorFieldRecord* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const VectorFieldRecord& from); - void MergeFrom(const VectorFieldRecord& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(VectorFieldRecord* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.VectorFieldRecord"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kValueFieldNumber = 1, - }; - // repeated .milvus.grpc.VectorRowRecord value = 1; - int value_size() const; - void clear_value(); - ::milvus::grpc::VectorRowRecord* mutable_value(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorRowRecord >* - mutable_value(); - const ::milvus::grpc::VectorRowRecord& value(int index) const; - ::milvus::grpc::VectorRowRecord* add_value(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorRowRecord >& - value() const; - - // @@protoc_insertion_point(class_scope:milvus.grpc.VectorFieldRecord) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorRowRecord > value_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class TermQuery : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.TermQuery) */ { - public: - TermQuery(); - virtual ~TermQuery(); - - TermQuery(const TermQuery& from); - TermQuery(TermQuery&& from) noexcept - : TermQuery() { - *this = ::std::move(from); - } - - inline TermQuery& operator=(const TermQuery& from) { - CopyFrom(from); - return *this; - } - inline TermQuery& operator=(TermQuery&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const TermQuery& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const TermQuery* internal_default_instance() { - return reinterpret_cast( - &_TermQuery_default_instance_); - } - static constexpr int kIndexInFileMessages = - 36; - - friend void swap(TermQuery& a, TermQuery& b) { - a.Swap(&b); - } - inline void Swap(TermQuery* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline TermQuery* New() const final { - return CreateMaybeMessage(nullptr); - } - - TermQuery* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const TermQuery& from); - void MergeFrom(const TermQuery& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(TermQuery* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.TermQuery"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kIntValueFieldNumber = 2, - kDoubleValueFieldNumber = 3, - kExtraParamsFieldNumber = 6, - kFieldNameFieldNumber = 1, - kValueNumFieldNumber = 4, - kBoostFieldNumber = 5, - }; - // repeated int64 int_value = 2; - int int_value_size() const; - void clear_int_value(); - ::PROTOBUF_NAMESPACE_ID::int64 int_value(int index) const; - void set_int_value(int index, ::PROTOBUF_NAMESPACE_ID::int64 value); - void add_int_value(::PROTOBUF_NAMESPACE_ID::int64 value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& - int_value() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* - mutable_int_value(); - - // repeated double double_value = 3; - int double_value_size() const; - void clear_double_value(); - double double_value(int index) const; - void set_double_value(int index, double value); - void add_double_value(double value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >& - double_value() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >* - mutable_double_value(); - - // repeated .milvus.grpc.KeyValuePair extra_params = 6; - int extra_params_size() const; - void clear_extra_params(); - ::milvus::grpc::KeyValuePair* mutable_extra_params(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* - mutable_extra_params(); - const ::milvus::grpc::KeyValuePair& extra_params(int index) const; - ::milvus::grpc::KeyValuePair* add_extra_params(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& - extra_params() const; - - // string field_name = 1; - void clear_field_name(); - const std::string& field_name() const; - void set_field_name(const std::string& value); - void set_field_name(std::string&& value); - void set_field_name(const char* value); - void set_field_name(const char* value, size_t size); - std::string* mutable_field_name(); - std::string* release_field_name(); - void set_allocated_field_name(std::string* field_name); - - // int64 value_num = 4; - void clear_value_num(); - ::PROTOBUF_NAMESPACE_ID::int64 value_num() const; - void set_value_num(::PROTOBUF_NAMESPACE_ID::int64 value); - - // float boost = 5; - void clear_boost(); - float boost() const; - void set_boost(float value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.TermQuery) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 > int_value_; - mutable std::atomic _int_value_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< double > double_value_; - mutable std::atomic _double_value_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair > extra_params_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr field_name_; - ::PROTOBUF_NAMESPACE_ID::int64 value_num_; - float boost_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class CompareExpr : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.CompareExpr) */ { - public: - CompareExpr(); - virtual ~CompareExpr(); - - CompareExpr(const CompareExpr& from); - CompareExpr(CompareExpr&& from) noexcept - : CompareExpr() { - *this = ::std::move(from); - } - - inline CompareExpr& operator=(const CompareExpr& from) { - CopyFrom(from); - return *this; - } - inline CompareExpr& operator=(CompareExpr&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const CompareExpr& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const CompareExpr* internal_default_instance() { - return reinterpret_cast( - &_CompareExpr_default_instance_); - } - static constexpr int kIndexInFileMessages = - 37; - - friend void swap(CompareExpr& a, CompareExpr& b) { - a.Swap(&b); - } - inline void Swap(CompareExpr* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline CompareExpr* New() const final { - return CreateMaybeMessage(nullptr); - } - - CompareExpr* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const CompareExpr& from); - void MergeFrom(const CompareExpr& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(CompareExpr* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.CompareExpr"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kOperandFieldNumber = 2, - kOperatorFieldNumber = 1, - }; - // string operand = 2; - void clear_operand(); - const std::string& operand() const; - void set_operand(const std::string& value); - void set_operand(std::string&& value); - void set_operand(const char* value); - void set_operand(const char* value, size_t size); - std::string* mutable_operand(); - std::string* release_operand(); - void set_allocated_operand(std::string* operand); - - // .milvus.grpc.CompareOperator operator = 1; - void clear_operator_(); - ::milvus::grpc::CompareOperator operator_() const; - void set_operator_(::milvus::grpc::CompareOperator value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.CompareExpr) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr operand_; - int operator__; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class RangeQuery : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.RangeQuery) */ { - public: - RangeQuery(); - virtual ~RangeQuery(); - - RangeQuery(const RangeQuery& from); - RangeQuery(RangeQuery&& from) noexcept - : RangeQuery() { - *this = ::std::move(from); - } - - inline RangeQuery& operator=(const RangeQuery& from) { - CopyFrom(from); - return *this; - } - inline RangeQuery& operator=(RangeQuery&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const RangeQuery& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const RangeQuery* internal_default_instance() { - return reinterpret_cast( - &_RangeQuery_default_instance_); - } - static constexpr int kIndexInFileMessages = - 38; - - friend void swap(RangeQuery& a, RangeQuery& b) { - a.Swap(&b); - } - inline void Swap(RangeQuery* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline RangeQuery* New() const final { - return CreateMaybeMessage(nullptr); - } - - RangeQuery* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const RangeQuery& from); - void MergeFrom(const RangeQuery& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(RangeQuery* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.RangeQuery"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kOperandFieldNumber = 2, - kExtraParamsFieldNumber = 4, - kFieldNameFieldNumber = 1, - kBoostFieldNumber = 3, - }; - // repeated .milvus.grpc.CompareExpr operand = 2; - int operand_size() const; - void clear_operand(); - ::milvus::grpc::CompareExpr* mutable_operand(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::CompareExpr >* - mutable_operand(); - const ::milvus::grpc::CompareExpr& operand(int index) const; - ::milvus::grpc::CompareExpr* add_operand(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::CompareExpr >& - operand() const; - - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - int extra_params_size() const; - void clear_extra_params(); - ::milvus::grpc::KeyValuePair* mutable_extra_params(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* - mutable_extra_params(); - const ::milvus::grpc::KeyValuePair& extra_params(int index) const; - ::milvus::grpc::KeyValuePair* add_extra_params(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& - extra_params() const; - - // string field_name = 1; - void clear_field_name(); - const std::string& field_name() const; - void set_field_name(const std::string& value); - void set_field_name(std::string&& value); - void set_field_name(const char* value); - void set_field_name(const char* value, size_t size); - std::string* mutable_field_name(); - std::string* release_field_name(); - void set_allocated_field_name(std::string* field_name); - - // float boost = 3; - void clear_boost(); - float boost() const; - void set_boost(float value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.RangeQuery) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::CompareExpr > operand_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair > extra_params_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr field_name_; - float boost_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class VectorQuery : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.VectorQuery) */ { - public: - VectorQuery(); - virtual ~VectorQuery(); - - VectorQuery(const VectorQuery& from); - VectorQuery(VectorQuery&& from) noexcept - : VectorQuery() { - *this = ::std::move(from); - } - - inline VectorQuery& operator=(const VectorQuery& from) { - CopyFrom(from); - return *this; - } - inline VectorQuery& operator=(VectorQuery&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const VectorQuery& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const VectorQuery* internal_default_instance() { - return reinterpret_cast( - &_VectorQuery_default_instance_); - } - static constexpr int kIndexInFileMessages = - 39; - - friend void swap(VectorQuery& a, VectorQuery& b) { - a.Swap(&b); - } - inline void Swap(VectorQuery* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline VectorQuery* New() const final { - return CreateMaybeMessage(nullptr); - } - - VectorQuery* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const VectorQuery& from); - void MergeFrom(const VectorQuery& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(VectorQuery* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.VectorQuery"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kRecordsFieldNumber = 3, - kExtraParamsFieldNumber = 5, - kFieldNameFieldNumber = 1, - kTopkFieldNumber = 4, - kQueryBoostFieldNumber = 2, - }; - // repeated .milvus.grpc.VectorRowRecord records = 3; - int records_size() const; - void clear_records(); - ::milvus::grpc::VectorRowRecord* mutable_records(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorRowRecord >* - mutable_records(); - const ::milvus::grpc::VectorRowRecord& records(int index) const; - ::milvus::grpc::VectorRowRecord* add_records(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorRowRecord >& - records() const; - - // repeated .milvus.grpc.KeyValuePair extra_params = 5; - int extra_params_size() const; - void clear_extra_params(); - ::milvus::grpc::KeyValuePair* mutable_extra_params(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* - mutable_extra_params(); - const ::milvus::grpc::KeyValuePair& extra_params(int index) const; - ::milvus::grpc::KeyValuePair* add_extra_params(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& - extra_params() const; - - // string field_name = 1; - void clear_field_name(); - const std::string& field_name() const; - void set_field_name(const std::string& value); - void set_field_name(std::string&& value); - void set_field_name(const char* value); - void set_field_name(const char* value, size_t size); - std::string* mutable_field_name(); - std::string* release_field_name(); - void set_allocated_field_name(std::string* field_name); - - // int64 topk = 4; - void clear_topk(); - ::PROTOBUF_NAMESPACE_ID::int64 topk() const; - void set_topk(::PROTOBUF_NAMESPACE_ID::int64 value); - - // float query_boost = 2; - void clear_query_boost(); - float query_boost() const; - void set_query_boost(float value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.VectorQuery) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorRowRecord > records_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair > extra_params_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr field_name_; - ::PROTOBUF_NAMESPACE_ID::int64 topk_; - float query_boost_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class BooleanQuery : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.BooleanQuery) */ { - public: - BooleanQuery(); - virtual ~BooleanQuery(); - - BooleanQuery(const BooleanQuery& from); - BooleanQuery(BooleanQuery&& from) noexcept - : BooleanQuery() { - *this = ::std::move(from); - } - - inline BooleanQuery& operator=(const BooleanQuery& from) { - CopyFrom(from); - return *this; - } - inline BooleanQuery& operator=(BooleanQuery&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const BooleanQuery& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const BooleanQuery* internal_default_instance() { - return reinterpret_cast( - &_BooleanQuery_default_instance_); - } - static constexpr int kIndexInFileMessages = - 40; - - friend void swap(BooleanQuery& a, BooleanQuery& b) { - a.Swap(&b); - } - inline void Swap(BooleanQuery* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline BooleanQuery* New() const final { - return CreateMaybeMessage(nullptr); - } - - BooleanQuery* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const BooleanQuery& from); - void MergeFrom(const BooleanQuery& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(BooleanQuery* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.BooleanQuery"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kGeneralQueryFieldNumber = 2, - kOccurFieldNumber = 1, - }; - // repeated .milvus.grpc.GeneralQuery general_query = 2; - int general_query_size() const; - void clear_general_query(); - ::milvus::grpc::GeneralQuery* mutable_general_query(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::GeneralQuery >* - mutable_general_query(); - const ::milvus::grpc::GeneralQuery& general_query(int index) const; - ::milvus::grpc::GeneralQuery* add_general_query(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::GeneralQuery >& - general_query() const; - - // .milvus.grpc.Occur occur = 1; - void clear_occur(); - ::milvus::grpc::Occur occur() const; - void set_occur(::milvus::grpc::Occur value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.BooleanQuery) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::GeneralQuery > general_query_; - int occur_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class GeneralQuery : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.GeneralQuery) */ { - public: - GeneralQuery(); - virtual ~GeneralQuery(); - - GeneralQuery(const GeneralQuery& from); - GeneralQuery(GeneralQuery&& from) noexcept - : GeneralQuery() { - *this = ::std::move(from); - } - - inline GeneralQuery& operator=(const GeneralQuery& from) { - CopyFrom(from); - return *this; - } - inline GeneralQuery& operator=(GeneralQuery&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const GeneralQuery& default_instance(); - - enum QueryCase { - kBooleanQuery = 1, - kTermQuery = 2, - kRangeQuery = 3, - kVectorQuery = 4, - QUERY_NOT_SET = 0, - }; - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const GeneralQuery* internal_default_instance() { - return reinterpret_cast( - &_GeneralQuery_default_instance_); - } - static constexpr int kIndexInFileMessages = - 41; - - friend void swap(GeneralQuery& a, GeneralQuery& b) { - a.Swap(&b); - } - inline void Swap(GeneralQuery* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline GeneralQuery* New() const final { - return CreateMaybeMessage(nullptr); - } - - GeneralQuery* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const GeneralQuery& from); - void MergeFrom(const GeneralQuery& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(GeneralQuery* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.GeneralQuery"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kBooleanQueryFieldNumber = 1, - kTermQueryFieldNumber = 2, - kRangeQueryFieldNumber = 3, - kVectorQueryFieldNumber = 4, - }; - // .milvus.grpc.BooleanQuery boolean_query = 1; - bool has_boolean_query() const; - void clear_boolean_query(); - const ::milvus::grpc::BooleanQuery& boolean_query() const; - ::milvus::grpc::BooleanQuery* release_boolean_query(); - ::milvus::grpc::BooleanQuery* mutable_boolean_query(); - void set_allocated_boolean_query(::milvus::grpc::BooleanQuery* boolean_query); - - // .milvus.grpc.TermQuery term_query = 2; - bool has_term_query() const; - void clear_term_query(); - const ::milvus::grpc::TermQuery& term_query() const; - ::milvus::grpc::TermQuery* release_term_query(); - ::milvus::grpc::TermQuery* mutable_term_query(); - void set_allocated_term_query(::milvus::grpc::TermQuery* term_query); - - // .milvus.grpc.RangeQuery range_query = 3; - bool has_range_query() const; - void clear_range_query(); - const ::milvus::grpc::RangeQuery& range_query() const; - ::milvus::grpc::RangeQuery* release_range_query(); - ::milvus::grpc::RangeQuery* mutable_range_query(); - void set_allocated_range_query(::milvus::grpc::RangeQuery* range_query); - - // .milvus.grpc.VectorQuery vector_query = 4; - bool has_vector_query() const; - void clear_vector_query(); - const ::milvus::grpc::VectorQuery& vector_query() const; - ::milvus::grpc::VectorQuery* release_vector_query(); - ::milvus::grpc::VectorQuery* mutable_vector_query(); - void set_allocated_vector_query(::milvus::grpc::VectorQuery* vector_query); - - void clear_query(); - QueryCase query_case() const; - // @@protoc_insertion_point(class_scope:milvus.grpc.GeneralQuery) - private: - class _Internal; - void set_has_boolean_query(); - void set_has_term_query(); - void set_has_range_query(); - void set_has_vector_query(); - - inline bool has_query() const; - inline void clear_has_query(); - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - union QueryUnion { - QueryUnion() {} - ::milvus::grpc::BooleanQuery* boolean_query_; - ::milvus::grpc::TermQuery* term_query_; - ::milvus::grpc::RangeQuery* range_query_; - ::milvus::grpc::VectorQuery* vector_query_; - } query_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; - - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class SearchParamPB : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.SearchParamPB) */ { - public: - SearchParamPB(); - virtual ~SearchParamPB(); - - SearchParamPB(const SearchParamPB& from); - SearchParamPB(SearchParamPB&& from) noexcept - : SearchParamPB() { - *this = ::std::move(from); - } - - inline SearchParamPB& operator=(const SearchParamPB& from) { - CopyFrom(from); - return *this; - } - inline SearchParamPB& operator=(SearchParamPB&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const SearchParamPB& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const SearchParamPB* internal_default_instance() { - return reinterpret_cast( - &_SearchParamPB_default_instance_); - } - static constexpr int kIndexInFileMessages = - 42; - - friend void swap(SearchParamPB& a, SearchParamPB& b) { - a.Swap(&b); - } - inline void Swap(SearchParamPB* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline SearchParamPB* New() const final { - return CreateMaybeMessage(nullptr); - } - - SearchParamPB* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const SearchParamPB& from); - void MergeFrom(const SearchParamPB& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(SearchParamPB* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.SearchParamPB"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kPartitionTagArrayFieldNumber = 2, - kExtraParamsFieldNumber = 4, - kCollectionNameFieldNumber = 1, - kGeneralQueryFieldNumber = 3, - }; - // repeated string partition_tag_array = 2; - int partition_tag_array_size() const; - void clear_partition_tag_array(); - const std::string& partition_tag_array(int index) const; - std::string* mutable_partition_tag_array(int index); - void set_partition_tag_array(int index, const std::string& value); - void set_partition_tag_array(int index, std::string&& value); - void set_partition_tag_array(int index, const char* value); - void set_partition_tag_array(int index, const char* value, size_t size); - std::string* add_partition_tag_array(); - void add_partition_tag_array(const std::string& value); - void add_partition_tag_array(std::string&& value); - void add_partition_tag_array(const char* value); - void add_partition_tag_array(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& partition_tag_array() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_partition_tag_array(); - - // repeated .milvus.grpc.KeyValuePair extra_params = 4; - int extra_params_size() const; - void clear_extra_params(); - ::milvus::grpc::KeyValuePair* mutable_extra_params(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* - mutable_extra_params(); - const ::milvus::grpc::KeyValuePair& extra_params(int index) const; - ::milvus::grpc::KeyValuePair* add_extra_params(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& - extra_params() const; - - // string collection_name = 1; - void clear_collection_name(); - const std::string& collection_name() const; - void set_collection_name(const std::string& value); - void set_collection_name(std::string&& value); - void set_collection_name(const char* value); - void set_collection_name(const char* value, size_t size); - std::string* mutable_collection_name(); - std::string* release_collection_name(); - void set_allocated_collection_name(std::string* collection_name); - - // .milvus.grpc.GeneralQuery general_query = 3; - bool has_general_query() const; - void clear_general_query(); - const ::milvus::grpc::GeneralQuery& general_query() const; - ::milvus::grpc::GeneralQuery* release_general_query(); - ::milvus::grpc::GeneralQuery* mutable_general_query(); - void set_allocated_general_query(::milvus::grpc::GeneralQuery* general_query); - - // @@protoc_insertion_point(class_scope:milvus.grpc.SearchParamPB) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField partition_tag_array_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair > extra_params_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr collection_name_; - ::milvus::grpc::GeneralQuery* general_query_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class InsertOrDeleteMsg : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.InsertOrDeleteMsg) */ { - public: - InsertOrDeleteMsg(); - virtual ~InsertOrDeleteMsg(); - - InsertOrDeleteMsg(const InsertOrDeleteMsg& from); - InsertOrDeleteMsg(InsertOrDeleteMsg&& from) noexcept - : InsertOrDeleteMsg() { - *this = ::std::move(from); - } - - inline InsertOrDeleteMsg& operator=(const InsertOrDeleteMsg& from) { - CopyFrom(from); - return *this; - } - inline InsertOrDeleteMsg& operator=(InsertOrDeleteMsg&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const InsertOrDeleteMsg& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const InsertOrDeleteMsg* internal_default_instance() { - return reinterpret_cast( - &_InsertOrDeleteMsg_default_instance_); - } - static constexpr int kIndexInFileMessages = - 43; - - friend void swap(InsertOrDeleteMsg& a, InsertOrDeleteMsg& b) { - a.Swap(&b); - } - inline void Swap(InsertOrDeleteMsg* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline InsertOrDeleteMsg* New() const final { - return CreateMaybeMessage(nullptr); - } - - InsertOrDeleteMsg* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const InsertOrDeleteMsg& from); - void MergeFrom(const InsertOrDeleteMsg& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(InsertOrDeleteMsg* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.InsertOrDeleteMsg"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kExtraParamsFieldNumber = 10, - kCollectionNameFieldNumber = 1, - kPartitionTagFieldNumber = 4, - kRowsDataFieldNumber = 2, - kUidFieldNumber = 3, - kTimestampFieldNumber = 5, - kSegmentIdFieldNumber = 6, - kChannelIdFieldNumber = 7, - kClientIdFieldNumber = 9, - kOpFieldNumber = 8, - }; - // repeated .milvus.grpc.KeyValuePair extra_params = 10; - int extra_params_size() const; - void clear_extra_params(); - ::milvus::grpc::KeyValuePair* mutable_extra_params(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* - mutable_extra_params(); - const ::milvus::grpc::KeyValuePair& extra_params(int index) const; - ::milvus::grpc::KeyValuePair* add_extra_params(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& - extra_params() const; - - // string collection_name = 1; - void clear_collection_name(); - const std::string& collection_name() const; - void set_collection_name(const std::string& value); - void set_collection_name(std::string&& value); - void set_collection_name(const char* value); - void set_collection_name(const char* value, size_t size); - std::string* mutable_collection_name(); - std::string* release_collection_name(); - void set_allocated_collection_name(std::string* collection_name); - - // string partition_tag = 4; - void clear_partition_tag(); - const std::string& partition_tag() const; - void set_partition_tag(const std::string& value); - void set_partition_tag(std::string&& value); - void set_partition_tag(const char* value); - void set_partition_tag(const char* value, size_t size); - std::string* mutable_partition_tag(); - std::string* release_partition_tag(); - void set_allocated_partition_tag(std::string* partition_tag); - - // .milvus.grpc.RowData rows_data = 2; - bool has_rows_data() const; - void clear_rows_data(); - const ::milvus::grpc::RowData& rows_data() const; - ::milvus::grpc::RowData* release_rows_data(); - ::milvus::grpc::RowData* mutable_rows_data(); - void set_allocated_rows_data(::milvus::grpc::RowData* rows_data); - - // int64 uid = 3; - void clear_uid(); - ::PROTOBUF_NAMESPACE_ID::int64 uid() const; - void set_uid(::PROTOBUF_NAMESPACE_ID::int64 value); - - // uint64 timestamp = 5; - void clear_timestamp(); - ::PROTOBUF_NAMESPACE_ID::uint64 timestamp() const; - void set_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // int64 segment_id = 6; - void clear_segment_id(); - ::PROTOBUF_NAMESPACE_ID::int64 segment_id() const; - void set_segment_id(::PROTOBUF_NAMESPACE_ID::int64 value); - - // int64 channel_id = 7; - void clear_channel_id(); - ::PROTOBUF_NAMESPACE_ID::int64 channel_id() const; - void set_channel_id(::PROTOBUF_NAMESPACE_ID::int64 value); - - // int64 client_id = 9; - void clear_client_id(); - ::PROTOBUF_NAMESPACE_ID::int64 client_id() const; - void set_client_id(::PROTOBUF_NAMESPACE_ID::int64 value); - - // .milvus.grpc.OpType op = 8; - void clear_op(); - ::milvus::grpc::OpType op() const; - void set_op(::milvus::grpc::OpType value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.InsertOrDeleteMsg) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair > extra_params_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr collection_name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr partition_tag_; - ::milvus::grpc::RowData* rows_data_; - ::PROTOBUF_NAMESPACE_ID::int64 uid_; - ::PROTOBUF_NAMESPACE_ID::uint64 timestamp_; - ::PROTOBUF_NAMESPACE_ID::int64 segment_id_; - ::PROTOBUF_NAMESPACE_ID::int64 channel_id_; - ::PROTOBUF_NAMESPACE_ID::int64 client_id_; - int op_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class SearchMsg : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.SearchMsg) */ { - public: - SearchMsg(); - virtual ~SearchMsg(); - - SearchMsg(const SearchMsg& from); - SearchMsg(SearchMsg&& from) noexcept - : SearchMsg() { - *this = ::std::move(from); - } - - inline SearchMsg& operator=(const SearchMsg& from) { - CopyFrom(from); - return *this; - } - inline SearchMsg& operator=(SearchMsg&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const SearchMsg& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const SearchMsg* internal_default_instance() { - return reinterpret_cast( - &_SearchMsg_default_instance_); - } - static constexpr int kIndexInFileMessages = - 44; - - friend void swap(SearchMsg& a, SearchMsg& b) { - a.Swap(&b); - } - inline void Swap(SearchMsg* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline SearchMsg* New() const final { - return CreateMaybeMessage(nullptr); - } - - SearchMsg* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const SearchMsg& from); - void MergeFrom(const SearchMsg& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(SearchMsg* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.SearchMsg"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kPartitionTagFieldNumber = 3, - kExtraParamsFieldNumber = 7, - kJsonFieldNumber = 8, - kCollectionNameFieldNumber = 1, - kDslFieldNumber = 9, - kRecordsFieldNumber = 2, - kUidFieldNumber = 4, - kTimestampFieldNumber = 5, - kClientIdFieldNumber = 6, - }; - // repeated string partition_tag = 3; - int partition_tag_size() const; - void clear_partition_tag(); - const std::string& partition_tag(int index) const; - std::string* mutable_partition_tag(int index); - void set_partition_tag(int index, const std::string& value); - void set_partition_tag(int index, std::string&& value); - void set_partition_tag(int index, const char* value); - void set_partition_tag(int index, const char* value, size_t size); - std::string* add_partition_tag(); - void add_partition_tag(const std::string& value); - void add_partition_tag(std::string&& value); - void add_partition_tag(const char* value); - void add_partition_tag(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& partition_tag() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_partition_tag(); - - // repeated .milvus.grpc.KeyValuePair extra_params = 7; - int extra_params_size() const; - void clear_extra_params(); - ::milvus::grpc::KeyValuePair* mutable_extra_params(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* - mutable_extra_params(); - const ::milvus::grpc::KeyValuePair& extra_params(int index) const; - ::milvus::grpc::KeyValuePair* add_extra_params(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& - extra_params() const; - - // repeated string json = 8; - int json_size() const; - void clear_json(); - const std::string& json(int index) const; - std::string* mutable_json(int index); - void set_json(int index, const std::string& value); - void set_json(int index, std::string&& value); - void set_json(int index, const char* value); - void set_json(int index, const char* value, size_t size); - std::string* add_json(); - void add_json(const std::string& value); - void add_json(std::string&& value); - void add_json(const char* value); - void add_json(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& json() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_json(); - - // string collection_name = 1; - void clear_collection_name(); - const std::string& collection_name() const; - void set_collection_name(const std::string& value); - void set_collection_name(std::string&& value); - void set_collection_name(const char* value); - void set_collection_name(const char* value, size_t size); - std::string* mutable_collection_name(); - std::string* release_collection_name(); - void set_allocated_collection_name(std::string* collection_name); - - // string dsl = 9; - void clear_dsl(); - const std::string& dsl() const; - void set_dsl(const std::string& value); - void set_dsl(std::string&& value); - void set_dsl(const char* value); - void set_dsl(const char* value, size_t size); - std::string* mutable_dsl(); - std::string* release_dsl(); - void set_allocated_dsl(std::string* dsl); - - // .milvus.grpc.VectorRowRecord records = 2; - bool has_records() const; - void clear_records(); - const ::milvus::grpc::VectorRowRecord& records() const; - ::milvus::grpc::VectorRowRecord* release_records(); - ::milvus::grpc::VectorRowRecord* mutable_records(); - void set_allocated_records(::milvus::grpc::VectorRowRecord* records); - - // int64 uid = 4; - void clear_uid(); - ::PROTOBUF_NAMESPACE_ID::int64 uid() const; - void set_uid(::PROTOBUF_NAMESPACE_ID::int64 value); - - // uint64 timestamp = 5; - void clear_timestamp(); - ::PROTOBUF_NAMESPACE_ID::uint64 timestamp() const; - void set_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // int64 client_id = 6; - void clear_client_id(); - ::PROTOBUF_NAMESPACE_ID::int64 client_id() const; - void set_client_id(::PROTOBUF_NAMESPACE_ID::int64 value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.SearchMsg) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField partition_tag_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair > extra_params_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField json_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr collection_name_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr dsl_; - ::milvus::grpc::VectorRowRecord* records_; - ::PROTOBUF_NAMESPACE_ID::int64 uid_; - ::PROTOBUF_NAMESPACE_ID::uint64 timestamp_; - ::PROTOBUF_NAMESPACE_ID::int64 client_id_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class TimeSyncMsg : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.TimeSyncMsg) */ { - public: - TimeSyncMsg(); - virtual ~TimeSyncMsg(); - - TimeSyncMsg(const TimeSyncMsg& from); - TimeSyncMsg(TimeSyncMsg&& from) noexcept - : TimeSyncMsg() { - *this = ::std::move(from); - } - - inline TimeSyncMsg& operator=(const TimeSyncMsg& from) { - CopyFrom(from); - return *this; - } - inline TimeSyncMsg& operator=(TimeSyncMsg&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const TimeSyncMsg& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const TimeSyncMsg* internal_default_instance() { - return reinterpret_cast( - &_TimeSyncMsg_default_instance_); - } - static constexpr int kIndexInFileMessages = - 45; - - friend void swap(TimeSyncMsg& a, TimeSyncMsg& b) { - a.Swap(&b); - } - inline void Swap(TimeSyncMsg* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline TimeSyncMsg* New() const final { - return CreateMaybeMessage(nullptr); - } - - TimeSyncMsg* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const TimeSyncMsg& from); - void MergeFrom(const TimeSyncMsg& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(TimeSyncMsg* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.TimeSyncMsg"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kPeerIdFieldNumber = 1, - kTimestampFieldNumber = 2, - kSyncTypeFieldNumber = 3, - }; - // int64 peer_Id = 1; - void clear_peer_id(); - ::PROTOBUF_NAMESPACE_ID::int64 peer_id() const; - void set_peer_id(::PROTOBUF_NAMESPACE_ID::int64 value); - - // uint64 Timestamp = 2; - void clear_timestamp(); - ::PROTOBUF_NAMESPACE_ID::uint64 timestamp() const; - void set_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // .milvus.grpc.SyncType sync_type = 3; - void clear_sync_type(); - ::milvus::grpc::SyncType sync_type() const; - void set_sync_type(::milvus::grpc::SyncType value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.TimeSyncMsg) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::int64 peer_id_; - ::PROTOBUF_NAMESPACE_ID::uint64 timestamp_; - int sync_type_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// ------------------------------------------------------------------- - -class Key2SegMsg : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.grpc.Key2SegMsg) */ { - public: - Key2SegMsg(); - virtual ~Key2SegMsg(); - - Key2SegMsg(const Key2SegMsg& from); - Key2SegMsg(Key2SegMsg&& from) noexcept - : Key2SegMsg() { - *this = ::std::move(from); - } - - inline Key2SegMsg& operator=(const Key2SegMsg& from) { - CopyFrom(from); - return *this; - } - inline Key2SegMsg& operator=(Key2SegMsg&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const Key2SegMsg& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const Key2SegMsg* internal_default_instance() { - return reinterpret_cast( - &_Key2SegMsg_default_instance_); - } - static constexpr int kIndexInFileMessages = - 46; - - friend void swap(Key2SegMsg& a, Key2SegMsg& b) { - a.Swap(&b); - } - inline void Swap(Key2SegMsg* other) { - if (other == this) return; - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline Key2SegMsg* New() const final { - return CreateMaybeMessage(nullptr); - } - - Key2SegMsg* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const Key2SegMsg& from); - void MergeFrom(const Key2SegMsg& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - #else - bool MergePartialFromCodedStream( - ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; - #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER - void SerializeWithCachedSizes( - ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; - ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( - ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Key2SegMsg* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "milvus.grpc.Key2SegMsg"; - } - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return nullptr; - } - inline void* MaybeArenaPtr() const { - return nullptr; - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); - return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kSegmentIdFieldNumber = 3, - kUidFieldNumber = 1, - kTimestampFieldNumber = 2, - }; - // repeated int64 segment_id = 3; - int segment_id_size() const; - void clear_segment_id(); - ::PROTOBUF_NAMESPACE_ID::int64 segment_id(int index) const; - void set_segment_id(int index, ::PROTOBUF_NAMESPACE_ID::int64 value); - void add_segment_id(::PROTOBUF_NAMESPACE_ID::int64 value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& - segment_id() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* - mutable_segment_id(); - - // int64 uid = 1; - void clear_uid(); - ::PROTOBUF_NAMESPACE_ID::int64 uid() const; - void set_uid(::PROTOBUF_NAMESPACE_ID::int64 value); - - // uint64 timestamp = 2; - void clear_timestamp(); - ::PROTOBUF_NAMESPACE_ID::uint64 timestamp() const; - void set_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value); - - // @@protoc_insertion_point(class_scope:milvus.grpc.Key2SegMsg) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 > segment_id_; - mutable std::atomic _segment_id_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::int64 uid_; - ::PROTOBUF_NAMESPACE_ID::uint64 timestamp_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_message_2eproto; -}; -// =================================================================== - - -// =================================================================== - -#ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// Status - -// .milvus.grpc.ErrorCode error_code = 1; -inline void Status::clear_error_code() { - error_code_ = 0; -} -inline ::milvus::grpc::ErrorCode Status::error_code() const { - // @@protoc_insertion_point(field_get:milvus.grpc.Status.error_code) - return static_cast< ::milvus::grpc::ErrorCode >(error_code_); -} -inline void Status::set_error_code(::milvus::grpc::ErrorCode value) { - - error_code_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.Status.error_code) -} - -// string reason = 2; -inline void Status::clear_reason() { - reason_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& Status::reason() const { - // @@protoc_insertion_point(field_get:milvus.grpc.Status.reason) - return reason_.GetNoArena(); -} -inline void Status::set_reason(const std::string& value) { - - reason_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.Status.reason) -} -inline void Status::set_reason(std::string&& value) { - - reason_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.Status.reason) -} -inline void Status::set_reason(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - reason_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.Status.reason) -} -inline void Status::set_reason(const char* value, size_t size) { - - reason_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.Status.reason) -} -inline std::string* Status::mutable_reason() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.Status.reason) - return reason_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* Status::release_reason() { - // @@protoc_insertion_point(field_release:milvus.grpc.Status.reason) - - return reason_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void Status::set_allocated_reason(std::string* reason) { - if (reason != nullptr) { - - } else { - - } - reason_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), reason); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.Status.reason) -} - -// ------------------------------------------------------------------- - -// KeyValuePair - -// string key = 1; -inline void KeyValuePair::clear_key() { - key_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& KeyValuePair::key() const { - // @@protoc_insertion_point(field_get:milvus.grpc.KeyValuePair.key) - return key_.GetNoArena(); -} -inline void KeyValuePair::set_key(const std::string& value) { - - key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.KeyValuePair.key) -} -inline void KeyValuePair::set_key(std::string&& value) { - - key_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.KeyValuePair.key) -} -inline void KeyValuePair::set_key(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.KeyValuePair.key) -} -inline void KeyValuePair::set_key(const char* value, size_t size) { - - key_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.KeyValuePair.key) -} -inline std::string* KeyValuePair::mutable_key() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.KeyValuePair.key) - return key_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* KeyValuePair::release_key() { - // @@protoc_insertion_point(field_release:milvus.grpc.KeyValuePair.key) - - return key_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void KeyValuePair::set_allocated_key(std::string* key) { - if (key != nullptr) { - - } else { - - } - key_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), key); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.KeyValuePair.key) -} - -// string value = 2; -inline void KeyValuePair::clear_value() { - value_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& KeyValuePair::value() const { - // @@protoc_insertion_point(field_get:milvus.grpc.KeyValuePair.value) - return value_.GetNoArena(); -} -inline void KeyValuePair::set_value(const std::string& value) { - - value_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.KeyValuePair.value) -} -inline void KeyValuePair::set_value(std::string&& value) { - - value_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.KeyValuePair.value) -} -inline void KeyValuePair::set_value(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - value_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.KeyValuePair.value) -} -inline void KeyValuePair::set_value(const char* value, size_t size) { - - value_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.KeyValuePair.value) -} -inline std::string* KeyValuePair::mutable_value() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.KeyValuePair.value) - return value_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* KeyValuePair::release_value() { - // @@protoc_insertion_point(field_release:milvus.grpc.KeyValuePair.value) - - return value_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void KeyValuePair::set_allocated_value(std::string* value) { - if (value != nullptr) { - - } else { - - } - value_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.KeyValuePair.value) -} - -// ------------------------------------------------------------------- - -// CollectionName - -// string collection_name = 1; -inline void CollectionName::clear_collection_name() { - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& CollectionName::collection_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.CollectionName.collection_name) - return collection_name_.GetNoArena(); -} -inline void CollectionName::set_collection_name(const std::string& value) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.CollectionName.collection_name) -} -inline void CollectionName::set_collection_name(std::string&& value) { - - collection_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.CollectionName.collection_name) -} -inline void CollectionName::set_collection_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.CollectionName.collection_name) -} -inline void CollectionName::set_collection_name(const char* value, size_t size) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.CollectionName.collection_name) -} -inline std::string* CollectionName::mutable_collection_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.CollectionName.collection_name) - return collection_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* CollectionName::release_collection_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.CollectionName.collection_name) - - return collection_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void CollectionName::set_allocated_collection_name(std::string* collection_name) { - if (collection_name != nullptr) { - - } else { - - } - collection_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), collection_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.CollectionName.collection_name) -} - -// ------------------------------------------------------------------- - -// CollectionNameList - -// .milvus.grpc.Status status = 1; -inline bool CollectionNameList::has_status() const { - return this != internal_default_instance() && status_ != nullptr; -} -inline void CollectionNameList::clear_status() { - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; -} -inline const ::milvus::grpc::Status& CollectionNameList::status() const { - const ::milvus::grpc::Status* p = status_; - // @@protoc_insertion_point(field_get:milvus.grpc.CollectionNameList.status) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Status_default_instance_); -} -inline ::milvus::grpc::Status* CollectionNameList::release_status() { - // @@protoc_insertion_point(field_release:milvus.grpc.CollectionNameList.status) - - ::milvus::grpc::Status* temp = status_; - status_ = nullptr; - return temp; -} -inline ::milvus::grpc::Status* CollectionNameList::mutable_status() { - - if (status_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual()); - status_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.CollectionNameList.status) - return status_; -} -inline void CollectionNameList::set_allocated_status(::milvus::grpc::Status* status) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete status_; - } - if (status) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - status = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, status, submessage_arena); - } - - } else { - - } - status_ = status; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.CollectionNameList.status) -} - -// repeated string collection_names = 2; -inline int CollectionNameList::collection_names_size() const { - return collection_names_.size(); -} -inline void CollectionNameList::clear_collection_names() { - collection_names_.Clear(); -} -inline const std::string& CollectionNameList::collection_names(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.CollectionNameList.collection_names) - return collection_names_.Get(index); -} -inline std::string* CollectionNameList::mutable_collection_names(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.CollectionNameList.collection_names) - return collection_names_.Mutable(index); -} -inline void CollectionNameList::set_collection_names(int index, const std::string& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.CollectionNameList.collection_names) - collection_names_.Mutable(index)->assign(value); -} -inline void CollectionNameList::set_collection_names(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.CollectionNameList.collection_names) - collection_names_.Mutable(index)->assign(std::move(value)); -} -inline void CollectionNameList::set_collection_names(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - collection_names_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:milvus.grpc.CollectionNameList.collection_names) -} -inline void CollectionNameList::set_collection_names(int index, const char* value, size_t size) { - collection_names_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.CollectionNameList.collection_names) -} -inline std::string* CollectionNameList::add_collection_names() { - // @@protoc_insertion_point(field_add_mutable:milvus.grpc.CollectionNameList.collection_names) - return collection_names_.Add(); -} -inline void CollectionNameList::add_collection_names(const std::string& value) { - collection_names_.Add()->assign(value); - // @@protoc_insertion_point(field_add:milvus.grpc.CollectionNameList.collection_names) -} -inline void CollectionNameList::add_collection_names(std::string&& value) { - collection_names_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:milvus.grpc.CollectionNameList.collection_names) -} -inline void CollectionNameList::add_collection_names(const char* value) { - GOOGLE_DCHECK(value != nullptr); - collection_names_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:milvus.grpc.CollectionNameList.collection_names) -} -inline void CollectionNameList::add_collection_names(const char* value, size_t size) { - collection_names_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:milvus.grpc.CollectionNameList.collection_names) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -CollectionNameList::collection_names() const { - // @@protoc_insertion_point(field_list:milvus.grpc.CollectionNameList.collection_names) - return collection_names_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -CollectionNameList::mutable_collection_names() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.CollectionNameList.collection_names) - return &collection_names_; -} - -// ------------------------------------------------------------------- - -// FieldName - -// string collection_name = 1; -inline void FieldName::clear_collection_name() { - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& FieldName::collection_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.FieldName.collection_name) - return collection_name_.GetNoArena(); -} -inline void FieldName::set_collection_name(const std::string& value) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.FieldName.collection_name) -} -inline void FieldName::set_collection_name(std::string&& value) { - - collection_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.FieldName.collection_name) -} -inline void FieldName::set_collection_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.FieldName.collection_name) -} -inline void FieldName::set_collection_name(const char* value, size_t size) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.FieldName.collection_name) -} -inline std::string* FieldName::mutable_collection_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.FieldName.collection_name) - return collection_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* FieldName::release_collection_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.FieldName.collection_name) - - return collection_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void FieldName::set_allocated_collection_name(std::string* collection_name) { - if (collection_name != nullptr) { - - } else { - - } - collection_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), collection_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.FieldName.collection_name) -} - -// string field_name = 2; -inline void FieldName::clear_field_name() { - field_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& FieldName::field_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.FieldName.field_name) - return field_name_.GetNoArena(); -} -inline void FieldName::set_field_name(const std::string& value) { - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.FieldName.field_name) -} -inline void FieldName::set_field_name(std::string&& value) { - - field_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.FieldName.field_name) -} -inline void FieldName::set_field_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.FieldName.field_name) -} -inline void FieldName::set_field_name(const char* value, size_t size) { - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.FieldName.field_name) -} -inline std::string* FieldName::mutable_field_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.FieldName.field_name) - return field_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* FieldName::release_field_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.FieldName.field_name) - - return field_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void FieldName::set_allocated_field_name(std::string* field_name) { - if (field_name != nullptr) { - - } else { - - } - field_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), field_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.FieldName.field_name) -} - -// ------------------------------------------------------------------- - -// Mapping - -// .milvus.grpc.Status status = 1; -inline bool Mapping::has_status() const { - return this != internal_default_instance() && status_ != nullptr; -} -inline void Mapping::clear_status() { - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; -} -inline const ::milvus::grpc::Status& Mapping::status() const { - const ::milvus::grpc::Status* p = status_; - // @@protoc_insertion_point(field_get:milvus.grpc.Mapping.status) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Status_default_instance_); -} -inline ::milvus::grpc::Status* Mapping::release_status() { - // @@protoc_insertion_point(field_release:milvus.grpc.Mapping.status) - - ::milvus::grpc::Status* temp = status_; - status_ = nullptr; - return temp; -} -inline ::milvus::grpc::Status* Mapping::mutable_status() { - - if (status_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual()); - status_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.Mapping.status) - return status_; -} -inline void Mapping::set_allocated_status(::milvus::grpc::Status* status) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete status_; - } - if (status) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - status = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, status, submessage_arena); - } - - } else { - - } - status_ = status; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.Mapping.status) -} - -// string collection_name = 2; -inline void Mapping::clear_collection_name() { - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& Mapping::collection_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.Mapping.collection_name) - return collection_name_.GetNoArena(); -} -inline void Mapping::set_collection_name(const std::string& value) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.Mapping.collection_name) -} -inline void Mapping::set_collection_name(std::string&& value) { - - collection_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.Mapping.collection_name) -} -inline void Mapping::set_collection_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.Mapping.collection_name) -} -inline void Mapping::set_collection_name(const char* value, size_t size) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.Mapping.collection_name) -} -inline std::string* Mapping::mutable_collection_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.Mapping.collection_name) - return collection_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* Mapping::release_collection_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.Mapping.collection_name) - - return collection_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void Mapping::set_allocated_collection_name(std::string* collection_name) { - if (collection_name != nullptr) { - - } else { - - } - collection_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), collection_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.Mapping.collection_name) -} - -// .milvus.grpc.Schema schema = 3; -inline bool Mapping::has_schema() const { - return this != internal_default_instance() && schema_ != nullptr; -} -inline void Mapping::clear_schema() { - if (GetArenaNoVirtual() == nullptr && schema_ != nullptr) { - delete schema_; - } - schema_ = nullptr; -} -inline const ::milvus::grpc::Schema& Mapping::schema() const { - const ::milvus::grpc::Schema* p = schema_; - // @@protoc_insertion_point(field_get:milvus.grpc.Mapping.schema) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Schema_default_instance_); -} -inline ::milvus::grpc::Schema* Mapping::release_schema() { - // @@protoc_insertion_point(field_release:milvus.grpc.Mapping.schema) - - ::milvus::grpc::Schema* temp = schema_; - schema_ = nullptr; - return temp; -} -inline ::milvus::grpc::Schema* Mapping::mutable_schema() { - - if (schema_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Schema>(GetArenaNoVirtual()); - schema_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.Mapping.schema) - return schema_; -} -inline void Mapping::set_allocated_schema(::milvus::grpc::Schema* schema) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete schema_; - } - if (schema) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - schema = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, schema, submessage_arena); - } - - } else { - - } - schema_ = schema; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.Mapping.schema) -} - -// repeated .milvus.grpc.KeyValuePair extra_params = 4; -inline int Mapping::extra_params_size() const { - return extra_params_.size(); -} -inline void Mapping::clear_extra_params() { - extra_params_.Clear(); -} -inline ::milvus::grpc::KeyValuePair* Mapping::mutable_extra_params(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.Mapping.extra_params) - return extra_params_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* -Mapping::mutable_extra_params() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.Mapping.extra_params) - return &extra_params_; -} -inline const ::milvus::grpc::KeyValuePair& Mapping::extra_params(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.Mapping.extra_params) - return extra_params_.Get(index); -} -inline ::milvus::grpc::KeyValuePair* Mapping::add_extra_params() { - // @@protoc_insertion_point(field_add:milvus.grpc.Mapping.extra_params) - return extra_params_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& -Mapping::extra_params() const { - // @@protoc_insertion_point(field_list:milvus.grpc.Mapping.extra_params) - return extra_params_; -} - -// ------------------------------------------------------------------- - -// MappingList - -// .milvus.grpc.Status status = 1; -inline bool MappingList::has_status() const { - return this != internal_default_instance() && status_ != nullptr; -} -inline void MappingList::clear_status() { - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; -} -inline const ::milvus::grpc::Status& MappingList::status() const { - const ::milvus::grpc::Status* p = status_; - // @@protoc_insertion_point(field_get:milvus.grpc.MappingList.status) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Status_default_instance_); -} -inline ::milvus::grpc::Status* MappingList::release_status() { - // @@protoc_insertion_point(field_release:milvus.grpc.MappingList.status) - - ::milvus::grpc::Status* temp = status_; - status_ = nullptr; - return temp; -} -inline ::milvus::grpc::Status* MappingList::mutable_status() { - - if (status_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual()); - status_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.MappingList.status) - return status_; -} -inline void MappingList::set_allocated_status(::milvus::grpc::Status* status) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete status_; - } - if (status) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - status = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, status, submessage_arena); - } - - } else { - - } - status_ = status; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.MappingList.status) -} - -// repeated .milvus.grpc.Mapping mapping_list = 2; -inline int MappingList::mapping_list_size() const { - return mapping_list_.size(); -} -inline void MappingList::clear_mapping_list() { - mapping_list_.Clear(); -} -inline ::milvus::grpc::Mapping* MappingList::mutable_mapping_list(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.MappingList.mapping_list) - return mapping_list_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::Mapping >* -MappingList::mutable_mapping_list() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.MappingList.mapping_list) - return &mapping_list_; -} -inline const ::milvus::grpc::Mapping& MappingList::mapping_list(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.MappingList.mapping_list) - return mapping_list_.Get(index); -} -inline ::milvus::grpc::Mapping* MappingList::add_mapping_list() { - // @@protoc_insertion_point(field_add:milvus.grpc.MappingList.mapping_list) - return mapping_list_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::Mapping >& -MappingList::mapping_list() const { - // @@protoc_insertion_point(field_list:milvus.grpc.MappingList.mapping_list) - return mapping_list_; -} - -// ------------------------------------------------------------------- - -// PartitionParam - -// string collection_name = 1; -inline void PartitionParam::clear_collection_name() { - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& PartitionParam::collection_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.PartitionParam.collection_name) - return collection_name_.GetNoArena(); -} -inline void PartitionParam::set_collection_name(const std::string& value) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.PartitionParam.collection_name) -} -inline void PartitionParam::set_collection_name(std::string&& value) { - - collection_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.PartitionParam.collection_name) -} -inline void PartitionParam::set_collection_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.PartitionParam.collection_name) -} -inline void PartitionParam::set_collection_name(const char* value, size_t size) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.PartitionParam.collection_name) -} -inline std::string* PartitionParam::mutable_collection_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.PartitionParam.collection_name) - return collection_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* PartitionParam::release_collection_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.PartitionParam.collection_name) - - return collection_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void PartitionParam::set_allocated_collection_name(std::string* collection_name) { - if (collection_name != nullptr) { - - } else { - - } - collection_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), collection_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.PartitionParam.collection_name) -} - -// string tag = 2; -inline void PartitionParam::clear_tag() { - tag_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& PartitionParam::tag() const { - // @@protoc_insertion_point(field_get:milvus.grpc.PartitionParam.tag) - return tag_.GetNoArena(); -} -inline void PartitionParam::set_tag(const std::string& value) { - - tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.PartitionParam.tag) -} -inline void PartitionParam::set_tag(std::string&& value) { - - tag_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.PartitionParam.tag) -} -inline void PartitionParam::set_tag(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.PartitionParam.tag) -} -inline void PartitionParam::set_tag(const char* value, size_t size) { - - tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.PartitionParam.tag) -} -inline std::string* PartitionParam::mutable_tag() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.PartitionParam.tag) - return tag_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* PartitionParam::release_tag() { - // @@protoc_insertion_point(field_release:milvus.grpc.PartitionParam.tag) - - return tag_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void PartitionParam::set_allocated_tag(std::string* tag) { - if (tag != nullptr) { - - } else { - - } - tag_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), tag); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.PartitionParam.tag) -} - -// ------------------------------------------------------------------- - -// PartitionList - -// .milvus.grpc.Status status = 1; -inline bool PartitionList::has_status() const { - return this != internal_default_instance() && status_ != nullptr; -} -inline void PartitionList::clear_status() { - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; -} -inline const ::milvus::grpc::Status& PartitionList::status() const { - const ::milvus::grpc::Status* p = status_; - // @@protoc_insertion_point(field_get:milvus.grpc.PartitionList.status) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Status_default_instance_); -} -inline ::milvus::grpc::Status* PartitionList::release_status() { - // @@protoc_insertion_point(field_release:milvus.grpc.PartitionList.status) - - ::milvus::grpc::Status* temp = status_; - status_ = nullptr; - return temp; -} -inline ::milvus::grpc::Status* PartitionList::mutable_status() { - - if (status_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual()); - status_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.PartitionList.status) - return status_; -} -inline void PartitionList::set_allocated_status(::milvus::grpc::Status* status) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete status_; - } - if (status) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - status = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, status, submessage_arena); - } - - } else { - - } - status_ = status; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.PartitionList.status) -} - -// repeated string partition_tag_array = 2; -inline int PartitionList::partition_tag_array_size() const { - return partition_tag_array_.size(); -} -inline void PartitionList::clear_partition_tag_array() { - partition_tag_array_.Clear(); -} -inline const std::string& PartitionList::partition_tag_array(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.PartitionList.partition_tag_array) - return partition_tag_array_.Get(index); -} -inline std::string* PartitionList::mutable_partition_tag_array(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.PartitionList.partition_tag_array) - return partition_tag_array_.Mutable(index); -} -inline void PartitionList::set_partition_tag_array(int index, const std::string& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.PartitionList.partition_tag_array) - partition_tag_array_.Mutable(index)->assign(value); -} -inline void PartitionList::set_partition_tag_array(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.PartitionList.partition_tag_array) - partition_tag_array_.Mutable(index)->assign(std::move(value)); -} -inline void PartitionList::set_partition_tag_array(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - partition_tag_array_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:milvus.grpc.PartitionList.partition_tag_array) -} -inline void PartitionList::set_partition_tag_array(int index, const char* value, size_t size) { - partition_tag_array_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.PartitionList.partition_tag_array) -} -inline std::string* PartitionList::add_partition_tag_array() { - // @@protoc_insertion_point(field_add_mutable:milvus.grpc.PartitionList.partition_tag_array) - return partition_tag_array_.Add(); -} -inline void PartitionList::add_partition_tag_array(const std::string& value) { - partition_tag_array_.Add()->assign(value); - // @@protoc_insertion_point(field_add:milvus.grpc.PartitionList.partition_tag_array) -} -inline void PartitionList::add_partition_tag_array(std::string&& value) { - partition_tag_array_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:milvus.grpc.PartitionList.partition_tag_array) -} -inline void PartitionList::add_partition_tag_array(const char* value) { - GOOGLE_DCHECK(value != nullptr); - partition_tag_array_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:milvus.grpc.PartitionList.partition_tag_array) -} -inline void PartitionList::add_partition_tag_array(const char* value, size_t size) { - partition_tag_array_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:milvus.grpc.PartitionList.partition_tag_array) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -PartitionList::partition_tag_array() const { - // @@protoc_insertion_point(field_list:milvus.grpc.PartitionList.partition_tag_array) - return partition_tag_array_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -PartitionList::mutable_partition_tag_array() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.PartitionList.partition_tag_array) - return &partition_tag_array_; -} - -// ------------------------------------------------------------------- - -// VectorRowRecord - -// repeated float float_data = 1; -inline int VectorRowRecord::float_data_size() const { - return float_data_.size(); -} -inline void VectorRowRecord::clear_float_data() { - float_data_.Clear(); -} -inline float VectorRowRecord::float_data(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.VectorRowRecord.float_data) - return float_data_.Get(index); -} -inline void VectorRowRecord::set_float_data(int index, float value) { - float_data_.Set(index, value); - // @@protoc_insertion_point(field_set:milvus.grpc.VectorRowRecord.float_data) -} -inline void VectorRowRecord::add_float_data(float value) { - float_data_.Add(value); - // @@protoc_insertion_point(field_add:milvus.grpc.VectorRowRecord.float_data) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >& -VectorRowRecord::float_data() const { - // @@protoc_insertion_point(field_list:milvus.grpc.VectorRowRecord.float_data) - return float_data_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >* -VectorRowRecord::mutable_float_data() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.VectorRowRecord.float_data) - return &float_data_; -} - -// bytes binary_data = 2; -inline void VectorRowRecord::clear_binary_data() { - binary_data_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& VectorRowRecord::binary_data() const { - // @@protoc_insertion_point(field_get:milvus.grpc.VectorRowRecord.binary_data) - return binary_data_.GetNoArena(); -} -inline void VectorRowRecord::set_binary_data(const std::string& value) { - - binary_data_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.VectorRowRecord.binary_data) -} -inline void VectorRowRecord::set_binary_data(std::string&& value) { - - binary_data_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.VectorRowRecord.binary_data) -} -inline void VectorRowRecord::set_binary_data(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - binary_data_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.VectorRowRecord.binary_data) -} -inline void VectorRowRecord::set_binary_data(const void* value, size_t size) { - - binary_data_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.VectorRowRecord.binary_data) -} -inline std::string* VectorRowRecord::mutable_binary_data() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.VectorRowRecord.binary_data) - return binary_data_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* VectorRowRecord::release_binary_data() { - // @@protoc_insertion_point(field_release:milvus.grpc.VectorRowRecord.binary_data) - - return binary_data_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void VectorRowRecord::set_allocated_binary_data(std::string* binary_data) { - if (binary_data != nullptr) { - - } else { - - } - binary_data_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), binary_data); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.VectorRowRecord.binary_data) -} - -// ------------------------------------------------------------------- - -// EntityIds - -// .milvus.grpc.Status status = 1; -inline bool EntityIds::has_status() const { - return this != internal_default_instance() && status_ != nullptr; -} -inline void EntityIds::clear_status() { - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; -} -inline const ::milvus::grpc::Status& EntityIds::status() const { - const ::milvus::grpc::Status* p = status_; - // @@protoc_insertion_point(field_get:milvus.grpc.EntityIds.status) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Status_default_instance_); -} -inline ::milvus::grpc::Status* EntityIds::release_status() { - // @@protoc_insertion_point(field_release:milvus.grpc.EntityIds.status) - - ::milvus::grpc::Status* temp = status_; - status_ = nullptr; - return temp; -} -inline ::milvus::grpc::Status* EntityIds::mutable_status() { - - if (status_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual()); - status_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.EntityIds.status) - return status_; -} -inline void EntityIds::set_allocated_status(::milvus::grpc::Status* status) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete status_; - } - if (status) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - status = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, status, submessage_arena); - } - - } else { - - } - status_ = status; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.EntityIds.status) -} - -// repeated int64 entity_id_array = 2; -inline int EntityIds::entity_id_array_size() const { - return entity_id_array_.size(); -} -inline void EntityIds::clear_entity_id_array() { - entity_id_array_.Clear(); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 EntityIds::entity_id_array(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.EntityIds.entity_id_array) - return entity_id_array_.Get(index); -} -inline void EntityIds::set_entity_id_array(int index, ::PROTOBUF_NAMESPACE_ID::int64 value) { - entity_id_array_.Set(index, value); - // @@protoc_insertion_point(field_set:milvus.grpc.EntityIds.entity_id_array) -} -inline void EntityIds::add_entity_id_array(::PROTOBUF_NAMESPACE_ID::int64 value) { - entity_id_array_.Add(value); - // @@protoc_insertion_point(field_add:milvus.grpc.EntityIds.entity_id_array) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& -EntityIds::entity_id_array() const { - // @@protoc_insertion_point(field_list:milvus.grpc.EntityIds.entity_id_array) - return entity_id_array_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* -EntityIds::mutable_entity_id_array() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.EntityIds.entity_id_array) - return &entity_id_array_; -} - -// ------------------------------------------------------------------- - -// VectorRecord - -// repeated .milvus.grpc.VectorRowRecord records = 1; -inline int VectorRecord::records_size() const { - return records_.size(); -} -inline void VectorRecord::clear_records() { - records_.Clear(); -} -inline ::milvus::grpc::VectorRowRecord* VectorRecord::mutable_records(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.VectorRecord.records) - return records_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorRowRecord >* -VectorRecord::mutable_records() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.VectorRecord.records) - return &records_; -} -inline const ::milvus::grpc::VectorRowRecord& VectorRecord::records(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.VectorRecord.records) - return records_.Get(index); -} -inline ::milvus::grpc::VectorRowRecord* VectorRecord::add_records() { - // @@protoc_insertion_point(field_add:milvus.grpc.VectorRecord.records) - return records_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorRowRecord >& -VectorRecord::records() const { - // @@protoc_insertion_point(field_list:milvus.grpc.VectorRecord.records) - return records_; -} - -// ------------------------------------------------------------------- - -// VectorParam - -// string json = 1; -inline void VectorParam::clear_json() { - json_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& VectorParam::json() const { - // @@protoc_insertion_point(field_get:milvus.grpc.VectorParam.json) - return json_.GetNoArena(); -} -inline void VectorParam::set_json(const std::string& value) { - - json_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.VectorParam.json) -} -inline void VectorParam::set_json(std::string&& value) { - - json_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.VectorParam.json) -} -inline void VectorParam::set_json(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - json_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.VectorParam.json) -} -inline void VectorParam::set_json(const char* value, size_t size) { - - json_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.VectorParam.json) -} -inline std::string* VectorParam::mutable_json() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.VectorParam.json) - return json_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* VectorParam::release_json() { - // @@protoc_insertion_point(field_release:milvus.grpc.VectorParam.json) - - return json_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void VectorParam::set_allocated_json(std::string* json) { - if (json != nullptr) { - - } else { - - } - json_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), json); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.VectorParam.json) -} - -// .milvus.grpc.VectorRecord row_record = 2; -inline bool VectorParam::has_row_record() const { - return this != internal_default_instance() && row_record_ != nullptr; -} -inline void VectorParam::clear_row_record() { - if (GetArenaNoVirtual() == nullptr && row_record_ != nullptr) { - delete row_record_; - } - row_record_ = nullptr; -} -inline const ::milvus::grpc::VectorRecord& VectorParam::row_record() const { - const ::milvus::grpc::VectorRecord* p = row_record_; - // @@protoc_insertion_point(field_get:milvus.grpc.VectorParam.row_record) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_VectorRecord_default_instance_); -} -inline ::milvus::grpc::VectorRecord* VectorParam::release_row_record() { - // @@protoc_insertion_point(field_release:milvus.grpc.VectorParam.row_record) - - ::milvus::grpc::VectorRecord* temp = row_record_; - row_record_ = nullptr; - return temp; -} -inline ::milvus::grpc::VectorRecord* VectorParam::mutable_row_record() { - - if (row_record_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::VectorRecord>(GetArenaNoVirtual()); - row_record_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.VectorParam.row_record) - return row_record_; -} -inline void VectorParam::set_allocated_row_record(::milvus::grpc::VectorRecord* row_record) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete row_record_; - } - if (row_record) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - row_record = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, row_record, submessage_arena); - } - - } else { - - } - row_record_ = row_record; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.VectorParam.row_record) -} - -// ------------------------------------------------------------------- - -// FieldMeta - -// string field_name = 1; -inline void FieldMeta::clear_field_name() { - field_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& FieldMeta::field_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.FieldMeta.field_name) - return field_name_.GetNoArena(); -} -inline void FieldMeta::set_field_name(const std::string& value) { - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.FieldMeta.field_name) -} -inline void FieldMeta::set_field_name(std::string&& value) { - - field_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.FieldMeta.field_name) -} -inline void FieldMeta::set_field_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.FieldMeta.field_name) -} -inline void FieldMeta::set_field_name(const char* value, size_t size) { - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.FieldMeta.field_name) -} -inline std::string* FieldMeta::mutable_field_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.FieldMeta.field_name) - return field_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* FieldMeta::release_field_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.FieldMeta.field_name) - - return field_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void FieldMeta::set_allocated_field_name(std::string* field_name) { - if (field_name != nullptr) { - - } else { - - } - field_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), field_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.FieldMeta.field_name) -} - -// .milvus.grpc.DataType type = 2; -inline void FieldMeta::clear_type() { - type_ = 0; -} -inline ::milvus::grpc::DataType FieldMeta::type() const { - // @@protoc_insertion_point(field_get:milvus.grpc.FieldMeta.type) - return static_cast< ::milvus::grpc::DataType >(type_); -} -inline void FieldMeta::set_type(::milvus::grpc::DataType value) { - - type_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.FieldMeta.type) -} - -// int64 dim = 3; -inline void FieldMeta::clear_dim() { - dim_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 FieldMeta::dim() const { - // @@protoc_insertion_point(field_get:milvus.grpc.FieldMeta.dim) - return dim_; -} -inline void FieldMeta::set_dim(::PROTOBUF_NAMESPACE_ID::int64 value) { - - dim_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.FieldMeta.dim) -} - -// ------------------------------------------------------------------- - -// Schema - -// repeated .milvus.grpc.FieldMeta field_metas = 1; -inline int Schema::field_metas_size() const { - return field_metas_.size(); -} -inline void Schema::clear_field_metas() { - field_metas_.Clear(); -} -inline ::milvus::grpc::FieldMeta* Schema::mutable_field_metas(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.Schema.field_metas) - return field_metas_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::FieldMeta >* -Schema::mutable_field_metas() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.Schema.field_metas) - return &field_metas_; -} -inline const ::milvus::grpc::FieldMeta& Schema::field_metas(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.Schema.field_metas) - return field_metas_.Get(index); -} -inline ::milvus::grpc::FieldMeta* Schema::add_field_metas() { - // @@protoc_insertion_point(field_add:milvus.grpc.Schema.field_metas) - return field_metas_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::FieldMeta >& -Schema::field_metas() const { - // @@protoc_insertion_point(field_list:milvus.grpc.Schema.field_metas) - return field_metas_; -} - -// ------------------------------------------------------------------- - -// RowData - -// bytes blob = 1; -inline void RowData::clear_blob() { - blob_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& RowData::blob() const { - // @@protoc_insertion_point(field_get:milvus.grpc.RowData.blob) - return blob_.GetNoArena(); -} -inline void RowData::set_blob(const std::string& value) { - - blob_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.RowData.blob) -} -inline void RowData::set_blob(std::string&& value) { - - blob_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.RowData.blob) -} -inline void RowData::set_blob(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - blob_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.RowData.blob) -} -inline void RowData::set_blob(const void* value, size_t size) { - - blob_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.RowData.blob) -} -inline std::string* RowData::mutable_blob() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.RowData.blob) - return blob_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* RowData::release_blob() { - // @@protoc_insertion_point(field_release:milvus.grpc.RowData.blob) - - return blob_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void RowData::set_allocated_blob(std::string* blob) { - if (blob != nullptr) { - - } else { - - } - blob_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), blob); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.RowData.blob) -} - -// ------------------------------------------------------------------- - -// InsertParam - -// string collection_name = 1; -inline void InsertParam::clear_collection_name() { - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& InsertParam::collection_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.InsertParam.collection_name) - return collection_name_.GetNoArena(); -} -inline void InsertParam::set_collection_name(const std::string& value) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.InsertParam.collection_name) -} -inline void InsertParam::set_collection_name(std::string&& value) { - - collection_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.InsertParam.collection_name) -} -inline void InsertParam::set_collection_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.InsertParam.collection_name) -} -inline void InsertParam::set_collection_name(const char* value, size_t size) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.InsertParam.collection_name) -} -inline std::string* InsertParam::mutable_collection_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.InsertParam.collection_name) - return collection_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* InsertParam::release_collection_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.InsertParam.collection_name) - - return collection_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void InsertParam::set_allocated_collection_name(std::string* collection_name) { - if (collection_name != nullptr) { - - } else { - - } - collection_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), collection_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.InsertParam.collection_name) -} - -// .milvus.grpc.Schema schema = 2; -inline bool InsertParam::has_schema() const { - return this != internal_default_instance() && schema_ != nullptr; -} -inline void InsertParam::clear_schema() { - if (GetArenaNoVirtual() == nullptr && schema_ != nullptr) { - delete schema_; - } - schema_ = nullptr; -} -inline const ::milvus::grpc::Schema& InsertParam::schema() const { - const ::milvus::grpc::Schema* p = schema_; - // @@protoc_insertion_point(field_get:milvus.grpc.InsertParam.schema) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Schema_default_instance_); -} -inline ::milvus::grpc::Schema* InsertParam::release_schema() { - // @@protoc_insertion_point(field_release:milvus.grpc.InsertParam.schema) - - ::milvus::grpc::Schema* temp = schema_; - schema_ = nullptr; - return temp; -} -inline ::milvus::grpc::Schema* InsertParam::mutable_schema() { - - if (schema_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Schema>(GetArenaNoVirtual()); - schema_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.InsertParam.schema) - return schema_; -} -inline void InsertParam::set_allocated_schema(::milvus::grpc::Schema* schema) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete schema_; - } - if (schema) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - schema = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, schema, submessage_arena); - } - - } else { - - } - schema_ = schema; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.InsertParam.schema) -} - -// repeated .milvus.grpc.RowData rows_data = 3; -inline int InsertParam::rows_data_size() const { - return rows_data_.size(); -} -inline void InsertParam::clear_rows_data() { - rows_data_.Clear(); -} -inline ::milvus::grpc::RowData* InsertParam::mutable_rows_data(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.InsertParam.rows_data) - return rows_data_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::RowData >* -InsertParam::mutable_rows_data() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.InsertParam.rows_data) - return &rows_data_; -} -inline const ::milvus::grpc::RowData& InsertParam::rows_data(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.InsertParam.rows_data) - return rows_data_.Get(index); -} -inline ::milvus::grpc::RowData* InsertParam::add_rows_data() { - // @@protoc_insertion_point(field_add:milvus.grpc.InsertParam.rows_data) - return rows_data_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::RowData >& -InsertParam::rows_data() const { - // @@protoc_insertion_point(field_list:milvus.grpc.InsertParam.rows_data) - return rows_data_; -} - -// repeated int64 entity_id_array = 4; -inline int InsertParam::entity_id_array_size() const { - return entity_id_array_.size(); -} -inline void InsertParam::clear_entity_id_array() { - entity_id_array_.Clear(); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 InsertParam::entity_id_array(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.InsertParam.entity_id_array) - return entity_id_array_.Get(index); -} -inline void InsertParam::set_entity_id_array(int index, ::PROTOBUF_NAMESPACE_ID::int64 value) { - entity_id_array_.Set(index, value); - // @@protoc_insertion_point(field_set:milvus.grpc.InsertParam.entity_id_array) -} -inline void InsertParam::add_entity_id_array(::PROTOBUF_NAMESPACE_ID::int64 value) { - entity_id_array_.Add(value); - // @@protoc_insertion_point(field_add:milvus.grpc.InsertParam.entity_id_array) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& -InsertParam::entity_id_array() const { - // @@protoc_insertion_point(field_list:milvus.grpc.InsertParam.entity_id_array) - return entity_id_array_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* -InsertParam::mutable_entity_id_array() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.InsertParam.entity_id_array) - return &entity_id_array_; -} - -// string partition_tag = 5; -inline void InsertParam::clear_partition_tag() { - partition_tag_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& InsertParam::partition_tag() const { - // @@protoc_insertion_point(field_get:milvus.grpc.InsertParam.partition_tag) - return partition_tag_.GetNoArena(); -} -inline void InsertParam::set_partition_tag(const std::string& value) { - - partition_tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.InsertParam.partition_tag) -} -inline void InsertParam::set_partition_tag(std::string&& value) { - - partition_tag_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.InsertParam.partition_tag) -} -inline void InsertParam::set_partition_tag(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - partition_tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.InsertParam.partition_tag) -} -inline void InsertParam::set_partition_tag(const char* value, size_t size) { - - partition_tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.InsertParam.partition_tag) -} -inline std::string* InsertParam::mutable_partition_tag() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.InsertParam.partition_tag) - return partition_tag_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* InsertParam::release_partition_tag() { - // @@protoc_insertion_point(field_release:milvus.grpc.InsertParam.partition_tag) - - return partition_tag_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void InsertParam::set_allocated_partition_tag(std::string* partition_tag) { - if (partition_tag != nullptr) { - - } else { - - } - partition_tag_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), partition_tag); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.InsertParam.partition_tag) -} - -// repeated .milvus.grpc.KeyValuePair extra_params = 6; -inline int InsertParam::extra_params_size() const { - return extra_params_.size(); -} -inline void InsertParam::clear_extra_params() { - extra_params_.Clear(); -} -inline ::milvus::grpc::KeyValuePair* InsertParam::mutable_extra_params(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.InsertParam.extra_params) - return extra_params_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* -InsertParam::mutable_extra_params() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.InsertParam.extra_params) - return &extra_params_; -} -inline const ::milvus::grpc::KeyValuePair& InsertParam::extra_params(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.InsertParam.extra_params) - return extra_params_.Get(index); -} -inline ::milvus::grpc::KeyValuePair* InsertParam::add_extra_params() { - // @@protoc_insertion_point(field_add:milvus.grpc.InsertParam.extra_params) - return extra_params_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& -InsertParam::extra_params() const { - // @@protoc_insertion_point(field_list:milvus.grpc.InsertParam.extra_params) - return extra_params_; -} - -// ------------------------------------------------------------------- - -// SearchParam - -// string collection_name = 1; -inline void SearchParam::clear_collection_name() { - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& SearchParam::collection_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchParam.collection_name) - return collection_name_.GetNoArena(); -} -inline void SearchParam::set_collection_name(const std::string& value) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.SearchParam.collection_name) -} -inline void SearchParam::set_collection_name(std::string&& value) { - - collection_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.SearchParam.collection_name) -} -inline void SearchParam::set_collection_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.SearchParam.collection_name) -} -inline void SearchParam::set_collection_name(const char* value, size_t size) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.SearchParam.collection_name) -} -inline std::string* SearchParam::mutable_collection_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchParam.collection_name) - return collection_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* SearchParam::release_collection_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.SearchParam.collection_name) - - return collection_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void SearchParam::set_allocated_collection_name(std::string* collection_name) { - if (collection_name != nullptr) { - - } else { - - } - collection_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), collection_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.SearchParam.collection_name) -} - -// repeated .milvus.grpc.VectorParam vector_param = 2; -inline int SearchParam::vector_param_size() const { - return vector_param_.size(); -} -inline void SearchParam::clear_vector_param() { - vector_param_.Clear(); -} -inline ::milvus::grpc::VectorParam* SearchParam::mutable_vector_param(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchParam.vector_param) - return vector_param_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorParam >* -SearchParam::mutable_vector_param() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.SearchParam.vector_param) - return &vector_param_; -} -inline const ::milvus::grpc::VectorParam& SearchParam::vector_param(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchParam.vector_param) - return vector_param_.Get(index); -} -inline ::milvus::grpc::VectorParam* SearchParam::add_vector_param() { - // @@protoc_insertion_point(field_add:milvus.grpc.SearchParam.vector_param) - return vector_param_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorParam >& -SearchParam::vector_param() const { - // @@protoc_insertion_point(field_list:milvus.grpc.SearchParam.vector_param) - return vector_param_; -} - -// string dsl = 3; -inline void SearchParam::clear_dsl() { - dsl_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& SearchParam::dsl() const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchParam.dsl) - return dsl_.GetNoArena(); -} -inline void SearchParam::set_dsl(const std::string& value) { - - dsl_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.SearchParam.dsl) -} -inline void SearchParam::set_dsl(std::string&& value) { - - dsl_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.SearchParam.dsl) -} -inline void SearchParam::set_dsl(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - dsl_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.SearchParam.dsl) -} -inline void SearchParam::set_dsl(const char* value, size_t size) { - - dsl_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.SearchParam.dsl) -} -inline std::string* SearchParam::mutable_dsl() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchParam.dsl) - return dsl_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* SearchParam::release_dsl() { - // @@protoc_insertion_point(field_release:milvus.grpc.SearchParam.dsl) - - return dsl_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void SearchParam::set_allocated_dsl(std::string* dsl) { - if (dsl != nullptr) { - - } else { - - } - dsl_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), dsl); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.SearchParam.dsl) -} - -// repeated string partition_tag = 4; -inline int SearchParam::partition_tag_size() const { - return partition_tag_.size(); -} -inline void SearchParam::clear_partition_tag() { - partition_tag_.Clear(); -} -inline const std::string& SearchParam::partition_tag(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchParam.partition_tag) - return partition_tag_.Get(index); -} -inline std::string* SearchParam::mutable_partition_tag(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchParam.partition_tag) - return partition_tag_.Mutable(index); -} -inline void SearchParam::set_partition_tag(int index, const std::string& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.SearchParam.partition_tag) - partition_tag_.Mutable(index)->assign(value); -} -inline void SearchParam::set_partition_tag(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.SearchParam.partition_tag) - partition_tag_.Mutable(index)->assign(std::move(value)); -} -inline void SearchParam::set_partition_tag(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - partition_tag_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:milvus.grpc.SearchParam.partition_tag) -} -inline void SearchParam::set_partition_tag(int index, const char* value, size_t size) { - partition_tag_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.SearchParam.partition_tag) -} -inline std::string* SearchParam::add_partition_tag() { - // @@protoc_insertion_point(field_add_mutable:milvus.grpc.SearchParam.partition_tag) - return partition_tag_.Add(); -} -inline void SearchParam::add_partition_tag(const std::string& value) { - partition_tag_.Add()->assign(value); - // @@protoc_insertion_point(field_add:milvus.grpc.SearchParam.partition_tag) -} -inline void SearchParam::add_partition_tag(std::string&& value) { - partition_tag_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:milvus.grpc.SearchParam.partition_tag) -} -inline void SearchParam::add_partition_tag(const char* value) { - GOOGLE_DCHECK(value != nullptr); - partition_tag_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:milvus.grpc.SearchParam.partition_tag) -} -inline void SearchParam::add_partition_tag(const char* value, size_t size) { - partition_tag_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:milvus.grpc.SearchParam.partition_tag) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -SearchParam::partition_tag() const { - // @@protoc_insertion_point(field_list:milvus.grpc.SearchParam.partition_tag) - return partition_tag_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -SearchParam::mutable_partition_tag() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.SearchParam.partition_tag) - return &partition_tag_; -} - -// repeated .milvus.grpc.KeyValuePair extra_params = 5; -inline int SearchParam::extra_params_size() const { - return extra_params_.size(); -} -inline void SearchParam::clear_extra_params() { - extra_params_.Clear(); -} -inline ::milvus::grpc::KeyValuePair* SearchParam::mutable_extra_params(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchParam.extra_params) - return extra_params_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* -SearchParam::mutable_extra_params() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.SearchParam.extra_params) - return &extra_params_; -} -inline const ::milvus::grpc::KeyValuePair& SearchParam::extra_params(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchParam.extra_params) - return extra_params_.Get(index); -} -inline ::milvus::grpc::KeyValuePair* SearchParam::add_extra_params() { - // @@protoc_insertion_point(field_add:milvus.grpc.SearchParam.extra_params) - return extra_params_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& -SearchParam::extra_params() const { - // @@protoc_insertion_point(field_list:milvus.grpc.SearchParam.extra_params) - return extra_params_; -} - -// ------------------------------------------------------------------- - -// SearchInSegmentParam - -// repeated string file_id_array = 1; -inline int SearchInSegmentParam::file_id_array_size() const { - return file_id_array_.size(); -} -inline void SearchInSegmentParam::clear_file_id_array() { - file_id_array_.Clear(); -} -inline const std::string& SearchInSegmentParam::file_id_array(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchInSegmentParam.file_id_array) - return file_id_array_.Get(index); -} -inline std::string* SearchInSegmentParam::mutable_file_id_array(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchInSegmentParam.file_id_array) - return file_id_array_.Mutable(index); -} -inline void SearchInSegmentParam::set_file_id_array(int index, const std::string& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.SearchInSegmentParam.file_id_array) - file_id_array_.Mutable(index)->assign(value); -} -inline void SearchInSegmentParam::set_file_id_array(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.SearchInSegmentParam.file_id_array) - file_id_array_.Mutable(index)->assign(std::move(value)); -} -inline void SearchInSegmentParam::set_file_id_array(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - file_id_array_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:milvus.grpc.SearchInSegmentParam.file_id_array) -} -inline void SearchInSegmentParam::set_file_id_array(int index, const char* value, size_t size) { - file_id_array_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.SearchInSegmentParam.file_id_array) -} -inline std::string* SearchInSegmentParam::add_file_id_array() { - // @@protoc_insertion_point(field_add_mutable:milvus.grpc.SearchInSegmentParam.file_id_array) - return file_id_array_.Add(); -} -inline void SearchInSegmentParam::add_file_id_array(const std::string& value) { - file_id_array_.Add()->assign(value); - // @@protoc_insertion_point(field_add:milvus.grpc.SearchInSegmentParam.file_id_array) -} -inline void SearchInSegmentParam::add_file_id_array(std::string&& value) { - file_id_array_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:milvus.grpc.SearchInSegmentParam.file_id_array) -} -inline void SearchInSegmentParam::add_file_id_array(const char* value) { - GOOGLE_DCHECK(value != nullptr); - file_id_array_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:milvus.grpc.SearchInSegmentParam.file_id_array) -} -inline void SearchInSegmentParam::add_file_id_array(const char* value, size_t size) { - file_id_array_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:milvus.grpc.SearchInSegmentParam.file_id_array) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -SearchInSegmentParam::file_id_array() const { - // @@protoc_insertion_point(field_list:milvus.grpc.SearchInSegmentParam.file_id_array) - return file_id_array_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -SearchInSegmentParam::mutable_file_id_array() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.SearchInSegmentParam.file_id_array) - return &file_id_array_; -} - -// .milvus.grpc.SearchParam search_param = 2; -inline bool SearchInSegmentParam::has_search_param() const { - return this != internal_default_instance() && search_param_ != nullptr; -} -inline void SearchInSegmentParam::clear_search_param() { - if (GetArenaNoVirtual() == nullptr && search_param_ != nullptr) { - delete search_param_; - } - search_param_ = nullptr; -} -inline const ::milvus::grpc::SearchParam& SearchInSegmentParam::search_param() const { - const ::milvus::grpc::SearchParam* p = search_param_; - // @@protoc_insertion_point(field_get:milvus.grpc.SearchInSegmentParam.search_param) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_SearchParam_default_instance_); -} -inline ::milvus::grpc::SearchParam* SearchInSegmentParam::release_search_param() { - // @@protoc_insertion_point(field_release:milvus.grpc.SearchInSegmentParam.search_param) - - ::milvus::grpc::SearchParam* temp = search_param_; - search_param_ = nullptr; - return temp; -} -inline ::milvus::grpc::SearchParam* SearchInSegmentParam::mutable_search_param() { - - if (search_param_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::SearchParam>(GetArenaNoVirtual()); - search_param_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchInSegmentParam.search_param) - return search_param_; -} -inline void SearchInSegmentParam::set_allocated_search_param(::milvus::grpc::SearchParam* search_param) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete search_param_; - } - if (search_param) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - search_param = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, search_param, submessage_arena); - } - - } else { - - } - search_param_ = search_param; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.SearchInSegmentParam.search_param) -} - -// ------------------------------------------------------------------- - -// Entities - -// .milvus.grpc.Status status = 1; -inline bool Entities::has_status() const { - return this != internal_default_instance() && status_ != nullptr; -} -inline void Entities::clear_status() { - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; -} -inline const ::milvus::grpc::Status& Entities::status() const { - const ::milvus::grpc::Status* p = status_; - // @@protoc_insertion_point(field_get:milvus.grpc.Entities.status) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Status_default_instance_); -} -inline ::milvus::grpc::Status* Entities::release_status() { - // @@protoc_insertion_point(field_release:milvus.grpc.Entities.status) - - ::milvus::grpc::Status* temp = status_; - status_ = nullptr; - return temp; -} -inline ::milvus::grpc::Status* Entities::mutable_status() { - - if (status_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual()); - status_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.Entities.status) - return status_; -} -inline void Entities::set_allocated_status(::milvus::grpc::Status* status) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete status_; - } - if (status) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - status = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, status, submessage_arena); - } - - } else { - - } - status_ = status; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.Entities.status) -} - -// repeated int64 ids = 2; -inline int Entities::ids_size() const { - return ids_.size(); -} -inline void Entities::clear_ids() { - ids_.Clear(); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 Entities::ids(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.Entities.ids) - return ids_.Get(index); -} -inline void Entities::set_ids(int index, ::PROTOBUF_NAMESPACE_ID::int64 value) { - ids_.Set(index, value); - // @@protoc_insertion_point(field_set:milvus.grpc.Entities.ids) -} -inline void Entities::add_ids(::PROTOBUF_NAMESPACE_ID::int64 value) { - ids_.Add(value); - // @@protoc_insertion_point(field_add:milvus.grpc.Entities.ids) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& -Entities::ids() const { - // @@protoc_insertion_point(field_list:milvus.grpc.Entities.ids) - return ids_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* -Entities::mutable_ids() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.Entities.ids) - return &ids_; -} - -// repeated bool valid_row = 3; -inline int Entities::valid_row_size() const { - return valid_row_.size(); -} -inline void Entities::clear_valid_row() { - valid_row_.Clear(); -} -inline bool Entities::valid_row(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.Entities.valid_row) - return valid_row_.Get(index); -} -inline void Entities::set_valid_row(int index, bool value) { - valid_row_.Set(index, value); - // @@protoc_insertion_point(field_set:milvus.grpc.Entities.valid_row) -} -inline void Entities::add_valid_row(bool value) { - valid_row_.Add(value); - // @@protoc_insertion_point(field_add:milvus.grpc.Entities.valid_row) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >& -Entities::valid_row() const { - // @@protoc_insertion_point(field_list:milvus.grpc.Entities.valid_row) - return valid_row_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< bool >* -Entities::mutable_valid_row() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.Entities.valid_row) - return &valid_row_; -} - -// repeated .milvus.grpc.RowData rows_data = 4; -inline int Entities::rows_data_size() const { - return rows_data_.size(); -} -inline void Entities::clear_rows_data() { - rows_data_.Clear(); -} -inline ::milvus::grpc::RowData* Entities::mutable_rows_data(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.Entities.rows_data) - return rows_data_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::RowData >* -Entities::mutable_rows_data() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.Entities.rows_data) - return &rows_data_; -} -inline const ::milvus::grpc::RowData& Entities::rows_data(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.Entities.rows_data) - return rows_data_.Get(index); -} -inline ::milvus::grpc::RowData* Entities::add_rows_data() { - // @@protoc_insertion_point(field_add:milvus.grpc.Entities.rows_data) - return rows_data_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::RowData >& -Entities::rows_data() const { - // @@protoc_insertion_point(field_list:milvus.grpc.Entities.rows_data) - return rows_data_; -} - -// ------------------------------------------------------------------- - -// QueryResult - -// .milvus.grpc.Status status = 1; -inline bool QueryResult::has_status() const { - return this != internal_default_instance() && status_ != nullptr; -} -inline void QueryResult::clear_status() { - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; -} -inline const ::milvus::grpc::Status& QueryResult::status() const { - const ::milvus::grpc::Status* p = status_; - // @@protoc_insertion_point(field_get:milvus.grpc.QueryResult.status) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Status_default_instance_); -} -inline ::milvus::grpc::Status* QueryResult::release_status() { - // @@protoc_insertion_point(field_release:milvus.grpc.QueryResult.status) - - ::milvus::grpc::Status* temp = status_; - status_ = nullptr; - return temp; -} -inline ::milvus::grpc::Status* QueryResult::mutable_status() { - - if (status_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual()); - status_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.QueryResult.status) - return status_; -} -inline void QueryResult::set_allocated_status(::milvus::grpc::Status* status) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete status_; - } - if (status) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - status = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, status, submessage_arena); - } - - } else { - - } - status_ = status; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.QueryResult.status) -} - -// .milvus.grpc.Entities entities = 2; -inline bool QueryResult::has_entities() const { - return this != internal_default_instance() && entities_ != nullptr; -} -inline void QueryResult::clear_entities() { - if (GetArenaNoVirtual() == nullptr && entities_ != nullptr) { - delete entities_; - } - entities_ = nullptr; -} -inline const ::milvus::grpc::Entities& QueryResult::entities() const { - const ::milvus::grpc::Entities* p = entities_; - // @@protoc_insertion_point(field_get:milvus.grpc.QueryResult.entities) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Entities_default_instance_); -} -inline ::milvus::grpc::Entities* QueryResult::release_entities() { - // @@protoc_insertion_point(field_release:milvus.grpc.QueryResult.entities) - - ::milvus::grpc::Entities* temp = entities_; - entities_ = nullptr; - return temp; -} -inline ::milvus::grpc::Entities* QueryResult::mutable_entities() { - - if (entities_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Entities>(GetArenaNoVirtual()); - entities_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.QueryResult.entities) - return entities_; -} -inline void QueryResult::set_allocated_entities(::milvus::grpc::Entities* entities) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete entities_; - } - if (entities) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - entities = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, entities, submessage_arena); - } - - } else { - - } - entities_ = entities; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.QueryResult.entities) -} - -// int64 row_num = 3; -inline void QueryResult::clear_row_num() { - row_num_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 QueryResult::row_num() const { - // @@protoc_insertion_point(field_get:milvus.grpc.QueryResult.row_num) - return row_num_; -} -inline void QueryResult::set_row_num(::PROTOBUF_NAMESPACE_ID::int64 value) { - - row_num_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.QueryResult.row_num) -} - -// repeated float scores = 4; -inline int QueryResult::scores_size() const { - return scores_.size(); -} -inline void QueryResult::clear_scores() { - scores_.Clear(); -} -inline float QueryResult::scores(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.QueryResult.scores) - return scores_.Get(index); -} -inline void QueryResult::set_scores(int index, float value) { - scores_.Set(index, value); - // @@protoc_insertion_point(field_set:milvus.grpc.QueryResult.scores) -} -inline void QueryResult::add_scores(float value) { - scores_.Add(value); - // @@protoc_insertion_point(field_add:milvus.grpc.QueryResult.scores) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >& -QueryResult::scores() const { - // @@protoc_insertion_point(field_list:milvus.grpc.QueryResult.scores) - return scores_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >* -QueryResult::mutable_scores() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.QueryResult.scores) - return &scores_; -} - -// repeated float distances = 5; -inline int QueryResult::distances_size() const { - return distances_.size(); -} -inline void QueryResult::clear_distances() { - distances_.Clear(); -} -inline float QueryResult::distances(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.QueryResult.distances) - return distances_.Get(index); -} -inline void QueryResult::set_distances(int index, float value) { - distances_.Set(index, value); - // @@protoc_insertion_point(field_set:milvus.grpc.QueryResult.distances) -} -inline void QueryResult::add_distances(float value) { - distances_.Add(value); - // @@protoc_insertion_point(field_add:milvus.grpc.QueryResult.distances) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >& -QueryResult::distances() const { - // @@protoc_insertion_point(field_list:milvus.grpc.QueryResult.distances) - return distances_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< float >* -QueryResult::mutable_distances() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.QueryResult.distances) - return &distances_; -} - -// repeated .milvus.grpc.KeyValuePair extra_params = 6; -inline int QueryResult::extra_params_size() const { - return extra_params_.size(); -} -inline void QueryResult::clear_extra_params() { - extra_params_.Clear(); -} -inline ::milvus::grpc::KeyValuePair* QueryResult::mutable_extra_params(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.QueryResult.extra_params) - return extra_params_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* -QueryResult::mutable_extra_params() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.QueryResult.extra_params) - return &extra_params_; -} -inline const ::milvus::grpc::KeyValuePair& QueryResult::extra_params(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.QueryResult.extra_params) - return extra_params_.Get(index); -} -inline ::milvus::grpc::KeyValuePair* QueryResult::add_extra_params() { - // @@protoc_insertion_point(field_add:milvus.grpc.QueryResult.extra_params) - return extra_params_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& -QueryResult::extra_params() const { - // @@protoc_insertion_point(field_list:milvus.grpc.QueryResult.extra_params) - return extra_params_; -} - -// int64 query_id = 7; -inline void QueryResult::clear_query_id() { - query_id_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 QueryResult::query_id() const { - // @@protoc_insertion_point(field_get:milvus.grpc.QueryResult.query_id) - return query_id_; -} -inline void QueryResult::set_query_id(::PROTOBUF_NAMESPACE_ID::int64 value) { - - query_id_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.QueryResult.query_id) -} - -// int64 client_id = 8; -inline void QueryResult::clear_client_id() { - client_id_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 QueryResult::client_id() const { - // @@protoc_insertion_point(field_get:milvus.grpc.QueryResult.client_id) - return client_id_; -} -inline void QueryResult::set_client_id(::PROTOBUF_NAMESPACE_ID::int64 value) { - - client_id_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.QueryResult.client_id) -} - -// ------------------------------------------------------------------- - -// StringReply - -// .milvus.grpc.Status status = 1; -inline bool StringReply::has_status() const { - return this != internal_default_instance() && status_ != nullptr; -} -inline void StringReply::clear_status() { - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; -} -inline const ::milvus::grpc::Status& StringReply::status() const { - const ::milvus::grpc::Status* p = status_; - // @@protoc_insertion_point(field_get:milvus.grpc.StringReply.status) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Status_default_instance_); -} -inline ::milvus::grpc::Status* StringReply::release_status() { - // @@protoc_insertion_point(field_release:milvus.grpc.StringReply.status) - - ::milvus::grpc::Status* temp = status_; - status_ = nullptr; - return temp; -} -inline ::milvus::grpc::Status* StringReply::mutable_status() { - - if (status_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual()); - status_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.StringReply.status) - return status_; -} -inline void StringReply::set_allocated_status(::milvus::grpc::Status* status) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete status_; - } - if (status) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - status = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, status, submessage_arena); - } - - } else { - - } - status_ = status; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.StringReply.status) -} - -// string string_reply = 2; -inline void StringReply::clear_string_reply() { - string_reply_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& StringReply::string_reply() const { - // @@protoc_insertion_point(field_get:milvus.grpc.StringReply.string_reply) - return string_reply_.GetNoArena(); -} -inline void StringReply::set_string_reply(const std::string& value) { - - string_reply_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.StringReply.string_reply) -} -inline void StringReply::set_string_reply(std::string&& value) { - - string_reply_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.StringReply.string_reply) -} -inline void StringReply::set_string_reply(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - string_reply_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.StringReply.string_reply) -} -inline void StringReply::set_string_reply(const char* value, size_t size) { - - string_reply_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.StringReply.string_reply) -} -inline std::string* StringReply::mutable_string_reply() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.StringReply.string_reply) - return string_reply_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* StringReply::release_string_reply() { - // @@protoc_insertion_point(field_release:milvus.grpc.StringReply.string_reply) - - return string_reply_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void StringReply::set_allocated_string_reply(std::string* string_reply) { - if (string_reply != nullptr) { - - } else { - - } - string_reply_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), string_reply); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.StringReply.string_reply) -} - -// ------------------------------------------------------------------- - -// BoolReply - -// .milvus.grpc.Status status = 1; -inline bool BoolReply::has_status() const { - return this != internal_default_instance() && status_ != nullptr; -} -inline void BoolReply::clear_status() { - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; -} -inline const ::milvus::grpc::Status& BoolReply::status() const { - const ::milvus::grpc::Status* p = status_; - // @@protoc_insertion_point(field_get:milvus.grpc.BoolReply.status) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Status_default_instance_); -} -inline ::milvus::grpc::Status* BoolReply::release_status() { - // @@protoc_insertion_point(field_release:milvus.grpc.BoolReply.status) - - ::milvus::grpc::Status* temp = status_; - status_ = nullptr; - return temp; -} -inline ::milvus::grpc::Status* BoolReply::mutable_status() { - - if (status_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual()); - status_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.BoolReply.status) - return status_; -} -inline void BoolReply::set_allocated_status(::milvus::grpc::Status* status) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete status_; - } - if (status) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - status = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, status, submessage_arena); - } - - } else { - - } - status_ = status; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.BoolReply.status) -} - -// bool bool_reply = 2; -inline void BoolReply::clear_bool_reply() { - bool_reply_ = false; -} -inline bool BoolReply::bool_reply() const { - // @@protoc_insertion_point(field_get:milvus.grpc.BoolReply.bool_reply) - return bool_reply_; -} -inline void BoolReply::set_bool_reply(bool value) { - - bool_reply_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.BoolReply.bool_reply) -} - -// ------------------------------------------------------------------- - -// CollectionRowCount - -// .milvus.grpc.Status status = 1; -inline bool CollectionRowCount::has_status() const { - return this != internal_default_instance() && status_ != nullptr; -} -inline void CollectionRowCount::clear_status() { - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; -} -inline const ::milvus::grpc::Status& CollectionRowCount::status() const { - const ::milvus::grpc::Status* p = status_; - // @@protoc_insertion_point(field_get:milvus.grpc.CollectionRowCount.status) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Status_default_instance_); -} -inline ::milvus::grpc::Status* CollectionRowCount::release_status() { - // @@protoc_insertion_point(field_release:milvus.grpc.CollectionRowCount.status) - - ::milvus::grpc::Status* temp = status_; - status_ = nullptr; - return temp; -} -inline ::milvus::grpc::Status* CollectionRowCount::mutable_status() { - - if (status_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual()); - status_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.CollectionRowCount.status) - return status_; -} -inline void CollectionRowCount::set_allocated_status(::milvus::grpc::Status* status) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete status_; - } - if (status) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - status = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, status, submessage_arena); - } - - } else { - - } - status_ = status; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.CollectionRowCount.status) -} - -// int64 collection_row_count = 2; -inline void CollectionRowCount::clear_collection_row_count() { - collection_row_count_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 CollectionRowCount::collection_row_count() const { - // @@protoc_insertion_point(field_get:milvus.grpc.CollectionRowCount.collection_row_count) - return collection_row_count_; -} -inline void CollectionRowCount::set_collection_row_count(::PROTOBUF_NAMESPACE_ID::int64 value) { - - collection_row_count_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.CollectionRowCount.collection_row_count) -} - -// ------------------------------------------------------------------- - -// Command - -// string cmd = 1; -inline void Command::clear_cmd() { - cmd_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& Command::cmd() const { - // @@protoc_insertion_point(field_get:milvus.grpc.Command.cmd) - return cmd_.GetNoArena(); -} -inline void Command::set_cmd(const std::string& value) { - - cmd_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.Command.cmd) -} -inline void Command::set_cmd(std::string&& value) { - - cmd_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.Command.cmd) -} -inline void Command::set_cmd(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - cmd_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.Command.cmd) -} -inline void Command::set_cmd(const char* value, size_t size) { - - cmd_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.Command.cmd) -} -inline std::string* Command::mutable_cmd() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.Command.cmd) - return cmd_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* Command::release_cmd() { - // @@protoc_insertion_point(field_release:milvus.grpc.Command.cmd) - - return cmd_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void Command::set_allocated_cmd(std::string* cmd) { - if (cmd != nullptr) { - - } else { - - } - cmd_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), cmd); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.Command.cmd) -} - -// ------------------------------------------------------------------- - -// IndexParam - -// .milvus.grpc.Status status = 1; -inline bool IndexParam::has_status() const { - return this != internal_default_instance() && status_ != nullptr; -} -inline void IndexParam::clear_status() { - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; -} -inline const ::milvus::grpc::Status& IndexParam::status() const { - const ::milvus::grpc::Status* p = status_; - // @@protoc_insertion_point(field_get:milvus.grpc.IndexParam.status) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Status_default_instance_); -} -inline ::milvus::grpc::Status* IndexParam::release_status() { - // @@protoc_insertion_point(field_release:milvus.grpc.IndexParam.status) - - ::milvus::grpc::Status* temp = status_; - status_ = nullptr; - return temp; -} -inline ::milvus::grpc::Status* IndexParam::mutable_status() { - - if (status_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual()); - status_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.IndexParam.status) - return status_; -} -inline void IndexParam::set_allocated_status(::milvus::grpc::Status* status) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete status_; - } - if (status) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - status = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, status, submessage_arena); - } - - } else { - - } - status_ = status; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.IndexParam.status) -} - -// string collection_name = 2; -inline void IndexParam::clear_collection_name() { - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& IndexParam::collection_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.IndexParam.collection_name) - return collection_name_.GetNoArena(); -} -inline void IndexParam::set_collection_name(const std::string& value) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.IndexParam.collection_name) -} -inline void IndexParam::set_collection_name(std::string&& value) { - - collection_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.IndexParam.collection_name) -} -inline void IndexParam::set_collection_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.IndexParam.collection_name) -} -inline void IndexParam::set_collection_name(const char* value, size_t size) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.IndexParam.collection_name) -} -inline std::string* IndexParam::mutable_collection_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.IndexParam.collection_name) - return collection_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* IndexParam::release_collection_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.IndexParam.collection_name) - - return collection_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void IndexParam::set_allocated_collection_name(std::string* collection_name) { - if (collection_name != nullptr) { - - } else { - - } - collection_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), collection_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.IndexParam.collection_name) -} - -// string field_name = 3; -inline void IndexParam::clear_field_name() { - field_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& IndexParam::field_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.IndexParam.field_name) - return field_name_.GetNoArena(); -} -inline void IndexParam::set_field_name(const std::string& value) { - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.IndexParam.field_name) -} -inline void IndexParam::set_field_name(std::string&& value) { - - field_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.IndexParam.field_name) -} -inline void IndexParam::set_field_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.IndexParam.field_name) -} -inline void IndexParam::set_field_name(const char* value, size_t size) { - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.IndexParam.field_name) -} -inline std::string* IndexParam::mutable_field_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.IndexParam.field_name) - return field_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* IndexParam::release_field_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.IndexParam.field_name) - - return field_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void IndexParam::set_allocated_field_name(std::string* field_name) { - if (field_name != nullptr) { - - } else { - - } - field_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), field_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.IndexParam.field_name) -} - -// string index_name = 4; -inline void IndexParam::clear_index_name() { - index_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& IndexParam::index_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.IndexParam.index_name) - return index_name_.GetNoArena(); -} -inline void IndexParam::set_index_name(const std::string& value) { - - index_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.IndexParam.index_name) -} -inline void IndexParam::set_index_name(std::string&& value) { - - index_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.IndexParam.index_name) -} -inline void IndexParam::set_index_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - index_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.IndexParam.index_name) -} -inline void IndexParam::set_index_name(const char* value, size_t size) { - - index_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.IndexParam.index_name) -} -inline std::string* IndexParam::mutable_index_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.IndexParam.index_name) - return index_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* IndexParam::release_index_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.IndexParam.index_name) - - return index_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void IndexParam::set_allocated_index_name(std::string* index_name) { - if (index_name != nullptr) { - - } else { - - } - index_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), index_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.IndexParam.index_name) -} - -// repeated .milvus.grpc.KeyValuePair extra_params = 5; -inline int IndexParam::extra_params_size() const { - return extra_params_.size(); -} -inline void IndexParam::clear_extra_params() { - extra_params_.Clear(); -} -inline ::milvus::grpc::KeyValuePair* IndexParam::mutable_extra_params(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.IndexParam.extra_params) - return extra_params_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* -IndexParam::mutable_extra_params() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.IndexParam.extra_params) - return &extra_params_; -} -inline const ::milvus::grpc::KeyValuePair& IndexParam::extra_params(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.IndexParam.extra_params) - return extra_params_.Get(index); -} -inline ::milvus::grpc::KeyValuePair* IndexParam::add_extra_params() { - // @@protoc_insertion_point(field_add:milvus.grpc.IndexParam.extra_params) - return extra_params_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& -IndexParam::extra_params() const { - // @@protoc_insertion_point(field_list:milvus.grpc.IndexParam.extra_params) - return extra_params_; -} - -// ------------------------------------------------------------------- - -// FlushParam - -// repeated string collection_name_array = 1; -inline int FlushParam::collection_name_array_size() const { - return collection_name_array_.size(); -} -inline void FlushParam::clear_collection_name_array() { - collection_name_array_.Clear(); -} -inline const std::string& FlushParam::collection_name_array(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.FlushParam.collection_name_array) - return collection_name_array_.Get(index); -} -inline std::string* FlushParam::mutable_collection_name_array(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.FlushParam.collection_name_array) - return collection_name_array_.Mutable(index); -} -inline void FlushParam::set_collection_name_array(int index, const std::string& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.FlushParam.collection_name_array) - collection_name_array_.Mutable(index)->assign(value); -} -inline void FlushParam::set_collection_name_array(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.FlushParam.collection_name_array) - collection_name_array_.Mutable(index)->assign(std::move(value)); -} -inline void FlushParam::set_collection_name_array(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - collection_name_array_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:milvus.grpc.FlushParam.collection_name_array) -} -inline void FlushParam::set_collection_name_array(int index, const char* value, size_t size) { - collection_name_array_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.FlushParam.collection_name_array) -} -inline std::string* FlushParam::add_collection_name_array() { - // @@protoc_insertion_point(field_add_mutable:milvus.grpc.FlushParam.collection_name_array) - return collection_name_array_.Add(); -} -inline void FlushParam::add_collection_name_array(const std::string& value) { - collection_name_array_.Add()->assign(value); - // @@protoc_insertion_point(field_add:milvus.grpc.FlushParam.collection_name_array) -} -inline void FlushParam::add_collection_name_array(std::string&& value) { - collection_name_array_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:milvus.grpc.FlushParam.collection_name_array) -} -inline void FlushParam::add_collection_name_array(const char* value) { - GOOGLE_DCHECK(value != nullptr); - collection_name_array_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:milvus.grpc.FlushParam.collection_name_array) -} -inline void FlushParam::add_collection_name_array(const char* value, size_t size) { - collection_name_array_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:milvus.grpc.FlushParam.collection_name_array) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -FlushParam::collection_name_array() const { - // @@protoc_insertion_point(field_list:milvus.grpc.FlushParam.collection_name_array) - return collection_name_array_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -FlushParam::mutable_collection_name_array() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.FlushParam.collection_name_array) - return &collection_name_array_; -} - -// ------------------------------------------------------------------- - -// CompactParam - -// string collection_name = 1; -inline void CompactParam::clear_collection_name() { - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& CompactParam::collection_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.CompactParam.collection_name) - return collection_name_.GetNoArena(); -} -inline void CompactParam::set_collection_name(const std::string& value) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.CompactParam.collection_name) -} -inline void CompactParam::set_collection_name(std::string&& value) { - - collection_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.CompactParam.collection_name) -} -inline void CompactParam::set_collection_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.CompactParam.collection_name) -} -inline void CompactParam::set_collection_name(const char* value, size_t size) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.CompactParam.collection_name) -} -inline std::string* CompactParam::mutable_collection_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.CompactParam.collection_name) - return collection_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* CompactParam::release_collection_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.CompactParam.collection_name) - - return collection_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void CompactParam::set_allocated_collection_name(std::string* collection_name) { - if (collection_name != nullptr) { - - } else { - - } - collection_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), collection_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.CompactParam.collection_name) -} - -// double threshold = 2; -inline void CompactParam::clear_threshold() { - threshold_ = 0; -} -inline double CompactParam::threshold() const { - // @@protoc_insertion_point(field_get:milvus.grpc.CompactParam.threshold) - return threshold_; -} -inline void CompactParam::set_threshold(double value) { - - threshold_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.CompactParam.threshold) -} - -// ------------------------------------------------------------------- - -// DeleteByIDParam - -// string collection_name = 1; -inline void DeleteByIDParam::clear_collection_name() { - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& DeleteByIDParam::collection_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.DeleteByIDParam.collection_name) - return collection_name_.GetNoArena(); -} -inline void DeleteByIDParam::set_collection_name(const std::string& value) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.DeleteByIDParam.collection_name) -} -inline void DeleteByIDParam::set_collection_name(std::string&& value) { - - collection_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.DeleteByIDParam.collection_name) -} -inline void DeleteByIDParam::set_collection_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.DeleteByIDParam.collection_name) -} -inline void DeleteByIDParam::set_collection_name(const char* value, size_t size) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.DeleteByIDParam.collection_name) -} -inline std::string* DeleteByIDParam::mutable_collection_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.DeleteByIDParam.collection_name) - return collection_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* DeleteByIDParam::release_collection_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.DeleteByIDParam.collection_name) - - return collection_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void DeleteByIDParam::set_allocated_collection_name(std::string* collection_name) { - if (collection_name != nullptr) { - - } else { - - } - collection_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), collection_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.DeleteByIDParam.collection_name) -} - -// repeated int64 id_array = 2; -inline int DeleteByIDParam::id_array_size() const { - return id_array_.size(); -} -inline void DeleteByIDParam::clear_id_array() { - id_array_.Clear(); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 DeleteByIDParam::id_array(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.DeleteByIDParam.id_array) - return id_array_.Get(index); -} -inline void DeleteByIDParam::set_id_array(int index, ::PROTOBUF_NAMESPACE_ID::int64 value) { - id_array_.Set(index, value); - // @@protoc_insertion_point(field_set:milvus.grpc.DeleteByIDParam.id_array) -} -inline void DeleteByIDParam::add_id_array(::PROTOBUF_NAMESPACE_ID::int64 value) { - id_array_.Add(value); - // @@protoc_insertion_point(field_add:milvus.grpc.DeleteByIDParam.id_array) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& -DeleteByIDParam::id_array() const { - // @@protoc_insertion_point(field_list:milvus.grpc.DeleteByIDParam.id_array) - return id_array_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* -DeleteByIDParam::mutable_id_array() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.DeleteByIDParam.id_array) - return &id_array_; -} - -// ------------------------------------------------------------------- - -// CollectionInfo - -// .milvus.grpc.Status status = 1; -inline bool CollectionInfo::has_status() const { - return this != internal_default_instance() && status_ != nullptr; -} -inline void CollectionInfo::clear_status() { - if (GetArenaNoVirtual() == nullptr && status_ != nullptr) { - delete status_; - } - status_ = nullptr; -} -inline const ::milvus::grpc::Status& CollectionInfo::status() const { - const ::milvus::grpc::Status* p = status_; - // @@protoc_insertion_point(field_get:milvus.grpc.CollectionInfo.status) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_Status_default_instance_); -} -inline ::milvus::grpc::Status* CollectionInfo::release_status() { - // @@protoc_insertion_point(field_release:milvus.grpc.CollectionInfo.status) - - ::milvus::grpc::Status* temp = status_; - status_ = nullptr; - return temp; -} -inline ::milvus::grpc::Status* CollectionInfo::mutable_status() { - - if (status_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::Status>(GetArenaNoVirtual()); - status_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.CollectionInfo.status) - return status_; -} -inline void CollectionInfo::set_allocated_status(::milvus::grpc::Status* status) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete status_; - } - if (status) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - status = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, status, submessage_arena); - } - - } else { - - } - status_ = status; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.CollectionInfo.status) -} - -// string json_info = 2; -inline void CollectionInfo::clear_json_info() { - json_info_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& CollectionInfo::json_info() const { - // @@protoc_insertion_point(field_get:milvus.grpc.CollectionInfo.json_info) - return json_info_.GetNoArena(); -} -inline void CollectionInfo::set_json_info(const std::string& value) { - - json_info_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.CollectionInfo.json_info) -} -inline void CollectionInfo::set_json_info(std::string&& value) { - - json_info_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.CollectionInfo.json_info) -} -inline void CollectionInfo::set_json_info(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - json_info_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.CollectionInfo.json_info) -} -inline void CollectionInfo::set_json_info(const char* value, size_t size) { - - json_info_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.CollectionInfo.json_info) -} -inline std::string* CollectionInfo::mutable_json_info() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.CollectionInfo.json_info) - return json_info_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* CollectionInfo::release_json_info() { - // @@protoc_insertion_point(field_release:milvus.grpc.CollectionInfo.json_info) - - return json_info_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void CollectionInfo::set_allocated_json_info(std::string* json_info) { - if (json_info != nullptr) { - - } else { - - } - json_info_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), json_info); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.CollectionInfo.json_info) -} - -// ------------------------------------------------------------------- - -// GetEntityIDsParam - -// string collection_name = 1; -inline void GetEntityIDsParam::clear_collection_name() { - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& GetEntityIDsParam::collection_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.GetEntityIDsParam.collection_name) - return collection_name_.GetNoArena(); -} -inline void GetEntityIDsParam::set_collection_name(const std::string& value) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.GetEntityIDsParam.collection_name) -} -inline void GetEntityIDsParam::set_collection_name(std::string&& value) { - - collection_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.GetEntityIDsParam.collection_name) -} -inline void GetEntityIDsParam::set_collection_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.GetEntityIDsParam.collection_name) -} -inline void GetEntityIDsParam::set_collection_name(const char* value, size_t size) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.GetEntityIDsParam.collection_name) -} -inline std::string* GetEntityIDsParam::mutable_collection_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.GetEntityIDsParam.collection_name) - return collection_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* GetEntityIDsParam::release_collection_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.GetEntityIDsParam.collection_name) - - return collection_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void GetEntityIDsParam::set_allocated_collection_name(std::string* collection_name) { - if (collection_name != nullptr) { - - } else { - - } - collection_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), collection_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.GetEntityIDsParam.collection_name) -} - -// int64 segment_id = 2; -inline void GetEntityIDsParam::clear_segment_id() { - segment_id_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 GetEntityIDsParam::segment_id() const { - // @@protoc_insertion_point(field_get:milvus.grpc.GetEntityIDsParam.segment_id) - return segment_id_; -} -inline void GetEntityIDsParam::set_segment_id(::PROTOBUF_NAMESPACE_ID::int64 value) { - - segment_id_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.GetEntityIDsParam.segment_id) -} - -// ------------------------------------------------------------------- - -// EntityIdentity - -// string collection_name = 1; -inline void EntityIdentity::clear_collection_name() { - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& EntityIdentity::collection_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.EntityIdentity.collection_name) - return collection_name_.GetNoArena(); -} -inline void EntityIdentity::set_collection_name(const std::string& value) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.EntityIdentity.collection_name) -} -inline void EntityIdentity::set_collection_name(std::string&& value) { - - collection_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.EntityIdentity.collection_name) -} -inline void EntityIdentity::set_collection_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.EntityIdentity.collection_name) -} -inline void EntityIdentity::set_collection_name(const char* value, size_t size) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.EntityIdentity.collection_name) -} -inline std::string* EntityIdentity::mutable_collection_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.EntityIdentity.collection_name) - return collection_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* EntityIdentity::release_collection_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.EntityIdentity.collection_name) - - return collection_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void EntityIdentity::set_allocated_collection_name(std::string* collection_name) { - if (collection_name != nullptr) { - - } else { - - } - collection_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), collection_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.EntityIdentity.collection_name) -} - -// repeated int64 id_array = 2; -inline int EntityIdentity::id_array_size() const { - return id_array_.size(); -} -inline void EntityIdentity::clear_id_array() { - id_array_.Clear(); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 EntityIdentity::id_array(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.EntityIdentity.id_array) - return id_array_.Get(index); -} -inline void EntityIdentity::set_id_array(int index, ::PROTOBUF_NAMESPACE_ID::int64 value) { - id_array_.Set(index, value); - // @@protoc_insertion_point(field_set:milvus.grpc.EntityIdentity.id_array) -} -inline void EntityIdentity::add_id_array(::PROTOBUF_NAMESPACE_ID::int64 value) { - id_array_.Add(value); - // @@protoc_insertion_point(field_add:milvus.grpc.EntityIdentity.id_array) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& -EntityIdentity::id_array() const { - // @@protoc_insertion_point(field_list:milvus.grpc.EntityIdentity.id_array) - return id_array_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* -EntityIdentity::mutable_id_array() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.EntityIdentity.id_array) - return &id_array_; -} - -// repeated string field_names = 3; -inline int EntityIdentity::field_names_size() const { - return field_names_.size(); -} -inline void EntityIdentity::clear_field_names() { - field_names_.Clear(); -} -inline const std::string& EntityIdentity::field_names(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.EntityIdentity.field_names) - return field_names_.Get(index); -} -inline std::string* EntityIdentity::mutable_field_names(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.EntityIdentity.field_names) - return field_names_.Mutable(index); -} -inline void EntityIdentity::set_field_names(int index, const std::string& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.EntityIdentity.field_names) - field_names_.Mutable(index)->assign(value); -} -inline void EntityIdentity::set_field_names(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.EntityIdentity.field_names) - field_names_.Mutable(index)->assign(std::move(value)); -} -inline void EntityIdentity::set_field_names(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - field_names_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:milvus.grpc.EntityIdentity.field_names) -} -inline void EntityIdentity::set_field_names(int index, const char* value, size_t size) { - field_names_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.EntityIdentity.field_names) -} -inline std::string* EntityIdentity::add_field_names() { - // @@protoc_insertion_point(field_add_mutable:milvus.grpc.EntityIdentity.field_names) - return field_names_.Add(); -} -inline void EntityIdentity::add_field_names(const std::string& value) { - field_names_.Add()->assign(value); - // @@protoc_insertion_point(field_add:milvus.grpc.EntityIdentity.field_names) -} -inline void EntityIdentity::add_field_names(std::string&& value) { - field_names_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:milvus.grpc.EntityIdentity.field_names) -} -inline void EntityIdentity::add_field_names(const char* value) { - GOOGLE_DCHECK(value != nullptr); - field_names_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:milvus.grpc.EntityIdentity.field_names) -} -inline void EntityIdentity::add_field_names(const char* value, size_t size) { - field_names_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:milvus.grpc.EntityIdentity.field_names) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -EntityIdentity::field_names() const { - // @@protoc_insertion_point(field_list:milvus.grpc.EntityIdentity.field_names) - return field_names_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -EntityIdentity::mutable_field_names() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.EntityIdentity.field_names) - return &field_names_; -} - -// ------------------------------------------------------------------- - -// VectorFieldParam - -// int64 dimension = 1; -inline void VectorFieldParam::clear_dimension() { - dimension_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 VectorFieldParam::dimension() const { - // @@protoc_insertion_point(field_get:milvus.grpc.VectorFieldParam.dimension) - return dimension_; -} -inline void VectorFieldParam::set_dimension(::PROTOBUF_NAMESPACE_ID::int64 value) { - - dimension_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.VectorFieldParam.dimension) -} - -// ------------------------------------------------------------------- - -// FieldType - -// .milvus.grpc.DataType data_type = 1; -inline bool FieldType::has_data_type() const { - return value_case() == kDataType; -} -inline void FieldType::set_has_data_type() { - _oneof_case_[0] = kDataType; -} -inline void FieldType::clear_data_type() { - if (has_data_type()) { - value_.data_type_ = 0; - clear_has_value(); - } -} -inline ::milvus::grpc::DataType FieldType::data_type() const { - // @@protoc_insertion_point(field_get:milvus.grpc.FieldType.data_type) - if (has_data_type()) { - return static_cast< ::milvus::grpc::DataType >(value_.data_type_); - } - return static_cast< ::milvus::grpc::DataType >(0); -} -inline void FieldType::set_data_type(::milvus::grpc::DataType value) { - if (!has_data_type()) { - clear_value(); - set_has_data_type(); - } - value_.data_type_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.FieldType.data_type) -} - -// .milvus.grpc.VectorFieldParam vector_param = 2; -inline bool FieldType::has_vector_param() const { - return value_case() == kVectorParam; -} -inline void FieldType::set_has_vector_param() { - _oneof_case_[0] = kVectorParam; -} -inline void FieldType::clear_vector_param() { - if (has_vector_param()) { - delete value_.vector_param_; - clear_has_value(); - } -} -inline ::milvus::grpc::VectorFieldParam* FieldType::release_vector_param() { - // @@protoc_insertion_point(field_release:milvus.grpc.FieldType.vector_param) - if (has_vector_param()) { - clear_has_value(); - ::milvus::grpc::VectorFieldParam* temp = value_.vector_param_; - value_.vector_param_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::milvus::grpc::VectorFieldParam& FieldType::vector_param() const { - // @@protoc_insertion_point(field_get:milvus.grpc.FieldType.vector_param) - return has_vector_param() - ? *value_.vector_param_ - : *reinterpret_cast< ::milvus::grpc::VectorFieldParam*>(&::milvus::grpc::_VectorFieldParam_default_instance_); -} -inline ::milvus::grpc::VectorFieldParam* FieldType::mutable_vector_param() { - if (!has_vector_param()) { - clear_value(); - set_has_vector_param(); - value_.vector_param_ = CreateMaybeMessage< ::milvus::grpc::VectorFieldParam >( - GetArenaNoVirtual()); - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.FieldType.vector_param) - return value_.vector_param_; -} - -inline bool FieldType::has_value() const { - return value_case() != VALUE_NOT_SET; -} -inline void FieldType::clear_has_value() { - _oneof_case_[0] = VALUE_NOT_SET; -} -inline FieldType::ValueCase FieldType::value_case() const { - return FieldType::ValueCase(_oneof_case_[0]); -} -// ------------------------------------------------------------------- - -// FieldParam - -// uint64 id = 1; -inline void FieldParam::clear_id() { - id_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 FieldParam::id() const { - // @@protoc_insertion_point(field_get:milvus.grpc.FieldParam.id) - return id_; -} -inline void FieldParam::set_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - id_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.FieldParam.id) -} - -// string name = 2; -inline void FieldParam::clear_name() { - name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& FieldParam::name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.FieldParam.name) - return name_.GetNoArena(); -} -inline void FieldParam::set_name(const std::string& value) { - - name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.FieldParam.name) -} -inline void FieldParam::set_name(std::string&& value) { - - name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.FieldParam.name) -} -inline void FieldParam::set_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.FieldParam.name) -} -inline void FieldParam::set_name(const char* value, size_t size) { - - name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.FieldParam.name) -} -inline std::string* FieldParam::mutable_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.FieldParam.name) - return name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* FieldParam::release_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.FieldParam.name) - - return name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void FieldParam::set_allocated_name(std::string* name) { - if (name != nullptr) { - - } else { - - } - name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.FieldParam.name) -} - -// .milvus.grpc.DataType type = 3; -inline void FieldParam::clear_type() { - type_ = 0; -} -inline ::milvus::grpc::DataType FieldParam::type() const { - // @@protoc_insertion_point(field_get:milvus.grpc.FieldParam.type) - return static_cast< ::milvus::grpc::DataType >(type_); -} -inline void FieldParam::set_type(::milvus::grpc::DataType value) { - - type_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.FieldParam.type) -} - -// repeated .milvus.grpc.KeyValuePair index_params = 4; -inline int FieldParam::index_params_size() const { - return index_params_.size(); -} -inline void FieldParam::clear_index_params() { - index_params_.Clear(); -} -inline ::milvus::grpc::KeyValuePair* FieldParam::mutable_index_params(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.FieldParam.index_params) - return index_params_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* -FieldParam::mutable_index_params() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.FieldParam.index_params) - return &index_params_; -} -inline const ::milvus::grpc::KeyValuePair& FieldParam::index_params(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.FieldParam.index_params) - return index_params_.Get(index); -} -inline ::milvus::grpc::KeyValuePair* FieldParam::add_index_params() { - // @@protoc_insertion_point(field_add:milvus.grpc.FieldParam.index_params) - return index_params_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& -FieldParam::index_params() const { - // @@protoc_insertion_point(field_list:milvus.grpc.FieldParam.index_params) - return index_params_; -} - -// repeated .milvus.grpc.KeyValuePair extra_params = 5; -inline int FieldParam::extra_params_size() const { - return extra_params_.size(); -} -inline void FieldParam::clear_extra_params() { - extra_params_.Clear(); -} -inline ::milvus::grpc::KeyValuePair* FieldParam::mutable_extra_params(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.FieldParam.extra_params) - return extra_params_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* -FieldParam::mutable_extra_params() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.FieldParam.extra_params) - return &extra_params_; -} -inline const ::milvus::grpc::KeyValuePair& FieldParam::extra_params(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.FieldParam.extra_params) - return extra_params_.Get(index); -} -inline ::milvus::grpc::KeyValuePair* FieldParam::add_extra_params() { - // @@protoc_insertion_point(field_add:milvus.grpc.FieldParam.extra_params) - return extra_params_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& -FieldParam::extra_params() const { - // @@protoc_insertion_point(field_list:milvus.grpc.FieldParam.extra_params) - return extra_params_; -} - -// ------------------------------------------------------------------- - -// VectorFieldRecord - -// repeated .milvus.grpc.VectorRowRecord value = 1; -inline int VectorFieldRecord::value_size() const { - return value_.size(); -} -inline void VectorFieldRecord::clear_value() { - value_.Clear(); -} -inline ::milvus::grpc::VectorRowRecord* VectorFieldRecord::mutable_value(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.VectorFieldRecord.value) - return value_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorRowRecord >* -VectorFieldRecord::mutable_value() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.VectorFieldRecord.value) - return &value_; -} -inline const ::milvus::grpc::VectorRowRecord& VectorFieldRecord::value(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.VectorFieldRecord.value) - return value_.Get(index); -} -inline ::milvus::grpc::VectorRowRecord* VectorFieldRecord::add_value() { - // @@protoc_insertion_point(field_add:milvus.grpc.VectorFieldRecord.value) - return value_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorRowRecord >& -VectorFieldRecord::value() const { - // @@protoc_insertion_point(field_list:milvus.grpc.VectorFieldRecord.value) - return value_; -} - -// ------------------------------------------------------------------- - -// TermQuery - -// string field_name = 1; -inline void TermQuery::clear_field_name() { - field_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& TermQuery::field_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.TermQuery.field_name) - return field_name_.GetNoArena(); -} -inline void TermQuery::set_field_name(const std::string& value) { - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.TermQuery.field_name) -} -inline void TermQuery::set_field_name(std::string&& value) { - - field_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.TermQuery.field_name) -} -inline void TermQuery::set_field_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.TermQuery.field_name) -} -inline void TermQuery::set_field_name(const char* value, size_t size) { - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.TermQuery.field_name) -} -inline std::string* TermQuery::mutable_field_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.TermQuery.field_name) - return field_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* TermQuery::release_field_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.TermQuery.field_name) - - return field_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void TermQuery::set_allocated_field_name(std::string* field_name) { - if (field_name != nullptr) { - - } else { - - } - field_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), field_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.TermQuery.field_name) -} - -// repeated int64 int_value = 2; -inline int TermQuery::int_value_size() const { - return int_value_.size(); -} -inline void TermQuery::clear_int_value() { - int_value_.Clear(); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 TermQuery::int_value(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.TermQuery.int_value) - return int_value_.Get(index); -} -inline void TermQuery::set_int_value(int index, ::PROTOBUF_NAMESPACE_ID::int64 value) { - int_value_.Set(index, value); - // @@protoc_insertion_point(field_set:milvus.grpc.TermQuery.int_value) -} -inline void TermQuery::add_int_value(::PROTOBUF_NAMESPACE_ID::int64 value) { - int_value_.Add(value); - // @@protoc_insertion_point(field_add:milvus.grpc.TermQuery.int_value) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& -TermQuery::int_value() const { - // @@protoc_insertion_point(field_list:milvus.grpc.TermQuery.int_value) - return int_value_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* -TermQuery::mutable_int_value() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.TermQuery.int_value) - return &int_value_; -} - -// repeated double double_value = 3; -inline int TermQuery::double_value_size() const { - return double_value_.size(); -} -inline void TermQuery::clear_double_value() { - double_value_.Clear(); -} -inline double TermQuery::double_value(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.TermQuery.double_value) - return double_value_.Get(index); -} -inline void TermQuery::set_double_value(int index, double value) { - double_value_.Set(index, value); - // @@protoc_insertion_point(field_set:milvus.grpc.TermQuery.double_value) -} -inline void TermQuery::add_double_value(double value) { - double_value_.Add(value); - // @@protoc_insertion_point(field_add:milvus.grpc.TermQuery.double_value) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >& -TermQuery::double_value() const { - // @@protoc_insertion_point(field_list:milvus.grpc.TermQuery.double_value) - return double_value_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >* -TermQuery::mutable_double_value() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.TermQuery.double_value) - return &double_value_; -} - -// int64 value_num = 4; -inline void TermQuery::clear_value_num() { - value_num_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 TermQuery::value_num() const { - // @@protoc_insertion_point(field_get:milvus.grpc.TermQuery.value_num) - return value_num_; -} -inline void TermQuery::set_value_num(::PROTOBUF_NAMESPACE_ID::int64 value) { - - value_num_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.TermQuery.value_num) -} - -// float boost = 5; -inline void TermQuery::clear_boost() { - boost_ = 0; -} -inline float TermQuery::boost() const { - // @@protoc_insertion_point(field_get:milvus.grpc.TermQuery.boost) - return boost_; -} -inline void TermQuery::set_boost(float value) { - - boost_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.TermQuery.boost) -} - -// repeated .milvus.grpc.KeyValuePair extra_params = 6; -inline int TermQuery::extra_params_size() const { - return extra_params_.size(); -} -inline void TermQuery::clear_extra_params() { - extra_params_.Clear(); -} -inline ::milvus::grpc::KeyValuePair* TermQuery::mutable_extra_params(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.TermQuery.extra_params) - return extra_params_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* -TermQuery::mutable_extra_params() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.TermQuery.extra_params) - return &extra_params_; -} -inline const ::milvus::grpc::KeyValuePair& TermQuery::extra_params(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.TermQuery.extra_params) - return extra_params_.Get(index); -} -inline ::milvus::grpc::KeyValuePair* TermQuery::add_extra_params() { - // @@protoc_insertion_point(field_add:milvus.grpc.TermQuery.extra_params) - return extra_params_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& -TermQuery::extra_params() const { - // @@protoc_insertion_point(field_list:milvus.grpc.TermQuery.extra_params) - return extra_params_; -} - -// ------------------------------------------------------------------- - -// CompareExpr - -// .milvus.grpc.CompareOperator operator = 1; -inline void CompareExpr::clear_operator_() { - operator__ = 0; -} -inline ::milvus::grpc::CompareOperator CompareExpr::operator_() const { - // @@protoc_insertion_point(field_get:milvus.grpc.CompareExpr.operator) - return static_cast< ::milvus::grpc::CompareOperator >(operator__); -} -inline void CompareExpr::set_operator_(::milvus::grpc::CompareOperator value) { - - operator__ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.CompareExpr.operator) -} - -// string operand = 2; -inline void CompareExpr::clear_operand() { - operand_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& CompareExpr::operand() const { - // @@protoc_insertion_point(field_get:milvus.grpc.CompareExpr.operand) - return operand_.GetNoArena(); -} -inline void CompareExpr::set_operand(const std::string& value) { - - operand_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.CompareExpr.operand) -} -inline void CompareExpr::set_operand(std::string&& value) { - - operand_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.CompareExpr.operand) -} -inline void CompareExpr::set_operand(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - operand_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.CompareExpr.operand) -} -inline void CompareExpr::set_operand(const char* value, size_t size) { - - operand_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.CompareExpr.operand) -} -inline std::string* CompareExpr::mutable_operand() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.CompareExpr.operand) - return operand_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* CompareExpr::release_operand() { - // @@protoc_insertion_point(field_release:milvus.grpc.CompareExpr.operand) - - return operand_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void CompareExpr::set_allocated_operand(std::string* operand) { - if (operand != nullptr) { - - } else { - - } - operand_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), operand); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.CompareExpr.operand) -} - -// ------------------------------------------------------------------- - -// RangeQuery - -// string field_name = 1; -inline void RangeQuery::clear_field_name() { - field_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& RangeQuery::field_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.RangeQuery.field_name) - return field_name_.GetNoArena(); -} -inline void RangeQuery::set_field_name(const std::string& value) { - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.RangeQuery.field_name) -} -inline void RangeQuery::set_field_name(std::string&& value) { - - field_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.RangeQuery.field_name) -} -inline void RangeQuery::set_field_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.RangeQuery.field_name) -} -inline void RangeQuery::set_field_name(const char* value, size_t size) { - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.RangeQuery.field_name) -} -inline std::string* RangeQuery::mutable_field_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.RangeQuery.field_name) - return field_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* RangeQuery::release_field_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.RangeQuery.field_name) - - return field_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void RangeQuery::set_allocated_field_name(std::string* field_name) { - if (field_name != nullptr) { - - } else { - - } - field_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), field_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.RangeQuery.field_name) -} - -// repeated .milvus.grpc.CompareExpr operand = 2; -inline int RangeQuery::operand_size() const { - return operand_.size(); -} -inline void RangeQuery::clear_operand() { - operand_.Clear(); -} -inline ::milvus::grpc::CompareExpr* RangeQuery::mutable_operand(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.RangeQuery.operand) - return operand_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::CompareExpr >* -RangeQuery::mutable_operand() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.RangeQuery.operand) - return &operand_; -} -inline const ::milvus::grpc::CompareExpr& RangeQuery::operand(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.RangeQuery.operand) - return operand_.Get(index); -} -inline ::milvus::grpc::CompareExpr* RangeQuery::add_operand() { - // @@protoc_insertion_point(field_add:milvus.grpc.RangeQuery.operand) - return operand_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::CompareExpr >& -RangeQuery::operand() const { - // @@protoc_insertion_point(field_list:milvus.grpc.RangeQuery.operand) - return operand_; -} - -// float boost = 3; -inline void RangeQuery::clear_boost() { - boost_ = 0; -} -inline float RangeQuery::boost() const { - // @@protoc_insertion_point(field_get:milvus.grpc.RangeQuery.boost) - return boost_; -} -inline void RangeQuery::set_boost(float value) { - - boost_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.RangeQuery.boost) -} - -// repeated .milvus.grpc.KeyValuePair extra_params = 4; -inline int RangeQuery::extra_params_size() const { - return extra_params_.size(); -} -inline void RangeQuery::clear_extra_params() { - extra_params_.Clear(); -} -inline ::milvus::grpc::KeyValuePair* RangeQuery::mutable_extra_params(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.RangeQuery.extra_params) - return extra_params_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* -RangeQuery::mutable_extra_params() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.RangeQuery.extra_params) - return &extra_params_; -} -inline const ::milvus::grpc::KeyValuePair& RangeQuery::extra_params(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.RangeQuery.extra_params) - return extra_params_.Get(index); -} -inline ::milvus::grpc::KeyValuePair* RangeQuery::add_extra_params() { - // @@protoc_insertion_point(field_add:milvus.grpc.RangeQuery.extra_params) - return extra_params_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& -RangeQuery::extra_params() const { - // @@protoc_insertion_point(field_list:milvus.grpc.RangeQuery.extra_params) - return extra_params_; -} - -// ------------------------------------------------------------------- - -// VectorQuery - -// string field_name = 1; -inline void VectorQuery::clear_field_name() { - field_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& VectorQuery::field_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.VectorQuery.field_name) - return field_name_.GetNoArena(); -} -inline void VectorQuery::set_field_name(const std::string& value) { - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.VectorQuery.field_name) -} -inline void VectorQuery::set_field_name(std::string&& value) { - - field_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.VectorQuery.field_name) -} -inline void VectorQuery::set_field_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.VectorQuery.field_name) -} -inline void VectorQuery::set_field_name(const char* value, size_t size) { - - field_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.VectorQuery.field_name) -} -inline std::string* VectorQuery::mutable_field_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.VectorQuery.field_name) - return field_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* VectorQuery::release_field_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.VectorQuery.field_name) - - return field_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void VectorQuery::set_allocated_field_name(std::string* field_name) { - if (field_name != nullptr) { - - } else { - - } - field_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), field_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.VectorQuery.field_name) -} - -// float query_boost = 2; -inline void VectorQuery::clear_query_boost() { - query_boost_ = 0; -} -inline float VectorQuery::query_boost() const { - // @@protoc_insertion_point(field_get:milvus.grpc.VectorQuery.query_boost) - return query_boost_; -} -inline void VectorQuery::set_query_boost(float value) { - - query_boost_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.VectorQuery.query_boost) -} - -// repeated .milvus.grpc.VectorRowRecord records = 3; -inline int VectorQuery::records_size() const { - return records_.size(); -} -inline void VectorQuery::clear_records() { - records_.Clear(); -} -inline ::milvus::grpc::VectorRowRecord* VectorQuery::mutable_records(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.VectorQuery.records) - return records_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorRowRecord >* -VectorQuery::mutable_records() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.VectorQuery.records) - return &records_; -} -inline const ::milvus::grpc::VectorRowRecord& VectorQuery::records(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.VectorQuery.records) - return records_.Get(index); -} -inline ::milvus::grpc::VectorRowRecord* VectorQuery::add_records() { - // @@protoc_insertion_point(field_add:milvus.grpc.VectorQuery.records) - return records_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::VectorRowRecord >& -VectorQuery::records() const { - // @@protoc_insertion_point(field_list:milvus.grpc.VectorQuery.records) - return records_; -} - -// int64 topk = 4; -inline void VectorQuery::clear_topk() { - topk_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 VectorQuery::topk() const { - // @@protoc_insertion_point(field_get:milvus.grpc.VectorQuery.topk) - return topk_; -} -inline void VectorQuery::set_topk(::PROTOBUF_NAMESPACE_ID::int64 value) { - - topk_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.VectorQuery.topk) -} - -// repeated .milvus.grpc.KeyValuePair extra_params = 5; -inline int VectorQuery::extra_params_size() const { - return extra_params_.size(); -} -inline void VectorQuery::clear_extra_params() { - extra_params_.Clear(); -} -inline ::milvus::grpc::KeyValuePair* VectorQuery::mutable_extra_params(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.VectorQuery.extra_params) - return extra_params_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* -VectorQuery::mutable_extra_params() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.VectorQuery.extra_params) - return &extra_params_; -} -inline const ::milvus::grpc::KeyValuePair& VectorQuery::extra_params(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.VectorQuery.extra_params) - return extra_params_.Get(index); -} -inline ::milvus::grpc::KeyValuePair* VectorQuery::add_extra_params() { - // @@protoc_insertion_point(field_add:milvus.grpc.VectorQuery.extra_params) - return extra_params_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& -VectorQuery::extra_params() const { - // @@protoc_insertion_point(field_list:milvus.grpc.VectorQuery.extra_params) - return extra_params_; -} - -// ------------------------------------------------------------------- - -// BooleanQuery - -// .milvus.grpc.Occur occur = 1; -inline void BooleanQuery::clear_occur() { - occur_ = 0; -} -inline ::milvus::grpc::Occur BooleanQuery::occur() const { - // @@protoc_insertion_point(field_get:milvus.grpc.BooleanQuery.occur) - return static_cast< ::milvus::grpc::Occur >(occur_); -} -inline void BooleanQuery::set_occur(::milvus::grpc::Occur value) { - - occur_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.BooleanQuery.occur) -} - -// repeated .milvus.grpc.GeneralQuery general_query = 2; -inline int BooleanQuery::general_query_size() const { - return general_query_.size(); -} -inline void BooleanQuery::clear_general_query() { - general_query_.Clear(); -} -inline ::milvus::grpc::GeneralQuery* BooleanQuery::mutable_general_query(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.BooleanQuery.general_query) - return general_query_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::GeneralQuery >* -BooleanQuery::mutable_general_query() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.BooleanQuery.general_query) - return &general_query_; -} -inline const ::milvus::grpc::GeneralQuery& BooleanQuery::general_query(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.BooleanQuery.general_query) - return general_query_.Get(index); -} -inline ::milvus::grpc::GeneralQuery* BooleanQuery::add_general_query() { - // @@protoc_insertion_point(field_add:milvus.grpc.BooleanQuery.general_query) - return general_query_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::GeneralQuery >& -BooleanQuery::general_query() const { - // @@protoc_insertion_point(field_list:milvus.grpc.BooleanQuery.general_query) - return general_query_; -} - -// ------------------------------------------------------------------- - -// GeneralQuery - -// .milvus.grpc.BooleanQuery boolean_query = 1; -inline bool GeneralQuery::has_boolean_query() const { - return query_case() == kBooleanQuery; -} -inline void GeneralQuery::set_has_boolean_query() { - _oneof_case_[0] = kBooleanQuery; -} -inline void GeneralQuery::clear_boolean_query() { - if (has_boolean_query()) { - delete query_.boolean_query_; - clear_has_query(); - } -} -inline ::milvus::grpc::BooleanQuery* GeneralQuery::release_boolean_query() { - // @@protoc_insertion_point(field_release:milvus.grpc.GeneralQuery.boolean_query) - if (has_boolean_query()) { - clear_has_query(); - ::milvus::grpc::BooleanQuery* temp = query_.boolean_query_; - query_.boolean_query_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::milvus::grpc::BooleanQuery& GeneralQuery::boolean_query() const { - // @@protoc_insertion_point(field_get:milvus.grpc.GeneralQuery.boolean_query) - return has_boolean_query() - ? *query_.boolean_query_ - : *reinterpret_cast< ::milvus::grpc::BooleanQuery*>(&::milvus::grpc::_BooleanQuery_default_instance_); -} -inline ::milvus::grpc::BooleanQuery* GeneralQuery::mutable_boolean_query() { - if (!has_boolean_query()) { - clear_query(); - set_has_boolean_query(); - query_.boolean_query_ = CreateMaybeMessage< ::milvus::grpc::BooleanQuery >( - GetArenaNoVirtual()); - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.GeneralQuery.boolean_query) - return query_.boolean_query_; -} - -// .milvus.grpc.TermQuery term_query = 2; -inline bool GeneralQuery::has_term_query() const { - return query_case() == kTermQuery; -} -inline void GeneralQuery::set_has_term_query() { - _oneof_case_[0] = kTermQuery; -} -inline void GeneralQuery::clear_term_query() { - if (has_term_query()) { - delete query_.term_query_; - clear_has_query(); - } -} -inline ::milvus::grpc::TermQuery* GeneralQuery::release_term_query() { - // @@protoc_insertion_point(field_release:milvus.grpc.GeneralQuery.term_query) - if (has_term_query()) { - clear_has_query(); - ::milvus::grpc::TermQuery* temp = query_.term_query_; - query_.term_query_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::milvus::grpc::TermQuery& GeneralQuery::term_query() const { - // @@protoc_insertion_point(field_get:milvus.grpc.GeneralQuery.term_query) - return has_term_query() - ? *query_.term_query_ - : *reinterpret_cast< ::milvus::grpc::TermQuery*>(&::milvus::grpc::_TermQuery_default_instance_); -} -inline ::milvus::grpc::TermQuery* GeneralQuery::mutable_term_query() { - if (!has_term_query()) { - clear_query(); - set_has_term_query(); - query_.term_query_ = CreateMaybeMessage< ::milvus::grpc::TermQuery >( - GetArenaNoVirtual()); - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.GeneralQuery.term_query) - return query_.term_query_; -} - -// .milvus.grpc.RangeQuery range_query = 3; -inline bool GeneralQuery::has_range_query() const { - return query_case() == kRangeQuery; -} -inline void GeneralQuery::set_has_range_query() { - _oneof_case_[0] = kRangeQuery; -} -inline void GeneralQuery::clear_range_query() { - if (has_range_query()) { - delete query_.range_query_; - clear_has_query(); - } -} -inline ::milvus::grpc::RangeQuery* GeneralQuery::release_range_query() { - // @@protoc_insertion_point(field_release:milvus.grpc.GeneralQuery.range_query) - if (has_range_query()) { - clear_has_query(); - ::milvus::grpc::RangeQuery* temp = query_.range_query_; - query_.range_query_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::milvus::grpc::RangeQuery& GeneralQuery::range_query() const { - // @@protoc_insertion_point(field_get:milvus.grpc.GeneralQuery.range_query) - return has_range_query() - ? *query_.range_query_ - : *reinterpret_cast< ::milvus::grpc::RangeQuery*>(&::milvus::grpc::_RangeQuery_default_instance_); -} -inline ::milvus::grpc::RangeQuery* GeneralQuery::mutable_range_query() { - if (!has_range_query()) { - clear_query(); - set_has_range_query(); - query_.range_query_ = CreateMaybeMessage< ::milvus::grpc::RangeQuery >( - GetArenaNoVirtual()); - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.GeneralQuery.range_query) - return query_.range_query_; -} - -// .milvus.grpc.VectorQuery vector_query = 4; -inline bool GeneralQuery::has_vector_query() const { - return query_case() == kVectorQuery; -} -inline void GeneralQuery::set_has_vector_query() { - _oneof_case_[0] = kVectorQuery; -} -inline void GeneralQuery::clear_vector_query() { - if (has_vector_query()) { - delete query_.vector_query_; - clear_has_query(); - } -} -inline ::milvus::grpc::VectorQuery* GeneralQuery::release_vector_query() { - // @@protoc_insertion_point(field_release:milvus.grpc.GeneralQuery.vector_query) - if (has_vector_query()) { - clear_has_query(); - ::milvus::grpc::VectorQuery* temp = query_.vector_query_; - query_.vector_query_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::milvus::grpc::VectorQuery& GeneralQuery::vector_query() const { - // @@protoc_insertion_point(field_get:milvus.grpc.GeneralQuery.vector_query) - return has_vector_query() - ? *query_.vector_query_ - : *reinterpret_cast< ::milvus::grpc::VectorQuery*>(&::milvus::grpc::_VectorQuery_default_instance_); -} -inline ::milvus::grpc::VectorQuery* GeneralQuery::mutable_vector_query() { - if (!has_vector_query()) { - clear_query(); - set_has_vector_query(); - query_.vector_query_ = CreateMaybeMessage< ::milvus::grpc::VectorQuery >( - GetArenaNoVirtual()); - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.GeneralQuery.vector_query) - return query_.vector_query_; -} - -inline bool GeneralQuery::has_query() const { - return query_case() != QUERY_NOT_SET; -} -inline void GeneralQuery::clear_has_query() { - _oneof_case_[0] = QUERY_NOT_SET; -} -inline GeneralQuery::QueryCase GeneralQuery::query_case() const { - return GeneralQuery::QueryCase(_oneof_case_[0]); -} -// ------------------------------------------------------------------- - -// SearchParamPB - -// string collection_name = 1; -inline void SearchParamPB::clear_collection_name() { - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& SearchParamPB::collection_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchParamPB.collection_name) - return collection_name_.GetNoArena(); -} -inline void SearchParamPB::set_collection_name(const std::string& value) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.SearchParamPB.collection_name) -} -inline void SearchParamPB::set_collection_name(std::string&& value) { - - collection_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.SearchParamPB.collection_name) -} -inline void SearchParamPB::set_collection_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.SearchParamPB.collection_name) -} -inline void SearchParamPB::set_collection_name(const char* value, size_t size) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.SearchParamPB.collection_name) -} -inline std::string* SearchParamPB::mutable_collection_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchParamPB.collection_name) - return collection_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* SearchParamPB::release_collection_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.SearchParamPB.collection_name) - - return collection_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void SearchParamPB::set_allocated_collection_name(std::string* collection_name) { - if (collection_name != nullptr) { - - } else { - - } - collection_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), collection_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.SearchParamPB.collection_name) -} - -// repeated string partition_tag_array = 2; -inline int SearchParamPB::partition_tag_array_size() const { - return partition_tag_array_.size(); -} -inline void SearchParamPB::clear_partition_tag_array() { - partition_tag_array_.Clear(); -} -inline const std::string& SearchParamPB::partition_tag_array(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchParamPB.partition_tag_array) - return partition_tag_array_.Get(index); -} -inline std::string* SearchParamPB::mutable_partition_tag_array(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchParamPB.partition_tag_array) - return partition_tag_array_.Mutable(index); -} -inline void SearchParamPB::set_partition_tag_array(int index, const std::string& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.SearchParamPB.partition_tag_array) - partition_tag_array_.Mutable(index)->assign(value); -} -inline void SearchParamPB::set_partition_tag_array(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.SearchParamPB.partition_tag_array) - partition_tag_array_.Mutable(index)->assign(std::move(value)); -} -inline void SearchParamPB::set_partition_tag_array(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - partition_tag_array_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:milvus.grpc.SearchParamPB.partition_tag_array) -} -inline void SearchParamPB::set_partition_tag_array(int index, const char* value, size_t size) { - partition_tag_array_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.SearchParamPB.partition_tag_array) -} -inline std::string* SearchParamPB::add_partition_tag_array() { - // @@protoc_insertion_point(field_add_mutable:milvus.grpc.SearchParamPB.partition_tag_array) - return partition_tag_array_.Add(); -} -inline void SearchParamPB::add_partition_tag_array(const std::string& value) { - partition_tag_array_.Add()->assign(value); - // @@protoc_insertion_point(field_add:milvus.grpc.SearchParamPB.partition_tag_array) -} -inline void SearchParamPB::add_partition_tag_array(std::string&& value) { - partition_tag_array_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:milvus.grpc.SearchParamPB.partition_tag_array) -} -inline void SearchParamPB::add_partition_tag_array(const char* value) { - GOOGLE_DCHECK(value != nullptr); - partition_tag_array_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:milvus.grpc.SearchParamPB.partition_tag_array) -} -inline void SearchParamPB::add_partition_tag_array(const char* value, size_t size) { - partition_tag_array_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:milvus.grpc.SearchParamPB.partition_tag_array) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -SearchParamPB::partition_tag_array() const { - // @@protoc_insertion_point(field_list:milvus.grpc.SearchParamPB.partition_tag_array) - return partition_tag_array_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -SearchParamPB::mutable_partition_tag_array() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.SearchParamPB.partition_tag_array) - return &partition_tag_array_; -} - -// .milvus.grpc.GeneralQuery general_query = 3; -inline bool SearchParamPB::has_general_query() const { - return this != internal_default_instance() && general_query_ != nullptr; -} -inline void SearchParamPB::clear_general_query() { - if (GetArenaNoVirtual() == nullptr && general_query_ != nullptr) { - delete general_query_; - } - general_query_ = nullptr; -} -inline const ::milvus::grpc::GeneralQuery& SearchParamPB::general_query() const { - const ::milvus::grpc::GeneralQuery* p = general_query_; - // @@protoc_insertion_point(field_get:milvus.grpc.SearchParamPB.general_query) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_GeneralQuery_default_instance_); -} -inline ::milvus::grpc::GeneralQuery* SearchParamPB::release_general_query() { - // @@protoc_insertion_point(field_release:milvus.grpc.SearchParamPB.general_query) - - ::milvus::grpc::GeneralQuery* temp = general_query_; - general_query_ = nullptr; - return temp; -} -inline ::milvus::grpc::GeneralQuery* SearchParamPB::mutable_general_query() { - - if (general_query_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::GeneralQuery>(GetArenaNoVirtual()); - general_query_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchParamPB.general_query) - return general_query_; -} -inline void SearchParamPB::set_allocated_general_query(::milvus::grpc::GeneralQuery* general_query) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete general_query_; - } - if (general_query) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - general_query = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, general_query, submessage_arena); - } - - } else { - - } - general_query_ = general_query; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.SearchParamPB.general_query) -} - -// repeated .milvus.grpc.KeyValuePair extra_params = 4; -inline int SearchParamPB::extra_params_size() const { - return extra_params_.size(); -} -inline void SearchParamPB::clear_extra_params() { - extra_params_.Clear(); -} -inline ::milvus::grpc::KeyValuePair* SearchParamPB::mutable_extra_params(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchParamPB.extra_params) - return extra_params_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* -SearchParamPB::mutable_extra_params() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.SearchParamPB.extra_params) - return &extra_params_; -} -inline const ::milvus::grpc::KeyValuePair& SearchParamPB::extra_params(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchParamPB.extra_params) - return extra_params_.Get(index); -} -inline ::milvus::grpc::KeyValuePair* SearchParamPB::add_extra_params() { - // @@protoc_insertion_point(field_add:milvus.grpc.SearchParamPB.extra_params) - return extra_params_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& -SearchParamPB::extra_params() const { - // @@protoc_insertion_point(field_list:milvus.grpc.SearchParamPB.extra_params) - return extra_params_; -} - -// ------------------------------------------------------------------- - -// InsertOrDeleteMsg - -// string collection_name = 1; -inline void InsertOrDeleteMsg::clear_collection_name() { - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& InsertOrDeleteMsg::collection_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.InsertOrDeleteMsg.collection_name) - return collection_name_.GetNoArena(); -} -inline void InsertOrDeleteMsg::set_collection_name(const std::string& value) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.InsertOrDeleteMsg.collection_name) -} -inline void InsertOrDeleteMsg::set_collection_name(std::string&& value) { - - collection_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.InsertOrDeleteMsg.collection_name) -} -inline void InsertOrDeleteMsg::set_collection_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.InsertOrDeleteMsg.collection_name) -} -inline void InsertOrDeleteMsg::set_collection_name(const char* value, size_t size) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.InsertOrDeleteMsg.collection_name) -} -inline std::string* InsertOrDeleteMsg::mutable_collection_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.InsertOrDeleteMsg.collection_name) - return collection_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* InsertOrDeleteMsg::release_collection_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.InsertOrDeleteMsg.collection_name) - - return collection_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void InsertOrDeleteMsg::set_allocated_collection_name(std::string* collection_name) { - if (collection_name != nullptr) { - - } else { - - } - collection_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), collection_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.InsertOrDeleteMsg.collection_name) -} - -// .milvus.grpc.RowData rows_data = 2; -inline bool InsertOrDeleteMsg::has_rows_data() const { - return this != internal_default_instance() && rows_data_ != nullptr; -} -inline void InsertOrDeleteMsg::clear_rows_data() { - if (GetArenaNoVirtual() == nullptr && rows_data_ != nullptr) { - delete rows_data_; - } - rows_data_ = nullptr; -} -inline const ::milvus::grpc::RowData& InsertOrDeleteMsg::rows_data() const { - const ::milvus::grpc::RowData* p = rows_data_; - // @@protoc_insertion_point(field_get:milvus.grpc.InsertOrDeleteMsg.rows_data) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_RowData_default_instance_); -} -inline ::milvus::grpc::RowData* InsertOrDeleteMsg::release_rows_data() { - // @@protoc_insertion_point(field_release:milvus.grpc.InsertOrDeleteMsg.rows_data) - - ::milvus::grpc::RowData* temp = rows_data_; - rows_data_ = nullptr; - return temp; -} -inline ::milvus::grpc::RowData* InsertOrDeleteMsg::mutable_rows_data() { - - if (rows_data_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::RowData>(GetArenaNoVirtual()); - rows_data_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.InsertOrDeleteMsg.rows_data) - return rows_data_; -} -inline void InsertOrDeleteMsg::set_allocated_rows_data(::milvus::grpc::RowData* rows_data) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete rows_data_; - } - if (rows_data) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - rows_data = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, rows_data, submessage_arena); - } - - } else { - - } - rows_data_ = rows_data; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.InsertOrDeleteMsg.rows_data) -} - -// int64 uid = 3; -inline void InsertOrDeleteMsg::clear_uid() { - uid_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 InsertOrDeleteMsg::uid() const { - // @@protoc_insertion_point(field_get:milvus.grpc.InsertOrDeleteMsg.uid) - return uid_; -} -inline void InsertOrDeleteMsg::set_uid(::PROTOBUF_NAMESPACE_ID::int64 value) { - - uid_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.InsertOrDeleteMsg.uid) -} - -// string partition_tag = 4; -inline void InsertOrDeleteMsg::clear_partition_tag() { - partition_tag_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& InsertOrDeleteMsg::partition_tag() const { - // @@protoc_insertion_point(field_get:milvus.grpc.InsertOrDeleteMsg.partition_tag) - return partition_tag_.GetNoArena(); -} -inline void InsertOrDeleteMsg::set_partition_tag(const std::string& value) { - - partition_tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.InsertOrDeleteMsg.partition_tag) -} -inline void InsertOrDeleteMsg::set_partition_tag(std::string&& value) { - - partition_tag_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.InsertOrDeleteMsg.partition_tag) -} -inline void InsertOrDeleteMsg::set_partition_tag(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - partition_tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.InsertOrDeleteMsg.partition_tag) -} -inline void InsertOrDeleteMsg::set_partition_tag(const char* value, size_t size) { - - partition_tag_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.InsertOrDeleteMsg.partition_tag) -} -inline std::string* InsertOrDeleteMsg::mutable_partition_tag() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.InsertOrDeleteMsg.partition_tag) - return partition_tag_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* InsertOrDeleteMsg::release_partition_tag() { - // @@protoc_insertion_point(field_release:milvus.grpc.InsertOrDeleteMsg.partition_tag) - - return partition_tag_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void InsertOrDeleteMsg::set_allocated_partition_tag(std::string* partition_tag) { - if (partition_tag != nullptr) { - - } else { - - } - partition_tag_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), partition_tag); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.InsertOrDeleteMsg.partition_tag) -} - -// uint64 timestamp = 5; -inline void InsertOrDeleteMsg::clear_timestamp() { - timestamp_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 InsertOrDeleteMsg::timestamp() const { - // @@protoc_insertion_point(field_get:milvus.grpc.InsertOrDeleteMsg.timestamp) - return timestamp_; -} -inline void InsertOrDeleteMsg::set_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - timestamp_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.InsertOrDeleteMsg.timestamp) -} - -// int64 segment_id = 6; -inline void InsertOrDeleteMsg::clear_segment_id() { - segment_id_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 InsertOrDeleteMsg::segment_id() const { - // @@protoc_insertion_point(field_get:milvus.grpc.InsertOrDeleteMsg.segment_id) - return segment_id_; -} -inline void InsertOrDeleteMsg::set_segment_id(::PROTOBUF_NAMESPACE_ID::int64 value) { - - segment_id_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.InsertOrDeleteMsg.segment_id) -} - -// int64 channel_id = 7; -inline void InsertOrDeleteMsg::clear_channel_id() { - channel_id_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 InsertOrDeleteMsg::channel_id() const { - // @@protoc_insertion_point(field_get:milvus.grpc.InsertOrDeleteMsg.channel_id) - return channel_id_; -} -inline void InsertOrDeleteMsg::set_channel_id(::PROTOBUF_NAMESPACE_ID::int64 value) { - - channel_id_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.InsertOrDeleteMsg.channel_id) -} - -// .milvus.grpc.OpType op = 8; -inline void InsertOrDeleteMsg::clear_op() { - op_ = 0; -} -inline ::milvus::grpc::OpType InsertOrDeleteMsg::op() const { - // @@protoc_insertion_point(field_get:milvus.grpc.InsertOrDeleteMsg.op) - return static_cast< ::milvus::grpc::OpType >(op_); -} -inline void InsertOrDeleteMsg::set_op(::milvus::grpc::OpType value) { - - op_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.InsertOrDeleteMsg.op) -} - -// int64 client_id = 9; -inline void InsertOrDeleteMsg::clear_client_id() { - client_id_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 InsertOrDeleteMsg::client_id() const { - // @@protoc_insertion_point(field_get:milvus.grpc.InsertOrDeleteMsg.client_id) - return client_id_; -} -inline void InsertOrDeleteMsg::set_client_id(::PROTOBUF_NAMESPACE_ID::int64 value) { - - client_id_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.InsertOrDeleteMsg.client_id) -} - -// repeated .milvus.grpc.KeyValuePair extra_params = 10; -inline int InsertOrDeleteMsg::extra_params_size() const { - return extra_params_.size(); -} -inline void InsertOrDeleteMsg::clear_extra_params() { - extra_params_.Clear(); -} -inline ::milvus::grpc::KeyValuePair* InsertOrDeleteMsg::mutable_extra_params(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.InsertOrDeleteMsg.extra_params) - return extra_params_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* -InsertOrDeleteMsg::mutable_extra_params() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.InsertOrDeleteMsg.extra_params) - return &extra_params_; -} -inline const ::milvus::grpc::KeyValuePair& InsertOrDeleteMsg::extra_params(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.InsertOrDeleteMsg.extra_params) - return extra_params_.Get(index); -} -inline ::milvus::grpc::KeyValuePair* InsertOrDeleteMsg::add_extra_params() { - // @@protoc_insertion_point(field_add:milvus.grpc.InsertOrDeleteMsg.extra_params) - return extra_params_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& -InsertOrDeleteMsg::extra_params() const { - // @@protoc_insertion_point(field_list:milvus.grpc.InsertOrDeleteMsg.extra_params) - return extra_params_; -} - -// ------------------------------------------------------------------- - -// SearchMsg - -// string collection_name = 1; -inline void SearchMsg::clear_collection_name() { - collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& SearchMsg::collection_name() const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchMsg.collection_name) - return collection_name_.GetNoArena(); -} -inline void SearchMsg::set_collection_name(const std::string& value) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.SearchMsg.collection_name) -} -inline void SearchMsg::set_collection_name(std::string&& value) { - - collection_name_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.SearchMsg.collection_name) -} -inline void SearchMsg::set_collection_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.SearchMsg.collection_name) -} -inline void SearchMsg::set_collection_name(const char* value, size_t size) { - - collection_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.SearchMsg.collection_name) -} -inline std::string* SearchMsg::mutable_collection_name() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchMsg.collection_name) - return collection_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* SearchMsg::release_collection_name() { - // @@protoc_insertion_point(field_release:milvus.grpc.SearchMsg.collection_name) - - return collection_name_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void SearchMsg::set_allocated_collection_name(std::string* collection_name) { - if (collection_name != nullptr) { - - } else { - - } - collection_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), collection_name); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.SearchMsg.collection_name) -} - -// .milvus.grpc.VectorRowRecord records = 2; -inline bool SearchMsg::has_records() const { - return this != internal_default_instance() && records_ != nullptr; -} -inline void SearchMsg::clear_records() { - if (GetArenaNoVirtual() == nullptr && records_ != nullptr) { - delete records_; - } - records_ = nullptr; -} -inline const ::milvus::grpc::VectorRowRecord& SearchMsg::records() const { - const ::milvus::grpc::VectorRowRecord* p = records_; - // @@protoc_insertion_point(field_get:milvus.grpc.SearchMsg.records) - return p != nullptr ? *p : *reinterpret_cast( - &::milvus::grpc::_VectorRowRecord_default_instance_); -} -inline ::milvus::grpc::VectorRowRecord* SearchMsg::release_records() { - // @@protoc_insertion_point(field_release:milvus.grpc.SearchMsg.records) - - ::milvus::grpc::VectorRowRecord* temp = records_; - records_ = nullptr; - return temp; -} -inline ::milvus::grpc::VectorRowRecord* SearchMsg::mutable_records() { - - if (records_ == nullptr) { - auto* p = CreateMaybeMessage<::milvus::grpc::VectorRowRecord>(GetArenaNoVirtual()); - records_ = p; - } - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchMsg.records) - return records_; -} -inline void SearchMsg::set_allocated_records(::milvus::grpc::VectorRowRecord* records) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete records_; - } - if (records) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - records = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, records, submessage_arena); - } - - } else { - - } - records_ = records; - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.SearchMsg.records) -} - -// repeated string partition_tag = 3; -inline int SearchMsg::partition_tag_size() const { - return partition_tag_.size(); -} -inline void SearchMsg::clear_partition_tag() { - partition_tag_.Clear(); -} -inline const std::string& SearchMsg::partition_tag(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchMsg.partition_tag) - return partition_tag_.Get(index); -} -inline std::string* SearchMsg::mutable_partition_tag(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchMsg.partition_tag) - return partition_tag_.Mutable(index); -} -inline void SearchMsg::set_partition_tag(int index, const std::string& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.SearchMsg.partition_tag) - partition_tag_.Mutable(index)->assign(value); -} -inline void SearchMsg::set_partition_tag(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.SearchMsg.partition_tag) - partition_tag_.Mutable(index)->assign(std::move(value)); -} -inline void SearchMsg::set_partition_tag(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - partition_tag_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:milvus.grpc.SearchMsg.partition_tag) -} -inline void SearchMsg::set_partition_tag(int index, const char* value, size_t size) { - partition_tag_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.SearchMsg.partition_tag) -} -inline std::string* SearchMsg::add_partition_tag() { - // @@protoc_insertion_point(field_add_mutable:milvus.grpc.SearchMsg.partition_tag) - return partition_tag_.Add(); -} -inline void SearchMsg::add_partition_tag(const std::string& value) { - partition_tag_.Add()->assign(value); - // @@protoc_insertion_point(field_add:milvus.grpc.SearchMsg.partition_tag) -} -inline void SearchMsg::add_partition_tag(std::string&& value) { - partition_tag_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:milvus.grpc.SearchMsg.partition_tag) -} -inline void SearchMsg::add_partition_tag(const char* value) { - GOOGLE_DCHECK(value != nullptr); - partition_tag_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:milvus.grpc.SearchMsg.partition_tag) -} -inline void SearchMsg::add_partition_tag(const char* value, size_t size) { - partition_tag_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:milvus.grpc.SearchMsg.partition_tag) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -SearchMsg::partition_tag() const { - // @@protoc_insertion_point(field_list:milvus.grpc.SearchMsg.partition_tag) - return partition_tag_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -SearchMsg::mutable_partition_tag() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.SearchMsg.partition_tag) - return &partition_tag_; -} - -// int64 uid = 4; -inline void SearchMsg::clear_uid() { - uid_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 SearchMsg::uid() const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchMsg.uid) - return uid_; -} -inline void SearchMsg::set_uid(::PROTOBUF_NAMESPACE_ID::int64 value) { - - uid_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.SearchMsg.uid) -} - -// uint64 timestamp = 5; -inline void SearchMsg::clear_timestamp() { - timestamp_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 SearchMsg::timestamp() const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchMsg.timestamp) - return timestamp_; -} -inline void SearchMsg::set_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - timestamp_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.SearchMsg.timestamp) -} - -// int64 client_id = 6; -inline void SearchMsg::clear_client_id() { - client_id_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 SearchMsg::client_id() const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchMsg.client_id) - return client_id_; -} -inline void SearchMsg::set_client_id(::PROTOBUF_NAMESPACE_ID::int64 value) { - - client_id_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.SearchMsg.client_id) -} - -// repeated .milvus.grpc.KeyValuePair extra_params = 7; -inline int SearchMsg::extra_params_size() const { - return extra_params_.size(); -} -inline void SearchMsg::clear_extra_params() { - extra_params_.Clear(); -} -inline ::milvus::grpc::KeyValuePair* SearchMsg::mutable_extra_params(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchMsg.extra_params) - return extra_params_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >* -SearchMsg::mutable_extra_params() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.SearchMsg.extra_params) - return &extra_params_; -} -inline const ::milvus::grpc::KeyValuePair& SearchMsg::extra_params(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchMsg.extra_params) - return extra_params_.Get(index); -} -inline ::milvus::grpc::KeyValuePair* SearchMsg::add_extra_params() { - // @@protoc_insertion_point(field_add:milvus.grpc.SearchMsg.extra_params) - return extra_params_.Add(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::grpc::KeyValuePair >& -SearchMsg::extra_params() const { - // @@protoc_insertion_point(field_list:milvus.grpc.SearchMsg.extra_params) - return extra_params_; -} - -// repeated string json = 8; -inline int SearchMsg::json_size() const { - return json_.size(); -} -inline void SearchMsg::clear_json() { - json_.Clear(); -} -inline const std::string& SearchMsg::json(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchMsg.json) - return json_.Get(index); -} -inline std::string* SearchMsg::mutable_json(int index) { - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchMsg.json) - return json_.Mutable(index); -} -inline void SearchMsg::set_json(int index, const std::string& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.SearchMsg.json) - json_.Mutable(index)->assign(value); -} -inline void SearchMsg::set_json(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:milvus.grpc.SearchMsg.json) - json_.Mutable(index)->assign(std::move(value)); -} -inline void SearchMsg::set_json(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - json_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:milvus.grpc.SearchMsg.json) -} -inline void SearchMsg::set_json(int index, const char* value, size_t size) { - json_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.SearchMsg.json) -} -inline std::string* SearchMsg::add_json() { - // @@protoc_insertion_point(field_add_mutable:milvus.grpc.SearchMsg.json) - return json_.Add(); -} -inline void SearchMsg::add_json(const std::string& value) { - json_.Add()->assign(value); - // @@protoc_insertion_point(field_add:milvus.grpc.SearchMsg.json) -} -inline void SearchMsg::add_json(std::string&& value) { - json_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:milvus.grpc.SearchMsg.json) -} -inline void SearchMsg::add_json(const char* value) { - GOOGLE_DCHECK(value != nullptr); - json_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:milvus.grpc.SearchMsg.json) -} -inline void SearchMsg::add_json(const char* value, size_t size) { - json_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:milvus.grpc.SearchMsg.json) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -SearchMsg::json() const { - // @@protoc_insertion_point(field_list:milvus.grpc.SearchMsg.json) - return json_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -SearchMsg::mutable_json() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.SearchMsg.json) - return &json_; -} - -// string dsl = 9; -inline void SearchMsg::clear_dsl() { - dsl_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline const std::string& SearchMsg::dsl() const { - // @@protoc_insertion_point(field_get:milvus.grpc.SearchMsg.dsl) - return dsl_.GetNoArena(); -} -inline void SearchMsg::set_dsl(const std::string& value) { - - dsl_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:milvus.grpc.SearchMsg.dsl) -} -inline void SearchMsg::set_dsl(std::string&& value) { - - dsl_.SetNoArena( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:milvus.grpc.SearchMsg.dsl) -} -inline void SearchMsg::set_dsl(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - dsl_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); - // @@protoc_insertion_point(field_set_char:milvus.grpc.SearchMsg.dsl) -} -inline void SearchMsg::set_dsl(const char* value, size_t size) { - - dsl_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:milvus.grpc.SearchMsg.dsl) -} -inline std::string* SearchMsg::mutable_dsl() { - - // @@protoc_insertion_point(field_mutable:milvus.grpc.SearchMsg.dsl) - return dsl_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline std::string* SearchMsg::release_dsl() { - // @@protoc_insertion_point(field_release:milvus.grpc.SearchMsg.dsl) - - return dsl_.ReleaseNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -inline void SearchMsg::set_allocated_dsl(std::string* dsl) { - if (dsl != nullptr) { - - } else { - - } - dsl_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), dsl); - // @@protoc_insertion_point(field_set_allocated:milvus.grpc.SearchMsg.dsl) -} - -// ------------------------------------------------------------------- - -// TimeSyncMsg - -// int64 peer_Id = 1; -inline void TimeSyncMsg::clear_peer_id() { - peer_id_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 TimeSyncMsg::peer_id() const { - // @@protoc_insertion_point(field_get:milvus.grpc.TimeSyncMsg.peer_Id) - return peer_id_; -} -inline void TimeSyncMsg::set_peer_id(::PROTOBUF_NAMESPACE_ID::int64 value) { - - peer_id_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.TimeSyncMsg.peer_Id) -} - -// uint64 Timestamp = 2; -inline void TimeSyncMsg::clear_timestamp() { - timestamp_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 TimeSyncMsg::timestamp() const { - // @@protoc_insertion_point(field_get:milvus.grpc.TimeSyncMsg.Timestamp) - return timestamp_; -} -inline void TimeSyncMsg::set_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - timestamp_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.TimeSyncMsg.Timestamp) -} - -// .milvus.grpc.SyncType sync_type = 3; -inline void TimeSyncMsg::clear_sync_type() { - sync_type_ = 0; -} -inline ::milvus::grpc::SyncType TimeSyncMsg::sync_type() const { - // @@protoc_insertion_point(field_get:milvus.grpc.TimeSyncMsg.sync_type) - return static_cast< ::milvus::grpc::SyncType >(sync_type_); -} -inline void TimeSyncMsg::set_sync_type(::milvus::grpc::SyncType value) { - - sync_type_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.TimeSyncMsg.sync_type) -} - -// ------------------------------------------------------------------- - -// Key2SegMsg - -// int64 uid = 1; -inline void Key2SegMsg::clear_uid() { - uid_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 Key2SegMsg::uid() const { - // @@protoc_insertion_point(field_get:milvus.grpc.Key2SegMsg.uid) - return uid_; -} -inline void Key2SegMsg::set_uid(::PROTOBUF_NAMESPACE_ID::int64 value) { - - uid_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.Key2SegMsg.uid) -} - -// uint64 timestamp = 2; -inline void Key2SegMsg::clear_timestamp() { - timestamp_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Key2SegMsg::timestamp() const { - // @@protoc_insertion_point(field_get:milvus.grpc.Key2SegMsg.timestamp) - return timestamp_; -} -inline void Key2SegMsg::set_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - timestamp_ = value; - // @@protoc_insertion_point(field_set:milvus.grpc.Key2SegMsg.timestamp) -} - -// repeated int64 segment_id = 3; -inline int Key2SegMsg::segment_id_size() const { - return segment_id_.size(); -} -inline void Key2SegMsg::clear_segment_id() { - segment_id_.Clear(); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 Key2SegMsg::segment_id(int index) const { - // @@protoc_insertion_point(field_get:milvus.grpc.Key2SegMsg.segment_id) - return segment_id_.Get(index); -} -inline void Key2SegMsg::set_segment_id(int index, ::PROTOBUF_NAMESPACE_ID::int64 value) { - segment_id_.Set(index, value); - // @@protoc_insertion_point(field_set:milvus.grpc.Key2SegMsg.segment_id) -} -inline void Key2SegMsg::add_segment_id(::PROTOBUF_NAMESPACE_ID::int64 value) { - segment_id_.Add(value); - // @@protoc_insertion_point(field_add:milvus.grpc.Key2SegMsg.segment_id) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& -Key2SegMsg::segment_id() const { - // @@protoc_insertion_point(field_list:milvus.grpc.Key2SegMsg.segment_id) - return segment_id_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* -Key2SegMsg::mutable_segment_id() { - // @@protoc_insertion_point(field_mutable_list:milvus.grpc.Key2SegMsg.segment_id) - return &segment_id_; -} - -#ifdef __GNUC__ - #pragma GCC diagnostic pop -#endif // __GNUC__ -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - - -// @@protoc_insertion_point(namespace_scope) - -} // namespace grpc -} // namespace milvus - -PROTOBUF_NAMESPACE_OPEN - -template <> struct is_proto_enum< ::milvus::grpc::ErrorCode> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::milvus::grpc::ErrorCode>() { - return ::milvus::grpc::ErrorCode_descriptor(); -} -template <> struct is_proto_enum< ::milvus::grpc::DataType> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::milvus::grpc::DataType>() { - return ::milvus::grpc::DataType_descriptor(); -} -template <> struct is_proto_enum< ::milvus::grpc::CompareOperator> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::milvus::grpc::CompareOperator>() { - return ::milvus::grpc::CompareOperator_descriptor(); -} -template <> struct is_proto_enum< ::milvus::grpc::Occur> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::milvus::grpc::Occur>() { - return ::milvus::grpc::Occur_descriptor(); -} -template <> struct is_proto_enum< ::milvus::grpc::OpType> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::milvus::grpc::OpType>() { - return ::milvus::grpc::OpType_descriptor(); -} -template <> struct is_proto_enum< ::milvus::grpc::SyncType> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::milvus::grpc::SyncType>() { - return ::milvus::grpc::SyncType_descriptor(); -} - -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) - -#include -#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_message_2eproto diff --git a/proxy/src/grpc/proto/etcd.proto b/proxy/src/grpc/proto/etcd.proto deleted file mode 100644 index fb8f06700b..0000000000 --- a/proxy/src/grpc/proto/etcd.proto +++ /dev/null @@ -1,248 +0,0 @@ -syntax = "proto3"; -package etcdserverpb; - -service Watch { - // Watch watches for events happening or that have happened. Both input and output - // are streams; the input stream is for creating and canceling watchers and the output - // stream sends events. One watch RPC can watch on multiple key ranges, streaming events - // for several watches at once. The entire event history can be watched starting from the - // last compaction revision. - rpc Watch(stream WatchRequest) returns (stream WatchResponse) { - } -} - -service KV { - // Range gets the keys in the range from the key-value store. - rpc Range(RangeRequest) returns (RangeResponse) { - } -} - -message RangeRequest { - enum SortOrder { - NONE = 0; // default, no sorting - ASCEND = 1; // lowest target value first - DESCEND = 2; // highest target value first - } - enum SortTarget { - KEY = 0; - VERSION = 1; - CREATE = 2; - MOD = 3; - VALUE = 4; - } - - // key is the first key for the range. If range_end is not given, the request only looks up key. - bytes key = 1; - // range_end is the upper bound on the requested range [key, range_end). - // If range_end is '\0', the range is all keys >= key. - // If range_end is key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"), - // then the range request gets all keys prefixed with key. - // If both key and range_end are '\0', then the range request returns all keys. - bytes range_end = 2; - // limit is a limit on the number of keys returned for the request. When limit is set to 0, - // it is treated as no limit. - int64 limit = 3; - // revision is the point-in-time of the key-value store to use for the range. - // If revision is less or equal to zero, the range is over the newest key-value store. - // If the revision has been compacted, ErrCompacted is returned as a response. - int64 revision = 4; - - // sort_order is the order for returned sorted results. - SortOrder sort_order = 5; - - // sort_target is the key-value field to use for sorting. - SortTarget sort_target = 6; - - // serializable sets the range request to use serializable member-local reads. - // Range requests are linearizable by default; linearizable requests have higher - // latency and lower throughput than serializable requests but reflect the current - // consensus of the cluster. For better performance, in exchange for possible stale reads, - // a serializable range request is served locally without needing to reach consensus - // with other nodes in the cluster. - bool serializable = 7; - - // keys_only when set returns only the keys and not the values. - bool keys_only = 8; - - // count_only when set returns only the count of the keys in the range. - bool count_only = 9; - - // min_mod_revision is the lower bound for returned key mod revisions; all keys with - // lesser mod revisions will be filtered away. - int64 min_mod_revision = 10; - - // max_mod_revision is the upper bound for returned key mod revisions; all keys with - // greater mod revisions will be filtered away. - int64 max_mod_revision = 11; - - // min_create_revision is the lower bound for returned key create revisions; all keys with - // lesser create revisions will be filtered away. - int64 min_create_revision = 12; - - // max_create_revision is the upper bound for returned key create revisions; all keys with - // greater create revisions will be filtered away. - int64 max_create_revision = 13; -} - -message RangeResponse { - ResponseHeader header = 1; - // kvs is the list of key-value pairs matched by the range request. - // kvs is empty when count is requested. - repeated KeyValue kvs = 2; - // more indicates if there are more keys to return in the requested range. - bool more = 3; - // count is set to the number of keys within the range when requested. - int64 count = 4; -} - -message WatchRequest { - // request_union is a request to either create a new watcher or cancel an existing watcher. - oneof request_union { - WatchCreateRequest create_request = 1; - WatchCancelRequest cancel_request = 2; - WatchProgressRequest progress_request = 3; - } -} - -message WatchCreateRequest { - // key is the key to register for watching. - bytes key = 1; - - // range_end is the end of the range [key, range_end) to watch. If range_end is not given, - // only the key argument is watched. If range_end is equal to '\0', all keys greater than - // or equal to the key argument are watched. - // If the range_end is one bit larger than the given key, - // then all keys with the prefix (the given key) will be watched. - bytes range_end = 2; - - // start_revision is an optional revision to watch from (inclusive). No start_revision is "now". - int64 start_revision = 3; - - // progress_notify is set so that the etcd server will periodically send a WatchResponse with - // no events to the new watcher if there are no recent events. It is useful when clients - // wish to recover a disconnected watcher starting from a recent known revision. - // The etcd server may decide how often it will send notifications based on current load. - bool progress_notify = 4; - - enum FilterType { - // filter out put event. - NOPUT = 0; - // filter out delete event. - NODELETE = 1; - } - - // filters filter the events at server side before it sends back to the watcher. - repeated FilterType filters = 5; - - // If prev_kv is set, created watcher gets the previous KV before the event happens. - // If the previous KV is already compacted, nothing will be returned. - bool prev_kv = 6; - - // If watch_id is provided and non-zero, it will be assigned to this watcher. - // Since creating a watcher in etcd is not a synchronous operation, - // this can be used ensure that ordering is correct when creating multiple - // watchers on the same stream. Creating a watcher with an ID already in - // use on the stream will cause an error to be returned. - int64 watch_id = 7; - - // fragment enables splitting large revisions into multiple watch responses. - bool fragment = 8; -} - -message WatchCancelRequest { - // watch_id is the watcher id to cancel so that no more events are transmitted. - int64 watch_id = 1; -} - -// Requests the a watch stream progress status be sent in the watch response stream as soon as -// possible. -message WatchProgressRequest { -} - -message WatchResponse { - ResponseHeader header = 1; - // watch_id is the ID of the watcher that corresponds to the response. - int64 watch_id = 2; - - // created is set to true if the response is for a create watch request. - // The client should record the watch_id and expect to receive events for - // the created watcher from the same stream. - // All events sent to the created watcher will attach with the same watch_id. - bool created = 3; - - // canceled is set to true if the response is for a cancel watch request. - // No further events will be sent to the canceled watcher. - bool canceled = 4; - - // compact_revision is set to the minimum index if a watcher tries to watch - // at a compacted index. - // - // This happens when creating a watcher at a compacted revision or the watcher cannot - // catch up with the progress of the key-value store. - // - // The client should treat the watcher as canceled and should not try to create any - // watcher with the same start_revision again. - int64 compact_revision = 5; - - // cancel_reason indicates the reason for canceling the watcher. - string cancel_reason = 6; - - // framgment is true if large watch response was split over multiple responses. - bool fragment = 7; - - repeated Event events = 11; -} - -message ResponseHeader { - // cluster_id is the ID of the cluster which sent the response. - uint64 cluster_id = 1; - // member_id is the ID of the member which sent the response. - uint64 member_id = 2; - // revision is the key-value store revision when the request was applied. - // For watch progress responses, the header.revision indicates progress. All future events - // recieved in this stream are guaranteed to have a higher revision number than the - // header.revision number. - int64 revision = 3; - // raft_term is the raft term when the request was applied. - uint64 raft_term = 4; -} - - -message KeyValue { - // key is the key in bytes. An empty key is not allowed. - bytes key = 1; - // create_revision is the revision of last creation on this key. - int64 create_revision = 2; - // mod_revision is the revision of last modification on this key. - int64 mod_revision = 3; - // version is the version of the key. A deletion resets - // the version to zero and any modification of the key - // increases its version. - int64 version = 4; - // value is the value held by the key, in bytes. - bytes value = 5; - // lease is the ID of the lease that attached to key. - // When the attached lease expires, the key will be deleted. - // If lease is 0, then no lease is attached to the key. - int64 lease = 6; -} - -message Event { - enum EventType { - PUT = 0; - DELETE = 1; - } - // type is the kind of event. If type is a PUT, it indicates - // new data has been stored to the key. If type is a DELETE, - // it indicates the key was deleted. - EventType type = 1; - // kv holds the KeyValue for the event. - // A PUT event contains current kv pair. - // A PUT event with kv.Version=1 indicates the creation of a key. - // A DELETE/EXPIRE event contains the deleted key with - // its modification revision set to the revision of deletion. - KeyValue kv = 2; - - // prev_kv holds the key-value pair before the event happens. - KeyValue prev_kv = 3; -} \ No newline at end of file diff --git a/proxy/src/log/CMakeLists.txt b/proxy/src/log/CMakeLists.txt deleted file mode 100644 index 83ef94aaef..0000000000 --- a/proxy/src/log/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. -#------------------------------------------------------------------------------- -set(LOG_FILES ${MILVUS_ENGINE_SRC}/log/Log.cpp - ${MILVUS_ENGINE_SRC}/log/Log.h - ${MILVUS_ENGINE_SRC}/log/LogMgr.cpp - ${MILVUS_ENGINE_SRC}/log/LogMgr.h - ${MILVUS_THIRDPARTY_SRC}/easyloggingpp/easylogging++.cc - ${MILVUS_THIRDPARTY_SRC}/easyloggingpp/easylogging++.h - ) - -add_library(log STATIC ${LOG_FILES}) diff --git a/proxy/src/log/Log.cpp b/proxy/src/log/Log.cpp deleted file mode 100644 index 067ee5148e..0000000000 --- a/proxy/src/log/Log.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "log/Log.h" - -#include -#include -#include -#include - -namespace milvus { - -std::string -LogOut(const char* pattern, ...) { - size_t len = strnlen(pattern, 1024) + 256; - auto str_p = std::make_unique(len); - memset(str_p.get(), 0, len); - - va_list vl; - va_start(vl, pattern); - vsnprintf(str_p.get(), len, pattern, vl); // NOLINT - va_end(vl); - - return std::string(str_p.get()); -} - -void -SetThreadName(const std::string& name) { - // Note: the name cannot exceed 16 bytes - pthread_setname_np(pthread_self(), name.c_str()); -} - -std::string -GetThreadName() { - std::string thread_name = "unamed"; - char name[16]; - size_t len = 16; - auto err = pthread_getname_np(pthread_self(), name, len); - if (not err) { - thread_name = name; - } - - return thread_name; -} - -} // namespace milvus diff --git a/proxy/src/log/Log.h b/proxy/src/log/Log.h deleted file mode 100644 index a1ab5d945b..0000000000 --- a/proxy/src/log/Log.h +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include - -#include "easyloggingpp/easylogging++.h" - -namespace milvus { - -/* - * Please use LOG_MODULE_LEVEL_C macro in member function of class - * and LOG_MODULE_LEVEL_ macro in other functions. - */ - -///////////////////////////////////////////////////////////////////////////////////////////////// -#define SERVER_MODULE_NAME "SERVER" -#define SERVER_MODULE_CLASS_FUNCTION \ - LogOut("[%s][%s::%s][%s] ", SERVER_MODULE_NAME, (typeid(*this).name()), __FUNCTION__, GetThreadName().c_str()) -#define SERVER_MODULE_FUNCTION LogOut("[%s][%s][%s] ", SERVER_MODULE_NAME, __FUNCTION__, GetThreadName().c_str()) - -#define LOG_SERVER_TRACE_C LOG(TRACE) << SERVER_MODULE_CLASS_FUNCTION -#define LOG_SERVER_DEBUG_C LOG(DEBUG) << SERVER_MODULE_CLASS_FUNCTION -#define LOG_SERVER_INFO_C LOG(INFO) << SERVER_MODULE_CLASS_FUNCTION -#define LOG_SERVER_WARNING_C LOG(WARNING) << SERVER_MODULE_CLASS_FUNCTION -#define LOG_SERVER_ERROR_C LOG(ERROR) << SERVER_MODULE_CLASS_FUNCTION -#define LOG_SERVER_FATAL_C LOG(FATAL) << SERVER_MODULE_CLASS_FUNCTION - -#define LOG_SERVER_TRACE_ LOG(TRACE) << SERVER_MODULE_FUNCTION -#define LOG_SERVER_DEBUG_ LOG(DEBUG) << SERVER_MODULE_FUNCTION -#define LOG_SERVER_INFO_ LOG(INFO) << SERVER_MODULE_FUNCTION -#define LOG_SERVER_WARNING_ LOG(WARNING) << SERVER_MODULE_FUNCTION -#define LOG_SERVER_ERROR_ LOG(ERROR) << SERVER_MODULE_FUNCTION -#define LOG_SERVER_FATAL_ LOG(FATAL) << SERVER_MODULE_FUNCTION - -///////////////////////////////////////////////////////////////////////////////////////////////// -#define ENGINE_MODULE_NAME "ENGINE" -#define ENGINE_MODULE_CLASS_FUNCTION \ - LogOut("[%s][%s::%s][%s] ", ENGINE_MODULE_NAME, (typeid(*this).name()), __FUNCTION__, GetThreadName().c_str()) -#define ENGINE_MODULE_FUNCTION LogOut("[%s][%s][%s] ", ENGINE_MODULE_NAME, __FUNCTION__, GetThreadName().c_str()) - -#define LOG_ENGINE_TRACE_C LOG(TRACE) << ENGINE_MODULE_CLASS_FUNCTION -#define LOG_ENGINE_DEBUG_C LOG(DEBUG) << ENGINE_MODULE_CLASS_FUNCTION -#define LOG_ENGINE_INFO_C LOG(INFO) << ENGINE_MODULE_CLASS_FUNCTION -#define LOG_ENGINE_WARNING_C LOG(WARNING) << ENGINE_MODULE_CLASS_FUNCTION -#define LOG_ENGINE_ERROR_C LOG(ERROR) << ENGINE_MODULE_CLASS_FUNCTION -#define LOG_ENGINE_FATAL_C LOG(FATAL) << ENGINE_MODULE_CLASS_FUNCTION - -#define LOG_ENGINE_TRACE_ LOG(TRACE) << ENGINE_MODULE_FUNCTION -#define LOG_ENGINE_DEBUG_ LOG(DEBUG) << ENGINE_MODULE_FUNCTION -#define LOG_ENGINE_INFO_ LOG(INFO) << ENGINE_MODULE_FUNCTION -#define LOG_ENGINE_WARNING_ LOG(WARNING) << ENGINE_MODULE_FUNCTION -#define LOG_ENGINE_ERROR_ LOG(ERROR) << ENGINE_MODULE_FUNCTION -#define LOG_ENGINE_FATAL_ LOG(FATAL) << ENGINE_MODULE_FUNCTION - -///////////////////////////////////////////////////////////////////////////////////////////////// -#define WRAPPER_MODULE_NAME "WRAPPER" -#define WRAPPER_MODULE_CLASS_FUNCTION \ - LogOut("[%s][%s::%s][%s] ", WRAPPER_MODULE_NAME, (typeid(*this).name()), __FUNCTION__, GetThreadName().c_str()) -#define WRAPPER_MODULE_FUNCTION LogOut("[%s][%s][%s] ", WRAPPER_MODULE_NAME, __FUNCTION__, GetThreadName().c_str()) - -#define LOG_WRAPPER_TRACE_C LOG(TRACE) << WRAPPER_MODULE_CLASS_FUNCTION -#define LOG_WRAPPER_DEBUG_C LOG(DEBUG) << WRAPPER_MODULE_CLASS_FUNCTION -#define LOG_WRAPPER_INFO_C LOG(INFO) << WRAPPER_MODULE_CLASS_FUNCTION -#define LOG_WRAPPER_WARNING_C LOG(WARNING) << WRAPPER_MODULE_CLASS_FUNCTION -#define LOG_WRAPPER_ERROR_C LOG(ERROR) << WRAPPER_MODULE_CLASS_FUNCTION -#define LOG_WRAPPER_FATAL_C LOG(FATAL) << WRAPPER_MODULE_CLASS_FUNCTION - -#define LOG_WRAPPER_TRACE_ LOG(TRACE) << WRAPPER_MODULE_FUNCTION -#define LOG_WRAPPER_DEBUG_ LOG(DEBUG) << WRAPPER_MODULE_FUNCTION -#define LOG_WRAPPER_INFO_ LOG(INFO) << WRAPPER_MODULE_FUNCTION -#define LOG_WRAPPER_WARNING_ LOG(WARNING) << WRAPPER_MODULE_FUNCTION -#define LOG_WRAPPER_ERROR_ LOG(ERROR) << WRAPPER_MODULE_FUNCTION -#define LOG_WRAPPER_FATAL_ LOG(FATAL) << WRAPPER_MODULE_FUNCTION - -///////////////////////////////////////////////////////////////////////////////////////////////// -#define STORAGE_MODULE_NAME "STORAGE" -#define STORAGE_MODULE_CLASS_FUNCTION \ - LogOut("[%s][%s::%s][%s] ", STORAGE_MODULE_NAME, (typeid(*this).name()), __FUNCTION__, GetThreadName().c_str()) -#define STORAGE_MODULE_FUNCTION LogOut("[%s][%s][%s] ", STORAGE_MODULE_NAME, __FUNCTION__, GetThreadName().c_str()) - -#define LOG_STORAGE_TRACE_C LOG(TRACE) << STORAGE_MODULE_CLASS_FUNCTION -#define LOG_STORAGE_DEBUG_C LOG(DEBUG) << STORAGE_MODULE_CLASS_FUNCTION -#define LOG_STORAGE_INFO_C LOG(INFO) << STORAGE_MODULE_CLASS_FUNCTION -#define LOG_STORAGE_WARNING_C LOG(WARNING) << STORAGE_MODULE_CLASS_FUNCTION -#define LOG_STORAGE_ERROR_C LOG(ERROR) << STORAGE_MODULE_CLASS_FUNCTION -#define LOG_STORAGE_FATAL_C LOG(FATAL) << STORAGE_MODULE_CLASS_FUNCTION - -#define LOG_STORAGE_TRACE_ LOG(TRACE) << STORAGE_MODULE_FUNCTION -#define LOG_STORAGE_DEBUG_ LOG(DEBUG) << STORAGE_MODULE_FUNCTION -#define LOG_STORAGE_INFO_ LOG(INFO) << STORAGE_MODULE_FUNCTION -#define LOG_STORAGE_WARNING_ LOG(WARNING) << STORAGE_MODULE_FUNCTION -#define LOG_STORAGE_ERROR_ LOG(ERROR) << STORAGE_MODULE_FUNCTION -#define LOG_STORAGE_FATAL_ LOG(FATAL) << STORAGE_MODULE_FUNCTION - -///////////////////////////////////////////////////////////////////////////////////////////////// -#define WAL_MODULE_NAME "WAL" -#define WAL_MODULE_CLASS_FUNCTION \ - LogOut("[%s][%s::%s][%s] ", WAL_MODULE_NAME, (typeid(*this).name()), __FUNCTION__, GetThreadName().c_str()) -#define WAL_MODULE_FUNCTION LogOut("[%s][%s][%s] ", WAL_MODULE_NAME, __FUNCTION__, GetThreadName().c_str()) - -#define LOG_WAL_TRACE_C LOG(TRACE) << WAL_MODULE_CLASS_FUNCTION -#define LOG_WAL_DEBUG_C LOG(DEBUG) << WAL_MODULE_CLASS_FUNCTION -#define LOG_WAL_INFO_C LOG(INFO) << WAL_MODULE_CLASS_FUNCTION -#define LOG_WAL_WARNING_C LOG(WARNING) << WAL_MODULE_CLASS_FUNCTION -#define LOG_WAL_ERROR_C LOG(ERROR) << WAL_MODULE_CLASS_FUNCTION -#define LOG_WAL_FATAL_C LOG(FATAL) << WAL_MODULE_CLASS_FUNCTION - -#define LOG_WAL_TRACE_ LOG(TRACE) << WAL_MODULE_FUNCTION -#define LOG_WAL_DEBUG_ LOG(DEBUG) << WAL_MODULE_FUNCTION -#define LOG_WAL_INFO_ LOG(INFO) << WAL_MODULE_FUNCTION -#define LOG_WAL_WARNING_ LOG(WARNING) << WAL_MODULE_FUNCTION -#define LOG_WAL_ERROR_ LOG(ERROR) << WAL_MODULE_FUNCTION -#define LOG_WAL_FATAL_ LOG(FATAL) << WAL_MODULE_FUNCTION - -///////////////////////////////////////////////////////////////////////////////////////////////////// -std::string -LogOut(const char* pattern, ...); - -void -SetThreadName(const std::string& name); - -std::string -GetThreadName(); - -} // namespace milvus diff --git a/proxy/src/log/LogMgr.cpp b/proxy/src/log/LogMgr.cpp deleted file mode 100644 index d3bb2809f0..0000000000 --- a/proxy/src/log/LogMgr.cpp +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include -#include -#include -#include - -#include - -#include "config/ServerConfig.h" -#include "log/LogMgr.h" -#include "utils/Status.h" - -namespace milvus { - -namespace { -static int global_idx = 0; -static int debug_idx = 0; -static int warning_idx = 0; -static int trace_idx = 0; -static int error_idx = 0; -static int fatal_idx = 0; -static int64_t logs_delete_exceeds = 1; -static bool enable_log_delete = false; - -/* module constant */ -const int64_t CONFIG_LOGS_MAX_LOG_FILE_SIZE_MIN = 536870912; /* 512 MB */ -const int64_t CONFIG_LOGS_MAX_LOG_FILE_SIZE_MAX = 4294967296; /* 4 GB */ -const int64_t CONFIG_LOGS_LOG_ROTATE_NUM_MIN = 0; -const int64_t CONFIG_LOGS_LOG_ROTATE_NUM_MAX = 1024; -} // namespace - -// TODO(yzb) : change the easylogging library to get the log level from parameter rather than filename -void -RolloutHandler(const char* filename, std::size_t size, el::Level level) { - char* dirc = strdup(filename); - char* basec = strdup(filename); - char* dir = dirname(dirc); - char* base = basename(basec); - - std::string s(base); - std::string list[] = {"\\", " ", "\'", "\"", "*", "\?", "{", "}", ";", "<", - ">", "|", "^", "&", "$", "#", "!", "`", "~"}; - std::string::size_type position; - for (auto substr : list) { - position = 0; - while ((position = s.find_first_of(substr, position)) != std::string::npos) { - s.insert(position, "\\"); - position += 2; - } - } - std::string m(std::string(dir) + "/" + s); - s = m; - try { - switch (level) { - case el::Level::Debug: { - s.append("." + std::to_string(++debug_idx)); - rename(m.c_str(), s.c_str()); - if (enable_log_delete && debug_idx - logs_delete_exceeds > 0) { - std::string to_delete = m + "." + std::to_string(debug_idx - logs_delete_exceeds); - // std::cout << "remote " << to_delete << std::endl; - boost::filesystem::remove(to_delete); - } - break; - } - case el::Level::Warning: { - s.append("." + std::to_string(++warning_idx)); - rename(m.c_str(), s.c_str()); - if (enable_log_delete && warning_idx - logs_delete_exceeds > 0) { - std::string to_delete = m + "." + std::to_string(warning_idx - logs_delete_exceeds); - boost::filesystem::remove(to_delete); - } - break; - } - case el::Level::Trace: { - s.append("." + std::to_string(++trace_idx)); - rename(m.c_str(), s.c_str()); - if (enable_log_delete && trace_idx - logs_delete_exceeds > 0) { - std::string to_delete = m + "." + std::to_string(trace_idx - logs_delete_exceeds); - boost::filesystem::remove(to_delete); - } - break; - } - case el::Level::Error: { - s.append("." + std::to_string(++error_idx)); - rename(m.c_str(), s.c_str()); - if (enable_log_delete && error_idx - logs_delete_exceeds > 0) { - std::string to_delete = m + "." + std::to_string(error_idx - logs_delete_exceeds); - boost::filesystem::remove(to_delete); - } - break; - } - case el::Level::Fatal: { - s.append("." + std::to_string(++fatal_idx)); - rename(m.c_str(), s.c_str()); - if (enable_log_delete && fatal_idx - logs_delete_exceeds > 0) { - std::string to_delete = m + "." + std::to_string(fatal_idx - logs_delete_exceeds); - boost::filesystem::remove(to_delete); - } - break; - } - default: { - s.append("." + std::to_string(++global_idx)); - rename(m.c_str(), s.c_str()); - if (enable_log_delete && global_idx - logs_delete_exceeds > 0) { - std::string to_delete = m + "." + std::to_string(global_idx - logs_delete_exceeds); - boost::filesystem::remove(to_delete); - } - break; - } - } - } catch (const std::exception& exc) { - std::cerr << exc.what() << ". Exception throws from RolloutHandler." << std::endl; - } -} - -Status -LogMgr::InitLog(bool trace_enable, const std::string& level, const std::string& logs_path, int64_t max_log_file_size, - int64_t delete_exceeds) { - std::unordered_map level_to_int{ - {"debug", 5}, {"info", 4}, {"warning", 3}, {"error", 2}, {"fatal", 1}, - }; - - bool debug_enable = false; - bool info_enable = false; - bool warning_enable = false; - bool error_enable = false; - bool fatal_enable = false; - - switch (level_to_int[level]) { - case 5: - debug_enable = true; - case 4: - info_enable = true; - case 3: - warning_enable = true; - case 2: - error_enable = true; - case 1: - fatal_enable = true; - break; - default: - return Status(SERVER_UNEXPECTED_ERROR, "invalid log level"); - } - - el::Configurations defaultConf; - defaultConf.setToDefault(); - defaultConf.setGlobally(el::ConfigurationType::Format, "[%datetime][%level]%msg"); - defaultConf.setGlobally(el::ConfigurationType::ToFile, "true"); - defaultConf.setGlobally(el::ConfigurationType::ToStandardOutput, "false"); - defaultConf.setGlobally(el::ConfigurationType::SubsecondPrecision, "3"); - defaultConf.setGlobally(el::ConfigurationType::PerformanceTracking, "false"); - - std::string logs_reg_path = logs_path.rfind('/') == logs_path.length() - 1 ? logs_path : logs_path + "/"; - std::string global_log_path = logs_reg_path + "milvus-%datetime{%y-%M-%d-%H:%m}-global.log"; - defaultConf.set(el::Level::Global, el::ConfigurationType::Filename, global_log_path.c_str()); - defaultConf.set(el::Level::Global, el::ConfigurationType::Enabled, "true"); - - std::string info_log_path = logs_reg_path + "milvus-%datetime{%y-%M-%d-%H:%m}-info.log"; - defaultConf.set(el::Level::Info, el::ConfigurationType::Filename, info_log_path.c_str()); - if (info_enable) { - defaultConf.set(el::Level::Info, el::ConfigurationType::Enabled, "true"); - } else { - defaultConf.set(el::Level::Info, el::ConfigurationType::Enabled, "false"); - } - - std::string debug_log_path = logs_reg_path + "milvus-%datetime{%y-%M-%d-%H:%m}-debug.log"; - defaultConf.set(el::Level::Debug, el::ConfigurationType::Filename, debug_log_path.c_str()); - if (debug_enable) { - defaultConf.set(el::Level::Debug, el::ConfigurationType::Enabled, "true"); - } else { - defaultConf.set(el::Level::Debug, el::ConfigurationType::Enabled, "false"); - } - - std::string warning_log_path = logs_reg_path + "milvus-%datetime{%y-%M-%d-%H:%m}-warning.log"; - defaultConf.set(el::Level::Warning, el::ConfigurationType::Filename, warning_log_path.c_str()); - if (warning_enable) { - defaultConf.set(el::Level::Warning, el::ConfigurationType::Enabled, "true"); - } else { - defaultConf.set(el::Level::Warning, el::ConfigurationType::Enabled, "false"); - } - - std::string trace_log_path = logs_reg_path + "milvus-%datetime{%y-%M-%d-%H:%m}-trace.log"; - defaultConf.set(el::Level::Trace, el::ConfigurationType::Filename, trace_log_path.c_str()); - if (trace_enable) { - defaultConf.set(el::Level::Trace, el::ConfigurationType::Enabled, "true"); - } else { - defaultConf.set(el::Level::Trace, el::ConfigurationType::Enabled, "false"); - } - - std::string error_log_path = logs_reg_path + "milvus-%datetime{%y-%M-%d-%H:%m}-error.log"; - defaultConf.set(el::Level::Error, el::ConfigurationType::Filename, error_log_path.c_str()); - if (error_enable) { - defaultConf.set(el::Level::Error, el::ConfigurationType::Enabled, "true"); - } else { - defaultConf.set(el::Level::Error, el::ConfigurationType::Enabled, "false"); - } - - std::string fatal_log_path = logs_reg_path + "milvus-%datetime{%y-%M-%d-%H:%m}-fatal.log"; - defaultConf.set(el::Level::Fatal, el::ConfigurationType::Filename, fatal_log_path.c_str()); - if (fatal_enable) { - defaultConf.set(el::Level::Fatal, el::ConfigurationType::Enabled, "true"); - } else { - defaultConf.set(el::Level::Fatal, el::ConfigurationType::Enabled, "false"); - } - - if (max_log_file_size < CONFIG_LOGS_MAX_LOG_FILE_SIZE_MIN || - max_log_file_size > CONFIG_LOGS_MAX_LOG_FILE_SIZE_MAX) { - return Status(SERVER_UNEXPECTED_ERROR, "max_log_file_size must in range[" + - std::to_string(CONFIG_LOGS_MAX_LOG_FILE_SIZE_MIN) + ", " + - std::to_string(CONFIG_LOGS_MAX_LOG_FILE_SIZE_MAX) + "], now is " + - std::to_string(max_log_file_size)); - } - defaultConf.setGlobally(el::ConfigurationType::MaxLogFileSize, std::to_string(max_log_file_size)); - el::Loggers::addFlag(el::LoggingFlag::StrictLogFileSizeCheck); - el::Helpers::installPreRollOutCallback(RolloutHandler); - el::Loggers::addFlag(el::LoggingFlag::DisableApplicationAbortOnFatalLog); - - // set delete_exceeds = 0 means disable throw away log file even they reach certain limit. - if (delete_exceeds != 0) { - if (delete_exceeds < CONFIG_LOGS_LOG_ROTATE_NUM_MIN || delete_exceeds > CONFIG_LOGS_LOG_ROTATE_NUM_MAX) { - return Status(SERVER_UNEXPECTED_ERROR, "delete_exceeds must in range[" + - std::to_string(CONFIG_LOGS_LOG_ROTATE_NUM_MIN) + ", " + - std::to_string(CONFIG_LOGS_LOG_ROTATE_NUM_MAX) + "], now is " + - std::to_string(delete_exceeds)); - } - enable_log_delete = true; - logs_delete_exceeds = delete_exceeds; - } - - el::Loggers::reconfigureLogger("default", defaultConf); - - return Status::OK(); -} - -} // namespace milvus diff --git a/proxy/src/log/LogMgr.h b/proxy/src/log/LogMgr.h deleted file mode 100644 index acd283ce03..0000000000 --- a/proxy/src/log/LogMgr.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "easyloggingpp/easylogging++.h" -#include "utils/Status.h" - -#include -#include - -namespace milvus { - -class LogMgr { - public: - static Status - InitLog(bool trace_enable, const std::string& level, const std::string& logs_path, int64_t max_log_file_size, - int64_t delete_exceeds); -}; - -} // namespace milvus diff --git a/proxy/src/main.cpp b/proxy/src/main.cpp deleted file mode 100644 index c9a7b490d8..0000000000 --- a/proxy/src/main.cpp +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include -#include -#include -#include -#include - -#include "config/ConfigMgr.h" -#include "easyloggingpp/easylogging++.h" -#include "server/Server.h" -#include "src/version.h" -#include "utils/SignalHandler.h" -#include "utils/Status.h" -#include "message_client/Client.h" - -INITIALIZE_EASYLOGGINGPP - - -void -print_help(const std::string& app_name) { - std::cout << std::endl << "Usage: " << app_name << " [OPTIONS]" << std::endl; - std::cout << R"( - Options: - -h --help Print this help. - -c --conf_file filename Read configuration from the file. - -d --daemon Daemonize this application. - -p --pid_file filename PID file used by daemonized app. -)" << std::endl; -} - -void -print_banner() { - std::cout << std::endl; - std::cout << " __ _________ _ ____ ______ " << std::endl; - std::cout << " / |/ / _/ /| | / / / / / __/ " << std::endl; - std::cout << " / /|_/ // // /_| |/ / /_/ /\\ \\ " << std::endl; - std::cout << " /_/ /_/___/____/___/\\____/___/ " << std::endl; - std::cout << std::endl; - std::cout << "Welcome to use Milvus!" << std::endl; - std::cout << "Milvus " << BUILD_TYPE << " version: v" << MILVUS_VERSION << ", built at " << BUILD_TIME << ", with " -#ifdef WITH_MKL - << "MKL" -#else - << "OpenBLAS" -#endif - << " library." << std::endl; -#ifdef MILVUS_GPU_VERSION - std::cout << "You are using Milvus GPU edition" << std::endl; -#else - std::cout << "You are using Milvus CPU edition" << std::endl; -#endif - std::cout << "Last commit id: " << LAST_COMMIT_ID << std::endl; - std::cout << std::endl; -} - -int -main(int argc, char* argv[]) { - print_banner(); - - static struct option long_options[] = {{"conf_file", required_argument, nullptr, 'c'}, - {"help", no_argument, nullptr, 'h'}, - {"daemon", no_argument, nullptr, 'd'}, - {"pid_file", required_argument, nullptr, 'p'}, - {nullptr, 0, nullptr, 0}}; - - int option_index = 0; - int64_t start_daemonized = 0; - - std::string config_filename; - std::string pid_filename; - std::string app_name = argv[0]; - milvus::Status s; - - milvus::server::Server& server = milvus::server::Server::GetInstance(); - - if (argc < 2) { - print_help(app_name); - goto FAIL; - } - - int value; - while ((value = getopt_long(argc, argv, "c:p:dh", long_options, &option_index)) != -1) { - switch (value) { - case 'c': { - char* config_filename_ptr = strdup(optarg); - config_filename = config_filename_ptr; - free(config_filename_ptr); - std::cout << "Loading configuration from: " << config_filename << std::endl; - break; - } - case 'p': { - char* pid_filename_ptr = strdup(optarg); - pid_filename = pid_filename_ptr; - free(pid_filename_ptr); - std::cout << pid_filename << std::endl; - break; - } - case 'd': - start_daemonized = 1; - break; - case 'h': - print_help(app_name); - return EXIT_SUCCESS; - case '?': - print_help(app_name); - return EXIT_FAILURE; - default: - print_help(app_name); - break; - } - } - - /* Handle Signal */ - milvus::signal_routine_func = [](int32_t exit_code) { - milvus::server::Server::GetInstance().Stop(); - exit(exit_code); - }; - signal(SIGHUP, milvus::HandleSignal); - signal(SIGINT, milvus::HandleSignal); - signal(SIGUSR1, milvus::HandleSignal); - signal(SIGSEGV, milvus::HandleSignal); - signal(SIGUSR2, milvus::HandleSignal); - signal(SIGTERM, milvus::HandleSignal); - - try { - milvus::ConfigMgr::GetInstance().Init(); - milvus::ConfigMgr::GetInstance().Load(config_filename); - } catch (milvus::ConfigStatus& cs) { - std::cerr << "Load config(" << config_filename << ") failed: " << cs.message << std::endl; - goto FAIL; - } - - server.Init(start_daemonized, pid_filename, config_filename); - - s = server.Start(); - if (s.ok()) { - std::cout << "Milvus server started successfully!" << std::endl; - } else { - std::cout << s.message() << std::endl; - goto FAIL; - } - - /* wait signal */ - pause(); - - return EXIT_SUCCESS; - -FAIL: - std::cout << "Milvus server exit..." << std::endl; - return EXIT_FAILURE; -} diff --git a/proxy/src/message_client/CMakeLists.txt b/proxy/src/message_client/CMakeLists.txt deleted file mode 100644 index 0c234a99f1..0000000000 --- a/proxy/src/message_client/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -set(src-cpp - Client.cpp - ClientV2.cpp - Consumer.cpp - Producer.cpp - M3_hash.cpp - PartitionPolicy.cpp) - -add_library(message_client_cpp - ${src-cpp} - ) - -target_include_directories(message_client_cpp PUBLIC ${PROJECT_BINARY_DIR}/thirdparty/pulsar/pulsar-src/pulsar-client-cpp/include) - -target_link_libraries(message_client_cpp utils pulsarStatic libprotobuf) - -#install(TARGETS message_client_cpp -# DESTINATION lib) \ No newline at end of file diff --git a/proxy/src/message_client/Client.cpp b/proxy/src/message_client/Client.cpp deleted file mode 100644 index d220599c5a..0000000000 --- a/proxy/src/message_client/Client.cpp +++ /dev/null @@ -1,13 +0,0 @@ - -#include "Client.h" - -namespace milvus { -namespace message_client { - -MsgClient::MsgClient(const std::string &serviceUrl) : pulsar::Client(serviceUrl) {} - -MsgClient::MsgClient(const std::string &serviceUrl, const pulsar::ClientConfiguration& clientConfiguration) - : pulsar::Client(serviceUrl, clientConfiguration) {} - -} -} \ No newline at end of file diff --git a/proxy/src/message_client/Client.h b/proxy/src/message_client/Client.h deleted file mode 100644 index e5f945ca32..0000000000 --- a/proxy/src/message_client/Client.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "pulsar/Client.h" -#include "pulsar/ClientConfiguration.h" - -namespace milvus { -namespace message_client { - -using Result = pulsar::Result; -using Message = pulsar::Message; - -class MsgClient : public pulsar::Client{ -public: - MsgClient(const std::string& serviceUrl); - MsgClient(const std::string& serviceUrl, const pulsar::ClientConfiguration& clientConfiguration); - - void set_client_id(int64_t id) { client_id_ = id; } - - int64_t get_client_id() { return client_id_; } - -private: - int64_t client_id_; -}; - -} -} \ No newline at end of file diff --git a/proxy/src/message_client/ClientV2.cpp b/proxy/src/message_client/ClientV2.cpp deleted file mode 100644 index b17cde0c06..0000000000 --- a/proxy/src/message_client/ClientV2.cpp +++ /dev/null @@ -1,326 +0,0 @@ -#include "ClientV2.h" -#include "pulsar/Result.h" -#include "PartitionPolicy.h" -#include "utils/CommonUtil.h" -#include "M3_hash.h" -#include "config/ServerConfig.h" -#include -#include -#include -#include "log/Log.h" - -namespace milvus::message_client { - -std::map>> total_results; - -MsgClientV2::MsgClientV2(int64_t client_id, - const std::string &service_url, - const uint32_t mut_parallelism, - const pulsar::ClientConfiguration &config) - : client_id_(client_id), service_url_(service_url), mut_parallelism_(mut_parallelism) { -} - -Status MsgClientV2::Init(const std::string &insert_delete, - const std::string &search, - const std::string &time_sync, - const std::string &search_by_id, - const std::string &search_result) { - //create pulsar client - auto pulsar_client = std::make_shared(service_url_); - //create pulsar producer - ProducerConfiguration producerConfiguration; - producerConfiguration.setPartitionsRoutingMode(ProducerConfiguration::CustomPartition); - producerConfiguration.setMessageRouter(std::make_shared()); - // insert_delete_producer_ = std::make_shared(pulsar_client, insert_delete, producerConfiguration); - search_producer_ = std::make_shared(pulsar_client, search, producerConfiguration); - search_by_id_producer_ = std::make_shared(pulsar_client, search_by_id, producerConfiguration); - time_sync_producer_ = std::make_shared(pulsar_client, time_sync); - - for (auto i = 0; i < mut_parallelism_; i++) { - std::string insert_or_delete_topic = insert_delete + "-" + std::to_string(i); - paralle_mut_producers_.emplace_back(std::make_shared(pulsar_client, - insert_or_delete_topic, - producerConfiguration)); - } - //create pulsar consumer - std::string subscribe_name = std::to_string(CommonUtil::RandomUINT64()); - consumer_ = std::make_shared(pulsar_client, search_result + subscribe_name); - - std::string search_topic = search_result + "-" + std::to_string(config.proxy_id()); - auto result = consumer_->subscribe(search_topic); - if (result != pulsar::Result::ResultOk) { - return Status(SERVER_UNEXPECTED_ERROR, - "Pulsar message client init occur error, " + std::string(pulsar::strResult(result))); - } - return Status::OK(); -} - -int64_t GetQueryNodeNum() { - return config.master.query_node_num(); -} - -Status -Aggregation(std::vector> results, milvus::grpc::QueryResult *result) { - if (results.empty()) { - return Status(DB_ERROR, "The result is null!"); - } - - std::vector all_scores; - std::vector all_distance; - std::vector all_entities_ids; - std::vector all_valid_row; - std::vector all_row_data; - std::vector all_kv_pairs; - - grpc::Status status; - int row_num = 0; - - for (auto &result_per_node : results) { - if (result_per_node->status().error_code() != grpc::ErrorCode::SUCCESS) { -// if (one_node_res->status().error_code() != grpc::ErrorCode::SUCCESS || -// one_node_res->entities().status().error_code() != grpc::ErrorCode::SUCCESS) { - return Status(DB_ERROR, "QueryNode return wrong status!"); - } - for (int j = 0; j < result_per_node->distances_size(); j++) { - all_scores.push_back(result_per_node->scores()[j]); - all_distance.push_back(result_per_node->distances()[j]); -// all_kv_pairs.push_back(result_per_node->extra_params()[j]); - } - for (int k = 0; k < result_per_node->entities().ids_size(); ++k) { - all_entities_ids.push_back(result_per_node->entities().ids(k)); -// all_valid_row.push_back(result_per_node->entities().valid_row(k)); -// all_row_data.push_back(result_per_node->entities().rows_data(k)); - } - if (result_per_node->row_num() > row_num) { - row_num = result_per_node->row_num(); - } - status = result_per_node->status(); - } - - std::vector index(all_distance.size()); - - iota(index.begin(), index.end(), 0); - - std::stable_sort(index.begin(), index.end(), - [&all_distance](size_t i1, size_t i2) { return all_distance[i1] > all_distance[i2]; }); - - grpc::Entities result_entities; - - for (int m = 0; m < result->row_num(); ++m) { - result->add_scores(all_scores[index[m]]); - result->add_distances(all_distance[index[m]]); -// result->add_extra_params(); -// result->mutable_extra_params(m)->CopyFrom(all_kv_pairs[index[m]]); - - result_entities.add_ids(all_entities_ids[index[m]]); -// result_entities.add_valid_row(all_valid_row[index[m]]); -// result_entities.add_rows_data(); -// result_entities.mutable_rows_data(m)->CopyFrom(all_row_data[index[m]]); - } - - result_entities.mutable_status()->CopyFrom(status); - - result->set_row_num(row_num); - result->mutable_entities()->CopyFrom(result_entities); - result->set_query_id(results[0]->query_id()); -// result->set_client_id(results[0]->client_id()); - - return Status::OK(); -} - -Status MsgClientV2::GetQueryResult(int64_t query_id, milvus::grpc::QueryResult *result) { - - int64_t query_node_num = GetQueryNodeNum(); - - auto t1 = std::chrono::high_resolution_clock::now(); - - while (true) { - auto received_result = total_results[query_id]; - if (received_result.size() == query_node_num) { - break; - } - Message msg; - consumer_->receive(msg); - - grpc::QueryResult search_res_msg; - auto status = search_res_msg.ParseFromString(msg.getDataAsString()); - if (status) { - auto message = std::make_shared(search_res_msg); - if (message->status().error_code() != grpc::ErrorCode::SUCCESS) { - consumer_->acknowledge(msg); - return Status(DB_ERROR, "Search Failed"); - } - total_results[message->query_id()].push_back(message); - consumer_->acknowledge(msg); - } else { - consumer_->acknowledge(msg); - return Status(DB_ERROR, "can't parse message which from pulsar!"); - } - } - auto status = Aggregation(total_results[query_id], result); - - return status; -} - -Status MsgClientV2::SendMutMessage(const milvus::grpc::InsertParam &request, - uint64_t timestamp, - const std::function &segment_id) { - using stdclock = std::chrono::high_resolution_clock; - auto start = stdclock::now(); - // may have retry policy? - auto row_count = request.rows_data_size(); - auto topic_num = config.pulsar.topicnum(); - auto stats = std::vector(topic_num); - std::atomic_uint64_t msg_sended = 0; - -#pragma omp parallel for default(none), shared(row_count, request, timestamp, stats, segment_id, msg_sended, topic_num), num_threads(topic_num) - for (auto i = 0; i < row_count; i++) { - milvus::grpc::InsertOrDeleteMsg mut_msg; - int this_thread = omp_get_thread_num(); - mut_msg.set_op(milvus::grpc::OpType::INSERT); - mut_msg.set_uid(request.entity_id_array(i)); - mut_msg.set_client_id(client_id_); - mut_msg.set_timestamp(timestamp); - mut_msg.set_collection_name(request.collection_name()); - mut_msg.set_partition_tag(request.partition_tag()); - uint64_t uid = request.entity_id_array(i); - auto channel_id = makeHash(&uid, sizeof(uint64_t)) % topic_num; - try { - mut_msg.set_segment_id(segment_id(request.collection_name(), channel_id, timestamp)); - mut_msg.mutable_rows_data()->CopyFrom(request.rows_data(i)); - mut_msg.mutable_extra_params()->CopyFrom(request.extra_params()); - - auto callback = [&stats, &msg_sended, this_thread](Result result, const pulsar::MessageId &messageId) { - msg_sended += 1; - if (result != pulsar::ResultOk) { - stats[this_thread] = Status(DB_ERROR, pulsar::strResult(result)); - } - }; - paralle_mut_producers_[this_thread]->sendAsync(mut_msg, callback); - } - catch (const std::exception &e) { - msg_sended += 1; - stats[this_thread] = Status(DB_ERROR, e.what()); - } - } - while (msg_sended < row_count) { - } - - auto end = stdclock::now(); - auto data_size = request.ByteSize(); - LOG_SERVER_INFO_ << "InsertReq Batch size:" << data_size / 1024.0 / 1024.0 << "M, " - << "throughput: " << data_size / std::chrono::duration_cast(end - start).count() * 1000 / 1024.0 / 1024 - << "M/s"; - - for (auto &stat : stats) { - if (!stat.ok()) { - return stat; - } - } - return Status::OK(); -} - -Status MsgClientV2::SendMutMessage(const milvus::grpc::DeleteByIDParam &request, - uint64_t timestamp, - const std::function &segment_id) { - using stdclock = std::chrono::high_resolution_clock; - auto start = stdclock::now(); - - auto row_count = request.id_array_size(); - auto topicnum = config.pulsar.topicnum(); - auto stats = std::vector(topicnum); - std::atomic_uint64_t msg_sended = 0; - -#pragma omp parallel for default(none), shared( request, timestamp, stats, segment_id, msg_sended, row_count, topicnum), num_threads(topicnum) - for (auto i = 0; i < row_count; i++) { - milvus::grpc::InsertOrDeleteMsg mut_msg; - mut_msg.set_op(milvus::grpc::OpType::DELETE); - mut_msg.set_client_id(client_id_); - mut_msg.set_uid(request.id_array(i)); - mut_msg.set_collection_name(request.collection_name()); - mut_msg.set_timestamp(timestamp); - - int this_thread = omp_get_thread_num(); - auto callback = [&stats, &msg_sended, this_thread](Result result, const pulsar::MessageId &messageId) { - msg_sended += 1; - if (result != pulsar::ResultOk) { - stats[this_thread] = Status(DB_ERROR, pulsar::strResult(result)); - } - }; - paralle_mut_producers_[this_thread]->sendAsync(mut_msg, callback); - } - while (msg_sended < row_count) { - } - - auto end = stdclock::now(); - auto data_size = request.ByteSize(); - LOG_SERVER_INFO_ << "InsertReq Batch size:" << data_size / 1024.0 / 1024.0 << "M, " - << "throughput: " << data_size / std::chrono::duration_cast(end - start).count() * 1000 / 1024.0 / 1024 - << "M/s"; - - for (auto &stat : stats) { - if (!stat.ok()) { - return stat; - } - } - return Status::OK(); -} - -Status MsgClientV2::SendQueryMessage(const milvus::grpc::SearchParam &request, uint64_t timestamp, int64_t &query_id) { - milvus::grpc::SearchMsg search_msg; - - query_id = GetUniqueQId(); - search_msg.set_collection_name(request.collection_name()); - search_msg.set_uid(query_id); - //TODO: get client id from master - search_msg.set_client_id(client_id_); - search_msg.set_timestamp(timestamp); - search_msg.set_dsl(request.dsl()); - - milvus::grpc::VectorRowRecord vector_row_recode; - std::vector vectors_records; - std::string binary_data; - for (int i = 0; i < request.vector_param_size(); ++i) { - search_msg.add_json(request.vector_param(i).json()); - for (int j = 0; j < request.vector_param(i).row_record().records_size(); ++j) { - for (int k = 0; k < request.vector_param(i).row_record().records(j).float_data_size(); ++k) { - vector_row_recode.add_float_data(request.vector_param(i).row_record().records(j).float_data(k)); - } - binary_data.append(request.vector_param(i).row_record().records(j).binary_data()); - } - } - vector_row_recode.set_binary_data(binary_data); - - search_msg.mutable_records()->CopyFrom(vector_row_recode); - - for (int m = 0; m < request.partition_tag_size(); ++m) { - search_msg.add_partition_tag(request.partition_tag(m)); - } - - for (int l = 0; l < request.extra_params_size(); ++l) { - search_msg.mutable_extra_params(l)->CopyFrom(request.extra_params(l)); - } - - auto result = search_producer_->send(search_msg); - if (result != pulsar::Result::ResultOk) { - return Status(DB_ERROR, pulsar::strResult(result)); - } - - return Status::OK(); -} - -MsgClientV2::~MsgClientV2() { -// insert_delete_producer_->close(); - for (auto &producer: paralle_mut_producers_) { - producer->close(); - } - search_producer_->close(); - search_by_id_producer_->close(); - time_sync_producer_->close(); - consumer_->close(); -} -} \ No newline at end of file diff --git a/proxy/src/message_client/ClientV2.h b/proxy/src/message_client/ClientV2.h deleted file mode 100644 index edb06bf162..0000000000 --- a/proxy/src/message_client/ClientV2.h +++ /dev/null @@ -1,58 +0,0 @@ -#pragma once - -#include "config/ServerConfig.h" -#include "utils/Status.h" -#include "Producer.h" -#include "Consumer.h" -#include "grpc/message.pb.h" - -namespace milvus::message_client { -//constexpr uint32_t ParallelNum = 12 * 20; - -class MsgClientV2 { - public: - MsgClientV2(int64_t client_id, - const std::string &service_url, - const uint32_t mut_parallelism, - const pulsar::ClientConfiguration &config = pulsar::ClientConfiguration()); - ~MsgClientV2(); - - // When using MsgClient, make sure it init successfully - Status Init(const std::string &insert_delete, - const std::string &search, - const std::string &time_sync, - const std::string &search_by_id, - const std::string &search_result); - - // unpackage batch insert or delete request, and delivery message to pulsar per row - Status SendMutMessage(const milvus::grpc::InsertParam &request, uint64_t timestamp, const std::function&); - - Status SendMutMessage(const milvus::grpc::DeleteByIDParam &request, uint64_t timestamp, const std::function&); - - // - Status SendQueryMessage(const milvus::grpc::SearchParam &request, uint64_t timestamp, int64_t &query_id); - - Status GetQueryResult(int64_t query_id, milvus::grpc::QueryResult *result); - - private: - int64_t GetUniqueQId() { - return q_id_.fetch_add(1); - } - - private: - std::atomic q_id_ = 0; - int64_t client_id_; - std::string service_url_; - std::shared_ptr consumer_; - // std::shared_ptr insert_delete_producer_; - std::shared_ptr search_producer_; - std::shared_ptr time_sync_producer_; - std::shared_ptr search_by_id_producer_; - std::vector> paralle_mut_producers_; - const uint32_t mut_parallelism_; -}; -} \ No newline at end of file diff --git a/proxy/src/message_client/Consumer.cpp b/proxy/src/message_client/Consumer.cpp deleted file mode 100644 index 85b52acce9..0000000000 --- a/proxy/src/message_client/Consumer.cpp +++ /dev/null @@ -1,76 +0,0 @@ - -#include "Consumer.h" -#include "grpc/message.pb.h" - -namespace milvus { -namespace message_client { - -MsgConsumer::MsgConsumer(std::shared_ptr &client, std::string subscription_name, const ConsumerConfiguration conf) - :client_(client), config_(conf), subscription_name_(subscription_name){} - -Result MsgConsumer::subscribe(const std::string &topic) { - return client_->subscribe(topic, subscription_name_, config_, consumer_); -} - -Result MsgConsumer::subscribe(const std::vector &topics) { - return client_->subscribe(topics, subscription_name_, config_, consumer_); -} - -Result MsgConsumer::unsubscribe() { - return consumer_.unsubscribe(); -} - -Result MsgConsumer::receive(Message &msg) { - return consumer_.receive(msg); -} - -Result MsgConsumer::receive(milvus::grpc::QueryResult &res) { - Message msg; - auto result = consumer_.receive(msg); - if (result == pulsar::ResultOk) { - res.ParseFromString(msg.getDataAsString()); - } - consumer_.acknowledge(msg); - return result; -} - -Result MsgConsumer::receive(milvus::grpc::Entities &res) { - Message msg; - auto result = consumer_.receive(msg); - if (result == pulsar::ResultOk) { - res.ParseFromString(msg.getDataAsString()); - } - consumer_.acknowledge(msg); - return result; -} - -Result MsgConsumer::receive(milvus::grpc::EntityIds &res) { - Message msg; - auto result = consumer_.receive(msg); - if (result == pulsar::ResultOk) { - res.ParseFromString(msg.getDataAsString()); - } - consumer_.acknowledge(msg); - return result; -} - -Result MsgConsumer::receive(milvus::grpc::Status &res) { - Message msg; - auto result = consumer_.receive(msg); - if (result == pulsar::ResultOk) { - res.ParseFromString(msg.getDataAsString()); - } - consumer_.acknowledge(msg); - return result; -} - -Result MsgConsumer::close() { - return consumer_.close(); -} - -Result MsgConsumer::acknowledge(const Message &message) { - return consumer_.acknowledge(message); -} - -} -} diff --git a/proxy/src/message_client/Consumer.h b/proxy/src/message_client/Consumer.h deleted file mode 100644 index da97ca7d02..0000000000 --- a/proxy/src/message_client/Consumer.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -#include "pulsar/Consumer.h" -#include "Client.h" -#include "grpc/message.pb.h" - -namespace milvus { -namespace message_client { - -enum ConsumerType { - INSERT = 0, - DELETE = 1, - SEARCH_RESULT = 2, -}; - -using Consumer = pulsar::Consumer; -using ConsumerConfiguration = pulsar::ConsumerConfiguration; - -class MsgConsumer{ -public: - MsgConsumer(std::shared_ptr &client, std::string consumer_name, - const pulsar::ConsumerConfiguration conf = ConsumerConfiguration()); - - Result subscribe(const std::string& topic); - Result subscribe(const std::vector& topics); - Result unsubscribe(); - Result receive(Message& msg); - Result receive(milvus::grpc::QueryResult &res); - Result receive(milvus::grpc::EntityIds &res); - Result receive(milvus::grpc::Entities &res); - Result receive(milvus::grpc::Status &res); - Result acknowledge(const Message& message); - Result close(); - - const Consumer& - consumer() const {return consumer_; } - -private: - Consumer consumer_; - std::shared_ptr client_; - ConsumerConfiguration config_; - std::string subscription_name_; -}; - -} -} \ No newline at end of file diff --git a/proxy/src/message_client/M3_hash.cpp b/proxy/src/message_client/M3_hash.cpp deleted file mode 100644 index 105e31b25d..0000000000 --- a/proxy/src/message_client/M3_hash.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#include "M3_hash.h" - -#include -#include - -#if BOOST_COMP_MSVC -#include -#define ROTATE_LEFT(x, y) _rotl(x, y) -#else -#define ROTATE_LEFT(x, y) rotate_left(x, y) -#endif - -#if BOOST_ENDIAN_LITTLE_BYTE -#define BYTESPWAP(x) (x) -#elif BOOST_ENDIAN_BIG_BYTE -#if BOOST_COMP_CLANG || BOOST_COMP_GNUC -#define BYTESPWAP(x) __builtin_bswap32(x) -#elif BOOST_COMP_MSVC -#define BYTESPWAP(x) _byteswap_uint32(x) -#else -#endif -#else -#endif - -#define MACRO_CHUNK_SIZE 4 -#define MACRO_C1 0xcc9e2d51U -#define MACRO_C2 0x1b873593U - -namespace milvus { -namespace message_client { - - - int32_t makeHash(const std::string &key) { - return static_cast(makeHash(&key.front(), key.length()) & std::numeric_limits::max()); - } - - uint32_t makeHash(const void *key, const int64_t len) { - const uint8_t *data = reinterpret_cast(key); - const int nblocks = len / MACRO_CHUNK_SIZE; -// uint32_t h1 = seed; - uint32_t h1 = 0; - const uint32_t *blocks = reinterpret_cast(data + nblocks * MACRO_CHUNK_SIZE); - - for (int i = -nblocks; i != 0; i++) { - uint32_t k1 = BYTESPWAP(blocks[i]); - - k1 = mixK1(k1); - h1 = mixH1(h1, k1); - } - - const uint8_t *tail = reinterpret_cast(data + nblocks * MACRO_CHUNK_SIZE); - uint32_t k1 = 0; - switch (len - nblocks * MACRO_CHUNK_SIZE) { - case 3: - k1 ^= static_cast(tail[2]) << 16; - case 2: - k1 ^= static_cast(tail[1]) << 8; - case 1: - k1 ^= static_cast(tail[0]); - }; - - h1 ^= mixK1(k1); - h1 ^= len; - h1 = fmix(h1); - - return h1; - } - - uint32_t fmix(uint32_t h) { - h ^= h >> 16; - h *= 0x85ebca6b; - h ^= h >> 13; - h *= 0xc2b2ae35; - h ^= h >> 16; - - return h; - } - - uint32_t mixK1(uint32_t k1) { - k1 *= MACRO_C1; - k1 = ROTATE_LEFT(k1, 15); - k1 *= MACRO_C2; - return k1; - } - - uint32_t mixH1(uint32_t h1, uint32_t k1) { - h1 ^= k1; - h1 = ROTATE_LEFT(h1, 13); - return h1 * 5 + 0xe6546b64; - } - - uint32_t rotate_left(uint32_t x, uint8_t r) { return (x << r) | (x >> ((32 - r))); } -} -} diff --git a/proxy/src/message_client/M3_hash.h b/proxy/src/message_client/M3_hash.h deleted file mode 100644 index 52fe179a87..0000000000 --- a/proxy/src/message_client/M3_hash.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include -namespace milvus { -namespace message_client { - - int32_t makeHash(const std::string& key); - uint32_t fmix(uint32_t h); - uint32_t mixK1(uint32_t k1); - uint32_t mixH1(uint32_t h1, uint32_t k1); - uint32_t rotate_left(uint32_t x, uint8_t r); - uint32_t makeHash(const void* key, const int64_t len); - -} -} diff --git a/proxy/src/message_client/PartitionPolicy.cpp b/proxy/src/message_client/PartitionPolicy.cpp deleted file mode 100644 index 1d596e4264..0000000000 --- a/proxy/src/message_client/PartitionPolicy.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "PartitionPolicy.h" -#include "M3_hash.h" -#include - -namespace milvus { -namespace message_client { - -int PartitionPolicy::getPartition(const pulsar::Message &msg, const pulsar::TopicMetadata &topicMetadata) { - return makeHash(msg.getPartitionKey()) % topicMetadata.getNumPartitions(); -} -} -} - diff --git a/proxy/src/message_client/PartitionPolicy.h b/proxy/src/message_client/PartitionPolicy.h deleted file mode 100644 index a960b63c4b..0000000000 --- a/proxy/src/message_client/PartitionPolicy.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include -#include "pulsar/MessageRoutingPolicy.h" -#include "pulsar/Message.h" -#include "pulsar/TopicMetadata.h" - -namespace milvus { -namespace message_client { -class PartitionPolicy : public pulsar::MessageRoutingPolicy { - - int getPartition(const pulsar::Message& msg, const pulsar::TopicMetadata& topicMetadata); - -}; -} -} diff --git a/proxy/src/message_client/Producer.cpp b/proxy/src/message_client/Producer.cpp deleted file mode 100644 index d49a13b2c7..0000000000 --- a/proxy/src/message_client/Producer.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include "Producer.h" -#include -#include "M3_hash.h" -#include - -namespace milvus { -namespace message_client { - - MsgProducer::MsgProducer(std::shared_ptr &client, const std::string &topic, - const ProducerConfiguration& conf) : client_(client), config_(conf) { - createProducer(topic); - } - - Result MsgProducer::createProducer(const std::string &topic) { - return client_->createProducer(topic, config_, producer_); - } - - Result MsgProducer::send(const Message &msg) { - return producer_.send(msg); - } - - void MsgProducer::sendAsync(const Message &msg, pulsar::SendCallback callback) { - return producer_.sendAsync(msg, callback); - } - - Result MsgProducer::send(const std::string &msg) { - auto pulsar_msg = pulsar::MessageBuilder().setContent(msg).build(); - return send(pulsar_msg); - } - - Result MsgProducer::send(const std::string &msg, const int64_t partitioned_key) { - auto pulsar_msg = pulsar::MessageBuilder(). - setContent(msg). - setPartitionKey(std::to_string(partitioned_key)). - build(); - return send(pulsar_msg); - } - - void MsgProducer::sendAsync(const std::string &msg, int64_t partitioned_key, pulsar::SendCallback callback) { - auto pulsar_msg = pulsar::MessageBuilder(). - setContent(msg). - setPartitionKey(std::to_string(partitioned_key)). - build(); - return sendAsync(pulsar_msg, callback); - } - - Result MsgProducer::send(milvus::grpc::InsertOrDeleteMsg &msg) { - int32_t channel_id = makeHash(std::to_string(msg.uid())) % 1024; - msg.set_channel_id(channel_id); - auto msg_str = msg.SerializeAsString(); - return send(msg_str, msg.uid()); - } - - void MsgProducer::sendAsync(milvus::grpc::InsertOrDeleteMsg &msg, pulsar::SendCallback callback) { - int32_t channel_id = makeHash(std::to_string(msg.uid())) % 1024; - msg.set_channel_id(channel_id); - auto msg_str = msg.SerializeAsString(); - return sendAsync(msg_str, msg.uid(), callback); - } - - Result MsgProducer::send(milvus::grpc::SearchMsg &msg) { - auto msg_str = msg.SerializeAsString(); - return send(msg_str, msg.uid()); - } - -// Result MsgProducer::send(const milvus::grpc::EntityIdentity &msg) { -// auto msg_str = msg.SerializeAsString(); -// return send(msg_str); -// } - - Result MsgProducer::send(milvus::grpc::TimeSyncMsg &msg) { - auto msg_str = msg.SerializeAsString(); - return send(msg_str); - } - - Result MsgProducer::close() { - return producer_.close(); - } -} -} \ No newline at end of file diff --git a/proxy/src/message_client/Producer.h b/proxy/src/message_client/Producer.h deleted file mode 100644 index 2dbad20f01..0000000000 --- a/proxy/src/message_client/Producer.h +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once - -#include "pulsar/Producer.h" -#include "Client.h" -#include "grpc/message.pb.h" - -namespace milvus { -namespace message_client { - -using Producer = pulsar::Producer; -using ProducerConfiguration = pulsar::ProducerConfiguration; - -class MsgProducer { - public: - MsgProducer(std::shared_ptr &client, const std::string &topic, - const ProducerConfiguration &conf = ProducerConfiguration()); - - Result createProducer(const std::string &topic); - Result send(const Message &msg); - void sendAsync(const Message &msg, pulsar::SendCallback callback); - Result send(const std::string &msg); - Result send(const std::string &msg, const int64_t partitioned_key); - void sendAsync(const std::string &msg, int64_t partitioned_key, pulsar::SendCallback callback); - Result send(milvus::grpc::InsertOrDeleteMsg &msg); - void sendAsync(milvus::grpc::InsertOrDeleteMsg &msg, pulsar::SendCallback callback); - Result send(milvus::grpc::SearchMsg &msg); -// Result send(milvus::grpc::EntityIdentity &msg); - Result send(milvus::grpc::TimeSyncMsg & msg); - Result close(); - - const Producer & - producer() const { return producer_; } - - private: - Producer producer_; - std::shared_ptr client_; - ProducerConfiguration config_; -}; - -} -} \ No newline at end of file diff --git a/proxy/src/meta/CMakeLists.txt b/proxy/src/meta/CMakeLists.txt deleted file mode 100644 index 30b21b9364..0000000000 --- a/proxy/src/meta/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -include_directories(${PROJECT_BINARY_DIR}/thirdparty/grpc/grpc-src/third_party/protobuf/src) -include_directories(${PROJECT_BINARY_DIR}/thirdparty/grpc/grpc-src/include) - -add_subdirectory( etcd_watcher ) -aux_source_directory( ./master master_src) -aux_source_directory(./etcd_client etcd_src) -add_library(meta - ${master_src} - ${etcd_src} - ./etcd_watcher/Watcher.cpp - ${PROJECT_SOURCE_DIR}/src/grpc/etcd.pb.cc - ${PROJECT_SOURCE_DIR}/src/grpc/etcd.grpc.pb.cc - ${PROJECT_SOURCE_DIR}/src/grpc/master.pb.cc - ${PROJECT_SOURCE_DIR}/src/grpc/master.grpc.pb.cc - ) diff --git a/proxy/src/meta/etcd_client/Etcd_client.cpp b/proxy/src/meta/etcd_client/Etcd_client.cpp deleted file mode 100644 index 320885dc35..0000000000 --- a/proxy/src/meta/etcd_client/Etcd_client.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "Etcd_client.h" -#include "grpc++/grpc++.h" - -namespace milvus{ -namespace master{ - -EtcdClient::EtcdClient(const std::string &addr) { - auto channel = grpc::CreateChannel(addr, grpc::InsecureChannelCredentials()); - stub_ = etcdserverpb::KV::NewStub(channel); -} - -Status -EtcdClient::Range(const etcdserverpb::RangeRequest& request, etcdserverpb::RangeResponse& response){ - ::grpc::ClientContext context; - auto status = stub_->Range(&context, request, &response); - if (!status.ok()){ - return Status(DB_ERROR, status.error_message()); - } - return Status::OK(); -} - -} -} \ No newline at end of file diff --git a/proxy/src/meta/etcd_client/Etcd_client.h b/proxy/src/meta/etcd_client/Etcd_client.h deleted file mode 100644 index 363884e6f4..0000000000 --- a/proxy/src/meta/etcd_client/Etcd_client.h +++ /dev/null @@ -1,18 +0,0 @@ -#include "grpc/etcd.grpc.pb.h" -#include "utils/Status.h" - -namespace milvus { -namespace master { - -class EtcdClient { - public: - explicit EtcdClient(const std::string &addr); - Status - Range(const etcdserverpb::RangeRequest& request, etcdserverpb::RangeResponse& response); - - private: - std::unique_ptr stub_; -}; - -} -} diff --git a/proxy/src/meta/etcd_watcher/CMakeLists.txt b/proxy/src/meta/etcd_watcher/CMakeLists.txt deleted file mode 100644 index ab142b1ba6..0000000000 --- a/proxy/src/meta/etcd_watcher/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -AUX_SOURCE_DIRECTORY(. watcher_src) -add_executable(test_watcher - ${watcher_src} - ${PROJECT_SOURCE_DIR}/src/grpc/etcd.pb.cc - ${PROJECT_SOURCE_DIR}/src/grpc/etcd.grpc.pb.cc - ) - -target_link_libraries( - test_watcher - PRIVATE - libprotobuf - grpc++_reflection - grpc++ -) \ No newline at end of file diff --git a/proxy/src/meta/etcd_watcher/Watcher.cpp b/proxy/src/meta/etcd_watcher/Watcher.cpp deleted file mode 100644 index eccfebf7bc..0000000000 --- a/proxy/src/meta/etcd_watcher/Watcher.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include "Watcher.h" - -#include -#include -#include "grpc/etcd.grpc.pb.h" - -namespace milvus { -namespace master { - -Watcher::Watcher(const std::string &address, - const std::string &key, - std::function callback, - bool with_prefix) { - auto channel = grpc::CreateChannel(address, grpc::InsecureChannelCredentials()); - stub_ = etcdserverpb::Watch::NewStub(channel); - - call_ = std::make_unique(key, with_prefix, stub_.get()); - work_thread_ = std::thread([&]() { - call_->WaitForResponse(callback); - }); -} - -void Watcher::Cancel() { - if (call_ == nullptr){ - return; - } - call_->CancelWatch(); -} - -Watcher::~Watcher() { - Cancel(); - work_thread_.join(); -} - -AsyncWatchAction::AsyncWatchAction(const std::string &key, bool with_prefix, etcdserverpb::Watch::Stub *stub) { - // tag `1` means to wire a rpc - stream_ = stub->AsyncWatch(&context_, &cq_, (void *) 1); - etcdserverpb::WatchRequest req; - req.mutable_create_request()->set_key(key); - if (with_prefix) { - std::string range_end(key); - int ascii = (int) range_end[range_end.length() - 1]; - range_end.back() = ascii + 1; - req.mutable_create_request()->set_range_end(range_end); - } - void *got_tag; - bool ok = false; - if (cq_.Next(&got_tag, &ok) && ok && got_tag == (void *) 1) { - // tag `2` means write watch request to stream - stream_->Write(req, (void *) 2); - } else { - throw std::runtime_error("failed to create a watch connection"); - } - - if (cq_.Next(&got_tag, &ok) && ok && got_tag == (void *) 2) { - stream_->Read(&reply_, (void *) this); - } else { - throw std::runtime_error("failed to write WatchCreateRequest to server"); - } -} - -void AsyncWatchAction::WaitForResponse(std::function callback) { - void *got_tag; - bool ok = false; - - while (cq_.Next(&got_tag, &ok)) { - if (!ok) { - break; - } - if (got_tag == (void *) 3) { - cancled_.store(true); - cq_.Shutdown(); - break; - } else if (got_tag == (void *) this) // read tag - { - if (reply_.events_size()) { - callback(reply_); - } - stream_->Read(&reply_, (void *) this); - } - } -} - -void AsyncWatchAction::CancelWatch() { - if (!cancled_.load()) { - // tag `3` mean write done - stream_->WritesDone((void *) 3); - cancled_.store(true); - } -} - -} -} \ No newline at end of file diff --git a/proxy/src/meta/etcd_watcher/Watcher.h b/proxy/src/meta/etcd_watcher/Watcher.h deleted file mode 100644 index da94d49ad5..0000000000 --- a/proxy/src/meta/etcd_watcher/Watcher.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once -#include "grpc/etcd.grpc.pb.h" -#include -#include - -namespace milvus { -namespace master { - -class AsyncWatchAction; - -class Watcher { - public: - Watcher(std::string const &address, - std::string const &key, - std::function callback, - bool with_prefix = true); - void Cancel(); - ~Watcher(); - - private: - std::unique_ptr stub_; - std::unique_ptr call_; - std::thread work_thread_; -}; - -class AsyncWatchAction { - public: - AsyncWatchAction(const std::string &key, bool with_prefix, etcdserverpb::Watch::Stub* stub); - void WaitForResponse(std::function callback); - void CancelWatch(); - private: - // Status status; - ::grpc::ClientContext context_; - ::grpc::CompletionQueue cq_; - etcdserverpb::WatchResponse reply_; - std::unique_ptr<::grpc::ClientAsyncReaderWriter> stream_; - std::atomic cancled_ = false; -}; -} -} \ No newline at end of file diff --git a/proxy/src/meta/etcd_watcher/test_watcher.cpp b/proxy/src/meta/etcd_watcher/test_watcher.cpp deleted file mode 100644 index edb80c39cc..0000000000 --- a/proxy/src/meta/etcd_watcher/test_watcher.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// Steps to test this file: -// 1. start a etcdv3 server -// 2. run this test -// 3. modify test key using etcdctlv3 or etcd-clientv3(Must using v3 api) -// TODO: move this test to unittest - -#include "Watcher.h" - -using namespace milvus::master; -int main() { - try { - Watcher watcher("127.0.0.1:2379", "SomeKey", [](etcdserverpb::WatchResponse res) { - std::cerr << "Key1 changed!" << std::endl; - std::cout << "Event size: " << res.events_size() << std::endl; - for (auto &event: res.events()) { - std::cout << - event.kv().key() << ":" << - event.kv().value() << std::endl; - } - }, false); - while (true) { - std::this_thread::sleep_for(std::chrono::milliseconds(60000)); - watcher.Cancel(); - break; - } - } - catch (const std::exception &e) { - std::cout << e.what(); - } - -} diff --git a/proxy/src/meta/master/GrpcClient.cpp b/proxy/src/meta/master/GrpcClient.cpp deleted file mode 100644 index 5a000e6df3..0000000000 --- a/proxy/src/meta/master/GrpcClient.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "GrpcClient.h" -#include "grpc++/grpc++.h" - -using grpc::ClientContext; - -namespace milvus { -namespace master { -GrpcClient::GrpcClient(const std::string &addr) { - auto channel = ::grpc::CreateChannel(addr, ::grpc::InsecureChannelCredentials()); - stub_ = masterpb::Master::NewStub(channel); -} - -GrpcClient::GrpcClient(std::shared_ptr<::grpc::Channel> &channel) - : stub_(masterpb::Master::NewStub(channel)) { -} - -Status GrpcClient::CreateCollection(const milvus::grpc::Mapping &mapping) { - ClientContext context; - ::milvus::grpc::Status response; - ::grpc::Status grpc_status = stub_->CreateCollection(&context, mapping, &response); - - if (!grpc_status.ok()) { - std::cerr << "CreateHybridCollection gRPC failed!" << grpc_status.error_message() << std::endl; - return Status(grpc_status.error_code(), "CreateHybridCollection gRPC failed!" + grpc_status.error_message()); - } - - if (response.error_code() != grpc::SUCCESS) { - // TODO: LOG - return Status(response.error_code(), response.reason()); - } - return Status::OK(); -} - -Status GrpcClient::CreateIndex(const milvus::grpc::IndexParam& request) { - ClientContext context; - ::milvus::grpc::Status response; - ::grpc::Status grpc_status = stub_->CreateIndex(&context, request, &response); - - if (!grpc_status.ok()) { - std::cerr << "CreateIndex gRPC failed!" << grpc_status.error_message() << std::endl; - return Status(grpc_status.error_code(), "CreateIndex gRPC failed!" + grpc_status.error_message()); - } - - if (response.error_code() != grpc::SUCCESS) { - // TODO: LOG - return Status(response.error_code(), response.reason()); - } - return Status::OK(); -} - -} -} \ No newline at end of file diff --git a/proxy/src/meta/master/GrpcClient.h b/proxy/src/meta/master/GrpcClient.h deleted file mode 100644 index bba67b9168..0000000000 --- a/proxy/src/meta/master/GrpcClient.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once -#include "grpc/master.grpc.pb.h" -#include "grpc/message.pb.h" -#include "grpc++/grpc++.h" -#include "utils/Status.h" - -namespace milvus { -namespace master { -class GrpcClient { - public: - explicit GrpcClient(const std::string& addr); - explicit GrpcClient(std::shared_ptr<::grpc::Channel>& channel); - ~GrpcClient() = default; - - public: - Status - CreateCollection(const milvus::grpc::Mapping& mapping); - - Status - CreateIndex(const milvus::grpc::IndexParam& request); - - private: - std::unique_ptr stub_; - -}; - - -} -} - diff --git a/proxy/src/query/BinaryQuery.cpp b/proxy/src/query/BinaryQuery.cpp deleted file mode 100644 index 4fdd714847..0000000000 --- a/proxy/src/query/BinaryQuery.cpp +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include -#include -#include -#include -#include -#include - -#include "query/BinaryQuery.h" - -namespace milvus { -namespace query { - -BinaryQueryPtr -ConstructBinTree(std::vector queries, QueryRelation relation, uint64_t idx) { - if (idx == queries.size()) { - return nullptr; - } else if (idx == queries.size() - 1) { - return queries[idx]->getBinaryQuery(); - } else { - BinaryQueryPtr bquery = std::make_shared(); - bquery->relation = relation; - bquery->left_query = std::make_shared(); - bquery->right_query = std::make_shared(); - bquery->left_query->bin = queries[idx]->getBinaryQuery(); - ++idx; - bquery->right_query->bin = ConstructBinTree(queries, relation, idx); - return bquery; - } -} - -Status -ConstructLeafBinTree(std::vector leaf_queries, BinaryQueryPtr binary_query, uint64_t idx) { - if (idx == leaf_queries.size()) { - return Status::OK(); - } - binary_query->left_query = std::make_shared(); - binary_query->right_query = std::make_shared(); - if (leaf_queries.size() == leaf_queries.size() - 1) { - binary_query->left_query->leaf = leaf_queries[idx]; - return Status::OK(); - } else if (idx == leaf_queries.size() - 2) { - binary_query->left_query->leaf = leaf_queries[idx]; - ++idx; - binary_query->right_query->leaf = leaf_queries[idx]; - return Status::OK(); - } else { - binary_query->left_query->bin->relation = binary_query->relation; - binary_query->right_query->leaf = leaf_queries[idx]; - ++idx; - return ConstructLeafBinTree(leaf_queries, binary_query->left_query->bin, idx); - } -} - -Status -GenBinaryQuery(BooleanQueryPtr query, BinaryQueryPtr& binary_query) { - if (query->getBooleanQueries().size() == 0) { - if (binary_query->relation == QueryRelation::AND || binary_query->relation == QueryRelation::OR) { - // Put VectorQuery to the end of leaf queries - auto query_size = query->getLeafQueries().size(); - for (uint64_t i = 0; i < query_size; ++i) { - if (query->getLeafQueries()[i]->vector_placeholder.size() > 0) { - std::swap(query->getLeafQueries()[i], query->getLeafQueries()[0]); - break; - } - } - return ConstructLeafBinTree(query->getLeafQueries(), binary_query, 0); - } else { - switch (query->getOccur()) { - case Occur::MUST: { - binary_query->relation = QueryRelation::AND; - return GenBinaryQuery(query, binary_query); - } - case Occur::MUST_NOT: - case Occur::SHOULD: { - binary_query->relation = QueryRelation::OR; - return GenBinaryQuery(query, binary_query); - } - default: - return Status::OK(); - } - } - } - - if (query->getBooleanQueries().size() == 1) { - auto bc = query->getBooleanQueries()[0]; - binary_query->left_query = std::make_shared(); - switch (bc->getOccur()) { - case Occur::MUST: { - binary_query->relation = QueryRelation::AND; - return GenBinaryQuery(bc, binary_query); - } - case Occur::MUST_NOT: - case Occur::SHOULD: { - binary_query->relation = QueryRelation::OR; - return GenBinaryQuery(bc, binary_query); - } - default: - return Status::OK(); - } - } - - // Construct binary query for every single boolean query - std::vector must_queries; - std::vector must_not_queries; - std::vector should_queries; - Status status; - for (auto& _query : query->getBooleanQueries()) { - status = GenBinaryQuery(_query, _query->getBinaryQuery()); - if (!status.ok()) { - return status; - } - if (_query->getOccur() == Occur::MUST) { - must_queries.emplace_back(_query); - } else if (_query->getOccur() == Occur::MUST_NOT) { - must_not_queries.emplace_back(_query); - } else { - should_queries.emplace_back(_query); - } - } - - // Construct binary query for combine boolean queries - BinaryQueryPtr must_bquery, should_bquery, must_not_bquery; - uint64_t bquery_num = 0; - if (must_queries.size() > 1) { - // Construct a must binary tree - must_bquery = ConstructBinTree(must_queries, QueryRelation::R1, 0); - ++bquery_num; - } else if (must_queries.size() == 1) { - must_bquery = must_queries[0]->getBinaryQuery(); - ++bquery_num; - } - - if (should_queries.size() > 1) { - // Construct a should binary tree - should_bquery = ConstructBinTree(should_queries, QueryRelation::R2, 0); - ++bquery_num; - } else if (should_queries.size() == 1) { - should_bquery = should_queries[0]->getBinaryQuery(); - ++bquery_num; - } - - if (must_not_queries.size() > 1) { - // Construct a must_not binary tree - must_not_bquery = ConstructBinTree(must_not_queries, QueryRelation::R1, 0); - ++bquery_num; - } else if (must_not_queries.size() == 1) { - must_not_bquery = must_not_queries[0]->getBinaryQuery(); - ++bquery_num; - } - - binary_query->left_query = std::make_shared(); - binary_query->right_query = std::make_shared(); - BinaryQueryPtr must_should_query = std::make_shared(); - must_should_query->left_query = std::make_shared(); - must_should_query->right_query = std::make_shared(); - if (bquery_num == 3) { - must_should_query->relation = QueryRelation::R3; - must_should_query->left_query->bin = must_bquery; - must_should_query->right_query->bin = should_bquery; - binary_query->relation = QueryRelation::R1; - binary_query->left_query->bin = must_should_query; - binary_query->right_query->bin = must_not_bquery; - } else if (bquery_num == 2) { - if (must_bquery == nullptr) { - binary_query->relation = QueryRelation::R3; - binary_query->left_query->bin = must_not_bquery; - binary_query->right_query->bin = should_bquery; - } else if (should_bquery == nullptr) { - binary_query->relation = QueryRelation::R4; - binary_query->left_query->bin = must_bquery; - binary_query->right_query->bin = must_not_bquery; - } else { - binary_query->relation = QueryRelation::R3; - binary_query->left_query->bin = must_bquery; - binary_query->right_query->bin = should_bquery; - } - } else { - if (must_bquery != nullptr) { - binary_query = must_bquery; - } else if (should_bquery != nullptr) { - binary_query = should_bquery; - } else { - binary_query = must_not_bquery; - } - } - - return Status::OK(); -} - -uint64_t -BinaryQueryHeight(BinaryQueryPtr& binary_query) { - if (binary_query == nullptr) { - return 1; - } - uint64_t left_height = 0, right_height = 0; - if (binary_query->left_query != nullptr) { - left_height = BinaryQueryHeight(binary_query->left_query->bin); - } - if (binary_query->right_query != nullptr) { - right_height = BinaryQueryHeight(binary_query->right_query->bin); - } - return left_height > right_height ? left_height + 1 : right_height + 1; -} - -/** - * rules: - * 1. The child node of 'should' and 'must_not' can only be 'term query' and 'range query'. - * 2. One layer cannot include bool query and leaf query. - * 3. The direct child node of 'bool' node cannot be 'should' node or 'must_not' node. - * 4. All filters are pre-filtered(Do structure query first, then use the result to do filtering for vector query). - * - */ - -Status -rule_1(BooleanQueryPtr& boolean_query, std::stack& path_stack) { - auto status = Status::OK(); - if (boolean_query != nullptr) { - path_stack.push(boolean_query); - for (const auto& leaf_query : boolean_query->getLeafQueries()) { - if (!leaf_query->vector_placeholder.empty()) { - while (!path_stack.empty()) { - auto query = path_stack.top(); - if (query->getOccur() == Occur::SHOULD || query->getOccur() == Occur::MUST_NOT) { - std::string msg = - "The child node of 'should' and 'must_not' can only be 'term query' and 'range query'."; - return Status{SERVER_INVALID_DSL_PARAMETER, msg}; - } - path_stack.pop(); - } - } - } - for (auto query : boolean_query->getBooleanQueries()) { - status = rule_1(query, path_stack); - if (!status.ok()) { - return status; - } - } - } - return status; -} - -Status -rule_2(BooleanQueryPtr& boolean_query) { - auto status = Status::OK(); - if (boolean_query != nullptr) { - if (!boolean_query->getBooleanQueries().empty() && !boolean_query->getLeafQueries().empty()) { - std::string msg = "One layer cannot include bool query and leaf query."; - return Status{SERVER_INVALID_DSL_PARAMETER, msg}; - } else { - for (auto query : boolean_query->getBooleanQueries()) { - status = rule_2(query); - if (!status.ok()) { - return status; - } - } - } - } - return status; -} - -Status -ValidateBooleanQuery(BooleanQueryPtr& boolean_query) { - auto status = Status::OK(); - if (boolean_query != nullptr) { - for (auto& query : boolean_query->getBooleanQueries()) { - if (query->getOccur() == Occur::SHOULD || query->getOccur() == Occur::MUST_NOT) { - std::string msg = "The direct child node of 'bool' node cannot be 'should' node or 'must_not' node."; - return Status{SERVER_INVALID_DSL_PARAMETER, msg}; - } - } - std::stack path_stack; - status = rule_1(boolean_query, path_stack); - if (!status.ok()) { - return status; - } - status = rule_2(boolean_query); - if (!status.ok()) { - return status; - } - } - return status; -} - -bool -ValidateBinaryQuery(BinaryQueryPtr& binary_query) { - uint64_t height = BinaryQueryHeight(binary_query); - return height > 1; -} - -} // namespace query -} // namespace milvus diff --git a/proxy/src/query/BinaryQuery.h b/proxy/src/query/BinaryQuery.h deleted file mode 100644 index 5912892847..0000000000 --- a/proxy/src/query/BinaryQuery.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include - -#include "BooleanQuery.h" - -namespace milvus { -namespace query { - -BinaryQueryPtr -ConstructBinTree(std::vector clauses, QueryRelation relation, uint64_t idx); - -Status -ConstructLeafBinTree(std::vector leaf_clauses, BinaryQueryPtr binary_query, uint64_t idx); - -Status -GenBinaryQuery(BooleanQueryPtr clause, BinaryQueryPtr& binary_query); - -uint64_t -BinaryQueryHeight(BinaryQueryPtr& binary_query); - -Status -ValidateBooleanQuery(BooleanQueryPtr& boolean_query); - -bool -ValidateBinaryQuery(BinaryQueryPtr& binary_query); - -} // namespace query -} // namespace milvus diff --git a/proxy/src/query/BooleanQuery.h b/proxy/src/query/BooleanQuery.h deleted file mode 100644 index 7b743c7a37..0000000000 --- a/proxy/src/query/BooleanQuery.h +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include - -#include "GeneralQuery.h" -#include "utils/Status.h" - -namespace milvus { -namespace query { - -enum class Occur { - INVALID = 0, - MUST, - MUST_NOT, - SHOULD, -}; - -class BooleanQuery { - public: - BooleanQuery() { - } - - explicit BooleanQuery(Occur occur) : occur_(occur) { - } - - Occur - getOccur() { - return occur_; - } - - void - SetOccur(Occur occur) { - occur_ = occur; - } - - void - AddBooleanQuery(std::shared_ptr boolean_clause) { - boolean_clauses_.emplace_back(boolean_clause); - } - - void - AddLeafQuery(LeafQueryPtr leaf_query) { - leaf_queries_.emplace_back(leaf_query); - } - - void - SetLeafQuery(std::vector leaf_queries) { - leaf_queries_ = leaf_queries; - } - - std::vector> - getBooleanQueries() { - return boolean_clauses_; - } - - BinaryQueryPtr& - getBinaryQuery() { - return binary_query_; - } - - std::vector& - getLeafQueries() { - return leaf_queries_; - } - - private: - Occur occur_ = Occur::INVALID; - std::vector> boolean_clauses_; - std::vector leaf_queries_; - BinaryQueryPtr binary_query_ = std::make_shared(); -}; -using BooleanQueryPtr = std::shared_ptr; - -} // namespace query -} // namespace milvus diff --git a/proxy/src/query/CMakeLists.txt b/proxy/src/query/CMakeLists.txt deleted file mode 100644 index 1f40826b34..0000000000 --- a/proxy/src/query/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. -#------------------------------------------------------------------------------- -aux_source_directory( ${MILVUS_ENGINE_SRC}/query QUERY_FILES ) - -add_library( query STATIC ) -target_sources( query PRIVATE ${QUERY_FILES} ) -target_include_directories( query PUBLIC ${MILVUS_ENGINE_SRC}/query ) diff --git a/proxy/src/query/GeneralQuery.h b/proxy/src/query/GeneralQuery.h deleted file mode 100644 index eae08a2e14..0000000000 --- a/proxy/src/query/GeneralQuery.h +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include -#include - -#include "db/Types.h" -#include "utils/Json.h" - -namespace milvus { -namespace query { - -enum class CompareOperator { - LT = 0, - LTE, - EQ, - GT, - GTE, - NE, -}; - -enum class QueryRelation { - INVALID = 0, - R1, - R2, - R3, - R4, - AND, - OR, -}; - -struct QueryColumn { - std::string name; - std::string column_value; -}; - -struct TermQuery { - milvus::json json_obj; - // std::string field_name; - // std::vector field_value; - // float boost; -}; -using TermQueryPtr = std::shared_ptr; - -struct CompareExpr { - CompareOperator compare_operator; - std::string operand; -}; - -struct RangeQuery { - milvus::json json_obj; - // std::string field_name; - // std::vector compare_expr; - // float boost; -}; -using RangeQueryPtr = std::shared_ptr; - -struct VectorRecord { - std::vector float_data; - std::vector binary_data; -}; - -struct VectorQuery { - std::string field_name; - milvus::json extra_params = {}; - int64_t topk; - int64_t nq; - std::string metric_type = ""; - float boost; - VectorRecord query_vector; -}; -using VectorQueryPtr = std::shared_ptr; - -struct LeafQuery; -using LeafQueryPtr = std::shared_ptr; - -struct BinaryQuery; -using BinaryQueryPtr = std::shared_ptr; - -struct GeneralQuery { - LeafQueryPtr leaf; - BinaryQueryPtr bin = std::make_shared(); -}; -using GeneralQueryPtr = std::shared_ptr; - -struct LeafQuery { - TermQueryPtr term_query; - RangeQueryPtr range_query; - std::string vector_placeholder; - float query_boost; -}; - -struct BinaryQuery { - GeneralQueryPtr left_query; - GeneralQueryPtr right_query; - QueryRelation relation; - float query_boost; -}; - -struct Query { - GeneralQueryPtr root; - std::unordered_map vectors; - - std::string collection_id; - std::vector partitions; - std::vector field_names; - std::set index_fields; - std::unordered_map metric_types; -}; -using QueryPtr = std::shared_ptr; - -} // namespace query -} // namespace milvus diff --git a/proxy/src/server/CMakeLists.txt b/proxy/src/server/CMakeLists.txt deleted file mode 100644 index 386e251e18..0000000000 --- a/proxy/src/server/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. -#------------------------------------------------------------------------------- - -set( GRPC_SERVICE_FILES ${MILVUS_ENGINE_SRC}/grpc/message.grpc.pb.cc - ${MILVUS_ENGINE_SRC}/grpc/message.pb.cc - ) - -aux_source_directory( ${MILVUS_ENGINE_SRC}/server SERVER_SERVICE_FILES ) -aux_source_directory( ${MILVUS_ENGINE_SRC}/server/init SERVER_INIT_FILES ) -aux_source_directory( ${MILVUS_ENGINE_SRC}/server/delivery/request DELIVERY_REQUEST_FILES ) -aux_source_directory( ${MILVUS_ENGINE_SRC}/server/delivery/strategy DELIVERY_STRATEGY_FILES ) -aux_source_directory( ${MILVUS_ENGINE_SRC}/server/delivery DELIVERY_FILES ) -aux_source_directory( ${MILVUS_ENGINE_SRC}/server/timesync TIME_SYNC_FILES ) -aux_source_directory( ${MILVUS_ENGINE_SRC}/server/tso TSO_FILES) - -set( SERVER_FILES ${SERVER_INIT_FILES} - ${SERVER_SERVICE_FILES} - ${SERVER_INIT_FILES} - ${DELIVERY_REQUEST_FILES} - ${DELIVERY_STRATEGY_FILES} - ${DELIVERY_FILES} - ${TIME_SYNC_FILES} - ${TSO_FILES} - ) - -aux_source_directory( ${MILVUS_ENGINE_SRC}/server/grpc_impl GRPC_IMPL_FILES ) -aux_source_directory( ${MILVUS_ENGINE_SRC}/server/grpc_impl/interceptor GRPC_INTERCEPTOR_FILES ) - -set( GRPC_SERVER_FILES ${GRPC_IMPL_FILES} - ${GRPC_INTERCEPTOR_FILES} - ) - - -aux_source_directory( ${MILVUS_ENGINE_SRC}/server/context SERVER_CONTEXT_FILES ) - -add_library( server STATIC) -target_sources( server - PRIVATE ${GRPC_SERVER_FILES} - ${GRPC_SERVICE_FILES} - ${SERVER_FILES} - ${SERVER_CONTEXT_FILES} - ) diff --git a/proxy/src/server/MessageWrapper.cpp b/proxy/src/server/MessageWrapper.cpp deleted file mode 100644 index 511903dda3..0000000000 --- a/proxy/src/server/MessageWrapper.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "server/delivery/ReqScheduler.h" -#include "MessageWrapper.h" -#include "config/ServerConfig.h" - -namespace milvus { -namespace server { - -MessageWrapper &MessageWrapper::GetInstance() { - static MessageWrapper wrapper; - return wrapper; -} - -Status MessageWrapper::Init() { - std::string pulsar_server_addr - (std::string{"pulsar://"} + config.pulsar.address() + ":" + std::to_string(config.pulsar.port())); - int client_id = config.proxy_id(); - msg_client_ = std::make_shared(client_id, pulsar_server_addr, config.pulsar.topicnum()); - auto status = msg_client_->Init("InsertOrDelete", "Search", "TimeSync", "SearchById", "SearchResult"); - if (!status.ok()){ - return status; - } - - // timeSync - time_sync_ = std::make_shared(client_id, GetMessageTimeSyncTime, config.timesync.interval(), pulsar_server_addr, "TimeSync"); - return status; -} -const std::shared_ptr &MessageWrapper::MessageClient() { - return msg_client_; -} - -void MessageWrapper::Stop() { - if (time_sync_ != nullptr){ - time_sync_->Stop(); - time_sync_= nullptr; - } - msg_client_ = nullptr; -} - -} -} \ No newline at end of file diff --git a/proxy/src/server/MessageWrapper.h b/proxy/src/server/MessageWrapper.h deleted file mode 100644 index 94ece631d7..0000000000 --- a/proxy/src/server/MessageWrapper.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once -#include "message_client/ClientV2.h" -#include "timesync/TimeSync.h" - -namespace milvus { -namespace server { - -class MessageWrapper { - - public: - static MessageWrapper& GetInstance(); - - Status Init(); - - const std::shared_ptr& - MessageClient(); - - void Stop(); - - private: - MessageWrapper() = default; - - private: - std::shared_ptr msg_client_; - std::shared_ptr time_sync_; -}; - -} -} \ No newline at end of file diff --git a/proxy/src/server/MetaWrapper.cpp b/proxy/src/server/MetaWrapper.cpp deleted file mode 100644 index da71af0a35..0000000000 --- a/proxy/src/server/MetaWrapper.cpp +++ /dev/null @@ -1,195 +0,0 @@ -#include "MetaWrapper.h" -#include "config/ServerConfig.h" -#include "nlohmann/json.hpp" -#include -#include -#include - -using Collection = masterpb::Collection; -using Schema = milvus::grpc::Schema; -using SegmentInfo = masterpb::Segment; -using JSON = nlohmann::json; - -namespace milvus { -namespace server { - -namespace { -Status ParseSegmentInfo(const std::string &json_str, SegmentInfo &segment_info) { - try { - auto json = JSON::parse(json_str); - segment_info.set_segment_id(json["segment_id"].get()); - segment_info.set_partition_tag(json["partition_tag"].get()); - segment_info.set_channel_start(json["channel_start"].get()); - segment_info.set_channel_end(json["channel_end"].get()); - segment_info.set_open_timestamp(json["open_timestamp"].get()); - segment_info.set_close_timestamp(json["close_timestamp"].get()); - segment_info.set_collection_id(json["collection_id"].get()); - segment_info.set_collection_name(json["collection_name"].get()); - segment_info.set_rows(json["rows"].get()); - return Status::OK(); - } - catch (const std::exception &e) { - return Status(DB_ERROR, e.what()); - } -} - -void ParseCollectionSchema(const std::string &json_str, Collection &collection) { - auto json = JSON::parse(json_str); - auto proto_str = json["grpc_marshal_string"].get(); - auto suc = google::protobuf::TextFormat::ParseFromString(proto_str, &collection); - if (!suc) { - std::cerr << "unmarshal failed" << std::endl; - } -} -} - -bool MetaWrapper::IsCollectionMetaKey(const std::string &key) { - return key.rfind(collection_path_, 0) == 0; -} - -bool MetaWrapper::IsSegmentMetaKey(const std::string &key) { - return key.rfind(segment_path_, 0) == 0; -} - -MetaWrapper &MetaWrapper::GetInstance() { - static MetaWrapper wrapper; - return wrapper; -} - -Status MetaWrapper::Init() { - try { - etcd_root_path_ = config.etcd.rootpath() + "/"; - segment_path_ = (boost::filesystem::path(etcd_root_path_) / "segment/").string(); - collection_path_ = (boost::filesystem::path(etcd_root_path_) / "collection/").string(); - - auto master_addr = config.master.address() + ":" + std::to_string(config.master.port()); - master_client_ = std::make_shared(master_addr); - - auto etcd_addr = config.etcd.address() + ":" + std::to_string(config.etcd.port()); - etcd_client_ = std::make_shared(etcd_addr); - - // init etcd watcher - auto f = [&](const etcdserverpb::WatchResponse &res) { - UpdateMeta(res); - }; - watcher_ = std::make_shared(etcd_addr, segment_path_, f, true); - return SyncMeta(); - } - catch (const std::exception &e) { - return Status(DB_ERROR, "Can not connect to meta server"); - } -} - -std::shared_ptr MetaWrapper::MetaClient() { - return master_client_; -} - -void MetaWrapper::UpdateMeta(const etcdserverpb::WatchResponse &res) { - for (auto &event: res.events()) { - auto &event_key = event.kv().key(); - auto &event_value = event.kv().value(); - - if (event.type() == etcdserverpb::Event_EventType::Event_EventType_PUT) { - if (event_key.rfind(segment_path_, 0) == 0) { - // segment info - SegmentInfo segment_info; - auto status = ParseSegmentInfo(event_value, segment_info); - if (status.ok()) { - std::unique_lock lock(mutex_); - segment_infos_[segment_info.segment_id()] = segment_info; - lock.unlock(); - } else { - return; - } - } else { - // table scheme - Collection collection; - ParseCollectionSchema(event_value, collection); - std::unique_lock lock(mutex_); - schemas_[collection.name()] = collection; - lock.unlock(); - } - } - // TODO: Delete event type - } -} - -uint64_t MetaWrapper::AskSegmentId(const std::string &collection_name, uint64_t channel_id, uint64_t timestamp) { - // TODO: may using some multi index data structure to speed up search - // index timestamp: no-unique, seems close timestamp is enough - // index collection_name: no-unique - // index channel_id: must satisfy channel_start <= channel_id < channel_end - std::shared_lock lock(mutex_); - for (auto &item: segment_infos_) { - auto &segment_info = item.second; - uint64_t open_ts = segment_info.open_timestamp(); - uint64_t close_ts = segment_info.close_timestamp(); - if (channel_id >= segment_info.channel_start() && channel_id < segment_info.channel_end() - && timestamp >= (open_ts << 18) && timestamp < (close_ts << 18) - && std::string(segment_info.collection_name()) == collection_name) { - return segment_info.segment_id(); - } - } - throw std::runtime_error("Can't find eligible segment"); -} - -const Schema &MetaWrapper::AskCollectionSchema(const std::string &collection_name) { - std::shared_lock lock(mutex_); - if (schemas_.find(collection_name) != schemas_.end()) { - return schemas_[collection_name].schema(); - } - throw std::runtime_error("Collection " + collection_name + " not existed"); -} - -Status MetaWrapper::SyncMeta() { - ::etcdserverpb::RangeRequest request; - request.set_key(etcd_root_path_); - std::string range_end(etcd_root_path_); - int ascii = (int) range_end[range_end.length() - 1]; - range_end.back() = ascii + 1; - request.set_range_end(range_end); - - ::etcdserverpb::RangeResponse response; - auto status = etcd_client_->Range(request, response); - if (status.ok()) { - for (auto &kv : response.kvs()) { - if (IsCollectionMetaKey(kv.key())) { - Collection collection; - ParseCollectionSchema(kv.value(), collection); - std::unique_lock lock(mutex_); - schemas_[collection.name()] = collection; - lock.unlock(); - } else { - assert(IsSegmentMetaKey(kv.key())); - SegmentInfo segment_info; - status = ParseSegmentInfo(kv.value(), segment_info); - if (status.ok()) { - std::unique_lock lock(mutex_); - segment_infos_[segment_info.segment_id()] = segment_info; - lock.unlock(); - } else { - return status; - } - } - } - } - return status; -} - -int64_t MetaWrapper::CountCollection(const std::string &collection_name) { - uint64_t count = 0; - // TODO: index to speed up - for (const auto &segment_info : segment_infos_) { - if (segment_info.second.collection_name() == collection_name) { - count += segment_info.second.rows(); - } - } - return count; -} - -void MetaWrapper::Stop() { - watcher_->Cancel(); -} - -} -} \ No newline at end of file diff --git a/proxy/src/server/MetaWrapper.h b/proxy/src/server/MetaWrapper.h deleted file mode 100644 index 3284b737a0..0000000000 --- a/proxy/src/server/MetaWrapper.h +++ /dev/null @@ -1,61 +0,0 @@ -#include "utils/Status.h" -#include "meta/master/GrpcClient.h" -#include "grpc/message.pb.h" -#include "grpc/master.pb.h" -#include "meta/etcd_watcher/Watcher.h" -#include "meta/etcd_client/Etcd_client.h" -#include "config/ServerConfig.h" - -#include - -namespace milvus { -namespace server { - -class MetaWrapper { - public: - static MetaWrapper & - GetInstance(); - - Status - Init(); - - std::shared_ptr - MetaClient(); - - uint64_t - AskSegmentId(const std::string &collection_name, uint64_t channel_id, uint64_t timestamp); - - const milvus::grpc::Schema & - AskCollectionSchema(const std::string &collection_name); - - Status - SyncMeta(); - - int64_t - CountCollection(const std::string& collection_name); - - void - Stop(); - - private: - bool IsCollectionMetaKey(const std::string &key); - - bool IsSegmentMetaKey(const std::string &key); - - void UpdateMeta(const etcdserverpb::WatchResponse &res); - - private: - std::shared_ptr master_client_; - std::shared_ptr etcd_client_; - std::unordered_map schemas_; - std::unordered_map segment_infos_; - std::shared_ptr watcher_; - std::shared_mutex mutex_; - - std::string etcd_root_path_; - std::string segment_path_; - std::string collection_path_; -}; - -} -} diff --git a/proxy/src/server/Server.cpp b/proxy/src/server/Server.cpp deleted file mode 100644 index 74c9a78a54..0000000000 --- a/proxy/src/server/Server.cpp +++ /dev/null @@ -1,310 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/Server.h" -#include "server/init/InstanceLockCheck.h" - -#include -#include -#include -#include -#include - -#include "config/ServerConfig.h" -#include "tracing/TracerUtil.h" -#include "log/LogMgr.h" -// #include "scheduler/SchedInst.h" -#include "server/grpc_impl/GrpcServer.h" -#include "server/init/CpuChecker.h" -#include "server/init/Directory.h" -// #include "server/init/GpuChecker.h" -#include "server/init/StorageChecker.h" -#include "src/version.h" -#include -#include -#include -#include "message_client/ClientV2.h" -#include "utils/Log.h" -#include "utils/SignalHandler.h" -#include "utils/TimeRecorder.h" -#include "MessageWrapper.h" -#include "MetaWrapper.h" - -namespace milvus { -namespace server { - -Server& -Server::GetInstance() { - static Server server; - return server; -} - -void -Server::Init(int64_t daemonized, const std::string& pid_filename, const std::string& config_filename) { - daemonized_ = daemonized; - pid_filename_ = pid_filename; - config_filename_ = config_filename; -} - -void -Server::Daemonize() { - if (daemonized_ == 0) { - return; - } - - std::cout << "Milvus server run in daemonize mode"; - - pid_t pid = 0; - - // Fork off the parent process - pid = fork(); - - // An error occurred - if (pid < 0) { - exit(EXIT_FAILURE); - } - - // Success: terminate parent - if (pid > 0) { - exit(EXIT_SUCCESS); - } - - // On success: The child process becomes session leader - if (setsid() < 0) { - exit(EXIT_FAILURE); - } - - // Ignore signal sent from child to parent process - signal(SIGCHLD, SIG_IGN); - - // Fork off for the second time - pid = fork(); - - // An error occurred - if (pid < 0) { - exit(EXIT_FAILURE); - } - - // Terminate the parent - if (pid > 0) { - exit(EXIT_SUCCESS); - } - - // Set new file permissions - umask(0); - - // Change the working directory to root - int ret = chdir("/"); - if (ret != 0) { - return; - } - - // Close all open fd - for (int64_t fd = sysconf(_SC_OPEN_MAX); fd > 0; fd--) { - close(fd); - } - - std::cout << "Redirect stdin/stdout/stderr to /dev/null"; - - // Redirect stdin/stdout/stderr to /dev/null - stdin = fopen("/dev/null", "r"); - stdout = fopen("/dev/null", "w+"); - stderr = fopen("/dev/null", "w+"); - // Try to write PID of daemon to lockfile - if (!pid_filename_.empty()) { - pid_fd_ = open(pid_filename_.c_str(), O_RDWR | O_CREAT, 0640); - if (pid_fd_ < 0) { - std::cerr << "Can't open filename: " + pid_filename_ + ", Error: " + strerror(errno); - exit(EXIT_FAILURE); - } - if (lockf(pid_fd_, F_TLOCK, 0) < 0) { - std::cerr << "Can't lock filename: " + pid_filename_ + ", Error: " + strerror(errno); - exit(EXIT_FAILURE); - } - - std::string pid_file_context = std::to_string(getpid()); - ssize_t res = write(pid_fd_, pid_file_context.c_str(), pid_file_context.size()); - if (res != 0) { - return; - } - } -} - -Status -Server::Start() { - if (daemonized_ != 0) { - Daemonize(); - } - - try { - /* Init opentracing tracer from config */ - std::string tracing_config_path = config.tracing.json_config_path(); - tracing_config_path.empty() ? tracing::TracerUtil::InitGlobal() - : tracing::TracerUtil::InitGlobal(tracing_config_path); - - auto time_zone = config.timezone(); - - if (time_zone.length() == 3) { - time_zone = "CUT"; - } else { - int time_bias = std::stoi(time_zone.substr(3, std::string::npos)); - if (time_bias == 0) { - time_zone = "CUT"; - } else if (time_bias > 0) { - time_zone = "CUT" + std::to_string(-time_bias); - } else { - time_zone = "CUT+" + std::to_string(-time_bias); - } - } - - if (setenv("TZ", time_zone.c_str(), 1) != 0) { - return Status(SERVER_UNEXPECTED_ERROR, "Fail to setenv"); - } - tzset(); - - /* log path is defined in Config file, so InitLog must be called after LoadConfig */ - STATUS_CHECK(LogMgr::InitLog(config.logs.trace.enable(), config.logs.level(), config.logs.path(), - config.logs.max_log_file_size(), config.logs.log_rotate_num())); - - STATUS_CHECK(Directory::Initialize(config.logs.path())); - - // print version information - LOG_SERVER_INFO_ << "Milvus " << BUILD_TYPE << " version: v" << MILVUS_VERSION << ", built at " << BUILD_TIME; -#ifdef MILVUS_GPU_VERSION - LOG_SERVER_INFO_ << "GPU edition"; -#else - LOG_SERVER_INFO_ << "CPU edition"; -#endif - STATUS_CHECK(StorageChecker::CheckStoragePermission()); - STATUS_CHECK(CpuChecker::CheckCpuInstructionSet()); - - /* record config and hardware information into log */ - LogConfigInFile(config_filename_); - LogCpuInfo(); - LOG_SERVER_INFO_ << "\n\n" - << std::string(15, '*') << "Config in memory" << std::string(15, '*') << "\n\n" - << ConfigMgr::GetInstance().Dump(); - - return StartService(); - } catch (std::exception& ex) { - std::string str = "Milvus server encounter exception: " + std::string(ex.what()); - return Status(SERVER_UNEXPECTED_ERROR, str); - } -} - -void -Server::Stop() { - std::cerr << "Milvus server is going to shutdown ..." << std::endl; - - /* Unlock and close lockfile */ - if (pid_fd_ != -1) { - int ret = lockf(pid_fd_, F_ULOCK, 0); - if (ret != 0) { - std::cerr << "ERROR: Can't lock file: " << strerror(errno) << std::endl; - exit(0); - } - ret = close(pid_fd_); - if (ret != 0) { - std::cerr << "ERROR: Can't close file: " << strerror(errno) << std::endl; - exit(0); - } - } - - /* delete lockfile */ - if (!pid_filename_.empty()) { - int ret = unlink(pid_filename_.c_str()); - if (ret != 0) { - std::cerr << "ERROR: Can't unlink file: " << strerror(errno) << std::endl; - exit(0); - } - } - - StopService(); - - std::cerr << "Milvus server exit..." << std::endl; -} - -Status -Server::StartService() { - Status stat; - - // stat = engine::KnowhereResource::Initialize(); - if (!stat.ok()) { - LOG_SERVER_ERROR_ << "KnowhereResource initialize fail: " << stat.message(); - goto FAIL; - } - - stat = MetaWrapper::GetInstance().Init(); - if (!stat.ok()) { - LOG_SERVER_ERROR_ << "Meta start service fail: " << stat.message(); - goto FAIL; - } - - // Init pulsar message client - stat = MessageWrapper::GetInstance().Init(); - if (!stat.ok()) { - LOG_SERVER_ERROR_ << "Pulsar message client start service fail: " << stat.message(); - goto FAIL; - } - - grpc::GrpcServer::GetInstance().Start(); - - return Status::OK(); -FAIL: - std::cerr << "Milvus initializes fail: " << stat.message() << std::endl; - return stat; -} - -void -Server::StopService() { - // storage::S3ClientWrapper::GetInstance().StopService(); - grpc::GrpcServer::GetInstance().Stop(); - MetaWrapper::GetInstance().Stop(); - MessageWrapper::GetInstance().Stop(); -} - -void -Server::LogConfigInFile(const std::string& path) { - // TODO(yhz): Check if file exists - auto node = YAML::LoadFile(path); - YAML::Emitter out; - out << node; - LOG_SERVER_INFO_ << "\n\n" - << std::string(15, '*') << "Config in file" << std::string(15, '*') << "\n\n" - << out.c_str(); -} - -void -Server::LogCpuInfo() { - /*CPU information*/ - std::fstream fcpu("/proc/cpuinfo", std::ios::in); - if (!fcpu.is_open()) { - LOG_SERVER_WARNING_ << "Cannot obtain CPU information. Open file /proc/cpuinfo fail: " << strerror(errno) - << "(errno: " << errno << ")"; - return; - } - std::stringstream cpu_info_ss; - cpu_info_ss << fcpu.rdbuf(); - fcpu.close(); - std::string cpu_info = cpu_info_ss.str(); - - auto processor_pos = cpu_info.rfind("processor"); - if (std::string::npos == processor_pos) { - LOG_SERVER_WARNING_ << "Cannot obtain CPU information. No sub string \'processor\'"; - return; - } - - auto sub_str = cpu_info.substr(processor_pos); - LOG_SERVER_INFO_ << "\n\n" << std::string(15, '*') << "CPU" << std::string(15, '*') << "\n\n" << sub_str; -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/Server.h b/proxy/src/server/Server.h deleted file mode 100644 index 0718fdfcda..0000000000 --- a/proxy/src/server/Server.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include "config/ConfigMgr.h" -#include "utils/Status.h" - -namespace milvus { -namespace server { - -class Server { - public: - static Server& - GetInstance(); - - void - Init(int64_t daemonized, const std::string& pid_filename, const std::string& config_filename); - - Status - Start(); - void - Stop(); - - private: - Server() = default; - ~Server() = default; - - void - Daemonize(); - - Status - StartService(); - void - StopService(); - - private: - static void - LogConfigInFile(const std::string& path); - - static void - LogCpuInfo(); - - private: - int64_t daemonized_ = 0; - int pid_fd_ = -1; - std::string pid_filename_; - std::string config_filename_; - // ConfigMgrPtr config_mgr_; -}; // Server - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/ValidationUtil.cpp b/proxy/src/server/ValidationUtil.cpp deleted file mode 100644 index cf8ab3a708..0000000000 --- a/proxy/src/server/ValidationUtil.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/ValidationUtil.h" -#include "db/Constants.h" -// #include "db/Utils.h" -// #include "knowhere/index/vector_index/ConfAdapter.h" -// #include "knowhere/index/vector_index/helpers/IndexParameter.h" -#include "utils/Log.h" -#include "utils/StringHelpFunctions.h" - -#include -#include -#include -#include - -namespace milvus { -namespace server { - -namespace { - -Status -CheckParameterRange(const milvus::json& json_params, const std::string& param_name, int64_t min, int64_t max, - bool min_close = true, bool max_closed = true) { - - return Status::OK(); -} - -Status -CheckParameterExistence(const milvus::json& json_params, const std::string& param_name) { - - - return Status::OK(); -} - -} // namespace - -Status -ValidateCollectionName(const std::string& collection_name) { - - - return Status::OK(); -} - -Status -ValidateFieldName(const std::string& field_name) { - - - return Status::OK(); -} - -Status -ValidateIndexType(std::string& index_type) { - - return Status::OK(); -} - -Status -ValidateDimension(int64_t dim, bool is_binary) { - - - return Status::OK(); -} - -Status -ValidateIndexParams(const milvus::json& index_params, int64_t dimension, const std::string& index_type) { - - return Status::OK(); -} - -Status -ValidateSegmentRowCount(int64_t segment_row_count) { - - return Status::OK(); -} - -Status -ValidateIndexMetricType(const std::string& metric_type, const std::string& index_type) { - - - return Status::OK(); -} - -Status -ValidateSearchTopk(int64_t top_k) { - - - return Status::OK(); -} - -Status -ValidatePartitionTags(const std::vector& partition_tags) { - - - return Status::OK(); -} - -// Status -// ValidateInsertDataSize(const engine::DataChunkPtr& data) { - -// return Status::OK(); -// } - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/ValidationUtil.h b/proxy/src/server/ValidationUtil.h deleted file mode 100644 index 71284adaf0..0000000000 --- a/proxy/src/server/ValidationUtil.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "db/Types.h" -#include "utils/Json.h" -#include "utils/Status.h" - -#include -#include - -namespace milvus { -namespace server { - -constexpr int64_t QUERY_MAX_TOPK = 2048; - -extern Status -ValidateCollectionName(const std::string& collection_name); - -extern Status -ValidateFieldName(const std::string& field_name); - -extern Status -ValidateDimension(int64_t dimension, bool is_binary); - -extern Status -ValidateIndexType(std::string& index_type); - -extern Status -ValidateIndexParams(const milvus::json& index_params, int64_t dimension, const std::string& index_type); - -extern Status -ValidateSegmentRowCount(int64_t segment_row_count); - -extern Status -ValidateIndexMetricType(const std::string& metric_type, const std::string& index_type); - -extern Status -ValidateSearchTopk(int64_t top_k); - -extern Status -ValidatePartitionTags(const std::vector& partition_tags); - -// extern Status -// ValidateInsertDataSize(const engine::DataChunkPtr& data); -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/context/ConnectionContext.h b/proxy/src/server/context/ConnectionContext.h deleted file mode 100644 index f1f2248c7d..0000000000 --- a/proxy/src/server/context/ConnectionContext.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include - -namespace milvus { -namespace server { - -class ConnectionContext { - public: - virtual ~ConnectionContext() { - } - virtual bool - IsConnectionBroken() const = 0; -}; - -using ConnectionContextPtr = std::shared_ptr; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/context/Context.cpp b/proxy/src/server/context/Context.cpp deleted file mode 100644 index d5f17cd3c0..0000000000 --- a/proxy/src/server/context/Context.cpp +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/context/Context.h" - -namespace milvus { -namespace server { - -Context::Context(const std::string& req_id) : req_id_(req_id) { -} - -const std::shared_ptr& -Context::GetTraceContext() const { - return trace_context_; -} - -void -Context::SetTraceContext(const std::shared_ptr& trace_context) { - trace_context_ = trace_context; -} -std::shared_ptr -Context::Child(const std::string& operation_name) const { - auto new_context = std::make_shared(req_id_); - new_context->SetTraceContext(trace_context_->Child(operation_name)); - return new_context; -} - -std::shared_ptr -Context::Follower(const std::string& operation_name) const { - auto new_context = std::make_shared(req_id_); - new_context->SetTraceContext(trace_context_->Follower(operation_name)); - return new_context; -} - -void -Context::SetConnectionContext(ConnectionContextPtr& context) { - context_ = context; -} - -bool -Context::IsConnectionBroken() const { - if (context_ == nullptr) { - return false; - } - - return context_->IsConnectionBroken(); -} - -ReqType -Context::GetReqType() const { - return req_type_; -} - -void -Context::SetReqType(ReqType type) { - req_type_ = type; -} - -///////////////////////////////////////////////////////////////////////////////////////////////// -ContextChild::ContextChild(const ContextPtr& context, const std::string& operation_name) { - if (context) { - context_ = context->Child(operation_name); - } -} - -ContextChild::~ContextChild() { - Finish(); -} - -void -ContextChild::Finish() { - if (context_) { - context_->GetTraceContext()->GetSpan()->Finish(); - context_ = nullptr; - } -} - -///////////////////////////////////////////////////////////////////////////////////////////////// -ContextFollower::ContextFollower(const ContextPtr& context, const std::string& operation_name) { - if (context) { - context_ = context->Follower(operation_name); - } -} - -ContextFollower::~ContextFollower() { - if (context_) { - context_->GetTraceContext()->GetSpan()->Finish(); - } -} - -void -ContextFollower::Finish() { - if (context_) { - context_->GetTraceContext()->GetSpan()->Finish(); - context_ = nullptr; - } -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/context/Context.h b/proxy/src/server/context/Context.h deleted file mode 100644 index 5f89cf36e0..0000000000 --- a/proxy/src/server/context/Context.h +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include - -#include - -#include "server/context/ConnectionContext.h" -#include "server/delivery/request/Types.h" -#include "tracing/TraceContext.h" - -namespace milvus { -namespace server { - -class Context { - public: - explicit Context(const std::string& request_id); - - inline std::string - ReqID() const { - return req_id_; - } - - std::shared_ptr - Child(const std::string& operation_name) const; - - std::shared_ptr - Follower(const std::string& operation_name) const; - - void - SetTraceContext(const std::shared_ptr& trace_context); - - const std::shared_ptr& - GetTraceContext() const; - - void - SetConnectionContext(ConnectionContextPtr& context); - - bool - IsConnectionBroken() const; - - ReqType - GetReqType() const; - - void - SetReqType(ReqType type); - - private: - std::string req_id_; - ReqType req_type_; - std::shared_ptr trace_context_; - ConnectionContextPtr context_; -}; - -using ContextPtr = std::shared_ptr; - -class ContextChild { - public: - explicit ContextChild(const ContextPtr& context, const std::string& operation_name); - ~ContextChild(); - - ContextPtr - Context() { - return context_; - } - - void - Finish(); - - private: - ContextPtr context_; -}; - -class ContextFollower { - public: - explicit ContextFollower(const ContextPtr& context, const std::string& operation_name); - ~ContextFollower(); - - ContextPtr - Context() { - return context_; - } - - void - Finish(); - - private: - ContextPtr context_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/ReqHandler.cpp b/proxy/src/server/delivery/ReqHandler.cpp deleted file mode 100644 index 201e0ff9d2..0000000000 --- a/proxy/src/server/delivery/ReqHandler.cpp +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/ReqHandler.h" - -#include - -#include "server/delivery/ReqScheduler.h" -#include "server/delivery/request/BaseReq.h" -#include "server/delivery/request/CmdReq.h" -#include "server/delivery/request/CompactReq.h" -#include "server/delivery/request/CountEntitiesReq.h" -#include "server/delivery/request/CreateCollectionReq.h" -#include "server/delivery/request/CreateIndexReq.h" -#include "server/delivery/request/CreatePartitionReq.h" -#include "server/delivery/request/DeleteEntityByIDReq.h" -#include "server/delivery/request/DescribeIndexReq.h" -#include "server/delivery/request/DropCollectionReq.h" -#include "server/delivery/request/DropIndexReq.h" -#include "server/delivery/request/DropPartitionReq.h" -#include "server/delivery/request/FlushReq.h" -#include "server/delivery/request/GetCollectionInfoReq.h" -#include "server/delivery/request/GetCollectionStatsReq.h" -#include "server/delivery/request/GetEntityByIDReq.h" -#include "server/delivery/request/HasCollectionReq.h" -#include "server/delivery/request/HasPartitionReq.h" -#include "server/delivery/request/InsertReq.h" -#include "server/delivery/request/ListCollectionsReq.h" -#include "server/delivery/request/ListIDInSegmentReq.h" -#include "server/delivery/request/ListPartitionsReq.h" -#include "server/delivery/request/LoadCollectionReq.h" -#include "server/delivery/request/SearchReq.h" - -namespace milvus { -namespace server { - -Status -ReqHandler::CreateCollection(const ContextPtr& context, const ::milvus::grpc::Mapping *request) { - BaseReqPtr req_ptr = CreateCollectionReq::Create(context, request); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::DropCollection(const ContextPtr& context, const std::string& collection_name) { - BaseReqPtr req_ptr = DropCollectionReq::Create(context, collection_name); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::HasCollection(const ContextPtr& context, const std::string& collection_name, bool& has_collection) { - BaseReqPtr req_ptr = HasCollectionReq::Create(context, collection_name, has_collection); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::ListCollections(const ContextPtr& context, std::vector& collections) { - BaseReqPtr req_ptr = ListCollectionsReq::Create(context, collections); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::GetCollectionInfo(const ContextPtr& context, const ::milvus::grpc::CollectionName *request, ::milvus::grpc::Mapping& response) { - BaseReqPtr req_ptr = GetCollectionInfoReq::Create(context, request, response); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::GetCollectionStats(const ContextPtr& context, const std::string& collection_name, - std::string& collection_stats) { - BaseReqPtr req_ptr = GetCollectionStatsReq::Create(context, collection_name, collection_stats); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::CountEntities(const ContextPtr& context, const std::string& collection_name, int64_t& count) { - BaseReqPtr req_ptr = CountEntitiesReq::Create(context, collection_name, count); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::CreatePartition(const ContextPtr& context, const std::string& collection_name, const std::string& tag) { - BaseReqPtr req_ptr = CreatePartitionReq::Create(context, collection_name, tag); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::DropPartition(const ContextPtr& context, const std::string& collection_name, const std::string& tag) { - BaseReqPtr req_ptr = DropPartitionReq::Create(context, collection_name, tag); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::HasPartition(const ContextPtr& context, const std::string& collection_name, const std::string& tag, - bool& has_partition) { - BaseReqPtr req_ptr = HasPartitionReq::Create(context, collection_name, tag, has_partition); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::ListPartitions(const ContextPtr& context, const std::string& collection_name, - std::vector& partitions) { - BaseReqPtr req_ptr = ListPartitionsReq::Create(context, collection_name, partitions); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::CreateIndex(const ContextPtr& context, const ::milvus::grpc::IndexParam *request) { - BaseReqPtr req_ptr = CreateIndexReq::Create(context, request); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::DescribeIndex(const ContextPtr& context, const std::string& collection_name, const std::string& field_name, - std::string& index_name, milvus::json& json_params) { - BaseReqPtr req_ptr = DescribeIndexReq::Create(context, collection_name, field_name, index_name, json_params); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::DropIndex(const ContextPtr& context, const std::string& collection_name, const std::string& field_name, - const std::string& index_name) { - BaseReqPtr req_ptr = DropIndexReq::Create(context, collection_name, index_name, field_name); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::Insert(const ContextPtr& context, const ::milvus::grpc::InsertParam* insert_param) { - BaseReqPtr req_ptr = InsertReq::Create(context, insert_param); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::GetEntityByID(const ContextPtr& context, const std::string& collection_name, const engine::IDNumbers& ids, - std::vector& field_names, std::vector& valid_row, - engine::DataChunkPtr& data_chunk) { - BaseReqPtr req_ptr = - GetEntityByIDReq::Create(context, collection_name, ids, field_names, valid_row, data_chunk); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::DeleteEntityByID(const ContextPtr& context, const ::milvus::grpc::DeleteByIDParam *param) { - BaseReqPtr req_ptr = DeleteEntityByIDReq::Create(context, param); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::Search(const ContextPtr& context, const query::QueryPtr& query_ptr, const milvus::json& json_params, - engine::QueryResultPtr& result) { -// BaseReqPtr req_ptr = SearchReq::Create(context, query_ptr, json_params, result); -// ReqScheduler::ExecReq(req_ptr); -// return req_ptr->status(); - return Status::OK(); -} - -Status -ReqHandler::ListIDInSegment(const ContextPtr& context, const std::string& collection_name, int64_t segment_id, - engine::IDNumbers& ids) { - BaseReqPtr req_ptr = ListIDInSegmentReq::Create(context, collection_name, segment_id, ids); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::LoadCollection(const ContextPtr& context, const std::string& collection_name) { - BaseReqPtr req_ptr = LoadCollectionReq::Create(context, collection_name); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::Flush(const ContextPtr& context, const std::vector& collection_names) { - BaseReqPtr req_ptr = FlushReq::Create(context, collection_names); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::Compact(const ContextPtr& context, const std::string& collection_name, double compact_threshold) { - BaseReqPtr req_ptr = CompactReq::Create(context, collection_name, compact_threshold); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} - -Status -ReqHandler::Cmd(const ContextPtr& context, const std::string& cmd, std::string& reply) { - BaseReqPtr req_ptr = CmdReq::Create(context, cmd, reply); - ReqScheduler::ExecReq(req_ptr); - return req_ptr->status(); -} -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/ReqHandler.h b/proxy/src/server/delivery/ReqHandler.h deleted file mode 100644 index e51b743f0b..0000000000 --- a/proxy/src/server/delivery/ReqHandler.h +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -// #include -// #include -#include -#include -#include -#include -#include - -// #include "query/BooleanQuery.h" -#include "server/delivery/request/BaseReq.h" -#include "utils/Status.h" - -namespace milvus { -namespace server { - -class ReqHandler { - public: - ReqHandler() = default; - - Status - CreateCollection(const ContextPtr& context, const ::milvus::grpc::Mapping *request); - - Status - DropCollection(const ContextPtr& context, const std::string& collection_name); - - Status - HasCollection(const ContextPtr& context, const std::string& collection_name, bool& has_collection); - - Status - ListCollections(const ContextPtr& context, std::vector& collections); - - Status - GetCollectionInfo(const ContextPtr& context, const ::milvus::grpc::CollectionName *request, ::milvus::grpc::Mapping& respons); - - Status - GetCollectionStats(const ContextPtr& context, const std::string& collection_name, std::string& collection_stats); - - Status - CountEntities(const ContextPtr& context, const std::string& collection_name, int64_t& count); - - Status - CreatePartition(const ContextPtr& context, const std::string& collection_name, const std::string& tag); - - Status - DropPartition(const ContextPtr& context, const std::string& collection_name, const std::string& tag); - - Status - HasPartition(const ContextPtr& context, const std::string& collection_name, const std::string& tag, - bool& has_partition); - - Status - ListPartitions(const ContextPtr& context, const std::string& collection_name, std::vector& partitions); - - Status - CreateIndex(const ContextPtr& context, const ::milvus::grpc::IndexParam *request); - - Status - DescribeIndex(const ContextPtr& context, const std::string& collection_name, const std::string& field_name, - std::string& index_name, milvus::json& json_params); - - Status - DropIndex(const ContextPtr& context, const std::string& collection_name, const std::string& field_name, - const std::string& index_name); - - Status - Insert(const ContextPtr& context, const ::milvus::grpc::InsertParam* insert_param); - - Status - GetEntityByID(const ContextPtr& context, const std::string& collection_name, const engine::IDNumbers& ids, - std::vector& field_names, std::vector& valid_row, - engine::DataChunkPtr& data_chunk); - - Status - DeleteEntityByID(const ContextPtr& context, const ::milvus::grpc::DeleteByIDParam *param); - - Status - Search(const ContextPtr& context, const query::QueryPtr& query_ptr, const milvus::json& json_params, - engine::QueryResultPtr& result); - - Status - ListIDInSegment(const ContextPtr& context, const std::string& collection_name, int64_t segment_id, - engine::IDNumbers& ids); - - Status - LoadCollection(const ContextPtr& context, const std::string& collection_name); - - Status - Flush(const ContextPtr& context, const std::vector& collection_names); - - Status - Compact(const ContextPtr& context, const std::string& collection_name, double compact_threshold); - - Status - Cmd(const ContextPtr& context, const std::string& cmd, std::string& reply); -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/ReqQueue.cpp b/proxy/src/server/delivery/ReqQueue.cpp deleted file mode 100644 index 5bcbe3fb71..0000000000 --- a/proxy/src/server/delivery/ReqQueue.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/ReqQueue.h" -#include "server/delivery/strategy/ReqStrategy.h" -#include "server/delivery/strategy/SearchReqStrategy.h" -#include "utils/Log.h" - -#include -#include -#include - -namespace milvus { -namespace server { - -namespace { -Status -ScheduleReq(const BaseReqPtr& req, std::queue& queue) { - if (req == nullptr) { - return Status(SERVER_NULL_POINTER, "request schedule cannot handle null object"); - } - - if (queue.empty()) { - queue.push(req); - return Status::OK(); - } - - static std::map s_schedulers = {{ReqType::kSearch, std::make_shared()}}; - - auto iter = s_schedulers.find(req->type()); - if (iter == s_schedulers.end() || iter->second == nullptr) { - queue.push(req); - } else { - iter->second->ReScheduleQueue(req, queue); - } - - return Status::OK(); -} -} // namespace - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -ReqQueue::ReqQueue() { -} - -ReqQueue::~ReqQueue() { -} - -BaseReqPtr -ReqQueue::TakeReq() { - return Take(); -} - -Status -ReqQueue::PutReq(const BaseReqPtr& req_ptr) { - std::unique_lock lock(mtx); - full_.wait(lock, [this] { return (queue_.size() < capacity_); }); - auto status = ScheduleReq(req_ptr, queue_); - empty_.notify_all(); - return status; -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/ReqQueue.h b/proxy/src/server/delivery/ReqQueue.h deleted file mode 100644 index 2c0cbcc496..0000000000 --- a/proxy/src/server/delivery/ReqQueue.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "server/delivery/request/BaseReq.h" -#include "utils/BlockingQueue.h" -#include "utils/Status.h" - -#include -#include -#include -#include -#include - -namespace milvus { -namespace server { - -using BlockingReqQueue = BlockingQueue; - -class ReqQueue : public BlockingReqQueue { - public: - ReqQueue(); - virtual ~ReqQueue(); - - BaseReqPtr - TakeReq(); - - Status - PutReq(const BaseReqPtr& req_ptr); -}; - -using ReqQueuePtr = std::shared_ptr; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/ReqScheduler.cpp b/proxy/src/server/delivery/ReqScheduler.cpp deleted file mode 100644 index 8b41ad38d1..0000000000 --- a/proxy/src/server/delivery/ReqScheduler.cpp +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/ReqScheduler.h" -#include "utils/Log.h" -#include "server/tso/TSO.h" - -#include -#include - -namespace milvus { -namespace server { - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -ReqScheduler::ReqScheduler() : stopped_(false) { - Start(); -} - -ReqScheduler::~ReqScheduler() { - Stop(); -} - -void -ReqScheduler::ExecReq(const BaseReqPtr& req_ptr) { - if (req_ptr == nullptr) { - return; - } - - ReqScheduler& scheduler = ReqScheduler::GetInstance(); - scheduler.ExecuteReq(req_ptr); -} - -void -ReqScheduler::Start() { - if (!stopped_) { - return; - } - - stopped_ = false; -} - -void -ReqScheduler::Stop() { - if (stopped_ && req_groups_.empty() && execute_threads_.empty()) { - return; - } - - LOG_SERVER_INFO_ << "Scheduler gonna stop..."; - { - std::lock_guard lock(queue_mtx_); - for (auto& iter : req_groups_) { - if (iter.second != nullptr) { - iter.second->Put(nullptr); - } - } - } - - for (auto& iter : execute_threads_) { - if (iter == nullptr) - continue; - iter->join(); - } - req_groups_.clear(); - execute_threads_.clear(); - stopped_ = true; - LOG_SERVER_INFO_ << "Scheduler stopped"; -} - -Status -ReqScheduler::ExecuteReq(const BaseReqPtr& req_ptr) { - if (req_ptr == nullptr) { - return Status::OK(); - } - - auto status = req_ptr->PreExecute(); - if (!status.ok()) { - req_ptr->Done(); - return status; - } - - status = PutToQueue(req_ptr); - - if (!status.ok()) { - LOG_SERVER_ERROR_ << "Put request to queue failed with code: " << status.ToString(); - req_ptr->Done(); - return status; - } - - if (req_ptr->async()) { - return Status::OK(); // async execution, caller need to call WaitToFinish at somewhere - } - - status = req_ptr->WaitToFinish(); // sync execution - if (!status.ok()){ - return status; - } - - return req_ptr->PostExecute(); -} - -void -ReqScheduler::TakeToExecute(ReqQueuePtr req_queue) { - SetThreadName("reqsched_thread"); - if (req_queue == nullptr) { - return; - } - - while (true) { - BaseReqPtr req = req_queue->TakeReq(); - if (req == nullptr) { - LOG_SERVER_ERROR_ << "Take null from request queue, stop thread"; - break; // stop the thread - } - - try { - if (req->type() == ReqType::kInsert || req->type() == ReqType::kDeleteEntityByID) { - std::lock_guard lock(time_syc_mtx_); - sending_ = true; - req->SetTimestamp(TSOracle::GetInstance().GetTimeStamp()); - } - if (req->type() == ReqType::kSearch){ - req->SetTimestamp(TSOracle::GetInstance().GetTimeStamp()); - } - auto status = req->Execute(); - if (!status.ok()) { - LOG_SERVER_ERROR_ << "Req failed with code: " << status.ToString(); - } - } catch (std::exception& ex) { - LOG_SERVER_ERROR_ << "Req failed to execute: " << ex.what(); - } - } -} - -Status -ReqScheduler::PutToQueue(const BaseReqPtr& req_ptr) { - std::lock_guard lock(queue_mtx_); - - std::string group_name = req_ptr->req_group(); - if (req_groups_.count(group_name) > 0) { - req_groups_[group_name]->PutReq(req_ptr); - } else { - ReqQueuePtr queue = std::make_shared(); - queue->PutReq(req_ptr); - req_groups_.insert(std::make_pair(group_name, queue)); - - // start a thread - ThreadPtr thread = std::make_shared(&ReqScheduler::TakeToExecute, this, queue); - - execute_threads_.push_back(thread); - LOG_SERVER_INFO_ << "Create new thread for request group: " << group_name; - } - - return Status::OK(); -} - -int64_t ReqScheduler::GetLatestDeliveredReqTime() { - std::lock_guard lock(time_syc_mtx_); - if (!sending_){ - latest_req_time_ = TSOracle::GetInstance().GetTimeStamp(); - } - return latest_req_time_; -} - -void ReqScheduler::UpdateLatestDeliveredReqTime(int64_t time) { - std::lock_guard lock(time_syc_mtx_); - // update pulsar synchronous time only if message has been sent to pulsar - assert(sending_); - sending_ = false; - latest_req_time_ = time; -} - -uint64_t GetMessageTimeSyncTime(){ - return ReqScheduler::GetInstance().GetLatestDeliveredReqTime(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/ReqScheduler.h b/proxy/src/server/delivery/ReqScheduler.h deleted file mode 100644 index e2e57915dc..0000000000 --- a/proxy/src/server/delivery/ReqScheduler.h +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "server/delivery/ReqQueue.h" -#include "utils/Status.h" - -#include -#include -#include -#include -#include - -namespace milvus { -namespace server { - -using ThreadPtr = std::shared_ptr; - -class ReqScheduler { - public: - static ReqScheduler& - GetInstance() { - static ReqScheduler scheduler; - return scheduler; - } - - void - Start(); - - void - Stop(); - - Status - ExecuteReq(const BaseReqPtr& req_ptr); - - static void - ExecReq(const BaseReqPtr& req_ptr); - - void UpdateLatestDeliveredReqTime(int64_t time); - - int64_t GetLatestDeliveredReqTime(); - - - protected: - ReqScheduler(); - - virtual ~ReqScheduler(); - - void - TakeToExecute(ReqQueuePtr req_queue); - - Status - PutToQueue(const BaseReqPtr& req_ptr); - - private: - mutable std::mutex queue_mtx_; - - // for time synchronous - std::mutex time_syc_mtx_; - int64_t latest_req_time_ = 0; - bool sending_; - - std::map req_groups_; - - std::vector execute_threads_; - - bool stopped_; -}; - -extern uint64_t GetMessageTimeSyncTime(); - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/BaseReq.cpp b/proxy/src/server/delivery/request/BaseReq.cpp deleted file mode 100644 index 4d8a50d595..0000000000 --- a/proxy/src/server/delivery/request/BaseReq.cpp +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/BaseReq.h" - -namespace milvus { -namespace server { - -BaseReq::BaseReq(const ContextPtr& context, ReqType type, bool async) - : context_(context), type_(type), async_(async), done_(false) { - req_group_ = GetReqGroup(type); - if (nullptr != context_) { - context_->SetReqType(type_); - } -} - -BaseReq::~BaseReq() { - WaitToFinish(); -} - -Status -BaseReq::PreExecute() { - status_ = OnPreExecute(); - if (!status_.ok()) { - Done(); - } - return status_; -} - -Status -BaseReq::Execute() { - status_ = OnExecute(); - Done(); - return status_; -} - -Status -BaseReq::PostExecute() { - status_ = OnPostExecute(); - return status_; -} - -Status -BaseReq::OnPreExecute() { - return Status::OK(); -} - -Status -BaseReq::OnPostExecute() { - return Status::OK(); -} - -void -BaseReq::Done() { - std::unique_lock lock(finish_mtx_); - done_ = true; - finish_cond_.notify_all(); -} - -void -BaseReq::SetStatus(const Status& status) { - status_ = status; -} - -Status -BaseReq::WaitToFinish() { - std::unique_lock lock(finish_mtx_); - finish_cond_.wait(lock, [this] { return done_; }); - return status_; -} - -void BaseReq::SetTimestamp(uint64_t ts) { - timestamp_ = ts; -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/BaseReq.h b/proxy/src/server/delivery/request/BaseReq.h deleted file mode 100644 index 065c9acd82..0000000000 --- a/proxy/src/server/delivery/request/BaseReq.h +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "server/context/Context.h" -#include "server/delivery/request/Types.h" -#include "utils/Status.h" -#include "message_client/ClientV2.h" - -#include -#include -#include -#include -#include - -namespace milvus { -namespace server { - -class BaseReq { - protected: - BaseReq(const ContextPtr& context, ReqType type, bool async = false); - - virtual ~BaseReq(); - - public: - const ContextPtr& - context() const { - return context_; - } - - ReqType - type() const { - return type_; - } - - std::string - req_group() const { - return req_group_; - } - - const Status& - status() const { - return status_; - } - - bool - async() const { - return async_; - } - - Status - PreExecute(); - - Status - Execute(); - - Status - PostExecute(); - - void - Done(); - - Status - WaitToFinish(); - - void - SetStatus(const Status& status); - - void - SetTimestamp(uint64_t ts); - - protected: - virtual Status - OnPreExecute(); - - virtual Status - OnExecute() = 0; - - virtual Status - OnPostExecute(); - - protected: - const ContextPtr context_; - ReqType type_; - std::string req_group_; - bool async_; - Status status_; - uint64_t timestamp_; - - - private: - mutable std::mutex finish_mtx_; - std::condition_variable finish_cond_; - bool done_; -}; - -using BaseReqPtr = std::shared_ptr; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/CmdReq.cpp b/proxy/src/server/delivery/request/CmdReq.cpp deleted file mode 100644 index 863acd3d5c..0000000000 --- a/proxy/src/server/delivery/request/CmdReq.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/CmdReq.h" -#include "config/ConfigMgr.h" -// #include "metrics/SystemInfo.h" -// #include "scheduler/SchedInst.h" -#include "src/version.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -#include -#include -#include -#include - -namespace milvus { -namespace server { - -CmdReq::CmdReq(const ContextPtr& context, const std::string& cmd, std::string& result) - : BaseReq(context, ReqType::kCmd), origin_cmd_(cmd), cmd_(tolower(cmd)), result_(result) { -} - -BaseReqPtr -CmdReq::Create(const ContextPtr& context, const std::string& cmd, std::string& result) { - return std::shared_ptr(new CmdReq(context, cmd, result)); -} - -Status -CmdReq::OnExecute() { - std::string hdr = "CmdReq(cmd=" + cmd_ + ")"; - TimeRecorderAuto rc(hdr); - Status stat = Status::OK(); - - return stat; -} - -std::vector -CmdReq::split(const std::string& src, char delimiter) { - std::stringstream ss(src); - std::vector words; - std::string word; - while (std::getline(ss, word, delimiter)) { - words.push_back(word); - } - return words; -} - -std::string -CmdReq::tolower(std::string s) { - std::transform(s.begin(), s.end(), s.begin(), [](unsigned char c) { return std::tolower(c); }); - return s; -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/CmdReq.h b/proxy/src/server/delivery/request/CmdReq.h deleted file mode 100644 index 7d81a06a8d..0000000000 --- a/proxy/src/server/delivery/request/CmdReq.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "BaseReq.h" - -#include -#include -#include - -namespace milvus { -namespace server { - -class CmdReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const std::string& cmd, std::string& result); - - protected: - CmdReq(const ContextPtr& context, const std::string& cmd, std::string& result); - - Status - OnExecute() override; - - private: - static std::vector - split(const std::string& src, char delimiter); - - static std::string - tolower(std::string s); - - private: - const std::string origin_cmd_; - const std::string cmd_; - std::string& result_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/CompactReq.cpp b/proxy/src/server/delivery/request/CompactReq.cpp deleted file mode 100644 index d85780dacd..0000000000 --- a/proxy/src/server/delivery/request/CompactReq.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#include "server/delivery/request/CompactReq.h" -#include "server/ValidationUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -#include -#include -#include - -namespace milvus { -namespace server { - -CompactReq::CompactReq(const ContextPtr& context, const std::string& collection_name, double compact_threshold) - : BaseReq(context, ReqType::kCompact), collection_name_(collection_name), compact_threshold_(compact_threshold) { -} - -BaseReqPtr -CompactReq::Create(const ContextPtr& context, const std::string& collection_name, double compact_threshold) { - return std::shared_ptr(new CompactReq(context, collection_name, compact_threshold)); -} - -Status -CompactReq::OnExecute() { - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/CompactReq.h b/proxy/src/server/delivery/request/CompactReq.h deleted file mode 100644 index 9fce3c21c4..0000000000 --- a/proxy/src/server/delivery/request/CompactReq.h +++ /dev/null @@ -1,45 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#pragma once - -#include "server/delivery/request/BaseReq.h" - -#include -#include - -namespace milvus { -namespace server { - -class CompactReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const std::string& collection_name, double compact_threshold); - - protected: - CompactReq(const ContextPtr& context, const std::string& collection_name, double compact_threshold); - - Status - OnExecute() override; - - private: - const std::string collection_name_; - double compact_threshold_ = 0.0; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/CountEntitiesReq.cpp b/proxy/src/server/delivery/request/CountEntitiesReq.cpp deleted file mode 100644 index a0ceb6990e..0000000000 --- a/proxy/src/server/delivery/request/CountEntitiesReq.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/CountEntitiesReq.h" -#include "BaseReq.h" -#include "server/ValidationUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" -#include "server/MetaWrapper.h" - -#include -#include -#include - -namespace milvus { -namespace server { - -CountEntitiesReq::CountEntitiesReq(const ContextPtr& context, const std::string& collection_name, int64_t& row_count) - : BaseReq(context, ReqType::kCountEntities), collection_name_(collection_name), row_count_(row_count) { -} - -BaseReqPtr -CountEntitiesReq::Create(const ContextPtr& context, const std::string& collection_name, int64_t& row_count) { - return std::shared_ptr(new CountEntitiesReq(context, collection_name, row_count)); -} - -Status -CountEntitiesReq::OnExecute() { - try { - std::string hdr = "CountEntitiesReq(collection=" + collection_name_ + ")"; - TimeRecorderAuto rc(hdr); - row_count_ = MetaWrapper::GetInstance().CountCollection(collection_name_); - - rc.ElapseFromBegin("done"); - } catch (std::exception& ex) { - return Status(SERVER_UNEXPECTED_ERROR, ex.what()); - } - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/CountEntitiesReq.h b/proxy/src/server/delivery/request/CountEntitiesReq.h deleted file mode 100644 index 2975b19335..0000000000 --- a/proxy/src/server/delivery/request/CountEntitiesReq.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "server/delivery/request/BaseReq.h" - -#include -#include - -namespace milvus { -namespace server { - -class CountEntitiesReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const std::string& collection_name, int64_t& row_count); - - protected: - CountEntitiesReq(const ContextPtr& context, const std::string& collection_name, int64_t& row_count); - - Status - OnExecute() override; - - private: - const std::string collection_name_; - int64_t& row_count_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/CreateCollectionReq.cpp b/proxy/src/server/delivery/request/CreateCollectionReq.cpp deleted file mode 100644 index 5b704e02d4..0000000000 --- a/proxy/src/server/delivery/request/CreateCollectionReq.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/CreateCollectionReq.h" -// #include "db/Utils.h" -#include "server/ValidationUtil.h" -#include "utils/Log.h" -#include "server/MetaWrapper.h" - -#include - -namespace milvus { -namespace server { - -CreateCollectionReq::CreateCollectionReq(const ContextPtr &context, const ::milvus::grpc::Mapping *request) - : BaseReq(context, ReqType::kCreateCollection), - request_(request) { -} - -BaseReqPtr -CreateCollectionReq::Create(const ContextPtr &context, const ::milvus::grpc::Mapping *request) { - return std::shared_ptr(new CreateCollectionReq(context, request)); -} - -Status -CreateCollectionReq::OnExecute() { - auto status = MetaWrapper::GetInstance().MetaClient()->CreateCollection(*request_); - if (status.ok()){ - status = MetaWrapper::GetInstance().SyncMeta(); - } - return status; -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/CreateCollectionReq.h b/proxy/src/server/delivery/request/CreateCollectionReq.h deleted file mode 100644 index 31366b37a5..0000000000 --- a/proxy/src/server/delivery/request/CreateCollectionReq.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include - -#include "server/delivery/request/BaseReq.h" - -namespace milvus { -namespace server { - -class CreateCollectionReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr &context, const ::milvus::grpc::Mapping *request); - - protected: - CreateCollectionReq(const ContextPtr &context, const ::milvus::grpc::Mapping *request); - - Status - OnExecute() override; - - private: - const std::string collection_name_; - const ::milvus::grpc::Mapping *request_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/CreateIndexReq.cpp b/proxy/src/server/delivery/request/CreateIndexReq.cpp deleted file mode 100644 index ed6cefc951..0000000000 --- a/proxy/src/server/delivery/request/CreateIndexReq.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/CreateIndexReq.h" -#include "server/ValidationUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -#include -#include -#include -#include -#include "server/MetaWrapper.h" - -namespace milvus { -namespace server { - -CreateIndexReq::CreateIndexReq(const ContextPtr& context, const std::string& collection_name, - const std::string& field_name, const std::string& index_name, - const milvus::json& json_params) - : BaseReq(context, ReqType::kCreateIndex), - collection_name_(collection_name), - field_name_(field_name), - index_name_(index_name), - json_params_(json_params) { -} - -CreateIndexReq::CreateIndexReq(const ContextPtr& context, const ::milvus::grpc::IndexParam *request) - : BaseReq(context, ReqType::kCreateIndex), - request_(request){} - -BaseReqPtr -CreateIndexReq::Create(const ContextPtr& context, const std::string& collection_name, const std::string& field_name, - const std::string& index_name, const milvus::json& json_params) { - return std::shared_ptr(new CreateIndexReq(context, collection_name, field_name, index_name, json_params)); -} - -BaseReqPtr -CreateIndexReq::Create(const ContextPtr& context, const ::milvus::grpc::IndexParam *request){ - return std::shared_ptr(new CreateIndexReq(context, request)); -} - -Status -CreateIndexReq::OnExecute() { - auto status = MetaWrapper::GetInstance().MetaClient()->CreateIndex(*request_); - if (status.ok()){ - status = MetaWrapper::GetInstance().SyncMeta(); - } - return status; -} - - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/CreateIndexReq.h b/proxy/src/server/delivery/request/CreateIndexReq.h deleted file mode 100644 index a9e367707b..0000000000 --- a/proxy/src/server/delivery/request/CreateIndexReq.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include "server/delivery/request/BaseReq.h" - -namespace milvus { -namespace server { - -class CreateIndexReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const std::string& collection_name, const std::string& field_name, - const std::string& index_name, const milvus::json& json_params); - - static BaseReqPtr - Create(const ContextPtr& context, const ::milvus::grpc::IndexParam *request); - - protected: - CreateIndexReq(const ContextPtr& context, const std::string& collection_name, const std::string& field_name, - const std::string& index_name, const milvus::json& json_params); - - CreateIndexReq(const ContextPtr& context, const ::milvus::grpc::IndexParam *request); - - Status - OnExecute() override; - - private: - const std::string collection_name_; - const std::string field_name_; - const std::string index_name_; - const milvus::json json_params_; - - const ::milvus::grpc::IndexParam *request_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/CreatePartitionReq.cpp b/proxy/src/server/delivery/request/CreatePartitionReq.cpp deleted file mode 100644 index eac3498d3b..0000000000 --- a/proxy/src/server/delivery/request/CreatePartitionReq.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/CreatePartitionReq.h" -#include "server/ValidationUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -#include -#include -#include - -namespace milvus { -namespace server { - -constexpr uint64_t MAX_PARTITION_NUM = 4096; - -CreatePartitionReq::CreatePartitionReq(const ContextPtr& context, const std::string& collection_name, - const std::string& tag) - : BaseReq(context, ReqType::kCreatePartition), collection_name_(collection_name), tag_(tag) { -} - -BaseReqPtr -CreatePartitionReq::Create(const ContextPtr& context, const std::string& collection_name, const std::string& tag) { - return std::shared_ptr(new CreatePartitionReq(context, collection_name, tag)); -} - -Status -CreatePartitionReq::OnExecute() { - - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/CreatePartitionReq.h b/proxy/src/server/delivery/request/CreatePartitionReq.h deleted file mode 100644 index 658e8b1f9b..0000000000 --- a/proxy/src/server/delivery/request/CreatePartitionReq.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include "server/delivery/request/BaseReq.h" - -namespace milvus { -namespace server { - -class CreatePartitionReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const std::string& collection_name, const std::string& tag); - - protected: - CreatePartitionReq(const ContextPtr& context, const std::string& collection_name, const std::string& tag); - - Status - OnExecute() override; - - private: - const std::string collection_name_; - const std::string tag_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/DeleteEntityByIDReq.cpp b/proxy/src/server/delivery/request/DeleteEntityByIDReq.cpp deleted file mode 100644 index 5e7be296d4..0000000000 --- a/proxy/src/server/delivery/request/DeleteEntityByIDReq.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#include "server/delivery/request/DeleteEntityByIDReq.h" -#include "src/server/delivery/ReqScheduler.h" -#include "server/MessageWrapper.h" -#include "server/MetaWrapper.h" - -#include -#include -#include -#include - -#include "server/ValidationUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -namespace milvus { -namespace server { - -DeleteEntityByIDReq::DeleteEntityByIDReq(const ContextPtr& context, const ::milvus::grpc::DeleteByIDParam *request) - : BaseReq(context, ReqType::kDeleteEntityByID), request_(request) { -} - -BaseReqPtr -DeleteEntityByIDReq::Create(const ContextPtr& context, const ::milvus::grpc::DeleteByIDParam *request) { - return std::shared_ptr(new DeleteEntityByIDReq(context, request)); -} - -Status -DeleteEntityByIDReq::OnExecute() { - auto &msg_client = MessageWrapper::GetInstance().MessageClient(); - auto segment_id = [](const std::string &collection_name, - uint64_t channel_id, - uint64_t timestamp) { - return MetaWrapper::GetInstance().AskSegmentId(collection_name, channel_id, timestamp); - }; - Status status = msg_client->SendMutMessage(*request_, timestamp_, segment_id); - return status; -} - -Status DeleteEntityByIDReq::OnPostExecute() { - ReqScheduler::GetInstance().UpdateLatestDeliveredReqTime(timestamp_); - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/DeleteEntityByIDReq.h b/proxy/src/server/delivery/request/DeleteEntityByIDReq.h deleted file mode 100644 index 3fbd1f5398..0000000000 --- a/proxy/src/server/delivery/request/DeleteEntityByIDReq.h +++ /dev/null @@ -1,49 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#pragma once - -#include -#include -#include - -#include "server/delivery/request/BaseReq.h" - -namespace milvus { -namespace server { - -class DeleteEntityByIDReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const ::milvus::grpc::DeleteByIDParam *request); - - protected: - DeleteEntityByIDReq(const ContextPtr& context, const ::milvus::grpc::DeleteByIDParam *request); - - Status - OnExecute() override; - - Status - OnPostExecute() override; - - - private: - const ::milvus::grpc::DeleteByIDParam *request_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/DescribeIndexReq.cpp b/proxy/src/server/delivery/request/DescribeIndexReq.cpp deleted file mode 100644 index 9ed961bbf5..0000000000 --- a/proxy/src/server/delivery/request/DescribeIndexReq.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/DescribeIndexReq.h" -#include "server/ValidationUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -#include -#include -#include -#include - -namespace milvus { -namespace server { - -DescribeIndexReq::DescribeIndexReq(const std::shared_ptr& context, - const std::string& collection_name, const std::string& field_name, - std::string& index_name, milvus::json& json_params) - : BaseReq(context, ReqType::kDescribeIndex), - collection_name_(collection_name), - field_name_(field_name), - index_name_(index_name), - json_params_(json_params) { -} - -BaseReqPtr -DescribeIndexReq::Create(const std::shared_ptr& context, const std::string& collection_name, - const std::string& field_name, std::string& index_name, milvus::json& json_params) { - return std::shared_ptr( - new DescribeIndexReq(context, collection_name, field_name, index_name, json_params)); -} - -Status -DescribeIndexReq::OnExecute() { - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/DescribeIndexReq.h b/proxy/src/server/delivery/request/DescribeIndexReq.h deleted file mode 100644 index 8d0a8efb6a..0000000000 --- a/proxy/src/server/delivery/request/DescribeIndexReq.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include "server/delivery/request/BaseReq.h" - -namespace milvus { -namespace server { - -class DescribeIndexReq : public BaseReq { - public: - static BaseReqPtr - Create(const std::shared_ptr& context, const std::string& collection_name, - const std::string& field_name, std::string& index_name, milvus::json& json_params); - - protected: - DescribeIndexReq(const std::shared_ptr& context, const std::string& collection_name, - const std::string& field_name, std::string& index_name, milvus::json& json_params); - - Status - OnExecute() override; - - private: - const std::string collection_name_; - const std::string field_name_; - std::string& index_name_; - milvus::json& json_params_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/DropCollectionReq.cpp b/proxy/src/server/delivery/request/DropCollectionReq.cpp deleted file mode 100644 index 60bc92c4c6..0000000000 --- a/proxy/src/server/delivery/request/DropCollectionReq.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/DropCollectionReq.h" -#include "server/ValidationUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -namespace milvus { -namespace server { - -DropCollectionReq::DropCollectionReq(const ContextPtr& context, const std::string& collection_name) - : BaseReq(context, ReqType::kDropCollection), collection_name_(collection_name) { -} - -BaseReqPtr -DropCollectionReq::Create(const ContextPtr& context, const std::string& collection_name) { - return std::shared_ptr(new DropCollectionReq(context, collection_name)); -} - -Status -DropCollectionReq::OnExecute() { - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/DropCollectionReq.h b/proxy/src/server/delivery/request/DropCollectionReq.h deleted file mode 100644 index d28236bf85..0000000000 --- a/proxy/src/server/delivery/request/DropCollectionReq.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "server/delivery/request/BaseReq.h" - -#include -#include - -namespace milvus { -namespace server { - -class DropCollectionReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const std::string& collection_name); - - protected: - DropCollectionReq(const ContextPtr& context, const std::string& collection_name); - - Status - OnExecute() override; - - private: - std::string collection_name_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/DropIndexReq.cpp b/proxy/src/server/delivery/request/DropIndexReq.cpp deleted file mode 100644 index 30652f59c0..0000000000 --- a/proxy/src/server/delivery/request/DropIndexReq.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/DropIndexReq.h" -#include "server/ValidationUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -#include -#include -#include - -namespace milvus { -namespace server { - -DropIndexReq::DropIndexReq(const ContextPtr& context, const std::string& collection_name, const std::string& field_name, - const std::string& index_name) - : BaseReq(context, ReqType::kDropIndex), - collection_name_(collection_name), - field_name_(field_name), - index_name_(index_name) { -} - -BaseReqPtr -DropIndexReq::Create(const ContextPtr& context, const std::string& collection_name, const std::string& field_name, - const std::string& index_name) { - return std::shared_ptr(new DropIndexReq(context, collection_name, field_name, index_name)); -} - -Status -DropIndexReq::OnExecute() { - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/DropIndexReq.h b/proxy/src/server/delivery/request/DropIndexReq.h deleted file mode 100644 index 22fe806bbf..0000000000 --- a/proxy/src/server/delivery/request/DropIndexReq.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "server/delivery/request/BaseReq.h" - -#include -#include - -namespace milvus { -namespace server { - -class DropIndexReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const std::string& collection_name, const std::string& field_name, - const std::string& index_name); - - protected: - DropIndexReq(const ContextPtr& context, const std::string& collection_name, const std::string& field_name, - const std::string& index_name); - - Status - OnExecute() override; - - private: - const std::string collection_name_; - const std::string field_name_; - const std::string index_name_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/DropPartitionReq.cpp b/proxy/src/server/delivery/request/DropPartitionReq.cpp deleted file mode 100644 index fa397a5bd3..0000000000 --- a/proxy/src/server/delivery/request/DropPartitionReq.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/DropPartitionReq.h" -#include "server/ValidationUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -#include -#include - -namespace milvus { -namespace server { - -DropPartitionReq::DropPartitionReq(const ContextPtr& context, const std::string& collection_name, - const std::string& tag) - : BaseReq(context, ReqType::kDropPartition), collection_name_(collection_name), tag_(tag) { -} - -BaseReqPtr -DropPartitionReq::Create(const ContextPtr& context, const std::string& collection_name, const std::string& tag) { - return std::shared_ptr(new DropPartitionReq(context, collection_name, tag)); -} - -Status -DropPartitionReq::OnExecute() { - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/DropPartitionReq.h b/proxy/src/server/delivery/request/DropPartitionReq.h deleted file mode 100644 index 90e57c27b4..0000000000 --- a/proxy/src/server/delivery/request/DropPartitionReq.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include "server/delivery/request/BaseReq.h" - -namespace milvus { -namespace server { - -class DropPartitionReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const std::string& collection_name, const std::string& tag); - - protected: - DropPartitionReq(const ContextPtr& context, const std::string& collection_name, const std::string& tag); - - Status - OnExecute() override; - - private: - const std::string collection_name_; - const std::string tag_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/FlushReq.cpp b/proxy/src/server/delivery/request/FlushReq.cpp deleted file mode 100644 index 361d9e5b7e..0000000000 --- a/proxy/src/server/delivery/request/FlushReq.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#include "server/delivery/request/FlushReq.h" - -#include -#include -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -namespace milvus { -namespace server { - -FlushReq::FlushReq(const ContextPtr& context, const std::vector& collection_names) - : BaseReq(context, ReqType::kFlush), collection_names_(collection_names) { -} - -BaseReqPtr -FlushReq::Create(const ContextPtr& context, const std::vector& collection_names) { - return std::shared_ptr(new FlushReq(context, collection_names)); -} - -Status -FlushReq::OnExecute() { - std::string hdr = "FlushReq flush collections: "; - for (auto& name : collection_names_) { - hdr += name; - hdr += ", "; - } - - TimeRecorderAuto rc(hdr); - LOG_SERVER_DEBUG_ << hdr; - - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/FlushReq.h b/proxy/src/server/delivery/request/FlushReq.h deleted file mode 100644 index c5f56281a3..0000000000 --- a/proxy/src/server/delivery/request/FlushReq.h +++ /dev/null @@ -1,45 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#pragma once - -#include "BaseReq.h" - -#include -#include -#include - -namespace milvus { -namespace server { - -class FlushReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const std::vector& collection_names); - - protected: - FlushReq(const ContextPtr& context, const std::vector& collection_names); - - Status - OnExecute() override; - - private: - std::vector collection_names_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/GetCollectionInfoReq.cpp b/proxy/src/server/delivery/request/GetCollectionInfoReq.cpp deleted file mode 100644 index 5ba1a7304b..0000000000 --- a/proxy/src/server/delivery/request/GetCollectionInfoReq.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/GetCollectionInfoReq.h" -// #include "db/Utils.h" -// #include "server/DBWrapper.h" -#include "server/ValidationUtil.h" -// #include "server/web_impl/Constants.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" -#include "server/MetaWrapper.h" - -#include - -namespace milvus { -namespace server { - -GetCollectionInfoReq::GetCollectionInfoReq(const ContextPtr& context, const ::milvus::grpc::CollectionName *request, ::milvus::grpc::Mapping& response) - : BaseReq(context, ReqType::kGetCollectionInfo), - collection_name_(request->collection_name()), - collection_schema_(response) { -} - -BaseReqPtr -GetCollectionInfoReq::Create(const ContextPtr& context, const ::milvus::grpc::CollectionName *request, ::milvus::grpc::Mapping& response) { - return std::shared_ptr(new GetCollectionInfoReq(context, request, response)); -} - -Status -GetCollectionInfoReq::OnExecute() { - try { - auto schema = MetaWrapper::GetInstance().AskCollectionSchema(collection_name_); - collection_schema_.mutable_schema()->CopyFrom(schema); - collection_schema_.set_collection_name(collection_schema_.collection_name()); - return Status::OK(); - } - catch (const std::exception& e){ - return Status{DB_ERROR, e.what()}; - } - -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/GetCollectionInfoReq.h b/proxy/src/server/delivery/request/GetCollectionInfoReq.h deleted file mode 100644 index 78b99bc56b..0000000000 --- a/proxy/src/server/delivery/request/GetCollectionInfoReq.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include - -#include "server/delivery/request/BaseReq.h" - -namespace milvus { -namespace server { - -class GetCollectionInfoReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const ::milvus::grpc::CollectionName *request, ::milvus::grpc::Mapping& response); - - protected: - GetCollectionInfoReq(const ContextPtr& context, const ::milvus::grpc::CollectionName *request, ::milvus::grpc::Mapping& response); - - Status - OnExecute() override; - - private: - const std::string collection_name_; - ::milvus::grpc::Mapping &collection_schema_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/GetCollectionStatsReq.cpp b/proxy/src/server/delivery/request/GetCollectionStatsReq.cpp deleted file mode 100644 index 1ce8570030..0000000000 --- a/proxy/src/server/delivery/request/GetCollectionStatsReq.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#include "server/delivery/request/GetCollectionStatsReq.h" -#include "server/ValidationUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -namespace milvus { -namespace server { - -GetCollectionStatsReq::GetCollectionStatsReq(const ContextPtr& context, const std::string& collection_name, - std::string& collection_stats) - : BaseReq(context, ReqType::kGetCollectionStats), - collection_name_(collection_name), - collection_stats_(collection_stats) { -} - -BaseReqPtr -GetCollectionStatsReq::Create(const ContextPtr& context, const std::string& collection_name, - std::string& collection_stats) { - return std::shared_ptr(new GetCollectionStatsReq(context, collection_name, collection_stats)); -} - -Status -GetCollectionStatsReq::OnExecute() { - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/GetCollectionStatsReq.h b/proxy/src/server/delivery/request/GetCollectionStatsReq.h deleted file mode 100644 index 57dd69f7e3..0000000000 --- a/proxy/src/server/delivery/request/GetCollectionStatsReq.h +++ /dev/null @@ -1,45 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#pragma once - -#include "server/delivery/request/BaseReq.h" - -#include -#include - -namespace milvus { -namespace server { - -class GetCollectionStatsReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const std::string& collection_name, std::string& collection_stats); - - protected: - GetCollectionStatsReq(const ContextPtr& context, const std::string& collection_name, std::string& collection_stats); - - Status - OnExecute() override; - - private: - const std::string collection_name_; - std::string& collection_stats_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/GetEntityByIDReq.cpp b/proxy/src/server/delivery/request/GetEntityByIDReq.cpp deleted file mode 100644 index 6012899468..0000000000 --- a/proxy/src/server/delivery/request/GetEntityByIDReq.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#include "server/delivery/request/GetEntityByIDReq.h" - -#include "db/Types.h" -#include "server/ValidationUtil.h" -#include "utils/TimeRecorder.h" - -#include -#include - -namespace milvus { -namespace server { - -constexpr uint64_t MAX_COUNT_RETURNED = 1000; - -GetEntityByIDReq::GetEntityByIDReq(const ContextPtr& context, const std::string& collection_name, - const engine::IDNumbers& id_array, std::vector& field_names, - std::vector& valid_row, - engine::DataChunkPtr& data_chunk) - : BaseReq(context, ReqType::kGetEntityByID), - collection_name_(collection_name), - id_array_(id_array), - field_names_(field_names), - valid_row_(valid_row), - data_chunk_(data_chunk) { -} - -BaseReqPtr -GetEntityByIDReq::Create(const ContextPtr& context, const std::string& collection_name, - const engine::IDNumbers& id_array, std::vector& field_names_, - std::vector& valid_row, - engine::DataChunkPtr& data_chunk) { - return std::shared_ptr( - new GetEntityByIDReq(context, collection_name, id_array, field_names_, valid_row, data_chunk)); -} - -Status -GetEntityByIDReq::OnExecute() { - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/GetEntityByIDReq.h b/proxy/src/server/delivery/request/GetEntityByIDReq.h deleted file mode 100644 index fe892041c3..0000000000 --- a/proxy/src/server/delivery/request/GetEntityByIDReq.h +++ /dev/null @@ -1,56 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#pragma once - -#include "server/delivery/request/BaseReq.h" - -#include -#include -#include -// #include "db/snapshot/Context.h" -// #include "db/snapshot/Resources.h" -// #include "segment/Segment.h" - -namespace milvus { -namespace server { - -class GetEntityByIDReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const std::string& collection_name, const engine::IDNumbers& id_array, - std::vector& field_names, std::vector& valid_row, - engine::DataChunkPtr& data_chunk); - - protected: - GetEntityByIDReq(const ContextPtr& context, const std::string& collection_name, const engine::IDNumbers& id_array, - std::vector& field_names, std::vector& valid_row, - engine::DataChunkPtr& data_chunk); - - Status - OnExecute() override; - - private: - std::string collection_name_; - engine::IDNumbers id_array_; - std::vector& field_names_; - engine::DataChunkPtr& data_chunk_; - std::vector& valid_row_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/HasCollectionReq.cpp b/proxy/src/server/delivery/request/HasCollectionReq.cpp deleted file mode 100644 index 5fd99e2421..0000000000 --- a/proxy/src/server/delivery/request/HasCollectionReq.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/HasCollectionReq.h" -#include "server/ValidationUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - - -namespace milvus { -namespace server { - -HasCollectionReq::HasCollectionReq(const ContextPtr& context, const std::string& collection_name, bool& exist) - : BaseReq(context, ReqType::kHasCollection), collection_name_(collection_name), exist_(exist) { -} - -BaseReqPtr -HasCollectionReq::Create(const ContextPtr& context, const std::string& collection_name, bool& exist) { - return std::shared_ptr(new HasCollectionReq(context, collection_name, exist)); -} - -Status -HasCollectionReq::OnExecute() { - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/HasCollectionReq.h b/proxy/src/server/delivery/request/HasCollectionReq.h deleted file mode 100644 index e7bb5825bf..0000000000 --- a/proxy/src/server/delivery/request/HasCollectionReq.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "server/delivery/request/BaseReq.h" - -#include -#include - -namespace milvus { -namespace server { - -class HasCollectionReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const std::string& collection_name, bool& exist); - - protected: - HasCollectionReq(const ContextPtr& context, const std::string& collection_name, bool& exist); - - Status - OnExecute() override; - - private: - std::string collection_name_; - bool& exist_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/HasPartitionReq.cpp b/proxy/src/server/delivery/request/HasPartitionReq.cpp deleted file mode 100644 index f7842f0a85..0000000000 --- a/proxy/src/server/delivery/request/HasPartitionReq.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/HasPartitionReq.h" -#include "server/ValidationUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -#include -#include - -namespace milvus { -namespace server { - -HasPartitionReq::HasPartitionReq(const ContextPtr& context, const std::string& collection_name, const std::string& tag, - bool& has_partition) - : BaseReq(context, ReqType::kHasCollection), - collection_name_(collection_name), - partition_tag_(tag), - has_partition_(has_partition) { -} - -BaseReqPtr -HasPartitionReq::Create(const ContextPtr& context, const std::string& collection_name, const std::string& tag, - bool& has_partition) { - return std::shared_ptr(new HasPartitionReq(context, collection_name, tag, has_partition)); -} - -Status -HasPartitionReq::OnExecute() { - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/HasPartitionReq.h b/proxy/src/server/delivery/request/HasPartitionReq.h deleted file mode 100644 index 1191f09004..0000000000 --- a/proxy/src/server/delivery/request/HasPartitionReq.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "server/delivery/request/BaseReq.h" - -#include -#include - -namespace milvus { -namespace server { - -class HasPartitionReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const std::string& collection_name, const std::string& tag, bool& has_partition); - - protected: - HasPartitionReq(const ContextPtr& context, const std::string& collection_name, const std::string& tag, - bool& has_partition); - - Status - OnExecute() override; - - private: - std::string collection_name_; - std::string partition_tag_; - bool& has_partition_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/InsertReq.cpp b/proxy/src/server/delivery/request/InsertReq.cpp deleted file mode 100644 index 3aaebb86d2..0000000000 --- a/proxy/src/server/delivery/request/InsertReq.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/InsertReq.h" -#include "server/ValidationUtil.h" -#include "utils/CommonUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" -#include "server/delivery/ReqScheduler.h" -#include "server/MessageWrapper.h" -#include "server/MetaWrapper.h" - -#include -#include -#include -#include -#include - -#ifdef ENABLE_CPU_PROFILING -#include -#endif - -namespace milvus { -namespace server { - -InsertReq::InsertReq(const ContextPtr &context, const ::milvus::grpc::InsertParam *insert_param) - : BaseReq(context, ReqType::kInsert), - insert_param_(insert_param) { -} - -BaseReqPtr -InsertReq::Create(const ContextPtr &context, const ::milvus::grpc::InsertParam *insert_param) { - return std::shared_ptr(new InsertReq(context, insert_param)); -} - -Status -InsertReq::OnExecute() { - LOG_SERVER_INFO_ << LogOut("[%s][%ld] ", "insert", 0) << "Execute InsertReq."; - auto &msg_client = MessageWrapper::GetInstance().MessageClient(); - auto segment_id = [](const std::string &collection_name, - uint64_t channel_id, - uint64_t timestamp) { - return MetaWrapper::GetInstance().AskSegmentId(collection_name, channel_id, timestamp); - }; - Status status; - status = msg_client->SendMutMessage(*insert_param_, timestamp_, segment_id); - return status; -} - -Status InsertReq::OnPostExecute() { - ReqScheduler::GetInstance().UpdateLatestDeliveredReqTime(timestamp_); - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/InsertReq.h b/proxy/src/server/delivery/request/InsertReq.h deleted file mode 100644 index 1481a37bb9..0000000000 --- a/proxy/src/server/delivery/request/InsertReq.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "server/delivery/request/BaseReq.h" - -#include -#include -#include -#include - -namespace milvus { -namespace server { - -class InsertReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr &context, const ::milvus::grpc::InsertParam *chunk_data); - - protected: - InsertReq(const ContextPtr &context, const ::milvus::grpc::InsertParam *chunk_data); - - Status - OnExecute() override; - - Status - OnPostExecute() override ; - - private: - const grpc::InsertParam *insert_param_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/ListCollectionsReq.cpp b/proxy/src/server/delivery/request/ListCollectionsReq.cpp deleted file mode 100644 index 690b9c7a30..0000000000 --- a/proxy/src/server/delivery/request/ListCollectionsReq.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/ListCollectionsReq.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -#include - -namespace milvus { -namespace server { - -ListCollectionsReq::ListCollectionsReq(const ContextPtr& context, std::vector& collection_list) - : BaseReq(context, ReqType::kListCollections), collection_list_(collection_list) { -} - -BaseReqPtr -ListCollectionsReq::Create(const ContextPtr& context, std::vector& collection_list) { - return std::shared_ptr(new ListCollectionsReq(context, collection_list)); -} - -Status -ListCollectionsReq::OnExecute() { - TimeRecorderAuto rc("ListCollectionsReq"); - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/ListCollectionsReq.h b/proxy/src/server/delivery/request/ListCollectionsReq.h deleted file mode 100644 index 0b37c9d718..0000000000 --- a/proxy/src/server/delivery/request/ListCollectionsReq.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include - -#include "server/delivery/request/BaseReq.h" - -namespace milvus { -namespace server { - -class ListCollectionsReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, std::vector& collection_list); - - protected: - ListCollectionsReq(const ContextPtr& context, std::vector& collection_list); - - Status - OnExecute() override; - - private: - std::vector& collection_list_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/ListIDInSegmentReq.cpp b/proxy/src/server/delivery/request/ListIDInSegmentReq.cpp deleted file mode 100644 index 08c6282804..0000000000 --- a/proxy/src/server/delivery/request/ListIDInSegmentReq.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#include "server/delivery/request/ListIDInSegmentReq.h" -#include "server/ValidationUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -#include -#include - -namespace milvus { -namespace server { - -ListIDInSegmentReq::ListIDInSegmentReq(const ContextPtr& context, const std::string& collection_name, - int64_t segment_id, engine::IDNumbers& ids) - : BaseReq(context, ReqType::kListIDInSegment), - collection_name_(collection_name), - segment_id_(segment_id), - ids_(ids) { -} - -BaseReqPtr -ListIDInSegmentReq::Create(const ContextPtr& context, const std::string& collection_name, int64_t segment_id, - engine::IDNumbers& ids) { - return std::shared_ptr(new ListIDInSegmentReq(context, collection_name, segment_id, ids)); -} - -Status -ListIDInSegmentReq::OnExecute() { - - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/ListIDInSegmentReq.h b/proxy/src/server/delivery/request/ListIDInSegmentReq.h deleted file mode 100644 index e5113db912..0000000000 --- a/proxy/src/server/delivery/request/ListIDInSegmentReq.h +++ /dev/null @@ -1,48 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#pragma once - -#include "server/delivery/request/BaseReq.h" - -#include -#include -#include - -namespace milvus { -namespace server { - -class ListIDInSegmentReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const std::string& collection_name, int64_t segment_id, engine::IDNumbers& ids); - - protected: - ListIDInSegmentReq(const ContextPtr& context, const std::string& collection_name, int64_t segment_id, - engine::IDNumbers& ids); - - Status - OnExecute() override; - - private: - std::string collection_name_; - int64_t segment_id_; - engine::IDNumbers& ids_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/ListPartitionsReq.cpp b/proxy/src/server/delivery/request/ListPartitionsReq.cpp deleted file mode 100644 index 81fadde6a3..0000000000 --- a/proxy/src/server/delivery/request/ListPartitionsReq.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/ListPartitionsReq.h" -#include "server/ValidationUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -#include -#include - -namespace milvus { -namespace server { - -ListPartitionsReq::ListPartitionsReq(const ContextPtr& context, const std::string& collection_name, - std::vector& partition_list) - : BaseReq(context, ReqType::kListPartitions), collection_name_(collection_name), partition_list_(partition_list) { -} - -BaseReqPtr -ListPartitionsReq::Create(const ContextPtr& context, const std::string& collection_name, - std::vector& partition_list) { - return std::shared_ptr(new ListPartitionsReq(context, collection_name, partition_list)); -} - -Status -ListPartitionsReq::OnExecute() { - std::string hdr = "ListPartitionsReq(collection=" + collection_name_ + ")"; - TimeRecorderAuto rc(hdr); - - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/ListPartitionsReq.h b/proxy/src/server/delivery/request/ListPartitionsReq.h deleted file mode 100644 index d05f95b1d7..0000000000 --- a/proxy/src/server/delivery/request/ListPartitionsReq.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "server/delivery/request/BaseReq.h" - -#include -#include -#include - -namespace milvus { -namespace server { - -class ListPartitionsReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const std::string& collection_name, std::vector& partition_list); - - protected: - ListPartitionsReq(const ContextPtr& context, const std::string& collection_name, - std::vector& partition_list); - - Status - OnExecute() override; - - private: - const std::string collection_name_; - std::vector& partition_list_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/LoadCollectionReq.cpp b/proxy/src/server/delivery/request/LoadCollectionReq.cpp deleted file mode 100644 index b6a247c85e..0000000000 --- a/proxy/src/server/delivery/request/LoadCollectionReq.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/LoadCollectionReq.h" -#include "server/ValidationUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -#include -#include - -namespace milvus { -namespace server { - -LoadCollectionReq::LoadCollectionReq(const ContextPtr& context, const std::string& collection_name) - : BaseReq(context, ReqType::kLoadCollection), collection_name_(collection_name) { -} - -BaseReqPtr -LoadCollectionReq::Create(const ContextPtr& context, const std::string& collection_name) { - return std::shared_ptr(new LoadCollectionReq(context, collection_name)); -} - -Status -LoadCollectionReq::OnExecute() { - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/LoadCollectionReq.h b/proxy/src/server/delivery/request/LoadCollectionReq.h deleted file mode 100644 index e33aeb4e59..0000000000 --- a/proxy/src/server/delivery/request/LoadCollectionReq.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "server/delivery/request/BaseReq.h" - -#include -#include - -namespace milvus { -namespace server { - -class LoadCollectionReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const std::string& collection_name); - - protected: - LoadCollectionReq(const ContextPtr& context, const std::string& collection_name); - - Status - OnExecute() override; - - private: - const std::string collection_name_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/SearchReq.cpp b/proxy/src/server/delivery/request/SearchReq.cpp deleted file mode 100644 index 379972a9e8..0000000000 --- a/proxy/src/server/delivery/request/SearchReq.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/SearchReq.h" -#include "server/MessageWrapper.h" -// #include "db/Utils.h" -#include "server/ValidationUtil.h" -#include "utils/CommonUtil.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -#include -#include -#include -#include -#include -#ifdef ENABLE_CPU_PROFILING -#include -#endif - -namespace milvus { -namespace server { - -SearchReq::SearchReq(const ContextPtr& context, const ::milvus::grpc::SearchParam *request, - ::milvus::grpc::QueryResult *result) - : BaseReq(context, ReqType::kSearch), - request_(request), - result_(result) { -} - -BaseReqPtr -SearchReq::Create(const ContextPtr& context, const ::milvus::grpc::SearchParam *request, - ::milvus::grpc::QueryResult *response) { - - return std::shared_ptr(new SearchReq(context, request, response)); -} - -Status -SearchReq::OnExecute() { - auto message_wrapper = milvus::server::MessageWrapper::GetInstance(); - auto client = message_wrapper.MessageClient(); - - int64_t query_id; - milvus::grpc::SearchParam request; - - auto send_status = client->SendQueryMessage(*request_, timestamp_, query_id); - - if (!send_status.ok()){ - return send_status; - } - - Status status = client->GetQueryResult(query_id, result_); - - return status; -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/SearchReq.h b/proxy/src/server/delivery/request/SearchReq.h deleted file mode 100644 index 659ec4948c..0000000000 --- a/proxy/src/server/delivery/request/SearchReq.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "server/delivery/request/BaseReq.h" - -#include -#include -#include -#include -// #include "db/snapshot/Context.h" - -namespace milvus { -namespace server { - -class SearchReq : public BaseReq { - public: - static BaseReqPtr - Create(const ContextPtr& context, const ::milvus::grpc::SearchParam *request, - ::milvus::grpc::QueryResult *response); - - protected: - SearchReq(const ContextPtr& context, const ::milvus::grpc::SearchParam *request, - ::milvus::grpc::QueryResult *result); - - Status - OnExecute() override; - - private: - const ::milvus::grpc::SearchParam *request_; - ::milvus::grpc::QueryResult* result_; -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/Types.cpp b/proxy/src/server/delivery/request/Types.cpp deleted file mode 100644 index b9fbc6105d..0000000000 --- a/proxy/src/server/delivery/request/Types.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/request/Types.h" - -#include "server/context/Context.h" -#include "utils/CommonUtil.h" -#include "utils/Exception.h" -#include "utils/Log.h" - -namespace milvus { -namespace server { - -static const char* DQL_REQ_GROUP = "dql"; -static const char* DDL_DML_REQ_GROUP = "ddl_dml"; -static const char* INFO_REQ_GROUP = "info"; - -std::string -GetReqGroup(ReqType type) { - static std::unordered_map s_map_type_group = { - /* general operations */ - {ReqType::kCmd, INFO_REQ_GROUP}, - - /* collection operations */ - {ReqType::kCreateCollection, DDL_DML_REQ_GROUP}, - {ReqType::kDropCollection, DDL_DML_REQ_GROUP}, - {ReqType::kHasCollection, INFO_REQ_GROUP}, - {ReqType::kListCollections, INFO_REQ_GROUP}, - {ReqType::kGetCollectionInfo, INFO_REQ_GROUP}, - {ReqType::kGetCollectionStats, INFO_REQ_GROUP}, - {ReqType::kCountEntities, INFO_REQ_GROUP}, - - /* partition operations */ - {ReqType::kCreatePartition, DDL_DML_REQ_GROUP}, - {ReqType::kDropPartition, DDL_DML_REQ_GROUP}, - {ReqType::kHasPartition, INFO_REQ_GROUP}, - {ReqType::kListPartitions, INFO_REQ_GROUP}, - - /* index operations */ - {ReqType::kCreateIndex, DDL_DML_REQ_GROUP}, - {ReqType::kDropIndex, DDL_DML_REQ_GROUP}, - - /* data operations */ - {ReqType::kInsert, DDL_DML_REQ_GROUP}, - {ReqType::kGetEntityByID, INFO_REQ_GROUP}, - {ReqType::kDeleteEntityByID, DDL_DML_REQ_GROUP}, - {ReqType::kSearch, DQL_REQ_GROUP}, - {ReqType::kListIDInSegment, DQL_REQ_GROUP}, - - /* other operations */ - {ReqType::kLoadCollection, DQL_REQ_GROUP}, - {ReqType::kFlush, DDL_DML_REQ_GROUP}, - {ReqType::kCompact, DDL_DML_REQ_GROUP}, - }; - - auto iter = s_map_type_group.find(type); - if (iter == s_map_type_group.end()) { - LOG_SERVER_ERROR_ << "Unsupported request type: " << (int32_t)type; - throw Exception(SERVER_NOT_IMPLEMENT, "request group undefined"); - } - return iter->second; -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/request/Types.h b/proxy/src/server/delivery/request/Types.h deleted file mode 100644 index 6fe8e4a9e8..0000000000 --- a/proxy/src/server/delivery/request/Types.h +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "db/Types.h" -#include "grpc/message.grpc.pb.h" -#include "query/GeneralQuery.h" -#include "utils/Json.h" -#include "utils/Status.h" - -#include -#include -#include -#include -#include -#include -#include - -namespace milvus { -namespace server { - -struct FieldSchema { - engine::DataType field_type_; - milvus::json field_params_; - milvus::json index_params_; -}; - -using FieldsType = std::unordered_map; - -struct CollectionSchema { - std::string collection_name_; - FieldsType fields_; - milvus::json extra_params_; -}; - -struct TopKQueryResult { - int64_t row_num_; - engine::ResultIds id_list_; - engine::ResultDistances distance_list_; - - TopKQueryResult() { - row_num_ = 0; - } - - TopKQueryResult(int64_t row_num, const engine::ResultIds& id_list, const engine::ResultDistances& distance_list) { - row_num_ = row_num; - id_list_ = id_list; - distance_list_ = distance_list; - } -}; - -struct HybridQueryResult { - int64_t row_num_; - engine::ResultIds id_list_; - engine::ResultDistances distance_list_; - - std::vector vectors_; - std::vector attrs_; -}; - -struct IndexParam { - std::string collection_name_; - int64_t index_type_; - std::string index_name_; - std::string extra_params_; - - IndexParam() { - index_type_ = 0; - } - - IndexParam(const std::string& collection_name, int64_t index_type) { - collection_name_ = collection_name; - index_type_ = index_type; - } -}; - -enum class ReqType { - // general operations - kCmd = 0, - - /* collection operations */ - kCreateCollection = 100, - kDropCollection, - kHasCollection, - kListCollections, - kGetCollectionInfo, - kGetCollectionStats, - kCountEntities, - - /* partition operations */ - kCreatePartition = 200, - kDropPartition, - kHasPartition, - kListPartitions, - - /* index operations */ - kCreateIndex = 300, - kDropIndex, - kDescribeIndex, - - /* data operations */ - kInsert = 400, - kGetEntityByID, - kDeleteEntityByID, - kSearch, - kListIDInSegment, - - /* other operations */ - kLoadCollection = 500, - kFlush, - kCompact, -}; - -extern std::string -GetReqGroup(ReqType type); - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/strategy/ReqStrategy.h b/proxy/src/server/delivery/strategy/ReqStrategy.h deleted file mode 100644 index 5b069629b5..0000000000 --- a/proxy/src/server/delivery/strategy/ReqStrategy.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "server/delivery/request/BaseReq.h" -#include "utils/BlockingQueue.h" -#include "utils/Status.h" - -#include -#include -#include -#include -#include - -namespace milvus { -namespace server { - -class ReqStrategy { - protected: - ReqStrategy() = default; - - public: - virtual Status - ReScheduleQueue(const BaseReqPtr& req, std::queue& queue) = 0; -}; - -using ReqStrategyPtr = std::shared_ptr; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/strategy/SearchReqStrategy.cpp b/proxy/src/server/delivery/strategy/SearchReqStrategy.cpp deleted file mode 100644 index 3d369371c7..0000000000 --- a/proxy/src/server/delivery/strategy/SearchReqStrategy.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/delivery/strategy/SearchReqStrategy.h" -#include "config/ServerConfig.h" -#include "utils/CommonUtil.h" -#include "utils/Error.h" -#include "utils/Log.h" -#include "utils/TimeRecorder.h" - -#include -#include - -namespace milvus { -namespace server { - -SearchReqStrategy::SearchReqStrategy() { - ConfigMgr::GetInstance().Attach("engine.search_combine_nq", this); -} - -SearchReqStrategy::~SearchReqStrategy() { - ConfigMgr::GetInstance().Detach("engine.search_combine_nq", this); -} - -Status -SearchReqStrategy::ReScheduleQueue(const BaseReqPtr& req, std::queue& queue) { - if (req->type() != ReqType::kSearch) { - std::string msg = "search strategy can only handle search request"; - LOG_SERVER_ERROR_ << msg; - return Status(SERVER_UNSUPPORTED_ERROR, msg); - } - - queue.push(req); - - return Status::OK(); -} - -void -SearchReqStrategy::ConfigUpdate(const std::string& name) { - search_combine_nq_ = config.engine.search_combine_nq(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/delivery/strategy/SearchReqStrategy.h b/proxy/src/server/delivery/strategy/SearchReqStrategy.h deleted file mode 100644 index 59c385e397..0000000000 --- a/proxy/src/server/delivery/strategy/SearchReqStrategy.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "config/ConfigMgr.h" -#include "server/delivery/strategy/ReqStrategy.h" -#include "utils/Status.h" - -#include -#include -#include - -namespace milvus { -namespace server { - -class SearchReqStrategy : public ReqStrategy, public ConfigObserver { - public: - SearchReqStrategy(); - - ~SearchReqStrategy(); - - Status - ReScheduleQueue(const BaseReqPtr& request, std::queue& queue) override; - - public: - void - ConfigUpdate(const std::string& name); - - private: - int64_t search_combine_nq_ = 0; -}; - -using ReqStrategyPtr = std::shared_ptr; -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/grpc_impl/GrpcRequestHandler.cpp b/proxy/src/server/grpc_impl/GrpcRequestHandler.cpp deleted file mode 100644 index 2f694c8c92..0000000000 --- a/proxy/src/server/grpc_impl/GrpcRequestHandler.cpp +++ /dev/null @@ -1,882 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/grpc_impl/GrpcRequestHandler.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "query/BinaryQuery.h" -#include "server/ValidationUtil.h" -#include "server/context/ConnectionContext.h" -#include "tracing/TextMapCarrier.h" -#include "tracing/TracerUtil.h" -#include "utils/Log.h" -#include "server/MetaWrapper.h" - -namespace milvus { -namespace server { -namespace grpc { - -const char *EXTRA_PARAM_KEY = "params"; -const size_t MAXIMUM_FIELD_NUM = 64; - -::milvus::grpc::ErrorCode -ErrorMap(ErrorCode code) { - static const std::map code_map = { - {SERVER_UNEXPECTED_ERROR, ::milvus::grpc::ErrorCode::UNEXPECTED_ERROR}, - {SERVER_UNSUPPORTED_ERROR, ::milvus::grpc::ErrorCode::UNEXPECTED_ERROR}, - {SERVER_NULL_POINTER, ::milvus::grpc::ErrorCode::UNEXPECTED_ERROR}, - {SERVER_INVALID_ARGUMENT, ::milvus::grpc::ErrorCode::ILLEGAL_ARGUMENT}, - {SERVER_FILE_NOT_FOUND, ::milvus::grpc::ErrorCode::FILE_NOT_FOUND}, - {SERVER_NOT_IMPLEMENT, ::milvus::grpc::ErrorCode::UNEXPECTED_ERROR}, - {SERVER_CANNOT_CREATE_FOLDER, ::milvus::grpc::ErrorCode::CANNOT_CREATE_FOLDER}, - {SERVER_CANNOT_CREATE_FILE, ::milvus::grpc::ErrorCode::CANNOT_CREATE_FILE}, - {SERVER_CANNOT_DELETE_FOLDER, ::milvus::grpc::ErrorCode::CANNOT_DELETE_FOLDER}, - {SERVER_CANNOT_DELETE_FILE, ::milvus::grpc::ErrorCode::CANNOT_DELETE_FILE}, - {SERVER_COLLECTION_NOT_EXIST, ::milvus::grpc::ErrorCode::COLLECTION_NOT_EXISTS}, - {SERVER_INVALID_COLLECTION_NAME, ::milvus::grpc::ErrorCode::ILLEGAL_COLLECTION_NAME}, - {SERVER_INVALID_COLLECTION_DIMENSION, ::milvus::grpc::ErrorCode::ILLEGAL_DIMENSION}, - {SERVER_INVALID_VECTOR_DIMENSION, ::milvus::grpc::ErrorCode::ILLEGAL_DIMENSION}, - {SERVER_INVALID_FIELD_NAME, ::milvus::grpc::ErrorCode::ILLEGAL_ARGUMENT}, - {SERVER_INVALID_FIELD_NUM, ::milvus::grpc::ErrorCode::ILLEGAL_ARGUMENT}, - - {SERVER_INVALID_INDEX_TYPE, ::milvus::grpc::ErrorCode::ILLEGAL_INDEX_TYPE}, - {SERVER_INVALID_ROWRECORD, ::milvus::grpc::ErrorCode::ILLEGAL_ROWRECORD}, - {SERVER_INVALID_ROWRECORD_ARRAY, ::milvus::grpc::ErrorCode::ILLEGAL_ROWRECORD}, - {SERVER_INVALID_TOPK, ::milvus::grpc::ErrorCode::ILLEGAL_TOPK}, - {SERVER_INVALID_NPROBE, ::milvus::grpc::ErrorCode::ILLEGAL_ARGUMENT}, - {SERVER_INVALID_INDEX_NLIST, ::milvus::grpc::ErrorCode::ILLEGAL_NLIST}, - {SERVER_INVALID_INDEX_METRIC_TYPE, ::milvus::grpc::ErrorCode::ILLEGAL_METRIC_TYPE}, - {SERVER_INVALID_SEGMENT_ROW_COUNT, ::milvus::grpc::ErrorCode::ILLEGAL_ARGUMENT}, - {SERVER_ILLEGAL_VECTOR_ID, ::milvus::grpc::ErrorCode::ILLEGAL_VECTOR_ID}, - {SERVER_ILLEGAL_SEARCH_RESULT, ::milvus::grpc::ErrorCode::ILLEGAL_SEARCH_RESULT}, - {SERVER_CACHE_FULL, ::milvus::grpc::ErrorCode::CACHE_FAILED}, - {DB_META_TRANSACTION_FAILED, ::milvus::grpc::ErrorCode::META_FAILED}, - {SERVER_BUILD_INDEX_ERROR, ::milvus::grpc::ErrorCode::BUILD_INDEX_ERROR}, - {SERVER_OUT_OF_MEMORY, ::milvus::grpc::ErrorCode::OUT_OF_MEMORY}, - }; - - if (code_map.find(code) != code_map.end()) { - return code_map.at(code); - } else { - return ::milvus::grpc::ErrorCode::UNEXPECTED_ERROR; - } -} - -std::string -RequestMap(ReqType req_type) { - static const std::unordered_map req_map = { - {ReqType::kInsert, "Insert"}, {ReqType::kCreateIndex, "CreateIndex"}, {ReqType::kSearch, "Search"}, - {ReqType::kFlush, "Flush"}, {ReqType::kGetEntityByID, "GetEntityByID"}, {ReqType::kCompact, "Compact"}, - }; - - if (req_map.find(req_type) != req_map.end()) { - return req_map.at(req_type); - } else { - return "OtherReq"; - } -} - -namespace { -void -CopyVectorData(const google::protobuf::RepeatedPtrField<::milvus::grpc::VectorRowRecord> &grpc_records, - std::vector &vectors_data) { - // calculate buffer size - int64_t float_data_size = 0, binary_data_size = 0; - for (auto &record : grpc_records) { - float_data_size += record.float_data_size(); - binary_data_size += record.binary_data().size(); - } - - int64_t data_size = binary_data_size; - if (float_data_size > 0) { - data_size = float_data_size * sizeof(float); - } - - // copy vector data - vectors_data.resize(data_size); - int64_t offset = 0; - if (float_data_size > 0) { - for (auto &record : grpc_records) { - int64_t single_size = record.float_data_size() * sizeof(float); - memcpy(&vectors_data[offset], record.float_data().data(), single_size); - offset += single_size; - } - } else if (binary_data_size > 0) { - for (auto &record : grpc_records) { - int64_t single_size = record.binary_data().size(); - memcpy(&vectors_data[offset], record.binary_data().data(), single_size); - offset += single_size; - } - } -} - -void -DeSerialization(const ::milvus::grpc::GeneralQuery &general_query, query::BooleanQueryPtr &boolean_clause, - query::QueryPtr &query_ptr) { -} - -void -ConstructResults(const TopKQueryResult &result, ::milvus::grpc::QueryResult *response) { - if (!response) { - return; - } - - response->set_row_num(result.row_num_); - - response->mutable_entities()->mutable_ids()->Resize(static_cast(result.id_list_.size()), 0); - memcpy(response->mutable_entities()->mutable_ids()->mutable_data(), result.id_list_.data(), - result.id_list_.size() * sizeof(int64_t)); - - response->mutable_distances()->Resize(static_cast(result.distance_list_.size()), 0.0); - memcpy(response->mutable_distances()->mutable_data(), result.distance_list_.data(), - result.distance_list_.size() * sizeof(float)); -} - -class GrpcConnectionContext : public milvus::server::ConnectionContext { - public: - explicit GrpcConnectionContext(::grpc::ServerContext *context) : context_(context) { - } - - bool - IsConnectionBroken() const override { - if (context_ == nullptr) { - return true; - } - - return context_->IsCancelled(); - } - - private: - ::grpc::ServerContext *context_ = nullptr; -}; - -} // namespace - -namespace { - -#define REQ_ID ("request_id") - -std::atomic _sequential_id; - -int64_t -get_sequential_id() { - return _sequential_id++; -} - -void -set_request_id(::grpc::ServerContext *context, const std::string &request_id) { - if (not context) { - // error - LOG_SERVER_ERROR_ << "set_request_id: grpc::ServerContext is nullptr" << std::endl; - return; - } - - context->AddInitialMetadata(REQ_ID, request_id); -} - -std::string -get_request_id(::grpc::ServerContext *context) { - if (not context) { - // error - LOG_SERVER_ERROR_ << "get_request_id: grpc::ServerContext is nullptr" << std::endl; - return "INVALID_ID"; - } - - auto server_metadata = context->server_metadata(); - - auto request_id_kv = server_metadata.find(REQ_ID); - if (request_id_kv == server_metadata.end()) { - // error - LOG_SERVER_ERROR_ << std::string(REQ_ID) << " not found in grpc.server_metadata" << std::endl; - return "INVALID_ID"; - } - - return request_id_kv->second.data(); -} - -} // namespace - -GrpcRequestHandler::GrpcRequestHandler(const std::shared_ptr &tracer) - : tracer_(tracer), random_num_generator_() { - std::random_device random_device; - random_num_generator_.seed(random_device()); -} - -void -GrpcRequestHandler::OnPostRecvInitialMetaData( - ::grpc::experimental::ServerRpcInfo *server_rpc_info, - ::grpc::experimental::InterceptorBatchMethods *interceptor_batch_methods) { - std::unordered_map text_map; - auto *metadata_map = interceptor_batch_methods->GetRecvInitialMetadata(); - auto context_kv = metadata_map->find(tracing::TracerUtil::GetTraceContextHeaderName()); - if (context_kv != metadata_map->end()) { - text_map[std::string(context_kv->first.data(), context_kv->first.length())] = - std::string(context_kv->second.data(), context_kv->second.length()); - } - // test debug mode - // if (std::string(server_rpc_info->method()).find("Search") != std::string::npos) { - // text_map["demo-debug-id"] = "debug-id"; - // } - - tracing::TextMapCarrier carrier{text_map}; - auto span_context_maybe = tracer_->Extract(carrier); - if (!span_context_maybe) { - std::cerr << span_context_maybe.error().message() << std::endl; - return; - } - auto span = tracer_->StartSpan(server_rpc_info->method(), {opentracing::ChildOf(span_context_maybe->get())}); - - auto server_context = server_rpc_info->server_context(); - auto client_metadata = server_context->client_metadata(); - - // if client provide request_id in metadata, milvus just use it, - // else milvus generate a sequential id. - std::string request_id; - auto request_id_kv = client_metadata.find("request_id"); - if (request_id_kv != client_metadata.end()) { - request_id = request_id_kv->second.data(); - LOG_SERVER_DEBUG_ << "client provide request_id: " << request_id; - - // if request_id is being used by another request, - // convert it to request_id_n. - std::lock_guard lock(context_map_mutex_); - if (context_map_.find(request_id) == context_map_.end()) { - // if not found exist, mark - context_map_[request_id] = nullptr; - } else { - // Finding a unused suffix - int64_t suffix = 1; - std::string try_request_id; - bool exist = true; - do { - try_request_id = request_id + "_" + std::to_string(suffix); - exist = context_map_.find(try_request_id) != context_map_.end(); - suffix++; - } while (exist); - context_map_[try_request_id] = nullptr; - } - } else { - request_id = std::to_string(get_sequential_id()); - set_request_id(server_context, request_id); - LOG_SERVER_DEBUG_ << "milvus generate request_id: " << request_id; - } - - auto trace_context = std::make_shared(span); - auto context = std::make_shared(request_id); - context->SetTraceContext(trace_context); - SetContext(server_rpc_info->server_context(), context); -} - -void -GrpcRequestHandler::OnPreSendMessage(::grpc::experimental::ServerRpcInfo *server_rpc_info, - ::grpc::experimental::InterceptorBatchMethods *interceptor_batch_methods) { - std::lock_guard lock(context_map_mutex_); - auto request_id = get_request_id(server_rpc_info->server_context()); - - if (context_map_.find(request_id) == context_map_.end()) { - // error - LOG_SERVER_ERROR_ << "request_id " << request_id << " not found in context_map_"; - return; - } - context_map_[request_id]->GetTraceContext()->GetSpan()->Finish(); - context_map_.erase(request_id); -} - -std::shared_ptr -GrpcRequestHandler::GetContext(::grpc::ServerContext *server_context) { - std::lock_guard lock(context_map_mutex_); - auto request_id = get_request_id(server_context); - - auto iter = context_map_.find(request_id); - if (iter == context_map_.end()) { - LOG_SERVER_ERROR_ << "GetContext: request_id " << request_id << " not found in context_map_"; - return nullptr; - } - - if (iter->second != nullptr) { - ConnectionContextPtr connection_context = std::make_shared(server_context); - iter->second->SetConnectionContext(connection_context); - } - return iter->second; -} - -void -GrpcRequestHandler::SetContext(::grpc::ServerContext *server_context, const std::shared_ptr &context) { - std::lock_guard lock(context_map_mutex_); - auto request_id = get_request_id(server_context); - context_map_[request_id] = context; -} - -uint64_t -GrpcRequestHandler::random_id() const { - std::lock_guard lock(random_mutex_); - auto value = random_num_generator_(); - while (value == 0) { - value = random_num_generator_(); - } - return value; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -::grpc::Status -GrpcRequestHandler::CreateCollection(::grpc::ServerContext *context, const ::milvus::grpc::Mapping *request, - ::milvus::grpc::Status *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - Status status = req_handler_.CreateCollection(GetContext(context), request); - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response, status, context) - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::HasCollection(::grpc::ServerContext *context, const ::milvus::grpc::CollectionName *request, - ::milvus::grpc::BoolReply *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - bool has_collection = false; - - Status status = req_handler_.HasCollection(GetContext(context), request->collection_name(), has_collection); - response->set_bool_reply(has_collection); - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response->mutable_status(), status, context); - - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::DropCollection(::grpc::ServerContext *context, const ::milvus::grpc::CollectionName *request, - ::milvus::grpc::Status *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - Status status = req_handler_.DropCollection(GetContext(context), request->collection_name()); - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response, status, context); - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::CreateIndex(::grpc::ServerContext *context, const ::milvus::grpc::IndexParam *request, - ::milvus::grpc::Status *response) { - CHECK_NULLPTR_RETURN(request) - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - -// milvus::json json_params; -// for (int i = 0; i < request->extra_params_size(); i++) { -// const ::milvus::grpc::KeyValuePair &extra = request->extra_params(i); -// if (extra.key() == EXTRA_PARAM_KEY) { -// json_params[EXTRA_PARAM_KEY] = json::parse(extra.value()); -// } else { -// json_params[extra.key()] = extra.value(); -// } -// } - - Status status = req_handler_.CreateIndex(GetContext(context), request); - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response, status, context); - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::DescribeIndex(::grpc::ServerContext *context, const ::milvus::grpc::IndexParam *request, - ::milvus::grpc::IndexParam *response) { - CHECK_NULLPTR_RETURN(request) - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - std::string index_name; - milvus::json index_params; - Status status = req_handler_.DescribeIndex(GetContext(context), request->collection_name(), request->field_name(), - index_name, index_params); - - response->set_collection_name(request->collection_name()); - response->set_field_name(request->field_name()); - ::milvus::grpc::KeyValuePair *kv = response->add_extra_params(); - kv->set_key(EXTRA_PARAM_KEY); - kv->set_value(index_params.dump()); - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response->mutable_status(), status, context); - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::DropIndex(::grpc::ServerContext *context, const ::milvus::grpc::IndexParam *request, - ::milvus::grpc::Status *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - Status status = req_handler_.DropIndex(GetContext(context), request->collection_name(), request->field_name(), - request->index_name()); - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response, status, context); - - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::GetEntityByID(::grpc::ServerContext *context, const ::milvus::grpc::EntityIdentity *request, - ::milvus::grpc::Entities *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::GetEntityIDs(::grpc::ServerContext *context, const ::milvus::grpc::GetEntityIDsParam *request, - ::milvus::grpc::EntityIds *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::SearchInSegment(::grpc::ServerContext *context, const ::milvus::grpc::SearchInSegmentParam *request, - ::milvus::grpc::QueryResult *response) { - - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::DescribeCollection(::grpc::ServerContext *context, const ::milvus::grpc::CollectionName *request, - ::milvus::grpc::Mapping *response) { - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - CHECK_NULLPTR_RETURN(request); - - Status status = req_handler_.GetCollectionInfo(GetContext(context), request, *response); - SET_RESPONSE(response->mutable_status(), status, context) - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::CountCollection(::grpc::ServerContext *context, const ::milvus::grpc::CollectionName *request, - ::milvus::grpc::CollectionRowCount *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - int64_t row_count = 0; - Status status = req_handler_.CountEntities(GetContext(context), request->collection_name(), row_count); - response->set_collection_row_count(row_count); - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response->mutable_status(), status, context); - - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::ShowCollections(::grpc::ServerContext *context, const ::milvus::grpc::Command *request, - ::milvus::grpc::CollectionNameList *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - std::vector collections; - Status status = req_handler_.ListCollections(GetContext(context), collections); - for (auto &collection : collections) { - response->add_collection_names(collection); - } - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response->mutable_status(), status, context); - - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::ShowCollectionInfo(::grpc::ServerContext *context, const ::milvus::grpc::CollectionName *request, - ::milvus::grpc::CollectionInfo *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - std::string collection_stats; - Status status = req_handler_.GetCollectionStats(GetContext(context), request->collection_name(), collection_stats); - response->set_json_info(collection_stats); - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response->mutable_status(), status, context); - - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::Cmd(::grpc::ServerContext *context, const ::milvus::grpc::Command *request, - ::milvus::grpc::StringReply *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - std::string reply; - Status status; - - std::string cmd = request->cmd(); - std::vector requests; - if (cmd == "requests") { - std::lock_guard lock(context_map_mutex_); - for (auto &iter : context_map_) { - if (nullptr == iter.second) { - continue; - } - if (iter.second->ReqID() == get_request_id(context)) { - continue; - } - auto request_str = RequestMap(iter.second->GetReqType()) + "-" + iter.second->ReqID(); - requests.emplace_back(request_str); - } - nlohmann::json reply_json; - reply_json["requests"] = requests; - reply = reply_json.dump(); - response->set_string_reply(reply); - } else { - status = req_handler_.Cmd(GetContext(context), cmd, reply); - response->set_string_reply(reply); - } - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response->mutable_status(), status, context); - - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::DeleteByID(::grpc::ServerContext *context, const ::milvus::grpc::DeleteByIDParam *request, - ::milvus::grpc::Status *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - Status status = req_handler_.DeleteEntityByID(GetContext(context), request); - SET_RESPONSE(response, status, context) - - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::PreloadCollection(::grpc::ServerContext *context, const ::milvus::grpc::CollectionName *request, - ::milvus::grpc::Status *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - Status status = req_handler_.LoadCollection(GetContext(context), request->collection_name()); - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response, status, context); - - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::CreatePartition(::grpc::ServerContext *context, const ::milvus::grpc::PartitionParam *request, - ::milvus::grpc::Status *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - Status status = req_handler_.CreatePartition(GetContext(context), request->collection_name(), request->tag()); - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response, status, context); - - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::HasPartition(::grpc::ServerContext *context, const ::milvus::grpc::PartitionParam *request, - ::milvus::grpc::BoolReply *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - bool has_collection = false; - - Status status = - req_handler_.HasPartition(GetContext(context), request->collection_name(), request->tag(), has_collection); - response->set_bool_reply(has_collection); - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response->mutable_status(), status, context); - - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::ShowPartitions(::grpc::ServerContext *context, const ::milvus::grpc::CollectionName *request, - ::milvus::grpc::PartitionList *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - std::vector partition_names; - Status status = req_handler_.ListPartitions(GetContext(context), request->collection_name(), partition_names); - for (auto &pn : partition_names) { - response->add_partition_tag_array(pn); - } - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response->mutable_status(), status, context); - - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::DropPartition(::grpc::ServerContext *context, const ::milvus::grpc::PartitionParam *request, - ::milvus::grpc::Status *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - Status status = req_handler_.DropPartition(GetContext(context), request->collection_name(), request->tag()); - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response, status, context); - - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::Flush(::grpc::ServerContext *context, const ::milvus::grpc::FlushParam *request, - ::milvus::grpc::Status *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - std::vector collection_names; - for (int32_t i = 0; i < request->collection_name_array().size(); i++) { - collection_names.push_back(request->collection_name_array(i)); - } - Status status = req_handler_.Flush(GetContext(context), collection_names); - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response, status, context); - - return ::grpc::Status::OK; -} - -::grpc::Status -GrpcRequestHandler::Compact(::grpc::ServerContext *context, const ::milvus::grpc::CompactParam *request, - ::milvus::grpc::Status *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - Status status = req_handler_.Compact(GetContext(context), request->collection_name(), request->threshold()); - - LOG_SERVER_INFO_ << LogOut("Request [%s] %s end.", GetContext(context)->ReqID().c_str(), __func__); - SET_RESPONSE(response, status, context); - - return ::grpc::Status::OK; -} - -/*******************************************New Interface*********************************************/ - -::grpc::Status -GrpcRequestHandler::Insert(::grpc::ServerContext *context, const ::milvus::grpc::InsertParam *request, - ::milvus::grpc::EntityIds *response) { - - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - // check insert param is valid - if (request->entity_id_array_size() != 0 && request->entity_id_array_size() != request->rows_data_size()) { - auto status = Status{SERVER_INVALID_ROWRECORD_ARRAY, "ID size not matches entity size"}; - SET_RESPONSE(response->mutable_status(), status, context); - return ::grpc::Status::OK; - } - - // check if collection exist, using `HasCollection` after. - try { - MetaWrapper::GetInstance().AskCollectionSchema(request->collection_name()); - } - catch (const std::exception& e){ - // means collection not exit - SET_RESPONSE(response->mutable_status(), Status(SERVER_COLLECTION_NOT_EXIST, "Collection not exist " + request->collection_name()), context) - return ::grpc::Status::OK; - } - - - // generate uid for entities - //if (request->entity_id_array_size() == 0) { - // auto ids = std::vector(request->rows_data_size()); - //} - // auto *r = const_cast<::milvus::grpc::InsertParam *>(request); - // r->set_entity_id_array(0,100); - - // delivery to pulsar message topic - Status status = req_handler_.Insert(GetContext(context), request); - if (status.ok()) { - response->mutable_entity_id_array()->CopyFrom(request->entity_id_array()); - } - SET_RESPONSE(response->mutable_status(), status, context); - return ::grpc::Status::OK; - -} - -::grpc::Status -GrpcRequestHandler::SearchPB(::grpc::ServerContext *context, const ::milvus::grpc::SearchParamPB *request, - ::milvus::grpc::QueryResult *response) { - CHECK_NULLPTR_RETURN(request); - - return ::grpc::Status::OK; -} - -Status -GrpcRequestHandler::ProcessLeafQueryJson(const nlohmann::json &json, query::BooleanQueryPtr &query, - std::string &field_name) { - auto status = Status::OK(); - if (json.contains("term")) { - auto leaf_query = std::make_shared(); - auto term_query = std::make_shared(); - nlohmann::json json_obj = json["term"]; - JSON_NULL_CHECK(json_obj); - JSON_OBJECT_CHECK(json_obj); - term_query->json_obj = json_obj; - nlohmann::json::iterator json_it = json_obj.begin(); - field_name = json_it.key(); - - leaf_query->term_query = term_query; - query->AddLeafQuery(leaf_query); - } else if (json.contains("range")) { - auto leaf_query = std::make_shared(); - auto range_query = std::make_shared(); - nlohmann::json json_obj = json["range"]; - JSON_NULL_CHECK(json_obj); - JSON_OBJECT_CHECK(json_obj); - range_query->json_obj = json_obj; - nlohmann::json::iterator json_it = json_obj.begin(); - field_name = json_it.key(); - - leaf_query->range_query = range_query; - query->AddLeafQuery(leaf_query); - } else if (json.contains("vector")) { - auto leaf_query = std::make_shared(); - auto vector_json = json["vector"]; - JSON_NULL_CHECK(vector_json); - - leaf_query->vector_placeholder = vector_json.get(); - query->AddLeafQuery(leaf_query); - } else { - return Status{SERVER_INVALID_ARGUMENT, "Leaf query get wrong key"}; - } - return status; -} - -Status -GrpcRequestHandler::ProcessBooleanQueryJson(const nlohmann::json &query_json, query::BooleanQueryPtr &boolean_query, - query::QueryPtr &query_ptr) { - auto status = Status::OK(); - if (query_json.empty()) { - return Status{SERVER_INVALID_ARGUMENT, "BoolQuery is null"}; - } - for (auto &el : query_json.items()) { - if (el.key() == "must") { - boolean_query->SetOccur(query::Occur::MUST); - auto must_json = el.value(); - if (!must_json.is_array()) { - std::string msg = "Must json string is not an array"; - return Status{SERVER_INVALID_DSL_PARAMETER, msg}; - } - - for (auto &json : must_json) { - auto must_query = std::make_shared(); - if (json.contains("must") || json.contains("should") || json.contains("must_not")) { - STATUS_CHECK(ProcessBooleanQueryJson(json, must_query, query_ptr)); - boolean_query->AddBooleanQuery(must_query); - } else { - std::string field_name; - STATUS_CHECK(ProcessLeafQueryJson(json, boolean_query, field_name)); - if (!field_name.empty()) { - query_ptr->index_fields.insert(field_name); - } - } - } - } else if (el.key() == "should") { - boolean_query->SetOccur(query::Occur::SHOULD); - auto should_json = el.value(); - if (!should_json.is_array()) { - std::string msg = "Should json string is not an array"; - return Status{SERVER_INVALID_DSL_PARAMETER, msg}; - } - - for (auto &json : should_json) { - auto should_query = std::make_shared(); - if (json.contains("must") || json.contains("should") || json.contains("must_not")) { - STATUS_CHECK(ProcessBooleanQueryJson(json, should_query, query_ptr)); - boolean_query->AddBooleanQuery(should_query); - } else { - std::string field_name; - STATUS_CHECK(ProcessLeafQueryJson(json, boolean_query, field_name)); - if (!field_name.empty()) { - query_ptr->index_fields.insert(field_name); - } - } - } - } else if (el.key() == "must_not") { - boolean_query->SetOccur(query::Occur::MUST_NOT); - auto should_json = el.value(); - if (!should_json.is_array()) { - std::string msg = "Must_not json string is not an array"; - return Status{SERVER_INVALID_DSL_PARAMETER, msg}; - } - - for (auto &json : should_json) { - if (json.contains("must") || json.contains("should") || json.contains("must_not")) { - auto must_not_query = std::make_shared(); - STATUS_CHECK(ProcessBooleanQueryJson(json, must_not_query, query_ptr)); - boolean_query->AddBooleanQuery(must_not_query); - } else { - std::string field_name; - STATUS_CHECK(ProcessLeafQueryJson(json, boolean_query, field_name)); - if (!field_name.empty()) { - query_ptr->index_fields.insert(field_name); - } - } - } - } else { - std::string msg = "BoolQuery json string does not include bool query"; - return Status{SERVER_INVALID_DSL_PARAMETER, msg}; - } - } - - return status; -} - -Status -GrpcRequestHandler::DeserializeJsonToBoolQuery( - const google::protobuf::RepeatedPtrField<::milvus::grpc::VectorParam> &vector_params, const std::string &dsl_string, - query::BooleanQueryPtr &boolean_query, query::QueryPtr &query_ptr) { - return Status::OK(); -} - -::grpc::Status -GrpcRequestHandler::Search(::grpc::ServerContext *context, const ::milvus::grpc::SearchParam *request, - ::milvus::grpc::QueryResult *response) { - CHECK_NULLPTR_RETURN(request); - LOG_SERVER_INFO_ << LogOut("Request [%s] %s begin.", GetContext(context)->ReqID().c_str(), __func__); - - //TODO: check if the request is legal - - BaseReqPtr req_ptr = SearchReq::Create(GetContext(context), request, response); - ReqScheduler::ExecReq(req_ptr); - - return ::grpc::Status::OK; -} - -} // namespace grpc -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/grpc_impl/GrpcRequestHandler.h b/proxy/src/server/grpc_impl/GrpcRequestHandler.h deleted file mode 100644 index 20ee3221d5..0000000000 --- a/proxy/src/server/grpc_impl/GrpcRequestHandler.h +++ /dev/null @@ -1,349 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include - -#include -#include -#include -#include -#include -#include -#include "query/BinaryQuery.h" -#include "grpc/message.grpc.pb.h" -#include "opentracing/tracer.h" -#include "server/context/Context.h" -#include "server/delivery/ReqHandler.h" -#include "server/grpc_impl/interceptor/GrpcInterceptorHookHandler.h" -#include "src/utils/Status.h" -#include "message_client/Consumer.h" -#include "message_client/Producer.h" -#include "message_client/ClientV2.h" - -namespace milvus { -namespace server { -namespace grpc { - -#define CHECK_NULLPTR_RETURN(PTR) \ - if (nullptr == request) { \ - return ::grpc::Status::OK; \ - } - -#define SET_TRACING_TAG(STATUS, SERVER_CONTEXT) \ - if ((STATUS).code() != ::milvus::grpc::ErrorCode::SUCCESS) { \ - GetContext((SERVER_CONTEXT))->GetTraceContext()->GetSpan()->SetTag("error", true); \ - GetContext((SERVER_CONTEXT))->GetTraceContext()->GetSpan()->SetTag("error_message", (STATUS).message()); \ - } - -#define SET_RESPONSE(RESPONSE, STATUS, SERVER_CONTEXT) \ - do { \ - if ((STATUS).ok()) { \ - (RESPONSE)->set_error_code(::milvus::grpc::ErrorCode::SUCCESS); \ - } else { \ - (RESPONSE)->set_error_code(ErrorMap((STATUS).code())); \ - } \ - (RESPONSE)->set_reason((STATUS).message()); \ - SET_TRACING_TAG(STATUS, SERVER_CONTEXT); \ - } while (false); - -::milvus::grpc::ErrorCode -ErrorMap(ErrorCode code); - -extern const char* EXTRA_PARAM_KEY; - -class GrpcRequestHandler final : public ::milvus::grpc::MilvusService::Service, public GrpcInterceptorHookHandler { - public: - explicit GrpcRequestHandler(const std::shared_ptr& tracer); - - void - OnPostRecvInitialMetaData(::grpc::experimental::ServerRpcInfo* server_rpc_info, - ::grpc::experimental::InterceptorBatchMethods* interceptor_batch_methods) override; - - void - OnPreSendMessage(::grpc::experimental::ServerRpcInfo* server_rpc_info, - ::grpc::experimental::InterceptorBatchMethods* interceptor_batch_methods) override; - - std::shared_ptr - GetContext(::grpc::ServerContext* server_context); - - void - SetContext(::grpc::ServerContext* server_context, const std::shared_ptr& context); - - uint64_t - random_id() const; - - // * - // @brief This method is used to create collection - // - // @param CollectionSchema, use to provide collection information to be created. - // - // @return Status - ::grpc::Status - CreateCollection(::grpc::ServerContext* context, const ::milvus::grpc::Mapping* request, - ::milvus::grpc::Status* response) override; - // * - // @brief This method is used to test collection existence. - // - // @param CollectionName, collection name is going to be tested. - // - // @return BoolReply - ::grpc::Status - HasCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, - ::milvus::grpc::BoolReply* response) override; - // * - // @brief This method is used to get collection schema. - // - // @param CollectionName, target collection name. - // - // @return CollectionSchema - ::grpc::Status - DescribeCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, - ::milvus::grpc::Mapping* response) override; - // * - // @brief This method is used to get collection schema. - // - // @param CollectionName, target collection name. - // - // @return CollectionRowCount - ::grpc::Status - CountCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, - ::milvus::grpc::CollectionRowCount* response) override; - // * - // @brief This method is used to list all collections. - // - // @param Command, dummy parameter. - // - // @return CollectionNameList - ::grpc::Status - ShowCollections(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, - ::milvus::grpc::CollectionNameList* response) override; - // * - // @brief This method is used to get collection detail information. - // - // @param CollectionName, target collection name. - // - // @return CollectionInfo - ::grpc::Status - ShowCollectionInfo(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, - ::milvus::grpc::CollectionInfo* response); - - // * - // @brief This method is used to delete collection. - // - // @param CollectionName, collection name is going to be deleted. - // - // @return CollectionNameList - ::grpc::Status - DropCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, - ::milvus::grpc::Status* response) override; - // * - // @brief This method is used to build index by collection in sync mode. - // - // @param IndexParam, index paramters. - // - // @return Status - ::grpc::Status - CreateIndex(::grpc::ServerContext* context, const ::milvus::grpc::IndexParam* request, - ::milvus::grpc::Status* response) override; - // * - // @brief This method is used to describe index - // - // @param CollectionName, target collection name. - // - // @return IndexParam - ::grpc::Status - DescribeIndex(::grpc::ServerContext* context, const ::milvus::grpc::IndexParam* request, - ::milvus::grpc::IndexParam* response) override; - // * - // @brief This method is used to drop index - // - // @param CollectionName, target collection name. - // - // @return Status - ::grpc::Status - DropIndex(::grpc::ServerContext* context, const ::milvus::grpc::IndexParam* request, - ::milvus::grpc::Status* response) override; - // * - // @brief This method is used to create partition - // - // @param PartitionParam, partition parameters. - // - // @return Status - ::grpc::Status - CreatePartition(::grpc::ServerContext* context, const ::milvus::grpc::PartitionParam* request, - ::milvus::grpc::Status* response) override; - - // * - // @brief This method is used to test partition existence. - // - // @param PartitionParam, target partition. - // - // @return BoolReply - ::grpc::Status - HasPartition(::grpc::ServerContext* context, const ::milvus::grpc::PartitionParam* request, - ::milvus::grpc::BoolReply* response); - - // * - // @brief This method is used to show partition information - // - // @param CollectionName, target collection name. - // - // @return PartitionList - ::grpc::Status - ShowPartitions(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, - ::milvus::grpc::PartitionList* response) override; - // * - // @brief This method is used to drop partition - // - // @param PartitionName, target partition name. - // - // @return Status - ::grpc::Status - DropPartition(::grpc::ServerContext* context, const ::milvus::grpc::PartitionParam* request, - ::milvus::grpc::Status* response) override; - // * - // @brief This method is used to add vector array to collection. - // - // @param InsertParam, insert parameters. - // - // @return VectorIds - ::grpc::Status - Insert(::grpc::ServerContext* context, const ::milvus::grpc::InsertParam* request, - ::milvus::grpc::EntityIds* response) override; - // * - // @brief This method is used to get vectors data by id array. - // - // @param VectorsIdentity, target vector id array. - // - // @return VectorsData - ::grpc::Status - GetEntityByID(::grpc::ServerContext* context, const ::milvus::grpc::EntityIdentity* request, - ::milvus::grpc::Entities* response) override; - - // * - // @brief This method is used to get vector ids from a segment - // - // @param GetVectorIDsParam, target collection and segment - // - // @return VectorIds - ::grpc::Status - GetEntityIDs(::grpc::ServerContext* context, const ::milvus::grpc::GetEntityIDsParam* request, - ::milvus::grpc::EntityIds* response) override; - // * - // @brief This method is used to query vector in collection. - // - // @param SearchParam, search parameters. - // - // @return TopKQueryResultList - ::grpc::Status - Search(::grpc::ServerContext* context, const ::milvus::grpc::SearchParam* request, - ::milvus::grpc::QueryResult* response) override; - - // * - // @brief This method is used to query vector in specified files. - // - // @param SearchInFilesParam, search in files paremeters. - // - // @return TopKQueryResultList - ::grpc::Status - SearchInSegment(::grpc::ServerContext* context, const ::milvus::grpc::SearchInSegmentParam* request, - ::milvus::grpc::QueryResult* response) override; - - // * - // @brief This method is used to give the server status. - // - // @param Command, command string - // - // @return StringReply - ::grpc::Status - Cmd(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, - ::milvus::grpc::StringReply* response) override; - - // * - // @brief This method is used to delete vector by id - // - // @param DeleteByIDParam, delete parameters. - // - // @return status - ::grpc::Status - DeleteByID(::grpc::ServerContext* context, const ::milvus::grpc::DeleteByIDParam* request, - ::milvus::grpc::Status* response) override; - - // * - // @brief This method is used to preload collection - // - // @param CollectionName, target collection name. - // - // @return Status - ::grpc::Status - PreloadCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, - ::milvus::grpc::Status* response) override; - - // * - // @brief This method is used to flush buffer into storage. - // - // @param FlushParam, flush parameters - // - // @return Status - ::grpc::Status - Flush(::grpc::ServerContext* context, const ::milvus::grpc::FlushParam* request, - ::milvus::grpc::Status* response) override; - - // * - // @brief This method is used to compact collection - // - // @param CollectionName, target collection name. - // - // @return Status - ::grpc::Status - Compact(::grpc::ServerContext* context, const ::milvus::grpc::CompactParam* request, - ::milvus::grpc::Status* response) override; - - /*******************************************New Interface*********************************************/ - - ::grpc::Status - SearchPB(::grpc::ServerContext* context, const ::milvus::grpc::SearchParamPB* request, - ::milvus::grpc::QueryResult* response) override; - - void - RegisterRequestHandler(const ReqHandler& handler) { - req_handler_ = handler; - } - - Status - DeserializeJsonToBoolQuery(const google::protobuf::RepeatedPtrField<::milvus::grpc::VectorParam>& vector_params, - const std::string& dsl_string, query::BooleanQueryPtr& boolean_query, - query::QueryPtr& query_ptr); - - Status - ProcessBooleanQueryJson(const nlohmann::json& query_json, query::BooleanQueryPtr& boolean_query, - query::QueryPtr& query_ptr); - - Status - ProcessLeafQueryJson(const nlohmann::json& json, query::BooleanQueryPtr& query, std::string& field_name); - - private: - // May remove req_handler ? - ReqHandler req_handler_; - - std::unordered_map> context_map_; - std::shared_ptr tracer_; - - mutable std::mt19937_64 random_num_generator_; - mutable std::mutex random_mutex_; - mutable std::mutex context_map_mutex_; -}; - -} // namespace grpc -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/grpc_impl/GrpcServer.cpp b/proxy/src/server/grpc_impl/GrpcServer.cpp deleted file mode 100644 index 55a8415fd1..0000000000 --- a/proxy/src/server/grpc_impl/GrpcServer.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/grpc_impl/GrpcServer.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GrpcRequestHandler.h" -#include "config/ServerConfig.h" -// #include "server/DBWrapper.h" -#include "server/grpc_impl/interceptor/SpanInterceptor.h" -#include "utils/Log.h" -#include "message_client/ClientV2.h" -#include "server/timesync/TimeSync.h" -#include "server/delivery/ReqScheduler.h" - -namespace milvus { -namespace server { -namespace grpc { - -constexpr int64_t MESSAGE_SIZE = -1; - -// this class is to check port occupation during server start -class NoReusePortOption : public ::grpc::ServerBuilderOption { - public: - void - UpdateArguments(::grpc::ChannelArguments* args) override { - args->SetInt(GRPC_ARG_ALLOW_REUSEPORT, 0); - int grpc_concurrency = 4 * std::thread::hardware_concurrency(); - grpc_concurrency = std::max(32, grpc_concurrency); - grpc_concurrency = std::min(256, grpc_concurrency); - args->SetInt(GRPC_ARG_MAX_CONCURRENT_STREAMS, grpc_concurrency); - } - - void - UpdatePlugins(std::vector>* plugins) override { - } -}; - -void -GrpcServer::Start() { - thread_ptr_ = std::make_shared(&GrpcServer::StartService, this); -} - -void -GrpcServer::Stop() { - StopService(); - if (thread_ptr_) { - thread_ptr_->join(); - thread_ptr_ = nullptr; - } -} - -Status -GrpcServer::StartService() { - SetThreadName("grpcserv_thread"); - - std::string server_address(config.network.address() + ":" + std::to_string(config.network.port())); - - ::grpc::ServerBuilder builder; - builder.SetOption(std::unique_ptr<::grpc::ServerBuilderOption>(new NoReusePortOption)); - builder.SetMaxReceiveMessageSize(MESSAGE_SIZE); // default 4 * 1024 * 1024 - builder.SetMaxSendMessageSize(MESSAGE_SIZE); - - builder.SetCompressionAlgorithmSupportStatus(GRPC_COMPRESS_STREAM_GZIP, true); - builder.SetDefaultCompressionAlgorithm(GRPC_COMPRESS_STREAM_GZIP); - builder.SetDefaultCompressionLevel(GRPC_COMPRESS_LEVEL_NONE); - - GrpcRequestHandler service(opentracing::Tracer::Global()); - service.RegisterRequestHandler(ReqHandler()); - - builder.AddListeningPort(server_address, ::grpc::InsecureServerCredentials()); - builder.RegisterService(&service); - - // Add gRPC interceptor - using InterceptorI = ::grpc::experimental::ServerInterceptorFactoryInterface; - using InterceptorIPtr = std::unique_ptr; - std::vector creators; - - creators.push_back( - std::unique_ptr<::grpc::experimental::ServerInterceptorFactoryInterface>(new SpanInterceptorFactory(&service))); - - builder.experimental().SetInterceptorCreators(std::move(creators)); - - server_ptr_ = builder.BuildAndStart(); - server_ptr_->Wait(); - return Status::OK(); -} - -Status -GrpcServer::StopService() { - if (server_ptr_ != nullptr) { - server_ptr_->Shutdown(); - } - - return Status::OK(); -} - -} // namespace grpc -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/grpc_impl/GrpcServer.h b/proxy/src/server/grpc_impl/GrpcServer.h deleted file mode 100644 index 99968ad9f5..0000000000 --- a/proxy/src/server/grpc_impl/GrpcServer.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "utils/Status.h" - -#include -#include -#include -#include -#include - -namespace milvus { -namespace server { -namespace grpc { - -class GrpcServer { - public: - static GrpcServer& - GetInstance() { - static GrpcServer grpc_server; - return grpc_server; - } - - void - Start(); - void - Stop(); - - private: - GrpcServer() = default; - ~GrpcServer() = default; - - Status - StartService(); - Status - StopService(); - - private: - std::unique_ptr<::grpc::Server> server_ptr_; - std::shared_ptr thread_ptr_; -}; - -} // namespace grpc -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/grpc_impl/interceptor/GrpcInterceptorHookHandler.cpp b/proxy/src/server/grpc_impl/interceptor/GrpcInterceptorHookHandler.cpp deleted file mode 100644 index fa2d29341c..0000000000 --- a/proxy/src/server/grpc_impl/interceptor/GrpcInterceptorHookHandler.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/grpc_impl/interceptor/GrpcInterceptorHookHandler.h" - -namespace milvus { -namespace server { -namespace grpc { - -void -GrpcInterceptorHookHandler::OnPostRecvInitialMetaData( - ::grpc::experimental::ServerRpcInfo* server_rpc_info, - ::grpc::experimental::InterceptorBatchMethods* interceptor_batch_methods) { -} - -void -GrpcInterceptorHookHandler::OnPreSendMessage(::grpc::experimental::ServerRpcInfo* server_rpc_info, - ::grpc::experimental::InterceptorBatchMethods* interceptor_batch_methods) { -} - -} // namespace grpc -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/grpc_impl/interceptor/GrpcInterceptorHookHandler.h b/proxy/src/server/grpc_impl/interceptor/GrpcInterceptorHookHandler.h deleted file mode 100644 index c9618a5e0e..0000000000 --- a/proxy/src/server/grpc_impl/interceptor/GrpcInterceptorHookHandler.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include - -namespace milvus { -namespace server { -namespace grpc { - -class GrpcInterceptorHookHandler { - public: - virtual void - OnPostRecvInitialMetaData(::grpc::experimental::ServerRpcInfo* server_rpc_info, - ::grpc::experimental::InterceptorBatchMethods* interceptor_batch_methods); - - virtual void - OnPreSendMessage(::grpc::experimental::ServerRpcInfo* server_rpc_info, - ::grpc::experimental::InterceptorBatchMethods* interceptor_batch_methods); -}; - -} // namespace grpc -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/grpc_impl/interceptor/SpanInterceptor.cpp b/proxy/src/server/grpc_impl/interceptor/SpanInterceptor.cpp deleted file mode 100644 index 2515fdd390..0000000000 --- a/proxy/src/server/grpc_impl/interceptor/SpanInterceptor.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/grpc_impl/interceptor/SpanInterceptor.h" -#include "tracing/TracerUtil.h" - -namespace milvus { -namespace server { -namespace grpc { - -SpanInterceptor::SpanInterceptor(::grpc::experimental::ServerRpcInfo* info, GrpcInterceptorHookHandler* hook_handler) - : info_(info), hook_handler_(hook_handler) { -} - -void -SpanInterceptor::Intercept(::grpc::experimental::InterceptorBatchMethods* methods) { - if (methods->QueryInterceptionHookPoint(::grpc::experimental::InterceptionHookPoints::POST_RECV_INITIAL_METADATA)) { - hook_handler_->OnPostRecvInitialMetaData(info_, methods); - - } else if (methods->QueryInterceptionHookPoint(::grpc::experimental::InterceptionHookPoints::PRE_SEND_MESSAGE)) { - hook_handler_->OnPreSendMessage(info_, methods); - } - - methods->Proceed(); -} - -::grpc::experimental::Interceptor* -SpanInterceptorFactory::CreateServerInterceptor(::grpc::experimental::ServerRpcInfo* info) { - return new SpanInterceptor(info, hook_handler_); -} - -} // namespace grpc -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/grpc_impl/interceptor/SpanInterceptor.h b/proxy/src/server/grpc_impl/interceptor/SpanInterceptor.h deleted file mode 100644 index 1b241953e3..0000000000 --- a/proxy/src/server/grpc_impl/interceptor/SpanInterceptor.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include -#include - -#include "GrpcInterceptorHookHandler.h" - -namespace milvus { -namespace server { -namespace grpc { - -class SpanInterceptor : public ::grpc::experimental::Interceptor { - public: - SpanInterceptor(::grpc::experimental::ServerRpcInfo* info, GrpcInterceptorHookHandler* hook_handler); - - void - Intercept(::grpc::experimental::InterceptorBatchMethods* methods) override; - - private: - ::grpc::experimental::ServerRpcInfo* info_; - GrpcInterceptorHookHandler* hook_handler_; - // std::shared_ptr tracer_; - // std::unique_ptr span_; -}; - -class SpanInterceptorFactory : public ::grpc::experimental::ServerInterceptorFactoryInterface { - public: - explicit SpanInterceptorFactory(GrpcInterceptorHookHandler* hook_handler) : hook_handler_(hook_handler) { - } - - ::grpc::experimental::Interceptor* - CreateServerInterceptor(::grpc::experimental::ServerRpcInfo* info) override; - - private: - GrpcInterceptorHookHandler* hook_handler_; -}; - -} // namespace grpc -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/init/CpuChecker.cpp b/proxy/src/server/init/CpuChecker.cpp deleted file mode 100644 index 73beb97996..0000000000 --- a/proxy/src/server/init/CpuChecker.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/init/CpuChecker.h" - -#include -#include -#include - - -#include "utils/Log.h" -#include "utils/StringHelpFunctions.h" - -namespace milvus { -namespace server { - -Status -CpuChecker::CheckCpuInstructionSet() { - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/init/CpuChecker.h b/proxy/src/server/init/CpuChecker.h deleted file mode 100644 index f459f63740..0000000000 --- a/proxy/src/server/init/CpuChecker.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "utils/Status.h" - -namespace milvus { -namespace server { - -class CpuChecker { - public: - static Status - CheckCpuInstructionSet(); -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/init/Directory.cpp b/proxy/src/server/init/Directory.cpp deleted file mode 100644 index 6b868a2e85..0000000000 --- a/proxy/src/server/init/Directory.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/init/Directory.h" - -#include -#include -#include -#include - -#include "config/ServerConfig.h" - -namespace milvus::server { - -Status -Directory::Initialize(const std::string& path) { - try { - init(path); - } catch (std::exception& ex) { - return Status(SERVER_UNEXPECTED_ERROR, ex.what()); - } - return Status::OK(); -} - - -Status -Directory::Access(const std::string& path) { - try { - access_check(path); - } catch (std::exception& ex) { - return Status(SERVER_UNEXPECTED_ERROR, ex.what()); - } - return Status::OK(); -} - -void -Directory::init(const std::string& path) { - if (path.empty()) { - return; - } - try { - // Returns True if a new directory was created, otherwise false. - boost::filesystem::create_directories(path); - } catch (std::exception& ex) { - std::string msg = "Cannot create directory: " + path + ", reason: " + ex.what(); - throw std::runtime_error(msg); - } catch (...) { - std::string msg = "Cannot create directory: " + path; - throw std::runtime_error(msg); - } -} - -void -Directory::access_check(const std::string& path) { - if (path.empty()) { - return; - } - int ret = access(path.c_str(), F_OK | R_OK | W_OK); - if (0 != ret) { - std::string msg = "Cannot access path: " + path + ", error(" + std::to_string(errno) + - "): " + std::string(strerror(errno)) + "."; - throw std::runtime_error(msg); - } -} - -} // namespace milvus::server diff --git a/proxy/src/server/init/Directory.h b/proxy/src/server/init/Directory.h deleted file mode 100644 index 0e405c3d77..0000000000 --- a/proxy/src/server/init/Directory.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include - -#include "utils/Status.h" - -namespace milvus::server { - -class Directory { - public: - static Status - Initialize(const std::string& path); - - static Status - Lock(const std::string& path); - - static Status - Access(const std::string& path); - - private: - static void - init(const std::string& path); - - static void - lock(const std::string& path); - - static void - access_check(const std::string& path); -}; - -} // namespace milvus::server diff --git a/proxy/src/server/init/InstanceLockCheck.cpp b/proxy/src/server/init/InstanceLockCheck.cpp deleted file mode 100644 index 11172488b3..0000000000 --- a/proxy/src/server/init/InstanceLockCheck.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/init/InstanceLockCheck.h" - -#include -#include -#include -#include - -#include "utils/Log.h" - -namespace milvus { -namespace server { - -Status -InstanceLockCheck::Check(const std::string& path) { - std::string lock_path = path + "/lock"; - auto fd = open(lock_path.c_str(), O_RDWR | O_CREAT | O_NOFOLLOW, 0640); - if (fd < 0) { - std::string msg; - if (errno == EROFS) { - // Not using locking for read-only lock file - msg += "Lock file is read-only."; - } - msg += "Could not open file: " + lock_path + ", " + strerror(errno); - return Status(SERVER_UNEXPECTED_ERROR, msg); - } - - // Acquire a write lock - struct flock fl; - // exclusive lock - fl.l_type = F_WRLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - auto fcl = fcntl(fd, F_SETLK, &fl); - if (fcl == -1) { - std::string msg = "Can't lock file: " + lock_path + ", due to "; - if (errno == EACCES || errno == EAGAIN) { - msg += "permission denied. "; - } else if (errno == ENOLCK) { - // Not using locking for nfs mounted lock file - msg += "using nfs. "; - } else { - msg += std::string(strerror(errno)) + ". "; - } - close(fd); - return Status(SERVER_UNEXPECTED_ERROR, msg); - } - - LOG_SERVER_INFO_ << "InstanceLockCheck passed."; - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/init/InstanceLockCheck.h b/proxy/src/server/init/InstanceLockCheck.h deleted file mode 100644 index 14f88343d6..0000000000 --- a/proxy/src/server/init/InstanceLockCheck.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include "utils/Status.h" - -namespace milvus { -namespace server { - -class InstanceLockCheck { - public: - static Status - Check(const std::string& path); -}; // InstanceLockCheck - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/init/StorageChecker.cpp b/proxy/src/server/init/StorageChecker.cpp deleted file mode 100644 index 939c67ca59..0000000000 --- a/proxy/src/server/init/StorageChecker.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "server/init/StorageChecker.h" - -#include - -#include -#include - - -#include "config/ServerConfig.h" -#include "utils/Log.h" -#include "utils/StringHelpFunctions.h" - -namespace milvus { -namespace server { - -Status -StorageChecker::CheckStoragePermission() { - /* Check log file write permission */ - const std::string& logs_path = config.logs.path(); - int ret = access(logs_path.c_str(), F_OK | R_OK | W_OK); - if (0 != ret) { - std::string err_msg = - " Access log path " + logs_path + " fail. " + strerror(errno) + "(code: " + std::to_string(errno) + ")"; - LOG_SERVER_FATAL_ << err_msg; - std::cerr << err_msg << std::endl; - return Status(SERVER_UNEXPECTED_ERROR, err_msg); - } - - return Status::OK(); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/init/StorageChecker.h b/proxy/src/server/init/StorageChecker.h deleted file mode 100644 index b55ffdc705..0000000000 --- a/proxy/src/server/init/StorageChecker.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "utils/Status.h" - -namespace milvus { -namespace server { - -class StorageChecker { - public: - static Status - CheckStoragePermission(); -}; - -} // namespace server -} // namespace milvus diff --git a/proxy/src/server/timesync/TimeSync.cpp b/proxy/src/server/timesync/TimeSync.cpp deleted file mode 100644 index 9d3be50933..0000000000 --- a/proxy/src/server/timesync/TimeSync.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include -#include "config/ServerConfig.h" -#include "TimeSync.h" -#include "message_client/Producer.h" - -namespace milvus { -namespace timesync { - -TimeSync::TimeSync(int64_t id, - std::function timestamp, - const int interval, - const std::string &pulsar_addr, - const std::string &time_sync_topic) : - timestamp_(timestamp), interval_(interval), pulsar_addr_(pulsar_addr), time_sync_topic_(time_sync_topic) { - sync_msg_.set_peer_id(id); - auto timer = [&]() { - std::shared_ptr - client = std::make_shared(this->pulsar_addr_); - milvus::message_client::MsgProducer producer(client, this->time_sync_topic_); - - for (;;) { - if (this->stop_) break; - this->sync_msg_.set_peer_id(config.proxy_id()); - this->sync_msg_.set_timestamp(this->timestamp_()); - this->sync_msg_.set_sync_type(milvus::grpc::READ); - auto rst = producer.send(sync_msg_.SerializeAsString()); - if (rst != pulsar::ResultOk) { - //TODO, add log - } - std::this_thread::sleep_for(std::chrono::milliseconds(this->interval_)); - } - auto rst = producer.close(); - if (rst != pulsar::ResultOk) { - //TODO, add log or throw exception - } - rst = client->close(); - if (rst != pulsar::ResultOk) { - //TODO, add log or throw exception - } - }; - timer_ = std::thread(timer); -} - -TimeSync::~TimeSync() { - stop_ = true; - timer_.join(); -} - -void TimeSync::Stop() { - stop_ = true; -} - -bool TimeSync::IsStop() const { - return stop_; -} - -} // namespace timesync -} // namespace milvus \ No newline at end of file diff --git a/proxy/src/server/timesync/TimeSync.h b/proxy/src/server/timesync/TimeSync.h deleted file mode 100644 index 0449464340..0000000000 --- a/proxy/src/server/timesync/TimeSync.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include "grpc/message.pb.h" - -namespace milvus { -namespace timesync { - -class TimeSync { - public: - TimeSync(int64_t id, - std::function timestamp, - const int interval, - const std::string &pulsar_addr, - const std::string &time_sync_topic); - virtual ~TimeSync(); - - void Stop(); - bool IsStop() const; - private: - std::function timestamp_; - const int interval_; - const std::string pulsar_addr_; - const std::string time_sync_topic_; - bool stop_ = false; - std::thread timer_; - milvus::grpc::TimeSyncMsg sync_msg_; -}; - -} // namespace timesync -} // namespace milvus \ No newline at end of file diff --git a/proxy/src/server/tso/TSO.cpp b/proxy/src/server/tso/TSO.cpp deleted file mode 100644 index 36b5bc65b7..0000000000 --- a/proxy/src/server/tso/TSO.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "TSO.h" - -namespace milvus { -namespace server { - -TSOracle& TSOracle::GetInstance() { - static TSOracle oracle; - return oracle; -} - -uint64_t TSOracle::GetTimeStamp() { - std::lock_guard lock(mutex_); - auto now = std::chrono::high_resolution_clock::now(); - uint64_t physical = GetPhysical(now); - uint64_t ts = ComposeTs(physical, 0); - - if (last_time_stamp_ == ts) { - logical_++; - return ts + logical_; - } - last_time_stamp_ = ts; - logical_ = 0; - return ts; -} - -uint64_t TSOracle::GetPhysical(const std::chrono::high_resolution_clock::time_point &t) { - auto nano_time = std::chrono::duration_cast(t.time_since_epoch()); - return nano_time.count(); -} - -uint64_t TSOracle::ComposeTs(uint64_t physical, uint64_t logical) { - return uint64_t((physical << physical_shift_bits) + logical); -} - -} -} \ No newline at end of file diff --git a/proxy/src/server/tso/TSO.h b/proxy/src/server/tso/TSO.h deleted file mode 100644 index 159e36f5f7..0000000000 --- a/proxy/src/server/tso/TSO.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once -#include -#include - -namespace milvus { -namespace server { - -const uint32_t physical_shift_bits = 18; - -class TSOracle { - public: - static TSOracle& GetInstance(); - - uint64_t GetTimeStamp(); - - private: - uint64_t GetPhysical(const std::chrono::high_resolution_clock::time_point &t); - uint64_t ComposeTs(uint64_t physical, uint64_t logical); - - private: - TSOracle() = default; - - private: - std::mutex mutex_; - uint64_t last_time_stamp_ = 0; - uint64_t logical_ = 0; -}; -} -} \ No newline at end of file diff --git a/proxy/src/tracing/CMakeLists.txt b/proxy/src/tracing/CMakeLists.txt deleted file mode 100644 index 60ffb59a57..0000000000 --- a/proxy/src/tracing/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. -#------------------------------------------------------------------------------- - -aux_source_directory( ${MILVUS_ENGINE_SRC}/tracing TRACING_FILES ) - -add_library( tracing STATIC ${TRACING_FILES} ) - -set( TRACING_LIB opentracing::opentracing - opentracing::mocktracer - pthread - z - dl - ) - -target_link_libraries( tracing PUBLIC ${TRACING_LIB} ) diff --git a/proxy/src/tracing/TextMapCarrier.cpp b/proxy/src/tracing/TextMapCarrier.cpp deleted file mode 100644 index 5d6316dc70..0000000000 --- a/proxy/src/tracing/TextMapCarrier.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "tracing/TextMapCarrier.h" - -namespace milvus { -namespace tracing { - -TextMapCarrier::TextMapCarrier(std::unordered_map& text_map) : text_map_(text_map) { -} - -opentracing::expected -TextMapCarrier::Set(opentracing::string_view key, opentracing::string_view value) const { - // text_map_[key] = value; - // return {}; - opentracing::expected result; - - auto was_successful = text_map_.emplace(key, value); - if (was_successful.second) { - // Use a default constructed opentracing::expected to indicate - // success. - return result; - } else { - // `key` clashes with existing data, so the span context can't be encoded - // successfully; set opentracing::expected to an std::error_code. - return opentracing::make_unexpected(std::make_error_code(std::errc::not_supported)); - } -} - -opentracing::expected -TextMapCarrier::ForeachKey(F f) const { - // Iterate through all key-value pairs, the tracer will use the relevant keys - // to extract a span context. - for (auto& key_value : text_map_) { - auto was_successful = f(key_value.first, key_value.second); - if (!was_successful) { - // If the callback returns and unexpected value, bail out of the loop. - return was_successful; - } - } - - // Indicate successful iteration. - return {}; -} - -// Optional, define TextMapReader::LookupKey to allow for faster extraction. -opentracing::expected -TextMapCarrier::LookupKey(opentracing::string_view key) const { - auto iter = text_map_.find(key); - if (iter != text_map_.end()) { - return opentracing::make_unexpected(opentracing::key_not_found_error); - } - return opentracing::string_view{iter->second}; -} - -} // namespace tracing -} // namespace milvus diff --git a/proxy/src/tracing/TextMapCarrier.h b/proxy/src/tracing/TextMapCarrier.h deleted file mode 100644 index 95a96d9ef0..0000000000 --- a/proxy/src/tracing/TextMapCarrier.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include - -#include -#include - -namespace milvus { -namespace tracing { - -class TextMapCarrier : public opentracing::TextMapReader, public opentracing::TextMapWriter { - public: - explicit TextMapCarrier(std::unordered_map& text_map); - - opentracing::expected - Set(opentracing::string_view key, opentracing::string_view value) const override; - - using F = std::function(opentracing::string_view, opentracing::string_view)>; - - opentracing::expected - ForeachKey(F f) const override; - - // Optional, define TextMapReader::LookupKey to allow for faster extraction. - opentracing::expected - LookupKey(opentracing::string_view key) const override; - - private: - std::unordered_map& text_map_; -}; - -} // namespace tracing -} // namespace milvus diff --git a/proxy/src/tracing/TraceContext.cpp b/proxy/src/tracing/TraceContext.cpp deleted file mode 100644 index e6ecb3146f..0000000000 --- a/proxy/src/tracing/TraceContext.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "tracing/TraceContext.h" - -#include - -namespace milvus { -namespace tracing { - -TraceContext::TraceContext(std::unique_ptr& span) : span_(std::move(span)) { -} - -std::unique_ptr -TraceContext::Child(const std::string& operation_name) const { - auto child_span = span_->tracer().StartSpan(operation_name, {opentracing::ChildOf(&(span_->context()))}); - return std::move(std::make_unique(child_span)); -} - -std::unique_ptr -TraceContext::Follower(const std::string& operation_name) const { - auto follower_span = span_->tracer().StartSpan(operation_name, {opentracing::FollowsFrom(&(span_->context()))}); - return std::move(std::make_unique(follower_span)); -} - -const std::unique_ptr& -TraceContext::GetSpan() const { - return span_; -} - -} // namespace tracing -} // namespace milvus diff --git a/proxy/src/tracing/TraceContext.h b/proxy/src/tracing/TraceContext.h deleted file mode 100644 index 84de27fc9c..0000000000 --- a/proxy/src/tracing/TraceContext.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include - -#include -#include - -namespace milvus { -namespace tracing { - -class TraceContext { - public: - explicit TraceContext(std::unique_ptr& span); - - std::unique_ptr - Child(const std::string& operation_name) const; - - std::unique_ptr - Follower(const std::string& operation_name) const; - - const std::unique_ptr& - GetSpan() const; - - private: - // std::unique_ptr span_context_; - std::unique_ptr span_; -}; - -} // namespace tracing -} // namespace milvus diff --git a/proxy/src/tracing/TracerUtil.cpp b/proxy/src/tracing/TracerUtil.cpp deleted file mode 100644 index cd4662c757..0000000000 --- a/proxy/src/tracing/TracerUtil.cpp +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "tracing/TracerUtil.h" - -#include -#include - -#include -#include - -#include "thirdparty/nlohmann/json.hpp" - -namespace milvus { -namespace tracing { - -const char* TRACER_LIBRARY_CONFIG_NAME = "tracer_library"; -const char* TRACER_CONFIGURATION_CONFIG_NAME = "tracer_configuration"; -const char* TRACE_CONTEXT_HEADER_CONFIG_NAME = "TraceContextHeaderName"; - -const char* TracerUtil::tracer_context_header_name_; - -void -TracerUtil::InitGlobal(const std::string& config_path) { - if (!config_path.empty()) { - LoadConfig(config_path); - } else { - tracer_context_header_name_ = ""; - } -} - -void -TracerUtil::LoadConfig(const std::string& config_path) { - // Parse JSON config - std::ifstream tracer_config(config_path); - if (!tracer_config.good()) { - std::cerr << "Failed to open tracer config file " << config_path << ": " << std::strerror(errno) << std::endl; - return; - } - using json = nlohmann::json; - json tracer_config_json; - tracer_config >> tracer_config_json; - std::string tracing_shared_lib = tracer_config_json[TRACER_LIBRARY_CONFIG_NAME]; - std::string tracer_config_str = tracer_config_json[TRACER_CONFIGURATION_CONFIG_NAME].dump(); - tracer_context_header_name_ = tracer_config_json[TRACE_CONTEXT_HEADER_CONFIG_NAME].dump().c_str(); - - // Load the tracer library. - std::string error_message; - auto handle_maybe = opentracing::DynamicallyLoadTracingLibrary(tracing_shared_lib.c_str(), error_message); - if (!handle_maybe) { - std::cerr << "Failed to load tracer library: " << error_message << std::endl; - return; - } - - // Construct a tracer. - auto& tracer_factory = handle_maybe->tracer_factory(); - auto tracer_maybe = tracer_factory.MakeTracer(tracer_config_str.c_str(), error_message); - if (!tracer_maybe) { - std::cerr << "Failed to create tracer: " << error_message << std::endl; - return; - } - auto& tracer = *tracer_maybe; - - opentracing::Tracer::InitGlobal(tracer); -} - -std::string -TracerUtil::GetTraceContextHeaderName() { - return tracer_context_header_name_; -} - -} // namespace tracing -} // namespace milvus diff --git a/proxy/src/tracing/TracerUtil.h b/proxy/src/tracing/TracerUtil.h deleted file mode 100644 index 6d9279b9dd..0000000000 --- a/proxy/src/tracing/TracerUtil.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include - -namespace milvus { -namespace tracing { - -extern const char* TRACER_LIBRARY_CONFIG_NAME; -extern const char* TRACER_CONFIGURATION_CONFIG_NAME; -extern const char* TRACE_CONTEXT_HEADER_CONFIG_NAME; - -class TracerUtil { - public: - static void - InitGlobal(const std::string& config_path = ""); - - static std::string - GetTraceContextHeaderName(); - - private: - static void - LoadConfig(const std::string& config_path); - - static const char* tracer_context_header_name_; -}; - -} // namespace tracing -} // namespace milvus diff --git a/proxy/src/utils/BlockingQueue.h b/proxy/src/utils/BlockingQueue.h deleted file mode 100644 index 1b489f53e6..0000000000 --- a/proxy/src/utils/BlockingQueue.h +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include - -namespace milvus { - -template -class BlockingQueue { - public: - BlockingQueue() : mtx(), full_(), empty_() { - } - - virtual ~BlockingQueue() { - } - - BlockingQueue(const BlockingQueue& rhs) = delete; - - BlockingQueue& - operator=(const BlockingQueue& rhs) = delete; - - void - Put(const T& task) { - std::unique_lock lock(mtx); - full_.wait(lock, [this] { return (queue_.size() < capacity_); }); - queue_.push(task); - empty_.notify_all(); - } - - T - Take() { - std::unique_lock lock(mtx); - empty_.wait(lock, [this] { return !queue_.empty(); }); - T front(queue_.front()); - queue_.pop(); - full_.notify_all(); - return front; - } - - T - Front() { - std::unique_lock lock(mtx); - empty_.wait(lock, [this] { return !queue_.empty(); }); - T front(queue_.front()); - return front; - } - - T - Back() { - std::unique_lock lock(mtx); - empty_.wait(lock, [this] { return !queue_.empty(); }); - T back(queue_.back()); - return back; - } - - size_t - Size() const { - std::lock_guard lock(mtx); - return queue_.size(); - } - - bool - Empty() const { - std::unique_lock lock(mtx); - return queue_.empty(); - } - - void - SetCapacity(const size_t capacity) { - capacity_ = (capacity > 0 ? capacity : capacity_); - } - - protected: - mutable std::mutex mtx; - std::condition_variable full_; - std::condition_variable empty_; - std::queue queue_; - size_t capacity_ = 32; -}; - -} // namespace milvus diff --git a/proxy/src/utils/CMakeLists.txt b/proxy/src/utils/CMakeLists.txt deleted file mode 100644 index 8661cc00bd..0000000000 --- a/proxy/src/utils/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. -#------------------------------------------------------------------------------- - -aux_source_directory( ${MILVUS_ENGINE_SRC}/utils UTILS_FILES ) - -add_library( utils STATIC ${UTILS_FILES} ) - -target_link_libraries(utils - libboost_filesystem.a - libboost_system.a) \ No newline at end of file diff --git a/proxy/src/utils/CommonUtil.cpp b/proxy/src/utils/CommonUtil.cpp deleted file mode 100644 index 296a2d3078..0000000000 --- a/proxy/src/utils/CommonUtil.cpp +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "utils/CommonUtil.h" -#include "utils/Log.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - - -namespace milvus { - -namespace fs = boost::filesystem; - -bool -CommonUtil::IsDirectoryExist(const std::string& path) { - DIR* dp = nullptr; - if ((dp = opendir(path.c_str())) == nullptr) { - return false; - } - - closedir(dp); - return true; -} - -Status -CommonUtil::CreateDirectory(const std::string& path) { - if (path.empty()) { - return Status::OK(); - } - - struct stat directory_stat; - int status = stat(path.c_str(), &directory_stat); - if (status == 0) { - return Status::OK(); // already exist - } - - fs::path fs_path(path); - fs::path parent_path = fs_path.parent_path(); - Status err_status = CreateDirectory(parent_path.string()); - if (!err_status.ok()) { - return err_status; - } - - status = stat(path.c_str(), &directory_stat); - if (status == 0) { - return Status::OK(); // already exist - } - - int makeOK = mkdir(path.c_str(), S_IRWXU | S_IRGRP | S_IROTH); - if (makeOK != 0) { - return Status(SERVER_UNEXPECTED_ERROR, "failed to create directory: " + path); - } - - return Status::OK(); -} - -namespace { -void -RemoveDirectory(const std::string& path) { - DIR* dir = nullptr; - const int32_t buf_size = 256; - char file_name[buf_size]; - - std::string folder_name = path + "/%s"; - if ((dir = opendir(path.c_str())) != nullptr) { - struct dirent* dmsg; - while ((dmsg = readdir(dir)) != nullptr) { - if (strcmp(dmsg->d_name, ".") != 0 && strcmp(dmsg->d_name, "..") != 0) { - snprintf(file_name, buf_size, folder_name.c_str(), dmsg->d_name); - std::string tmp = file_name; - if (tmp.find(".") == std::string::npos) { - RemoveDirectory(file_name); - } - remove(file_name); - } - } - } - - if (dir != nullptr) { - closedir(dir); - } - remove(path.c_str()); -} -} // namespace - -Status -CommonUtil::DeleteDirectory(const std::string& path) { - if (path.empty()) { - return Status::OK(); - } - - struct stat directory_stat; - int statOK = stat(path.c_str(), &directory_stat); - if (statOK != 0) { - return Status::OK(); - } - - RemoveDirectory(path); - return Status::OK(); -} - -bool -CommonUtil::IsFileExist(const std::string& path) { - return (access(path.c_str(), F_OK) == 0); -} - -uint64_t -CommonUtil::GetFileSize(const std::string& path) { - struct stat file_info; - if (stat(path.c_str(), &file_info) < 0) { - return 0; - } - - return static_cast(file_info.st_size); -} - -std::string -CommonUtil::GetFileName(std::string filename) { - int pos = filename.find_last_of('/'); - return filename.substr(pos + 1); -} - -std::string -CommonUtil::GetExePath() { - const int64_t buf_len = 1024; - char buf[buf_len]; - int64_t cnt = readlink("/proc/self/exe", buf, buf_len); - if (cnt < 0 || cnt >= buf_len) { - return ""; - } - - buf[cnt] = '\0'; - - std::string exe_path = buf; - if (exe_path.rfind('/') != exe_path.length() - 1) { - std::string sub_str = exe_path.substr(0, exe_path.rfind('/')); - return sub_str + "/"; - } - return exe_path; -} - -bool -CommonUtil::TimeStrToTime(const std::string& time_str, time_t& time_integer, tm& time_struct, - const std::string& format) { - time_integer = 0; - memset(&time_struct, 0, sizeof(tm)); - - int ret = sscanf(time_str.c_str(), format.c_str(), &(time_struct.tm_year), &(time_struct.tm_mon), - &(time_struct.tm_mday), &(time_struct.tm_hour), &(time_struct.tm_min), &(time_struct.tm_sec)); - if (ret <= 0) { - return false; - } - - time_struct.tm_year -= 1900; - time_struct.tm_mon--; - time_integer = mktime(&time_struct); - - return true; -} - -void -CommonUtil::ConvertTime(time_t time_integer, tm& time_struct) { - localtime_r(&time_integer, &time_struct); -} - -void -CommonUtil::ConvertTime(tm time_struct, time_t& time_integer) { - time_integer = mktime(&time_struct); -} - -uint64_t -CommonUtil::RandomUINT64(){ - std::random_device rd; //Get a random seed from the OS entropy device, or whatever - std::mt19937_64 eng(rd()); //Use the 64-bit Mersenne Twister 19937 generator - //and seed it with entropy. - //Define the distribution, by default it goes from 0 to MAX(unsigned long long) - //or what have you. - std::uniform_int_distribution distr; - return distr(eng); - -} - -#ifdef ENABLE_CPU_PROFILING -std::string -CommonUtil::GetCurrentTimeStr() { - time_t tt; - time(&tt); - tt = tt + 8 * 60; - tm t; - gmtime_r(&tt, &t); - - std::string str = std::to_string(t.tm_year + 1900) + "_" + std::to_string(t.tm_mon + 1) + "_" + - std::to_string(t.tm_mday) + "_" + std::to_string(t.tm_hour) + "_" + std::to_string(t.tm_min) + - "_" + std::to_string(t.tm_sec); - return str; -} -#endif - -} // namespace milvus diff --git a/proxy/src/utils/CommonUtil.h b/proxy/src/utils/CommonUtil.h deleted file mode 100644 index ded802379d..0000000000 --- a/proxy/src/utils/CommonUtil.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "utils/Status.h" - -#include -#include - -namespace milvus { - -class CommonUtil { - public: - static bool - IsFileExist(const std::string& path); - static uint64_t - GetFileSize(const std::string& path); - static bool - IsDirectoryExist(const std::string& path); - static Status - CreateDirectory(const std::string& path); - static Status - DeleteDirectory(const std::string& path); - - static std::string - GetFileName(std::string filename); - static std::string - GetExePath(); - - static bool - TimeStrToTime(const std::string& time_str, time_t& time_integer, tm& time_struct, - const std::string& format = "%d-%d-%d %d:%d:%d"); - - static void - ConvertTime(time_t time_integer, tm& time_struct); - static void - ConvertTime(tm time_struct, time_t& time_integer); - - static uint64_t - RandomUINT64(); - -#ifdef ENABLE_CPU_PROFILING - static std::string - GetCurrentTimeStr(); -#endif -}; - -} // namespace milvus diff --git a/proxy/src/utils/ConfigUtils.cpp b/proxy/src/utils/ConfigUtils.cpp deleted file mode 100644 index da566b7971..0000000000 --- a/proxy/src/utils/ConfigUtils.cpp +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "utils/ConfigUtils.h" -#include "utils/Log.h" -#include "utils/StringHelpFunctions.h" - -#include -#include -#include -#ifdef MILVUS_GPU_VERSION -#include -#endif -#include -#include -#include -#include -#include -#include -#include - -#if defined(__x86_64__) -#define THREAD_MULTIPLY_CPU 1 -#elif defined(__powerpc64__) -#define THREAD_MULTIPLY_CPU 4 -#else -#define THREAD_MULTIPLY_CPU 1 -#endif - -namespace milvus { -namespace server { - -std::unordered_map BYTE_UNITS = { - {"b", 1}, - {"k", 1024}, - {"m", 1024 * 1024}, - {"g", 1024 * 1024 * 1024}, -}; - -bool -is_number(const std::string& s) { - return !s.empty() && std::find_if(s.begin(), s.end(), [](unsigned char c) { return !std::isdigit(c); }) == s.end(); -} - -bool -is_alpha(const std::string& s) { - return !s.empty() && std::find_if(s.begin(), s.end(), [](unsigned char c) { return !std::isalpha(c); }) == s.end(); -} - -std::string -str_tolower(std::string s) { - std::transform(s.begin(), s.end(), s.begin(), [](unsigned char c) { return std::tolower(c); }); - return s; -} - -int64_t -parse_bytes(const std::string& str, std::string& err) { - try { - std::string s = str; - if (is_number(s)) - return std::stoll(s); - if (s.length() == 0) - return 0; - - auto last_two = s.substr(s.length() - 2, 2); - auto last_one = s.substr(s.length() - 1); - if (is_alpha(last_two) && is_alpha(last_one)) - if (last_one == "b" or last_one == "B") - s = s.substr(0, s.length() - 1); - auto& units = BYTE_UNITS; - auto suffix = str_tolower(s.substr(s.length() - 1)); - - std::string digits_part; - if (is_number(suffix)) { - digits_part = s; - suffix = 'b'; - } else { - digits_part = s.substr(0, s.length() - 1); - } - - if (units.find(suffix) != units.end() or is_number(suffix)) { - auto digits = std::stoll(digits_part); - return digits * units[suffix]; - } else { - std::stringstream ss; - ss << "The specified value for memory (" << str << ") should specify the units." - << "The postfix should be one of the `b` `k` `m` `g` characters"; - err = ss.str(); - } - } catch (...) { - err = "Unknown error happened on parse bytes."; - } - return 0; -} - -bool -GetSystemMemInfo(int64_t& total_mem, int64_t& free_mem) { - struct sysinfo info; - int ret = sysinfo(&info); - total_mem = info.totalram; - free_mem = info.freeram; - - return ret == 0; // succeed 0, failed -1 -} - -bool -GetSystemAvailableThreads(int64_t& thread_count) { - // threadCnt = std::thread::hardware_concurrency(); - thread_count = sysconf(_SC_NPROCESSORS_CONF); - thread_count *= THREAD_MULTIPLY_CPU; - - if (thread_count == 0) { - thread_count = 8; - } - - return true; -} - -Status -ValidateGpuIndex(int32_t gpu_index) { -#ifdef MILVUS_GPU_VERSION - int num_devices = 0; - auto cuda_err = cudaGetDeviceCount(&num_devices); - - if (cuda_err != cudaSuccess) { - std::string msg = "Failed to get gpu card number, cuda error:" + std::to_string(cuda_err); - LOG_SERVER_ERROR_ << msg; - return Status(SERVER_UNEXPECTED_ERROR, msg); - } - - if (gpu_index >= num_devices) { - std::string msg = "Invalid gpu index: " + std::to_string(gpu_index); - LOG_SERVER_ERROR_ << msg; - return Status(SERVER_INVALID_ARGUMENT, msg); - } -#endif - - return Status::OK(); -} - -#ifdef MILVUS_GPU_VERSION -Status -GetGpuMemory(int32_t gpu_index, int64_t& memory) { - - cudaDeviceProp deviceProp; - auto cuda_err = cudaGetDeviceProperties(&deviceProp, gpu_index); - if (cuda_err) { - std::string msg = "Failed to get gpu properties for gpu" + std::to_string(gpu_index) + - " , cuda error:" + std::to_string(cuda_err); - LOG_SERVER_ERROR_ << msg; - return Status(SERVER_UNEXPECTED_ERROR, msg); - } - - memory = deviceProp.totalGlobalMem; - return Status::OK(); -} -#endif - -Status -ValidateIpAddress(const std::string& ip_address) { - struct in_addr address; - - int result = inet_pton(AF_INET, ip_address.c_str(), &address); - - switch (result) { - case 1: - return Status::OK(); - case 0: { - std::string msg = "Invalid IP address: " + ip_address; - LOG_SERVER_ERROR_ << msg; - return Status(SERVER_INVALID_ARGUMENT, msg); - } - default: { - std::string msg = "IP address conversion error: " + ip_address; - LOG_SERVER_ERROR_ << msg; - return Status(SERVER_UNEXPECTED_ERROR, msg); - } - } -} - -Status -ValidateStringIsNumber(const std::string& str) { - if (str.empty() || !std::all_of(str.begin(), str.end(), ::isdigit)) { - return Status(SERVER_INVALID_ARGUMENT, "Invalid number"); - } - try { - int64_t value = std::stol(str); - if (value < 0) { - return Status(SERVER_INVALID_ARGUMENT, "Negative number"); - } - } catch (...) { - return Status(SERVER_INVALID_ARGUMENT, "Invalid number"); - } - return Status::OK(); -} - -Status -ValidateStringIsBool(const std::string& str) { - std::string s = str; - std::transform(s.begin(), s.end(), s.begin(), ::tolower); - if (s == "true" || s == "on" || s == "yes" || s == "1" || s == "false" || s == "off" || s == "no" || s == "0" || - s.empty()) { - return Status::OK(); - } - return Status(SERVER_INVALID_ARGUMENT, "Invalid boolean: " + str); -} - -Status -ValidateStringIsFloat(const std::string& str) { - try { - float val = std::stof(str); - if (val < 0.0) { - return Status(SERVER_INVALID_ARGUMENT, "Negative float: " + str); - } - } catch (...) { - return Status(SERVER_INVALID_ARGUMENT, "Invalid float: " + str); - } - return Status::OK(); -} - -Status -ValidateDbURI(const std::string& uri) { - std::string dialectRegex = "(.*)"; - std::string usernameRegex = "(.*)"; - std::string passwordRegex = "(.*)"; - std::string hostRegex = "(.*)"; - std::string portRegex = "(.*)"; - std::string dbNameRegex = "(.*)"; - std::string uriRegexStr = dialectRegex + "\\:\\/\\/" + usernameRegex + "\\:" + passwordRegex + "\\@" + hostRegex + - "\\:" + portRegex + "\\/" + dbNameRegex; - std::regex uriRegex(uriRegexStr); - std::smatch pieces_match; - - bool okay = true; - - if (std::regex_match(uri, pieces_match, uriRegex)) { - std::string dialect = pieces_match[1].str(); - std::transform(dialect.begin(), dialect.end(), dialect.begin(), ::tolower); - if (dialect.find("mysql") == std::string::npos && dialect.find("sqlite") == std::string::npos && - dialect.find("mock") == std::string::npos) { - LOG_SERVER_ERROR_ << "Invalid dialect in URI: dialect = " << dialect; - okay = false; - } - - /* - * Could be DNS, skip checking - * - std::string host = pieces_match[4].str(); - if (!host.empty() && host != "localhost") { - if (ValidateIpAddress(host) != SERVER_SUCCESS) { - LOG_SERVER_ERROR_ << "Invalid host ip address in uri = " << host; - okay = false; - } - } - */ - - std::string port = pieces_match[5].str(); - if (!port.empty()) { - auto status = ValidateStringIsNumber(port); - if (!status.ok()) { - LOG_SERVER_ERROR_ << "Invalid port in uri = " << port; - okay = false; - } - } - } else { - LOG_SERVER_ERROR_ << "Wrong URI format: URI = " << uri; - okay = false; - } - - return (okay ? Status::OK() : Status(SERVER_INVALID_ARGUMENT, "Invalid db backend uri")); -} - -Status -ValidateStoragePath(const std::string& path) { - // Validate storage path if is valid, only correct absolute path will be validated pass - // Invalid path only contain character[a-zA-Z], number[0-9], '-', and '_', - // and path must start with '/'. - // examples below are invalid - // '/a//a', '/a--/a', '/-a/a', '/a@#/a', 'aaa/sfs' - std::string path_pattern = "^\\/(\\w+-?\\/?)+$"; - std::regex regex(path_pattern); - - return std::regex_match(path, regex) ? Status::OK() : Status(SERVER_INVALID_ARGUMENT, "Invalid file path"); -} - -Status -ValidateLogLevel(const std::string& level) { - std::set supported_level{"debug", "info", "warning", "error", "fatal"}; - - return supported_level.find(level) != supported_level.end() - ? Status::OK() - : Status(SERVER_INVALID_ARGUMENT, "Log level must be one of debug, info, warning, error and fatal."); -} - -bool -IsNumber(const std::string& s) { - return !s.empty() && std::all_of(s.begin(), s.end(), ::isdigit); -} - -} // namespace server -} // namespace milvus diff --git a/proxy/src/utils/ConfigUtils.h b/proxy/src/utils/ConfigUtils.h deleted file mode 100644 index 27d3ce6842..0000000000 --- a/proxy/src/utils/ConfigUtils.h +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include - -#include "utils/Status.h" - -namespace milvus { -namespace server { - -extern int64_t -parse_bytes(const std::string& str, std::string& err); - -extern bool -GetSystemMemInfo(int64_t& total_mem, int64_t& free_mem); - -extern bool -GetSystemAvailableThreads(int64_t& thread_count); - -extern Status -ValidateGpuIndex(int32_t gpu_index); - -#ifdef MILVUS_GPU_VERSION -extern Status -GetGpuMemory(int32_t gpu_index, int64_t& memory); -#endif - -extern Status -ValidateIpAddress(const std::string& ip_address); - -extern Status -ValidateStringIsNumber(const std::string& str); - -extern Status -ValidateStringIsBool(const std::string& str); - -extern Status -ValidateStringIsFloat(const std::string& str); - -extern Status -ValidateDbURI(const std::string& uri); - -extern Status -ValidateStoragePath(const std::string& path); - -extern Status -ValidateLogLevel(const std::string& level); - -extern bool -IsNumber(const std::string& s); -} // namespace server -} // namespace milvus diff --git a/proxy/src/utils/Error.h b/proxy/src/utils/Error.h deleted file mode 100644 index a82b4570db..0000000000 --- a/proxy/src/utils/Error.h +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include - -namespace milvus { - -using ErrorCode = int32_t; - -constexpr ErrorCode SERVER_SUCCESS = 0; -constexpr ErrorCode SERVER_ERROR_CODE_BASE = 30000; - -constexpr ErrorCode -ToServerErrorCode(const ErrorCode error_code) { - return SERVER_ERROR_CODE_BASE + error_code; -} - -constexpr ErrorCode DB_SUCCESS = 0; -constexpr ErrorCode DB_ERROR_CODE_BASE = 40000; - -constexpr ErrorCode -ToDbErrorCode(const ErrorCode error_code) { - return DB_ERROR_CODE_BASE + error_code; -} - -constexpr ErrorCode KNOWHERE_SUCCESS = 0; -constexpr ErrorCode KNOWHERE_ERROR_CODE_BASE = 50000; - -constexpr ErrorCode -ToKnowhereErrorCode(const ErrorCode error_code) { - return KNOWHERE_ERROR_CODE_BASE + error_code; -} - -constexpr ErrorCode WAL_SUCCESS = 0; -constexpr ErrorCode WAL_ERROR_CODE_BASE = 60000; - -constexpr ErrorCode -ToWalErrorCode(const ErrorCode error_code) { - return WAL_ERROR_CODE_BASE + error_code; -} - -constexpr ErrorCode SS_SUCCESS = 0; -constexpr ErrorCode SS_ERROR_CODE_BASE = 70000; - -constexpr ErrorCode -ToSSErrorCode(const ErrorCode error_code) { - return SS_ERROR_CODE_BASE + error_code; -} - -// server error code -constexpr ErrorCode SERVER_UNEXPECTED_ERROR = ToServerErrorCode(1); -constexpr ErrorCode SERVER_UNSUPPORTED_ERROR = ToServerErrorCode(2); -constexpr ErrorCode SERVER_NULL_POINTER = ToServerErrorCode(3); -constexpr ErrorCode SERVER_INVALID_ARGUMENT = ToServerErrorCode(4); -constexpr ErrorCode SERVER_FILE_NOT_FOUND = ToServerErrorCode(5); -constexpr ErrorCode SERVER_NOT_IMPLEMENT = ToServerErrorCode(6); -constexpr ErrorCode SERVER_CANNOT_CREATE_FOLDER = ToServerErrorCode(8); -constexpr ErrorCode SERVER_CANNOT_CREATE_FILE = ToServerErrorCode(9); -constexpr ErrorCode SERVER_CANNOT_DELETE_FOLDER = ToServerErrorCode(10); -constexpr ErrorCode SERVER_CANNOT_DELETE_FILE = ToServerErrorCode(11); -constexpr ErrorCode SERVER_BUILD_INDEX_ERROR = ToServerErrorCode(12); -constexpr ErrorCode SERVER_CANNOT_OPEN_FILE = ToServerErrorCode(13); -constexpr ErrorCode SERVER_FILE_MAGIC_BYTES_ERROR = ToServerErrorCode(14); -constexpr ErrorCode SERVER_FILE_SUM_BYTES_ERROR = ToServerErrorCode(15); -constexpr ErrorCode SERVER_CANNOT_READ_FILE = ToServerErrorCode(16); - -constexpr ErrorCode SERVER_COLLECTION_NOT_EXIST = ToServerErrorCode(100); -constexpr ErrorCode SERVER_INVALID_COLLECTION_NAME = ToServerErrorCode(101); -constexpr ErrorCode SERVER_INVALID_COLLECTION_DIMENSION = ToServerErrorCode(102); -constexpr ErrorCode SERVER_INVALID_VECTOR_DIMENSION = ToServerErrorCode(104); -constexpr ErrorCode SERVER_INVALID_INDEX_TYPE = ToServerErrorCode(105); -constexpr ErrorCode SERVER_INVALID_ROWRECORD = ToServerErrorCode(106); -constexpr ErrorCode SERVER_INVALID_ROWRECORD_ARRAY = ToServerErrorCode(107); -constexpr ErrorCode SERVER_INVALID_TOPK = ToServerErrorCode(108); -constexpr ErrorCode SERVER_ILLEGAL_VECTOR_ID = ToServerErrorCode(109); -constexpr ErrorCode SERVER_ILLEGAL_SEARCH_RESULT = ToServerErrorCode(110); -constexpr ErrorCode SERVER_CACHE_FULL = ToServerErrorCode(111); -constexpr ErrorCode SERVER_WRITE_ERROR = ToServerErrorCode(112); -constexpr ErrorCode SERVER_INVALID_NPROBE = ToServerErrorCode(113); -constexpr ErrorCode SERVER_INVALID_INDEX_NLIST = ToServerErrorCode(114); -constexpr ErrorCode SERVER_INVALID_INDEX_METRIC_TYPE = ToServerErrorCode(115); -constexpr ErrorCode SERVER_INVALID_SEGMENT_ROW_COUNT = ToServerErrorCode(116); -constexpr ErrorCode SERVER_OUT_OF_MEMORY = ToServerErrorCode(117); -constexpr ErrorCode SERVER_INVALID_PARTITION_TAG = ToServerErrorCode(118); -constexpr ErrorCode SERVER_INVALID_BINARY_QUERY = ToServerErrorCode(119); -constexpr ErrorCode SERVER_INVALID_DSL_PARAMETER = ToServerErrorCode(120); -constexpr ErrorCode SERVER_INVALID_FIELD_NAME = ToServerErrorCode(121); -constexpr ErrorCode SERVER_INVALID_FIELD_NUM = ToServerErrorCode(122); - -// db error code -constexpr ErrorCode DB_META_TRANSACTION_FAILED = ToDbErrorCode(1); -constexpr ErrorCode DB_ERROR = ToDbErrorCode(2); -constexpr ErrorCode DB_NOT_FOUND = ToDbErrorCode(3); -constexpr ErrorCode DB_ALREADY_EXIST = ToDbErrorCode(4); -constexpr ErrorCode DB_INVALID_PATH = ToDbErrorCode(5); -constexpr ErrorCode DB_INCOMPATIB_META = ToDbErrorCode(6); -constexpr ErrorCode DB_INVALID_META_URI = ToDbErrorCode(7); -constexpr ErrorCode DB_EMPTY_COLLECTION = ToDbErrorCode(8); -constexpr ErrorCode DB_BLOOM_FILTER_ERROR = ToDbErrorCode(9); -constexpr ErrorCode DB_PARTITION_NOT_FOUND = ToDbErrorCode(10); -constexpr ErrorCode DB_OUT_OF_STORAGE = ToDbErrorCode(11); -constexpr ErrorCode DB_META_QUERY_FAILED = ToDbErrorCode(12); - -// knowhere error code -constexpr ErrorCode KNOWHERE_ERROR = ToKnowhereErrorCode(1); -constexpr ErrorCode KNOWHERE_INVALID_ARGUMENT = ToKnowhereErrorCode(2); -constexpr ErrorCode KNOWHERE_UNEXPECTED_ERROR = ToKnowhereErrorCode(3); -constexpr ErrorCode KNOWHERE_NO_SPACE = ToKnowhereErrorCode(4); - -// knowhere error code -constexpr ErrorCode WAL_ERROR = ToWalErrorCode(1); -constexpr ErrorCode WAL_META_ERROR = ToWalErrorCode(2); -constexpr ErrorCode WAL_FILE_ERROR = ToWalErrorCode(3); -constexpr ErrorCode WAL_PATH_ERROR = ToWalErrorCode(4); - -// Snapshot error code -constexpr ErrorCode SS_ERROR = ToSSErrorCode(1); -constexpr ErrorCode SS_STALE_ERROR = ToSSErrorCode(2); -constexpr ErrorCode SS_NOT_FOUND_ERROR = ToSSErrorCode(3); -constexpr ErrorCode SS_INVALID_CONTEX_ERROR = ToSSErrorCode(4); -constexpr ErrorCode SS_DUPLICATED_ERROR = ToSSErrorCode(5); -constexpr ErrorCode SS_NOT_ACTIVE_ERROR = ToSSErrorCode(6); -constexpr ErrorCode SS_CONSTRAINT_CHECK_ERROR = ToSSErrorCode(7); -constexpr ErrorCode SS_INVALID_ARGUMENT_ERROR = ToSSErrorCode(8); -constexpr ErrorCode SS_OPERATION_PENDING = ToSSErrorCode(9); -constexpr ErrorCode SS_TIMEOUT = ToSSErrorCode(10); -constexpr ErrorCode SS_NOT_COMMITED = ToSSErrorCode(11); - -} // namespace milvus diff --git a/proxy/src/utils/Exception.h b/proxy/src/utils/Exception.h deleted file mode 100644 index abf1d1d01e..0000000000 --- a/proxy/src/utils/Exception.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "utils/Error.h" - -#include -#include - -namespace milvus { - -#define THROW_ERROR(err_code, err_msg) \ - LOG_ENGINE_ERROR_ << err_msg; \ - throw Exception(err_code, err_msg); - -class Exception : public std::exception { - public: - Exception(ErrorCode code, const std::string& message) : code_(code), message_(message) { - } - - ErrorCode - code() const noexcept { - return code_; - } - - const char* - what() const noexcept override { - if (message_.empty()) { - return "Default Exception."; - } else { - return message_.c_str(); - } - } - - ~Exception() noexcept override = default; - - protected: - ErrorCode code_; - std::string message_; -}; - -class InvalidArgumentException : public Exception { - public: - InvalidArgumentException() : Exception(SERVER_INVALID_ARGUMENT, "Invalid Argument") { - } - - explicit InvalidArgumentException(const std::string& message) : Exception(SERVER_INVALID_ARGUMENT, message) { - } -}; - -} // namespace milvus diff --git a/proxy/src/utils/Json.h b/proxy/src/utils/Json.h deleted file mode 100644 index 03ee2127fb..0000000000 --- a/proxy/src/utils/Json.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "nlohmann/json.hpp" - -namespace milvus { - -using json = nlohmann::json; - -#define JSON_NULL_CHECK(json) \ - do { \ - if (json.empty()) { \ - return Status{SERVER_INVALID_ARGUMENT, "Json is null"}; \ - } \ - } while (false) - -#define JSON_OBJECT_CHECK(json) \ - do { \ - if (!json.is_object()) { \ - return Status{SERVER_INVALID_ARGUMENT, "Json is not a json object"}; \ - } \ - } while (false) - -} // namespace milvus diff --git a/proxy/src/utils/Log.h b/proxy/src/utils/Log.h deleted file mode 100644 index f2a25d7de1..0000000000 --- a/proxy/src/utils/Log.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "log/Log.h" diff --git a/proxy/src/utils/SignalHandler.cpp b/proxy/src/utils/SignalHandler.cpp deleted file mode 100644 index 69ef16fedc..0000000000 --- a/proxy/src/utils/SignalHandler.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "utils/SignalHandler.h" -#include "utils/Log.h" - -#include -#include -#include - -namespace milvus { - -signal_func_ptr signal_routine_func = nullptr; - -void -HandleSignal(int signum) { - int32_t exit_code = 1; /* 0: normal exit; 1: exception */ - switch (signum) { - case SIGINT: - case SIGUSR2: - exit_code = 0; - /* no break */ - default: { - if (exit_code == 0) { - LOG_SERVER_INFO_ << "Server received signal: " << signum; - } else { - LOG_SERVER_INFO_ << "Server received critical signal: " << signum; - PrintStacktrace(); - } - if (signal_routine_func != nullptr) { - (*signal_routine_func)(exit_code); - } - } - } -} - -void -PrintStacktrace() { - const int bt_depth = 128; - void* array[bt_depth]; - int stack_num = backtrace(array, bt_depth); - char** stacktrace = backtrace_symbols(array, stack_num); - - LOG_SERVER_INFO_ << "Call stack:"; - for (int i = 0; i < stack_num; ++i) { - std::string info = stacktrace[i]; - std::cout << "No." << i << ": " << info << std::endl; - LOG_SERVER_INFO_ << info; - } - free(stacktrace); -} - -} // namespace milvus diff --git a/proxy/src/utils/SignalHandler.h b/proxy/src/utils/SignalHandler.h deleted file mode 100644 index 5c58886e45..0000000000 --- a/proxy/src/utils/SignalHandler.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include - -namespace milvus { - -typedef void (*signal_func_ptr)(int32_t); - -extern signal_func_ptr signal_routine_func; - -extern void -HandleSignal(int signum); - -extern void -PrintStacktrace(); - -} // namespace milvus diff --git a/proxy/src/utils/Status.cpp b/proxy/src/utils/Status.cpp deleted file mode 100644 index a4f987bdf2..0000000000 --- a/proxy/src/utils/Status.cpp +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "utils/Status.h" - -#include - -namespace milvus { - -constexpr int CODE_WIDTH = sizeof(StatusCode); - -Status::Status(StatusCode code, const std::string& msg) { - // 4 bytes store code - // 4 bytes store message length - // the left bytes store message string - const uint32_t length = (uint32_t)msg.size(); - auto result = new char[length + sizeof(length) + CODE_WIDTH]; - std::memcpy(result, &code, CODE_WIDTH); - std::memcpy(result + CODE_WIDTH, &length, sizeof(length)); - memcpy(result + sizeof(length) + CODE_WIDTH, msg.data(), length); - - state_ = result; -} - -Status::Status() : state_(nullptr) { -} - -Status::~Status() { - delete state_; -} - -Status::Status(const Status& s) : state_(nullptr) { - CopyFrom(s); -} - -Status& -Status::operator=(const Status& s) { - CopyFrom(s); - return *this; -} - -Status::Status(Status&& s) : state_(nullptr) { - MoveFrom(s); -} - -Status& -Status::operator=(Status&& s) { - MoveFrom(s); - return *this; -} - -void -Status::CopyFrom(const Status& s) { - delete state_; - state_ = nullptr; - if (s.state_ == nullptr) { - return; - } - - uint32_t length = 0; - memcpy(&length, s.state_ + CODE_WIDTH, sizeof(length)); - int buff_len = length + sizeof(length) + CODE_WIDTH; - state_ = new char[buff_len]; - memcpy(state_, s.state_, buff_len); -} - -void -Status::MoveFrom(Status& s) { - delete state_; - state_ = s.state_; - s.state_ = nullptr; -} - -std::string -Status::message() const { - if (state_ == nullptr) { - return "OK"; - } - - std::string msg; - uint32_t length = 0; - memcpy(&length, state_ + CODE_WIDTH, sizeof(length)); - if (length > 0) { - msg.append(state_ + sizeof(length) + CODE_WIDTH, length); - } - - return msg; -} - -std::string -Status::ToString() const { - if (state_ == nullptr) { - return "OK"; - } - - std::string result; - switch (code()) { - case DB_SUCCESS: - result = "OK "; - break; - case DB_ERROR: - result = "Error: "; - break; - case DB_META_TRANSACTION_FAILED: - result = "Database error: "; - break; - case DB_NOT_FOUND: - result = "Not found: "; - break; - case DB_ALREADY_EXIST: - result = "Already exist: "; - break; - case DB_INVALID_PATH: - result = "Invalid path: "; - break; - default: - result = "Error code(" + std::to_string(code()) + "): "; - break; - } - - result += message(); - return result; -} - -} // namespace milvus diff --git a/proxy/src/utils/Status.h b/proxy/src/utils/Status.h deleted file mode 100644 index e67d6ed048..0000000000 --- a/proxy/src/utils/Status.h +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "utils/Error.h" - -#include - -namespace milvus { - -class Status; -#define STATUS_CHECK(func) \ - do { \ - Status s = func; \ - if (!s.ok()) { \ - return s; \ - } \ - } while (false) - -using StatusCode = ErrorCode; - -class Status { - public: - Status(StatusCode code, const std::string& msg); - Status(); - ~Status(); - - Status(const Status& s); - - Status& - operator=(const Status& s); - - Status(Status&& s); - - Status& - operator=(Status&& s); - - static Status - OK() { - return Status(); - } - - bool - ok() const { - return state_ == nullptr || code() == 0; - } - - StatusCode - code() const { - return (state_ == nullptr) ? 0 : *(StatusCode*)(state_); - } - - std::string - message() const; - - std::string - ToString() const; - - private: - inline void - CopyFrom(const Status& s); - - inline void - MoveFrom(Status& s); - - private: - char* state_ = nullptr; -}; // Status - -} // namespace milvus diff --git a/proxy/src/utils/StringHelpFunctions.cpp b/proxy/src/utils/StringHelpFunctions.cpp deleted file mode 100644 index 49ab32f050..0000000000 --- a/proxy/src/utils/StringHelpFunctions.cpp +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "utils/StringHelpFunctions.h" - -#include -#include -#include - -namespace milvus { - -void -StringHelpFunctions::TrimStringBlank(std::string& string) { - if (!string.empty()) { - static std::string s_format(" \n\r\t"); - string.erase(0, string.find_first_not_of(s_format)); - string.erase(string.find_last_not_of(s_format) + 1); - } -} - -void -StringHelpFunctions::TrimStringQuote(std::string& string, const std::string& qoute) { - if (!string.empty()) { - string.erase(0, string.find_first_not_of(qoute)); - string.erase(string.find_last_not_of(qoute) + 1); - } -} - -void -StringHelpFunctions::SplitStringByDelimeter(const std::string& str, const std::string& delimeter, - std::vector& result) { - if (str.empty()) { - return; - } - - size_t prev = 0; - while (true) { - size_t pos = str.find_first_of(delimeter, prev); - if (pos == std::string::npos) { - result.emplace_back(str.substr(prev)); - break; - } else { - result.emplace_back(str.substr(prev, pos - prev)); - prev = pos + 1; - } - } -} - -void -StringHelpFunctions::MergeStringWithDelimeter(const std::vector& strs, const std::string& delimeter, - std::string& result) { - if (strs.empty()) { - result = ""; - return; - } - - result = strs[0]; - for (size_t i = 1; i < strs.size(); i++) { - result = result + delimeter + strs[i]; - } -} - -Status -StringHelpFunctions::SplitStringByQuote(const std::string& str, const std::string& delimeter, const std::string& quote, - std::vector& result) { - if (quote.empty()) { - SplitStringByDelimeter(str, delimeter, result); - return Status::OK(); - } - - size_t last = 0; - size_t index = str.find_first_of(quote, last); - if (index == std::string::npos) { - SplitStringByDelimeter(str, delimeter, result); - return Status::OK(); - } - - std::string process_str = str; - while (index != std::string::npos) { - std::string prefix = process_str.substr(last, index - last); - std::string append_prefix; - if (!prefix.empty()) { - std::vector prefix_split; - SplitStringByDelimeter(prefix, delimeter, prefix_split); - for (size_t i = 0; i < prefix_split.size() - 1; i++) { - result.push_back(prefix_split[i]); - } - append_prefix = prefix_split[prefix_split.size() - 1]; - } - last = index + 1; - std::string postfix = process_str.substr(last); - index = postfix.find_first_of(quote, 0); - - - if (index == std::string::npos) { - return Status(SERVER_UNEXPECTED_ERROR, ""); - } - std::string quoted_text = postfix.substr(0, index); - append_prefix += quoted_text; - - last = index + 1; - index = postfix.find_first_of(delimeter, last); - - - if (index != std::string::npos) { - if (index > last) { - append_prefix += postfix.substr(last, index - last); - } - } else { - append_prefix += postfix.substr(last); - } - result.emplace_back(append_prefix); - - if (last == postfix.length()) { - return Status::OK(); - } - - process_str = postfix.substr(index + 1); - last = 0; - index = process_str.find_first_of(quote, last); - } - - if (!process_str.empty()) { - SplitStringByDelimeter(process_str, delimeter, result); - } - - return Status::OK(); -} - -bool -StringHelpFunctions::IsRegexMatch(const std::string& target_str, const std::string& pattern_str) { - // if target_str equals pattern_str, return true - if (target_str == pattern_str) { - return true; - } - - // regex match - std::regex pattern(pattern_str); - std::smatch results; - return std::regex_match(target_str, results, pattern); -} - -Status -StringHelpFunctions::ConvertToBoolean(const std::string& str, bool& value) { - std::string s = str; - std::transform(s.begin(), s.end(), s.begin(), ::tolower); - value = s == "true" || s == "on" || s == "yes" || s == "1"; - - return Status::OK(); -} - -} // namespace milvus diff --git a/proxy/src/utils/StringHelpFunctions.h b/proxy/src/utils/StringHelpFunctions.h deleted file mode 100644 index 2b779084c4..0000000000 --- a/proxy/src/utils/StringHelpFunctions.h +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include "utils/Status.h" - -#include -#include - -namespace milvus { - -class StringHelpFunctions { - private: - StringHelpFunctions() = default; - - public: - // trim blanks from begin and end - // " a b c " => "a b c" - static void - TrimStringBlank(std::string& string); - - // trim quotes from begin and end - // "'abc'" => "abc" - static void - TrimStringQuote(std::string& string, const std::string& qoute); - - // split string by delimeter ',' - // a,b,c a | b | c - // a,b, a | b | - // ,b,c | b | c - // ,b, | b | - // ,, | | - // a a - static void - SplitStringByDelimeter(const std::string& str, const std::string& delimeter, std::vector& result); - - // merge strings with delimeter - // "a", "b", "c" => "a,b,c" - static void - MergeStringWithDelimeter(const std::vector& strs, const std::string& delimeter, std::string& result); - - // assume the collection has two columns, quote='\"', delimeter=',' - // a,b a | b - // "aa,gg,yy",b aa,gg,yy | b - // aa"dd,rr"kk,pp aadd,rrkk | pp - // "aa,bb" aa,bb - // 55,1122\"aa,bb\",yyy,\"kkk\" 55 | 1122aa,bb | yyy | kkk - // "55,1122"aa,bb",yyy,"kkk" illegal - static Status - SplitStringByQuote(const std::string& str, const std::string& delimeter, const std::string& quote, - std::vector& result); - - // std regex match function - // regex grammar reference: http://www.cplusplus.com/reference/regex/ECMAScript/ - static bool - IsRegexMatch(const std::string& target_str, const std::string& pattern); - - // conversion rules refer to ValidationUtil::ValidateStringIsBool() - // "true", "on", "yes", "1" ==> true - // "false", "off", "no", "0", "" ==> false - static Status - ConvertToBoolean(const std::string& str, bool& value); -}; - -} // namespace milvus diff --git a/proxy/src/utils/ThreadPool.h b/proxy/src/utils/ThreadPool.h deleted file mode 100644 index ab42d11e1d..0000000000 --- a/proxy/src/utils/ThreadPool.h +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define MAX_THREADS_NUM 32 - -namespace milvus { - -class ThreadPool { - public: - explicit ThreadPool(size_t threads, size_t queue_size = 1000); - - template - auto - enqueue(F&& f, Args&&... args) -> std::future::type>; - - ~ThreadPool(); - - private: - // need to keep track of threads so we can join them - std::vector workers_; - - // the task queue - std::queue > tasks_; - - size_t max_queue_size_; - - // synchronization - std::mutex queue_mutex_; - - std::condition_variable condition_; - - bool stop; -}; - -// the constructor just launches some amount of workers -inline ThreadPool::ThreadPool(size_t threads, size_t queue_size) : max_queue_size_(queue_size), stop(false) { - for (size_t i = 0; i < threads; ++i) - workers_.emplace_back([this] { - for (;;) { - std::function task; - - { - std::unique_lock lock(this->queue_mutex_); - this->condition_.wait(lock, [this] { return this->stop || !this->tasks_.empty(); }); - if (this->stop && this->tasks_.empty()) - return; - task = std::move(this->tasks_.front()); - this->tasks_.pop(); - } - this->condition_.notify_all(); - - task(); - } - }); -} - -// add new work item to the pool -template -auto -ThreadPool::enqueue(F&& f, Args&&... args) -> std::future::type> { - using return_type = typename std::result_of::type; - - auto task = std::make_shared >( - std::bind(std::forward(f), std::forward(args)...)); - std::future res = task->get_future(); - { - std::unique_lock lock(queue_mutex_); - this->condition_.wait(lock, [this] { return this->tasks_.size() < max_queue_size_; }); - // don't allow enqueueing after stopping the pool - if (stop) - throw std::runtime_error("enqueue on stopped ThreadPool"); - - tasks_.emplace([task]() { (*task)(); }); - } - condition_.notify_all(); - return res; -} - -// the destructor joins all threads -inline ThreadPool::~ThreadPool() { - { - std::unique_lock lock(queue_mutex_); - stop = true; - } - condition_.notify_all(); - for (std::thread& worker : workers_) { - worker.join(); - } -} - -} // namespace milvus diff --git a/proxy/src/utils/TimeRecorder.cpp b/proxy/src/utils/TimeRecorder.cpp deleted file mode 100644 index cb8b674753..0000000000 --- a/proxy/src/utils/TimeRecorder.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#include "utils/TimeRecorder.h" -#include "utils/Log.h" - -namespace milvus { - -TimeRecorder::TimeRecorder(const std::string& header, int64_t log_level) : header_(header), log_level_(log_level) { - start_ = last_ = stdclock::now(); -} - -TimeRecorder::~TimeRecorder() = default; - -std::string -TimeRecorder::GetTimeSpanStr(double span) { - std::string str_sec = std::to_string(span * 0.000001) + ((span > 1000000) ? " seconds" : " second"); - std::string str_ms = std::to_string(span * 0.001) + " ms"; - - return str_sec + " [" + str_ms + "]"; -} - -void -TimeRecorder::PrintTimeRecord(const std::string& msg, double span) { - std::string str_log; - if (!header_.empty()) - str_log += header_ + ": "; - str_log += msg; - str_log += " ("; - str_log += TimeRecorder::GetTimeSpanStr(span); - str_log += ")"; - - switch (log_level_) { - case 0: { - LOG_SERVER_TRACE_ << str_log; - break; - } - case 1: { - LOG_SERVER_DEBUG_ << str_log; - break; - } - case 2: { - LOG_SERVER_INFO_ << str_log; - break; - } - case 3: { - LOG_SERVER_WARNING_ << str_log; - break; - } - case 4: { - LOG_SERVER_ERROR_ << str_log; - break; - } - case 5: { - LOG_SERVER_FATAL_ << str_log; - break; - } - default: { - LOG_SERVER_INFO_ << str_log; - break; - } - } -} - -double -TimeRecorder::RecordSection(const std::string& msg) { - stdclock::time_point curr = stdclock::now(); - double span = (std::chrono::duration(curr - last_)).count(); - last_ = curr; - - PrintTimeRecord(msg, span); - return span; -} - -double -TimeRecorder::ElapseFromBegin(const std::string& msg) { - stdclock::time_point curr = stdclock::now(); - double span = (std::chrono::duration(curr - start_)).count(); - - PrintTimeRecord(msg, span); - return span; -} - -TimeRecorderAuto::TimeRecorderAuto(const std::string& header, int64_t log_level) : TimeRecorder(header, log_level) { -} - -TimeRecorderAuto::~TimeRecorderAuto() { - ElapseFromBegin("totally cost"); -} - -} // namespace milvus diff --git a/proxy/src/utils/TimeRecorder.h b/proxy/src/utils/TimeRecorder.h deleted file mode 100644 index 5103513cfa..0000000000 --- a/proxy/src/utils/TimeRecorder.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#pragma once - -#include -#include -#include "utils/Log.h" - -namespace milvus { - -inline void -print_timestamp(const std::string& message) { - std::chrono::time_point now = std::chrono::system_clock::now(); - auto duration = now.time_since_epoch(); - auto micros = std::chrono::duration_cast(duration).count(); - micros %= 1000000; - double millisecond = (double)micros / 1000.0; - - LOG_SERVER_DEBUG_ << std::fixed << " " << millisecond << "(ms) [timestamp]" << message; -} - -class TimeRecorder { - using stdclock = std::chrono::high_resolution_clock; - - public: - explicit TimeRecorder(const std::string& header, int64_t log_level = 1); - - virtual ~TimeRecorder(); // trace = 0, debug = 1, info = 2, warn = 3, error = 4, critical = 5 - - double - RecordSection(const std::string& msg); - - double - ElapseFromBegin(const std::string& msg); - - static std::string - GetTimeSpanStr(double span); - - private: - void - PrintTimeRecord(const std::string& msg, double span); - - private: - std::string header_; - stdclock::time_point start_; - stdclock::time_point last_; - int64_t log_level_; -}; - -class TimeRecorderAuto : public TimeRecorder { - public: - explicit TimeRecorderAuto(const std::string& header, int64_t log_level = 1); - - ~TimeRecorderAuto() override; -}; - -} // namespace milvus diff --git a/proxy/src/version.h b/proxy/src/version.h deleted file mode 100644 index 567d08f2ac..0000000000 --- a/proxy/src/version.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#define MILVUS_VERSION "0.10.0" -#define BUILD_TYPE "Debug" -#define BUILD_TIME "2020-09-07 19:44.43" -#define LAST_COMMIT_ID "1d4b351ff722da79dfc41a5995ece105b3f63824" diff --git a/proxy/src/version.h.in b/proxy/src/version.h.in deleted file mode 100644 index 0f0b3c1edf..0000000000 --- a/proxy/src/version.h.in +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2019-2020 Zilliz. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software distributed under the License -// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -// or implied. See the License for the specific language governing permissions and limitations under the License. - -#cmakedefine MILVUS_VERSION "@MILVUS_VERSION@" -#cmakedefine BUILD_TYPE "@BUILD_TYPE@" -#cmakedefine BUILD_TIME "@BUILD_TIME@" -#cmakedefine LAST_COMMIT_ID "@LAST_COMMIT_ID@" diff --git a/proxy/thirdparty/CMakeLists.txt b/proxy/thirdparty/CMakeLists.txt deleted file mode 100644 index c08a2d1809..0000000000 --- a/proxy/thirdparty/CMakeLists.txt +++ /dev/null @@ -1,59 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. -#------------------------------------------------------------------------------- -# Using default c and cxx compiler in our build tree -# Thirdpart cxx and c flags -add_compile_options( -O3 -fPIC -Wno-error -fopenmp ) - -if ( NOT KNOWHERE_VERBOSE_THIRDPARTY_BUILD ) - set( EP_LOG_OPTIONS LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 LOG_DOWNLOAD 1 ) -else () - set( EP_LOG_OPTIONS ) -endif () - -set( MAKE_BUILD_ARGS "-j6" ) - -include( FetchContent ) -set( FETCHCONTENT_BASE_DIR ${MILVUS_BINARY_DIR}/3rdparty_download ) -set( FETCHCONTENT_QUIET OFF ) - -# ---------------------------------------------------------------------- -# Find pthreads - -set( THREADS_PREFER_PTHREAD_FLAG ON ) -find_package( Threads REQUIRED ) - -# ****************************** Thirdparty googletest *************************************** -if ( MILVUS_BUILD_TESTS ) - add_subdirectory( gtest ) -endif() - -# ****************************** Thirdparty grpc *************************************** -if ( MILVUS_WITH_GRPC ) - add_subdirectory( grpc ) -endif () - -# ****************************** Thirdparty yaml *************************************** -if ( MILVUS_WITH_YAMLCPP ) - add_subdirectory( yaml-cpp ) -endif() - -# ****************************** Thirdparty opentracing *************************************** -if ( MILVUS_WITH_OPENTRACING ) - add_subdirectory( opentracing ) -endif() - - -# ****************************** Thirdparty pulsar-client-cpp *************************************** -if ( MILVUS_WITH_PULSAR ) - add_subdirectory(pulsar) -endif() \ No newline at end of file diff --git a/proxy/thirdparty/avro/CMakeLists.txt b/proxy/thirdparty/avro/CMakeLists.txt deleted file mode 100644 index 16b235fd70..0000000000 --- a/proxy/thirdparty/avro/CMakeLists.txt +++ /dev/null @@ -1,56 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. -#------------------------------------------------------------------------------- - -if (DEFINED ENV{MILVUS_AVRO_URL}) - set(AVRO_URL "$ENV{MILVUS_AVRO_URL}") -else () - set(AVRO_URL - "https://github.com/apache/avro/archive/${AVRO_VERSION}.zip") -endif () - - -message(STATUS "Building avro-${AVRO_VERSION} from source") - - -FetchContent_Declare( - avro - URL ${AVRO_URL} - # URL_MD5 "f9137c5bc18b7d74027936f0f1bfa5c8" - DOWNLOAD_DIR ${MILVUS_BINARY_DIR}/3rdparty_download/download - SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/avro-src - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/avro-build -) - -include(FetchContent) -FetchContent_GetProperties( avro ) -if (NOT avro_POPULATED) - FetchContent_Populate(avro) - -# file(REMOVE ${avro_SOURCE_DIR}/pulsar-client-cpp/CMakeLists.txt) -# message("${pulsar_SOURCE_DIR}/pulsar-client-cpp/CMakeLists.txt") -# EXECUTE_PROCESS(COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists ${pulsar_SOURCE_DIR}/pulsar-client-cpp/CMakeLists.txt) - - # Adding the following targets: - # pulsar-client-cpp - add_subdirectory(${avro_SOURCE_DIR}/lang/c++ - ${avro_BINARY_DIR} - EXCLUDE_FROM_ALL) - - file (INSTALL DIRECTORY ${avro_SOURCE_DIR}/lang/c++/api/ DESTINATION ${avro_BINARY_DIR}/include/avro - FILES_MATCHING PATTERN *.hh) - -# target_include_directories(avrocpp PUBLIC ${pulsar_SOURCE_DIR}/pulsar-client-cpp/include) -endif () - -get_property(var DIRECTORY "${avro_SOURCE_DIR}/lang/c++" PROPERTY COMPILE_OPTIONS) -message(STATUS "avro compile options: ${var}") diff --git a/proxy/thirdparty/easyloggingpp/easylogging++.cc b/proxy/thirdparty/easyloggingpp/easylogging++.cc deleted file mode 100644 index 4c6df12686..0000000000 --- a/proxy/thirdparty/easyloggingpp/easylogging++.cc +++ /dev/null @@ -1,3299 +0,0 @@ -// -// Bismillah ar-Rahmaan ar-Raheem -// -// Easylogging++ v9.96.7 -// Cross-platform logging library for C++ applications -// -// Copyright (c) 2012-2018 Zuhd Web Services -// Copyright (c) 2012-2018 @abumusamq -// -// This library is released under the MIT Licence. -// https://github.com/zuhd-org/easyloggingpp/blob/master/LICENSE -// -// https://zuhd.org -// http://muflihun.com -// - -#include "easylogging++.h" - -#if defined(AUTO_INITIALIZE_EASYLOGGINGPP) -INITIALIZE_EASYLOGGINGPP -#endif - -namespace el { - -// el::base -namespace base { -// el::base::consts -namespace consts { - -// Level log values - These are values that are replaced in place of %level format specifier -// Extra spaces after format specifiers are only for readability purposes in log files -static const base::type::char_t* kInfoLevelLogValue = ELPP_LITERAL("INFO"); -static const base::type::char_t* kDebugLevelLogValue = ELPP_LITERAL("DEBUG"); -static const base::type::char_t* kWarningLevelLogValue = ELPP_LITERAL("WARNING"); -static const base::type::char_t* kErrorLevelLogValue = ELPP_LITERAL("ERROR"); -static const base::type::char_t* kFatalLevelLogValue = ELPP_LITERAL("FATAL"); -static const base::type::char_t* kVerboseLevelLogValue = - ELPP_LITERAL("VERBOSE"); // will become VERBOSE-x where x = verbose level -static const base::type::char_t* kTraceLevelLogValue = ELPP_LITERAL("TRACE"); -static const base::type::char_t* kInfoLevelShortLogValue = ELPP_LITERAL("I"); -static const base::type::char_t* kDebugLevelShortLogValue = ELPP_LITERAL("D"); -static const base::type::char_t* kWarningLevelShortLogValue = ELPP_LITERAL("W"); -static const base::type::char_t* kErrorLevelShortLogValue = ELPP_LITERAL("E"); -static const base::type::char_t* kFatalLevelShortLogValue = ELPP_LITERAL("F"); -static const base::type::char_t* kVerboseLevelShortLogValue = ELPP_LITERAL("V"); -static const base::type::char_t* kTraceLevelShortLogValue = ELPP_LITERAL("T"); -// Format specifiers - These are used to define log format -static const base::type::char_t* kAppNameFormatSpecifier = ELPP_LITERAL("%app"); -static const base::type::char_t* kLoggerIdFormatSpecifier = ELPP_LITERAL("%logger"); -static const base::type::char_t* kThreadIdFormatSpecifier = ELPP_LITERAL("%thread"); -static const base::type::char_t* kSeverityLevelFormatSpecifier = ELPP_LITERAL("%level"); -static const base::type::char_t* kSeverityLevelShortFormatSpecifier = ELPP_LITERAL("%levshort"); -static const base::type::char_t* kDateTimeFormatSpecifier = ELPP_LITERAL("%datetime"); -static const base::type::char_t* kLogFileFormatSpecifier = ELPP_LITERAL("%file"); -static const base::type::char_t* kLogFileBaseFormatSpecifier = ELPP_LITERAL("%fbase"); -static const base::type::char_t* kLogLineFormatSpecifier = ELPP_LITERAL("%line"); -static const base::type::char_t* kLogLocationFormatSpecifier = ELPP_LITERAL("%loc"); -static const base::type::char_t* kLogFunctionFormatSpecifier = ELPP_LITERAL("%func"); -static const base::type::char_t* kCurrentUserFormatSpecifier = ELPP_LITERAL("%user"); -static const base::type::char_t* kCurrentHostFormatSpecifier = ELPP_LITERAL("%host"); -static const base::type::char_t* kMessageFormatSpecifier = ELPP_LITERAL("%msg"); -static const base::type::char_t* kVerboseLevelFormatSpecifier = ELPP_LITERAL("%vlevel"); -static const char* kDateTimeFormatSpecifierForFilename = "%datetime"; -// Date/time -static const char* kDays[7] = {"Sundayaaa", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; -static const char* kDaysAbbrev[7] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; -static const char* kMonths[12] = {"January", "February", "March", "Apri", "May", "June", - "July", "August", "September", "October", "November", "December"}; -static const char* kMonthsAbbrev[12] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; -static const char* kDefaultDateTimeFormat = "%Y-%M-%d %H:%m:%s,%g"; -static const char* kDefaultDateTimeFormatInFilename = "%Y-%M-%d_%H-%m"; -static const int kYearBase = 1900; -static const char* kAm = "AM"; -static const char* kPm = "PM"; -// Miscellaneous constants - -static const char* kNullPointer = "nullptr"; -#if ELPP_VARIADIC_TEMPLATES_SUPPORTED -#endif // ELPP_VARIADIC_TEMPLATES_SUPPORTED -static const base::type::VerboseLevel kMaxVerboseLevel = 9; -static const char* kUnknownUser = "user"; -static const char* kUnknownHost = "unknown-host"; - -//---------------- DEFAULT LOG FILE ----------------------- - -#if defined(ELPP_NO_DEFAULT_LOG_FILE) -#if ELPP_OS_UNIX -static const char* kDefaultLogFile = "/dev/null"; -#elif ELPP_OS_WINDOWS -static const char* kDefaultLogFile = "nul"; -#endif // ELPP_OS_UNIX -#elif defined(ELPP_DEFAULT_LOG_FILE) -static const char* kDefaultLogFile = ELPP_DEFAULT_LOG_FILE; -#else -static const char* kDefaultLogFile = "myeasylog.log"; -#endif // defined(ELPP_NO_DEFAULT_LOG_FILE) - -#if !defined(ELPP_DISABLE_LOG_FILE_FROM_ARG) -static const char* kDefaultLogFileParam = "--default-log-file"; -#endif // !defined(ELPP_DISABLE_LOG_FILE_FROM_ARG) -#if defined(ELPP_LOGGING_FLAGS_FROM_ARG) -static const char* kLoggingFlagsParam = "--logging-flags"; -#endif // defined(ELPP_LOGGING_FLAGS_FROM_ARG) -static const char* kValidLoggerIdSymbols = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._"; -static const char* kConfigurationComment = "##"; -static const char* kConfigurationLevel = "*"; -static const char* kConfigurationLoggerId = "--"; -} // namespace consts -// el::base::utils -namespace utils { - -/// @brief Aborts application due with user-defined status -static void -abort(int status, const std::string& reason) { - // Both status and reason params are there for debugging with tools like gdb etc - ELPP_UNUSED(status); - ELPP_UNUSED(reason); -#if defined(ELPP_COMPILER_MSVC) && defined(_M_IX86) && defined(_DEBUG) - // Ignore msvc critical error dialog - break instead (on debug mode) - _asm int 3 -#else - ::abort(); -#endif // defined(ELPP_COMPILER_MSVC) && defined(_M_IX86) && defined(_DEBUG) -} - -} // namespace utils -} // namespace base - -// el - -// LevelHelper - -const char* -LevelHelper::convertToString(Level level) { - // Do not use switch over strongly typed enums because Intel C++ compilers dont support them yet. - if (level == Level::Global) - return "GLOBAL"; - if (level == Level::Debug) - return "DEBUG"; - if (level == Level::Info) - return "INFO"; - if (level == Level::Warning) - return "WARNING"; - if (level == Level::Error) - return "ERROR"; - if (level == Level::Fatal) - return "FATAL"; - if (level == Level::Verbose) - return "VERBOSE"; - if (level == Level::Trace) - return "TRACE"; - return "UNKNOWN"; -} - -struct StringToLevelItem { - const char* levelString; - Level level; -}; - -static struct StringToLevelItem stringToLevelMap[] = { - {"global", Level::Global}, {"debug", Level::Debug}, {"info", Level::Info}, {"warning", Level::Warning}, - {"error", Level::Error}, {"fatal", Level::Fatal}, {"verbose", Level::Verbose}, {"trace", Level::Trace}}; - -Level -LevelHelper::convertFromString(const char* levelStr) { - for (auto& item : stringToLevelMap) { - if (base::utils::Str::cStringCaseEq(levelStr, item.levelString)) { - return item.level; - } - } - return Level::Unknown; -} - -void -LevelHelper::forEachLevel(base::type::EnumType* startIndex, const std::function& fn) { - base::type::EnumType lIndexMax = LevelHelper::kMaxValid; - do { - if (fn()) { - break; - } - *startIndex = static_cast(*startIndex << 1); - } while (*startIndex <= lIndexMax); -} - -// ConfigurationTypeHelper - -const char* -ConfigurationTypeHelper::convertToString(ConfigurationType configurationType) { - // Do not use switch over strongly typed enums because Intel C++ compilers dont support them yet. - if (configurationType == ConfigurationType::Enabled) - return "ENABLED"; - if (configurationType == ConfigurationType::Filename) - return "FILENAME"; - if (configurationType == ConfigurationType::Format) - return "FORMAT"; - if (configurationType == ConfigurationType::ToFile) - return "TO_FILE"; - if (configurationType == ConfigurationType::ToStandardOutput) - return "TO_STANDARD_OUTPUT"; - if (configurationType == ConfigurationType::SubsecondPrecision) - return "SUBSECOND_PRECISION"; - if (configurationType == ConfigurationType::PerformanceTracking) - return "PERFORMANCE_TRACKING"; - if (configurationType == ConfigurationType::MaxLogFileSize) - return "MAX_LOG_FILE_SIZE"; - if (configurationType == ConfigurationType::LogFlushThreshold) - return "LOG_FLUSH_THRESHOLD"; - return "UNKNOWN"; -} - -struct ConfigurationStringToTypeItem { - const char* configString; - ConfigurationType configType; -}; - -static struct ConfigurationStringToTypeItem configStringToTypeMap[] = { - {"enabled", ConfigurationType::Enabled}, - {"to_file", ConfigurationType::ToFile}, - {"to_standard_output", ConfigurationType::ToStandardOutput}, - {"format", ConfigurationType::Format}, - {"filename", ConfigurationType::Filename}, - {"subsecond_precision", ConfigurationType::SubsecondPrecision}, - {"milliseconds_width", ConfigurationType::MillisecondsWidth}, - {"performance_tracking", ConfigurationType::PerformanceTracking}, - {"max_log_file_size", ConfigurationType::MaxLogFileSize}, - {"log_flush_threshold", ConfigurationType::LogFlushThreshold}, -}; - -ConfigurationType -ConfigurationTypeHelper::convertFromString(const char* configStr) { - for (auto& item : configStringToTypeMap) { - if (base::utils::Str::cStringCaseEq(configStr, item.configString)) { - return item.configType; - } - } - return ConfigurationType::Unknown; -} - -void -ConfigurationTypeHelper::forEachConfigType(base::type::EnumType* startIndex, const std::function& fn) { - base::type::EnumType cIndexMax = ConfigurationTypeHelper::kMaxValid; - do { - if (fn()) { - break; - } - *startIndex = static_cast(*startIndex << 1); - } while (*startIndex <= cIndexMax); -} - -// Configuration - -Configuration::Configuration(const Configuration& c) - : m_level(c.m_level), m_configurationType(c.m_configurationType), m_value(c.m_value) { -} - -Configuration& -Configuration::operator=(const Configuration& c) { - if (&c != this) { - m_level = c.m_level; - m_configurationType = c.m_configurationType; - m_value = c.m_value; - } - return *this; -} - -/// @brief Full constructor used to sets value of configuration -Configuration::Configuration(Level level, ConfigurationType configurationType, const std::string& value) - : m_level(level), m_configurationType(configurationType), m_value(value) { -} - -void -Configuration::log(el::base::type::ostream_t& os) const { - os << LevelHelper::convertToString(m_level) << ELPP_LITERAL(" ") - << ConfigurationTypeHelper::convertToString(m_configurationType) << ELPP_LITERAL(" = ") << m_value.c_str(); -} - -/// @brief Used to find configuration from configuration (pointers) repository. Avoid using it. -Configuration::Predicate::Predicate(Level level, ConfigurationType configurationType) - : m_level(level), m_configurationType(configurationType) { -} - -bool -Configuration::Predicate::operator()(const Configuration* conf) const { - return ((conf != nullptr) && (conf->level() == m_level) && (conf->configurationType() == m_configurationType)); -} - -// Configurations - -Configurations::Configurations(void) : m_configurationFile(std::string()), m_isFromFile(false) { -} - -Configurations::Configurations(const std::string& configurationFile, bool useDefaultsForRemaining, Configurations* base) - : m_configurationFile(configurationFile), m_isFromFile(false) { - parseFromFile(configurationFile, base); - if (useDefaultsForRemaining) { - setRemainingToDefault(); - } -} - -bool -Configurations::parseFromFile(const std::string& configurationFile, Configurations* base) { - // We initial assertion with true because if we have assertion diabled, we want to pass this - // check and if assertion is enabled we will have values re-assigned any way. - bool assertionPassed = true; - ELPP_ASSERT((assertionPassed = base::utils::File::pathExists(configurationFile.c_str(), true)) == true, - "Configuration file [" << configurationFile << "] does not exist!"); - if (!assertionPassed) { - return false; - } - bool success = Parser::parseFromFile(configurationFile, this, base); - m_isFromFile = success; - return success; -} - -bool -Configurations::parseFromText(const std::string& configurationsString, Configurations* base) { - bool success = Parser::parseFromText(configurationsString, this, base); - if (success) { - m_isFromFile = false; - } - return success; -} - -void -Configurations::setFromBase(Configurations* base) { - if (base == nullptr || base == this) { - return; - } - base::threading::ScopedLock scopedLock(base->lock()); - for (Configuration*& conf : base->list()) { - set(conf); - } -} - -bool -Configurations::hasConfiguration(ConfigurationType configurationType) { - base::type::EnumType lIndex = LevelHelper::kMinValid; - bool result = false; - LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { - if (hasConfiguration(LevelHelper::castFromInt(lIndex), configurationType)) { - result = true; - } - return result; - }); - return result; -} - -bool -Configurations::hasConfiguration(Level level, ConfigurationType configurationType) { - base::threading::ScopedLock scopedLock(lock()); -#if ELPP_COMPILER_INTEL - // We cant specify template types here, Intel C++ throws compilation error - // "error: type name is not allowed" - return RegistryWithPred::get(level, configurationType) != nullptr; -#else - return RegistryWithPred::get(level, configurationType) != nullptr; -#endif // ELPP_COMPILER_INTEL -} - -void -Configurations::set(Level level, ConfigurationType configurationType, const std::string& value) { - base::threading::ScopedLock scopedLock(lock()); - unsafeSet(level, configurationType, value); // This is not unsafe anymore as we have locked mutex - if (level == Level::Global) { - unsafeSetGlobally(configurationType, value, false); // Again this is not unsafe either - } -} - -void -Configurations::set(Configuration* conf) { - if (conf == nullptr) { - return; - } - set(conf->level(), conf->configurationType(), conf->value()); -} - -void -Configurations::setToDefault(void) { - setGlobally(ConfigurationType::Enabled, std::string("true"), true); - setGlobally(ConfigurationType::Filename, std::string(base::consts::kDefaultLogFile), true); -#if defined(ELPP_NO_LOG_TO_FILE) - setGlobally(ConfigurationType::ToFile, std::string("false"), true); -#else - setGlobally(ConfigurationType::ToFile, std::string("true"), true); -#endif // defined(ELPP_NO_LOG_TO_FILE) - setGlobally(ConfigurationType::ToStandardOutput, std::string("true"), true); - setGlobally(ConfigurationType::SubsecondPrecision, std::string("3"), true); - setGlobally(ConfigurationType::PerformanceTracking, std::string("true"), true); - setGlobally(ConfigurationType::MaxLogFileSize, std::string("0"), true); - setGlobally(ConfigurationType::LogFlushThreshold, std::string("0"), true); - - setGlobally(ConfigurationType::Format, std::string("%datetime %level [%logger] %msg"), true); - set(Level::Debug, ConfigurationType::Format, - std::string("%datetime %level [%logger] [%user@%host] [%func] [%loc] %msg")); - // INFO and WARNING are set to default by Level::Global - set(Level::Error, ConfigurationType::Format, std::string("%datetime %level [%logger] %msg")); - set(Level::Fatal, ConfigurationType::Format, std::string("%datetime %level [%logger] %msg")); - set(Level::Verbose, ConfigurationType::Format, std::string("%datetime %level-%vlevel [%logger] %msg")); - set(Level::Trace, ConfigurationType::Format, std::string("%datetime %level [%logger] [%func] [%loc] %msg")); -} - -void -Configurations::setRemainingToDefault(void) { - base::threading::ScopedLock scopedLock(lock()); -#if defined(ELPP_NO_LOG_TO_FILE) - unsafeSetIfNotExist(Level::Global, ConfigurationType::Enabled, std::string("false")); -#else - unsafeSetIfNotExist(Level::Global, ConfigurationType::Enabled, std::string("true")); -#endif // defined(ELPP_NO_LOG_TO_FILE) - unsafeSetIfNotExist(Level::Global, ConfigurationType::Filename, std::string(base::consts::kDefaultLogFile)); - unsafeSetIfNotExist(Level::Global, ConfigurationType::ToStandardOutput, std::string("true")); - unsafeSetIfNotExist(Level::Global, ConfigurationType::SubsecondPrecision, std::string("3")); - unsafeSetIfNotExist(Level::Global, ConfigurationType::PerformanceTracking, std::string("true")); - unsafeSetIfNotExist(Level::Global, ConfigurationType::MaxLogFileSize, std::string("0")); - unsafeSetIfNotExist(Level::Global, ConfigurationType::Format, std::string("%datetime %level [%logger] %msg")); - unsafeSetIfNotExist(Level::Debug, ConfigurationType::Format, - std::string("%datetime %level [%logger] [%user@%host] [%func] [%loc] %msg")); - // INFO and WARNING are set to default by Level::Global - unsafeSetIfNotExist(Level::Error, ConfigurationType::Format, std::string("%datetime %level [%logger] %msg")); - unsafeSetIfNotExist(Level::Fatal, ConfigurationType::Format, std::string("%datetime %level [%logger] %msg")); - unsafeSetIfNotExist(Level::Verbose, ConfigurationType::Format, - std::string("%datetime %level-%vlevel [%logger] %msg")); - unsafeSetIfNotExist(Level::Trace, ConfigurationType::Format, - std::string("%datetime %level [%logger] [%func] [%loc] %msg")); -} - -bool -Configurations::Parser::parseFromFile(const std::string& configurationFile, Configurations* sender, - Configurations* base) { - sender->setFromBase(base); - std::ifstream fileStream_(configurationFile.c_str(), std::ifstream::in); - ELPP_ASSERT(fileStream_.is_open(), "Unable to open configuration file [" << configurationFile << "] for parsing."); - bool parsedSuccessfully = false; - std::string line = std::string(); - Level currLevel = Level::Unknown; - std::string currConfigStr = std::string(); - std::string currLevelStr = std::string(); - while (fileStream_.good()) { - std::getline(fileStream_, line); - parsedSuccessfully = parseLine(&line, &currConfigStr, &currLevelStr, &currLevel, sender); - ELPP_ASSERT(parsedSuccessfully, "Unable to parse configuration line: " << line); - } - return parsedSuccessfully; -} - -bool -Configurations::Parser::parseFromText(const std::string& configurationsString, Configurations* sender, - Configurations* base) { - sender->setFromBase(base); - bool parsedSuccessfully = false; - std::stringstream ss(configurationsString); - std::string line = std::string(); - Level currLevel = Level::Unknown; - std::string currConfigStr = std::string(); - std::string currLevelStr = std::string(); - while (std::getline(ss, line)) { - parsedSuccessfully = parseLine(&line, &currConfigStr, &currLevelStr, &currLevel, sender); - ELPP_ASSERT(parsedSuccessfully, "Unable to parse configuration line: " << line); - } - return parsedSuccessfully; -} - -void -Configurations::Parser::ignoreComments(std::string* line) { - std::size_t foundAt = 0; - std::size_t quotesStart = line->find("\""); - std::size_t quotesEnd = std::string::npos; - if (quotesStart != std::string::npos) { - quotesEnd = line->find("\"", quotesStart + 1); - while (quotesEnd != std::string::npos && line->at(quotesEnd - 1) == '\\') { - // Do not erase slash yet - we will erase it in parseLine(..) while loop - quotesEnd = line->find("\"", quotesEnd + 2); - } - } - if ((foundAt = line->find(base::consts::kConfigurationComment)) != std::string::npos) { - if (foundAt < quotesEnd) { - foundAt = line->find(base::consts::kConfigurationComment, quotesEnd + 1); - } - *line = line->substr(0, foundAt); - } -} - -bool -Configurations::Parser::isLevel(const std::string& line) { - return base::utils::Str::startsWith(line, std::string(base::consts::kConfigurationLevel)); -} - -bool -Configurations::Parser::isComment(const std::string& line) { - return base::utils::Str::startsWith(line, std::string(base::consts::kConfigurationComment)); -} - -bool -Configurations::Parser::isConfig(const std::string& line) { - std::size_t assignment = line.find('='); - return line != "" && ((line[0] >= 'A' && line[0] <= 'Z') || (line[0] >= 'a' && line[0] <= 'z')) && - (assignment != std::string::npos) && (line.size() > assignment); -} - -bool -Configurations::Parser::parseLine(std::string* line, std::string* currConfigStr, std::string* currLevelStr, - Level* currLevel, Configurations* conf) { - ConfigurationType currConfig = ConfigurationType::Unknown; - std::string currValue = std::string(); - *line = base::utils::Str::trim(*line); - if (isComment(*line)) - return true; - ignoreComments(line); - *line = base::utils::Str::trim(*line); - if (line->empty()) { - // Comment ignored - return true; - } - if (isLevel(*line)) { - if (line->size() <= 2) { - return true; - } - *currLevelStr = line->substr(1, line->size() - 2); - *currLevelStr = base::utils::Str::toUpper(*currLevelStr); - *currLevelStr = base::utils::Str::trim(*currLevelStr); - *currLevel = LevelHelper::convertFromString(currLevelStr->c_str()); - return true; - } - if (isConfig(*line)) { - std::size_t assignment = line->find('='); - *currConfigStr = line->substr(0, assignment); - *currConfigStr = base::utils::Str::toUpper(*currConfigStr); - *currConfigStr = base::utils::Str::trim(*currConfigStr); - currConfig = ConfigurationTypeHelper::convertFromString(currConfigStr->c_str()); - currValue = line->substr(assignment + 1); - currValue = base::utils::Str::trim(currValue); - std::size_t quotesStart = currValue.find("\"", 0); - std::size_t quotesEnd = std::string::npos; - if (quotesStart != std::string::npos) { - quotesEnd = currValue.find("\"", quotesStart + 1); - while (quotesEnd != std::string::npos && currValue.at(quotesEnd - 1) == '\\') { - currValue = currValue.erase(quotesEnd - 1, 1); - quotesEnd = currValue.find("\"", quotesEnd + 2); - } - } - if (quotesStart != std::string::npos && quotesEnd != std::string::npos) { - // Quote provided - check and strip if valid - ELPP_ASSERT((quotesStart < quotesEnd), - "Configuration error - No ending quote found in [" << currConfigStr << "]"); - ELPP_ASSERT((quotesStart + 1 != quotesEnd), "Empty configuration value for [" << currConfigStr << "]"); - if ((quotesStart != quotesEnd) && (quotesStart + 1 != quotesEnd)) { - // Explicit check in case if assertion is disabled - currValue = currValue.substr(quotesStart + 1, quotesEnd - 1); - } - } - } - ELPP_ASSERT(*currLevel != Level::Unknown, "Unrecognized severity level [" << *currLevelStr << "]"); - ELPP_ASSERT(currConfig != ConfigurationType::Unknown, "Unrecognized configuration [" << *currConfigStr << "]"); - if (*currLevel == Level::Unknown || currConfig == ConfigurationType::Unknown) { - return false; // unrecognizable level or config - } - conf->set(*currLevel, currConfig, currValue); - return true; -} - -void -Configurations::unsafeSetIfNotExist(Level level, ConfigurationType configurationType, const std::string& value) { - Configuration* conf = RegistryWithPred::get(level, configurationType); - if (conf == nullptr) { - unsafeSet(level, configurationType, value); - } -} - -void -Configurations::unsafeSet(Level level, ConfigurationType configurationType, const std::string& value) { - Configuration* conf = RegistryWithPred::get(level, configurationType); - if (conf == nullptr) { - registerNew(new Configuration(level, configurationType, value)); - } else { - conf->setValue(value); - } - if (level == Level::Global) { - unsafeSetGlobally(configurationType, value, false); - } -} - -void -Configurations::setGlobally(ConfigurationType configurationType, const std::string& value, bool includeGlobalLevel) { - if (includeGlobalLevel) { - set(Level::Global, configurationType, value); - } - base::type::EnumType lIndex = LevelHelper::kMinValid; - LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { - set(LevelHelper::castFromInt(lIndex), configurationType, value); - return false; // Do not break lambda function yet as we need to set all levels regardless - }); -} - -void -Configurations::unsafeSetGlobally(ConfigurationType configurationType, const std::string& value, - bool includeGlobalLevel) { - if (includeGlobalLevel) { - unsafeSet(Level::Global, configurationType, value); - } - base::type::EnumType lIndex = LevelHelper::kMinValid; - LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { - unsafeSet(LevelHelper::castFromInt(lIndex), configurationType, value); - return false; // Do not break lambda function yet as we need to set all levels regardless - }); -} - -// LogBuilder - -void -LogBuilder::convertToColoredOutput(base::type::string_t* logLine, Level level) { - if (!m_termSupportsColor) - return; - const base::type::char_t* resetColor = ELPP_LITERAL("\x1b[0m"); - if (level == Level::Error || level == Level::Fatal) - *logLine = ELPP_LITERAL("\x1b[31m") + *logLine + resetColor; - else if (level == Level::Warning) - *logLine = ELPP_LITERAL("\x1b[33m") + *logLine + resetColor; - else if (level == Level::Debug) - *logLine = ELPP_LITERAL("\x1b[32m") + *logLine + resetColor; - else if (level == Level::Info) - *logLine = ELPP_LITERAL("\x1b[36m") + *logLine + resetColor; - else if (level == Level::Trace) - *logLine = ELPP_LITERAL("\x1b[35m") + *logLine + resetColor; -} - -// Logger - -Logger::Logger(const std::string& id, base::LogStreamsReferenceMap* logStreamsReference) - : m_id(id), - m_typedConfigurations(nullptr), - m_parentApplicationName(std::string()), - m_isConfigured(false), - m_logStreamsReference(logStreamsReference) { - initUnflushedCount(); -} - -Logger::Logger(const std::string& id, const Configurations& configurations, - base::LogStreamsReferenceMap* logStreamsReference) - : m_id(id), - m_typedConfigurations(nullptr), - m_parentApplicationName(std::string()), - m_isConfigured(false), - m_logStreamsReference(logStreamsReference) { - initUnflushedCount(); - configure(configurations); -} - -Logger::Logger(const Logger& logger) { - base::utils::safeDelete(m_typedConfigurations); - m_id = logger.m_id; - m_typedConfigurations = logger.m_typedConfigurations; - m_parentApplicationName = logger.m_parentApplicationName; - m_isConfigured = logger.m_isConfigured; - m_configurations = logger.m_configurations; - m_unflushedCount = logger.m_unflushedCount; - m_logStreamsReference = logger.m_logStreamsReference; -} - -Logger& -Logger::operator=(const Logger& logger) { - if (&logger != this) { - base::utils::safeDelete(m_typedConfigurations); - m_id = logger.m_id; - m_typedConfigurations = logger.m_typedConfigurations; - m_parentApplicationName = logger.m_parentApplicationName; - m_isConfigured = logger.m_isConfigured; - m_configurations = logger.m_configurations; - m_unflushedCount = logger.m_unflushedCount; - m_logStreamsReference = logger.m_logStreamsReference; - } - return *this; -} - -void -Logger::configure(const Configurations& configurations) { - m_isConfigured = false; // we set it to false in case if we fail - initUnflushedCount(); - if (m_typedConfigurations != nullptr) { - Configurations* c = const_cast(m_typedConfigurations->configurations()); - if (c->hasConfiguration(Level::Global, ConfigurationType::Filename)) { - flush(); - } - } - base::threading::ScopedLock scopedLock(lock()); - if (m_configurations != configurations) { - m_configurations.setFromBase(const_cast(&configurations)); - } - base::utils::safeDelete(m_typedConfigurations); - m_typedConfigurations = new base::TypedConfigurations(&m_configurations, m_logStreamsReference); - resolveLoggerFormatSpec(); - m_isConfigured = true; -} - -void -Logger::reconfigure(void) { - ELPP_INTERNAL_INFO(1, "Reconfiguring logger [" << m_id << "]"); - configure(m_configurations); -} - -bool -Logger::isValidId(const std::string& id) { - for (std::string::const_iterator it = id.begin(); it != id.end(); ++it) { - if (!base::utils::Str::contains(base::consts::kValidLoggerIdSymbols, *it)) { - return false; - } - } - return true; -} - -void -Logger::flush(void) { - ELPP_INTERNAL_INFO(3, "Flushing logger [" << m_id << "] all levels"); - base::threading::ScopedLock scopedLock(lock()); - base::type::EnumType lIndex = LevelHelper::kMinValid; - LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { - flush(LevelHelper::castFromInt(lIndex), nullptr); - return false; - }); -} - -void -Logger::flush(Level level, base::type::fstream_t* fs) { - if (fs == nullptr && m_typedConfigurations->toFile(level)) { - fs = m_typedConfigurations->fileStream(level); - } - if (fs != nullptr) { - fs->flush(); - std::unordered_map::iterator iter = m_unflushedCount.find(level); - if (iter != m_unflushedCount.end()) { - iter->second = 0; - } - Helpers::validateFileRolling(this, level); - } -} - -void -Logger::initUnflushedCount(void) { - m_unflushedCount.clear(); - base::type::EnumType lIndex = LevelHelper::kMinValid; - LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { - m_unflushedCount.insert(std::make_pair(LevelHelper::castFromInt(lIndex), 0)); - return false; - }); -} - -void -Logger::resolveLoggerFormatSpec(void) const { - base::type::EnumType lIndex = LevelHelper::kMinValid; - LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { - base::LogFormat* logFormat = - const_cast(&m_typedConfigurations->logFormat(LevelHelper::castFromInt(lIndex))); - base::utils::Str::replaceFirstWithEscape(logFormat->m_format, base::consts::kLoggerIdFormatSpecifier, m_id); - return false; - }); -} - -// el::base -namespace base { - -// el::base::utils -namespace utils { - -// File - -base::type::fstream_t* -File::newFileStream(const std::string& filename) { - base::type::fstream_t* fs = new base::type::fstream_t(filename.c_str(), base::type::fstream_t::out -#if !defined(ELPP_FRESH_LOG_FILE) - | base::type::fstream_t::app -#endif - ); -#if defined(ELPP_UNICODE) - std::locale elppUnicodeLocale(""); -#if ELPP_OS_WINDOWS - std::locale elppUnicodeLocaleWindows(elppUnicodeLocale, new std::codecvt_utf8_utf16); - elppUnicodeLocale = elppUnicodeLocaleWindows; -#endif // ELPP_OS_WINDOWS - fs->imbue(elppUnicodeLocale); -#endif // defined(ELPP_UNICODE) - if (fs->is_open()) { - fs->flush(); - } else { - base::utils::safeDelete(fs); - ELPP_INTERNAL_ERROR("Bad file [" << filename << "]", true); - } - return fs; -} - -std::size_t -File::getSizeOfFile(base::type::fstream_t* fs) { - if (fs == nullptr) { - return 0; - } - // Since the file stream is appended to or truncated, the current - // offset is the file size. - std::size_t size = static_cast(fs->tellg()); - return size; -} - -bool -File::pathExists(const char* path, bool considerFile) { - if (path == nullptr) { - return false; - } -#if ELPP_OS_UNIX - ELPP_UNUSED(considerFile); - struct stat st; - return (stat(path, &st) == 0); -#elif ELPP_OS_WINDOWS - DWORD fileType = GetFileAttributesA(path); - if (fileType == INVALID_FILE_ATTRIBUTES) { - return false; - } - return considerFile ? true : ((fileType & FILE_ATTRIBUTE_DIRECTORY) == 0 ? false : true); -#endif // ELPP_OS_UNIX -} - -bool -File::createPath(const std::string& path) { - if (path.empty()) { - return false; - } - if (base::utils::File::pathExists(path.c_str())) { - return true; - } - int status = -1; - - char* currPath = const_cast(path.c_str()); - std::string builtPath = std::string(); -#if ELPP_OS_UNIX - if (path[0] == '/') { - builtPath = "/"; - } - currPath = STRTOK(currPath, base::consts::kFilePathSeperator, 0); -#elif ELPP_OS_WINDOWS - // Use secure functions API - char* nextTok_ = nullptr; - currPath = STRTOK(currPath, base::consts::kFilePathSeperator, &nextTok_); - ELPP_UNUSED(nextTok_); -#endif // ELPP_OS_UNIX - while (currPath != nullptr) { - builtPath.append(currPath); - builtPath.append(base::consts::kFilePathSeperator); -#if ELPP_OS_UNIX - status = mkdir(builtPath.c_str(), ELPP_LOG_PERMS); - currPath = STRTOK(nullptr, base::consts::kFilePathSeperator, 0); -#elif ELPP_OS_WINDOWS - status = _mkdir(builtPath.c_str()); - currPath = STRTOK(nullptr, base::consts::kFilePathSeperator, &nextTok_); -#endif // ELPP_OS_UNIX - } - if (status == -1) { - ELPP_INTERNAL_ERROR("Error while creating path [" << path << "]", true); - return false; - } - return true; -} - -std::string -File::extractPathFromFilename(const std::string& fullPath, const char* separator) { - if ((fullPath == "") || (fullPath.find(separator) == std::string::npos)) { - return fullPath; - } - std::size_t lastSlashAt = fullPath.find_last_of(separator); - if (lastSlashAt == 0) { - return std::string(separator); - } - return fullPath.substr(0, lastSlashAt + 1); -} - -void -File::buildStrippedFilename(const char* filename, char buff[], std::size_t limit) { - std::size_t sizeOfFilename = strlen(filename); - if (sizeOfFilename >= limit) { - filename += (sizeOfFilename - limit); - if (filename[0] != '.' && filename[1] != '.') { // prepend if not already - filename += 3; // 3 = '..' - STRCAT(buff, "..", limit); - } - } - STRCAT(buff, filename, limit); -} - -void -File::buildBaseFilename(const std::string& fullPath, char buff[], std::size_t limit, const char* separator) { - const char* filename = fullPath.c_str(); - std::size_t lastSlashAt = fullPath.find_last_of(separator); - filename += lastSlashAt ? lastSlashAt + 1 : 0; - std::size_t sizeOfFilename = strlen(filename); - if (sizeOfFilename >= limit) { - filename += (sizeOfFilename - limit); - if (filename[0] != '.' && filename[1] != '.') { // prepend if not already - filename += 3; // 3 = '..' - STRCAT(buff, "..", limit); - } - } - STRCAT(buff, filename, limit); -} - -// Str - -bool -Str::wildCardMatch(const char* str, const char* pattern) { - while (*pattern) { - switch (*pattern) { - case '?': - if (!*str) - return false; - ++str; - ++pattern; - break; - case '*': - if (wildCardMatch(str, pattern + 1)) - return true; - if (*str && wildCardMatch(str + 1, pattern)) - return true; - return false; - default: - if (*str++ != *pattern++) - return false; - break; - } - } - return !*str && !*pattern; -} - -std::string& -Str::ltrim(std::string& str) { - str.erase(str.begin(), std::find_if(str.begin(), str.end(), [](char c) { return !std::isspace(c); })); - return str; -} - -std::string& -Str::rtrim(std::string& str) { - str.erase(std::find_if(str.rbegin(), str.rend(), [](char c) { return !std::isspace(c); }).base(), str.end()); - return str; -} - -std::string& -Str::trim(std::string& str) { - return ltrim(rtrim(str)); -} - -bool -Str::startsWith(const std::string& str, const std::string& start) { - return (str.length() >= start.length()) && (str.compare(0, start.length(), start) == 0); -} - -bool -Str::endsWith(const std::string& str, const std::string& end) { - return (str.length() >= end.length()) && (str.compare(str.length() - end.length(), end.length(), end) == 0); -} - -std::string& -Str::replaceAll(std::string& str, char replaceWhat, char replaceWith) { - std::replace(str.begin(), str.end(), replaceWhat, replaceWith); - return str; -} - -std::string& -Str::replaceAll(std::string& str, const std::string& replaceWhat, const std::string& replaceWith) { - if (replaceWhat == replaceWith) - return str; - std::size_t foundAt = std::string::npos; - while ((foundAt = str.find(replaceWhat, foundAt + 1)) != std::string::npos) { - str.replace(foundAt, replaceWhat.length(), replaceWith); - } - return str; -} - -void -Str::replaceFirstWithEscape(base::type::string_t& str, const base::type::string_t& replaceWhat, - const base::type::string_t& replaceWith) { - std::size_t foundAt = base::type::string_t::npos; - while ((foundAt = str.find(replaceWhat, foundAt + 1)) != base::type::string_t::npos) { - if (foundAt > 0 && str[foundAt - 1] == base::consts::kFormatSpecifierChar) { - str.erase(foundAt - 1, 1); - ++foundAt; - } else { - str.replace(foundAt, replaceWhat.length(), replaceWith); - return; - } - } -} -#if defined(ELPP_UNICODE) -void -Str::replaceFirstWithEscape(base::type::string_t& str, const base::type::string_t& replaceWhat, - const std::string& replaceWith) { - replaceFirstWithEscape(str, replaceWhat, base::type::string_t(replaceWith.begin(), replaceWith.end())); -} -#endif // defined(ELPP_UNICODE) - -std::string& -Str::toUpper(std::string& str) { - std::transform(str.begin(), str.end(), str.begin(), [](char c) { return static_cast(::toupper(c)); }); - return str; -} - -bool -Str::cStringEq(const char* s1, const char* s2) { - if (s1 == nullptr && s2 == nullptr) - return true; - if (s1 == nullptr || s2 == nullptr) - return false; - return strcmp(s1, s2) == 0; -} - -bool -Str::cStringCaseEq(const char* s1, const char* s2) { - if (s1 == nullptr && s2 == nullptr) - return true; - if (s1 == nullptr || s2 == nullptr) - return false; - - // With thanks to cygwin for this code - int d = 0; - - while (true) { - const int c1 = toupper(*s1++); - const int c2 = toupper(*s2++); - - if (((d = c1 - c2) != 0) || (c2 == '\0')) { - break; - } - } - - return d == 0; -} - -bool -Str::contains(const char* str, char c) { - for (; *str; ++str) { - if (*str == c) - return true; - } - return false; -} - -char* -Str::convertAndAddToBuff(std::size_t n, int len, char* buf, const char* bufLim, bool zeroPadded) { - char localBuff[10] = ""; - char* p = localBuff + sizeof(localBuff) - 2; - if (n > 0) { - for (; n > 0 && p > localBuff && len > 0; n /= 10, --len) *--p = static_cast(n % 10 + '0'); - } else { - *--p = '0'; - --len; - } - if (zeroPadded) - while (p > localBuff && len-- > 0) *--p = static_cast('0'); - return addToBuff(p, buf, bufLim); -} - -char* -Str::addToBuff(const char* str, char* buf, const char* bufLim) { - while ((buf < bufLim) && ((*buf = *str++) != '\0')) ++buf; - return buf; -} - -char* -Str::clearBuff(char buff[], std::size_t lim) { - STRCPY(buff, "", lim); - ELPP_UNUSED(lim); // For *nix we dont have anything using lim in above STRCPY macro - return buff; -} - -/// @brief Converst wchar* to char* -/// NOTE: Need to free return value after use! -char* -Str::wcharPtrToCharPtr(const wchar_t* line) { - std::size_t len_ = wcslen(line) + 1; - char* buff_ = static_cast(malloc(len_ + 1)); -#if ELPP_OS_UNIX || (ELPP_OS_WINDOWS && !ELPP_CRT_DBG_WARNINGS) - std::wcstombs(buff_, line, len_); -#elif ELPP_OS_WINDOWS - std::size_t convCount_ = 0; - mbstate_t mbState_; - ::memset(static_cast(&mbState_), 0, sizeof(mbState_)); - wcsrtombs_s(&convCount_, buff_, len_, &line, len_, &mbState_); -#endif // ELPP_OS_UNIX || (ELPP_OS_WINDOWS && !ELPP_CRT_DBG_WARNINGS) - return buff_; -} - -// OS - -#if ELPP_OS_WINDOWS -/// @brief Gets environment variables for Windows based OS. -/// We are not using getenv(const char*) because of CRT deprecation -/// @param varname Variable name to get environment variable value for -/// @return If variable exist the value of it otherwise nullptr -const char* -OS::getWindowsEnvironmentVariable(const char* varname) { - const DWORD bufferLen = 50; - static char buffer[bufferLen]; - if (GetEnvironmentVariableA(varname, buffer, bufferLen)) { - return buffer; - } - return nullptr; -} -#endif // ELPP_OS_WINDOWS -#if ELPP_OS_ANDROID -std::string -OS::getProperty(const char* prop) { - char propVal[PROP_VALUE_MAX + 1]; - int ret = __system_property_get(prop, propVal); - return ret == 0 ? std::string() : std::string(propVal); -} - -std::string -OS::getDeviceName(void) { - std::stringstream ss; - std::string manufacturer = getProperty("ro.product.manufacturer"); - std::string model = getProperty("ro.product.model"); - if (manufacturer.empty() || model.empty()) { - return std::string(); - } - ss << manufacturer << "-" << model; - return ss.str(); -} -#endif // ELPP_OS_ANDROID - -const std::string -OS::getBashOutput(const char* command) { -#if (ELPP_OS_UNIX && !ELPP_OS_ANDROID && !ELPP_CYGWIN) - if (command == nullptr) { - return std::string(); - } - FILE* proc = nullptr; - if ((proc = popen(command, "r")) == nullptr) { - ELPP_INTERNAL_ERROR("\nUnable to run command [" << command << "]", true); - return std::string(); - } - char hBuff[4096]; - if (fgets(hBuff, sizeof(hBuff), proc) != nullptr) { - pclose(proc); - const std::size_t buffLen = strlen(hBuff); - if (buffLen > 0 && hBuff[buffLen - 1] == '\n') { - hBuff[buffLen - 1] = '\0'; - } - return std::string(hBuff); - } else { - pclose(proc); - } - return std::string(); -#else - ELPP_UNUSED(command); - return std::string(); -#endif // (ELPP_OS_UNIX && !ELPP_OS_ANDROID && !ELPP_CYGWIN) -} - -std::string -OS::getEnvironmentVariable(const char* variableName, const char* defaultVal, const char* alternativeBashCommand) { -#if ELPP_OS_UNIX - const char* val = getenv(variableName); -#elif ELPP_OS_WINDOWS - const char* val = getWindowsEnvironmentVariable(variableName); -#endif // ELPP_OS_UNIX - if ((val == nullptr) || ((strcmp(val, "") == 0))) { -#if ELPP_OS_UNIX && defined(ELPP_FORCE_ENV_VAR_FROM_BASH) - // Try harder on unix-based systems - std::string valBash = base::utils::OS::getBashOutput(alternativeBashCommand); - if (valBash.empty()) { - return std::string(defaultVal); - } else { - return valBash; - } -#elif ELPP_OS_WINDOWS || ELPP_OS_UNIX - ELPP_UNUSED(alternativeBashCommand); - return std::string(defaultVal); -#endif // ELPP_OS_UNIX && defined(ELPP_FORCE_ENV_VAR_FROM_BASH) - } - return std::string(val); -} - -std::string -OS::currentUser(void) { -#if ELPP_OS_UNIX && !ELPP_OS_ANDROID - return getEnvironmentVariable("USER", base::consts::kUnknownUser, "whoami"); -#elif ELPP_OS_WINDOWS - return getEnvironmentVariable("USERNAME", base::consts::kUnknownUser); -#elif ELPP_OS_ANDROID - ELPP_UNUSED(base::consts::kUnknownUser); - return std::string("android"); -#else - return std::string(); -#endif // ELPP_OS_UNIX && !ELPP_OS_ANDROID -} - -std::string -OS::currentHost(void) { -#if ELPP_OS_UNIX && !ELPP_OS_ANDROID - return getEnvironmentVariable("HOSTNAME", base::consts::kUnknownHost, "hostname"); -#elif ELPP_OS_WINDOWS - return getEnvironmentVariable("COMPUTERNAME", base::consts::kUnknownHost); -#elif ELPP_OS_ANDROID - ELPP_UNUSED(base::consts::kUnknownHost); - return getDeviceName(); -#else - return std::string(); -#endif // ELPP_OS_UNIX && !ELPP_OS_ANDROID -} - -bool -OS::termSupportsColor(void) { - std::string term = getEnvironmentVariable("TERM", ""); - return term == "xterm" || term == "xterm-color" || term == "xterm-256color" || term == "screen" || - term == "linux" || term == "cygwin" || term == "screen-256color"; -} - -// DateTime - -void -DateTime::gettimeofday(struct timeval* tv) { -#if ELPP_OS_WINDOWS - if (tv != nullptr) { -#if ELPP_COMPILER_MSVC || defined(_MSC_EXTENSIONS) - const unsigned __int64 delta_ = 11644473600000000Ui64; -#else - const unsigned __int64 delta_ = 11644473600000000ULL; -#endif // ELPP_COMPILER_MSVC || defined(_MSC_EXTENSIONS) - const double secOffSet = 0.000001; - const unsigned long usecOffSet = 1000000; - FILETIME fileTime; - GetSystemTimeAsFileTime(&fileTime); - unsigned __int64 present = 0; - present |= fileTime.dwHighDateTime; - present = present << 32; - present |= fileTime.dwLowDateTime; - present /= 10; // mic-sec - // Subtract the difference - present -= delta_; - tv->tv_sec = static_cast(present * secOffSet); - tv->tv_usec = static_cast(present % usecOffSet); - } -#else - ::gettimeofday(tv, nullptr); -#endif // ELPP_OS_WINDOWS -} - -std::string -DateTime::getDateTime(const char* format, const base::SubsecondPrecision* ssPrec) { - struct timeval currTime; - gettimeofday(&currTime); - return timevalToString(currTime, format, ssPrec); -} - -std::string -DateTime::timevalToString(struct timeval tval, const char* format, const el::base::SubsecondPrecision* ssPrec) { - struct ::tm timeInfo; - buildTimeInfo(&tval, &timeInfo); - const int kBuffSize = 30; - char buff_[kBuffSize] = ""; - parseFormat(buff_, kBuffSize, format, &timeInfo, static_cast(tval.tv_usec / ssPrec->m_offset), ssPrec); - return std::string(buff_); -} - -base::type::string_t -DateTime::formatTime(unsigned long long time, base::TimestampUnit timestampUnit) { - base::type::EnumType start = static_cast(timestampUnit); - const base::type::char_t* unit = base::consts::kTimeFormats[start].unit; - for (base::type::EnumType i = start; i < base::consts::kTimeFormatsCount - 1; ++i) { - if (time <= base::consts::kTimeFormats[i].value) { - break; - } - if (base::consts::kTimeFormats[i].value == 1000.0f && time / 1000.0f < 1.9f) { - break; - } - time /= static_cast(base::consts::kTimeFormats[i].value); - unit = base::consts::kTimeFormats[i + 1].unit; - } - base::type::stringstream_t ss; - ss << time << " " << unit; - return ss.str(); -} - -unsigned long long -DateTime::getTimeDifference(const struct timeval& endTime, const struct timeval& startTime, - base::TimestampUnit timestampUnit) { - if (timestampUnit == base::TimestampUnit::Microsecond) { - return static_cast( - static_cast(1000000 * endTime.tv_sec + endTime.tv_usec) - - static_cast(1000000 * startTime.tv_sec + startTime.tv_usec)); - } - // milliseconds - auto conv = [](const struct timeval& tim) { - return static_cast((tim.tv_sec * 1000) + (tim.tv_usec / 1000)); - }; - return static_cast(conv(endTime) - conv(startTime)); -} - -struct ::tm* -DateTime::buildTimeInfo(struct timeval* currTime, struct ::tm* timeInfo) { -#if ELPP_OS_UNIX - time_t rawTime = currTime->tv_sec; - ::elpptime_r(&rawTime, timeInfo); - return timeInfo; -#else -#if ELPP_COMPILER_MSVC - ELPP_UNUSED(currTime); - time_t t; -#if defined(_USE_32BIT_TIME_T) - _time32(&t); -#else - _time64(&t); -#endif - elpptime_s(timeInfo, &t); - return timeInfo; -#else - // For any other compilers that don't have CRT warnings issue e.g, MinGW or TDM GCC- we use different method - time_t rawTime = currTime->tv_sec; - struct tm* tmInf = elpptime(&rawTime); - *timeInfo = *tmInf; - return timeInfo; -#endif // ELPP_COMPILER_MSVC -#endif // ELPP_OS_UNIX -} - -char* -DateTime::parseFormat(char* buf, std::size_t bufSz, const char* format, const struct tm* tInfo, std::size_t msec, - const base::SubsecondPrecision* ssPrec) { - const char* bufLim = buf + bufSz; - for (; *format; ++format) { - if (*format == base::consts::kFormatSpecifierChar) { - switch (*++format) { - case base::consts::kFormatSpecifierChar: // Escape - break; - case '\0': // End - --format; - break; - case 'd': // Day - buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_mday, 2, buf, bufLim); - continue; - case 'a': // Day of week (short) - buf = base::utils::Str::addToBuff(base::consts::kDaysAbbrev[tInfo->tm_wday], buf, bufLim); - continue; - case 'A': // Day of week (long) - buf = base::utils::Str::addToBuff(base::consts::kDays[tInfo->tm_wday], buf, bufLim); - continue; - case 'M': // month - buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_mon + 1, 2, buf, bufLim); - continue; - case 'b': // month (short) - buf = base::utils::Str::addToBuff(base::consts::kMonthsAbbrev[tInfo->tm_mon], buf, bufLim); - continue; - case 'B': // month (long) - buf = base::utils::Str::addToBuff(base::consts::kMonths[tInfo->tm_mon], buf, bufLim); - continue; - case 'y': // year (two digits) - buf = - base::utils::Str::convertAndAddToBuff(tInfo->tm_year + base::consts::kYearBase, 2, buf, bufLim); - continue; - case 'Y': // year (four digits) - buf = - base::utils::Str::convertAndAddToBuff(tInfo->tm_year + base::consts::kYearBase, 4, buf, bufLim); - continue; - case 'h': // hour (12-hour) - buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_hour % 12, 2, buf, bufLim); - continue; - case 'H': // hour (24-hour) - buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_hour, 2, buf, bufLim); - continue; - case 'm': // minute - buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_min, 2, buf, bufLim); - continue; - case 's': // second - buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_sec, 2, buf, bufLim); - continue; - case 'z': // subsecond part - case 'g': - buf = base::utils::Str::convertAndAddToBuff(msec, ssPrec->m_width, buf, bufLim); - continue; - case 'F': // AM/PM - buf = base::utils::Str::addToBuff((tInfo->tm_hour >= 12) ? base::consts::kPm : base::consts::kAm, - buf, bufLim); - continue; - default: - continue; - } - } - if (buf == bufLim) - break; - *buf++ = *format; - } - return buf; -} - -// CommandLineArgs - -void -CommandLineArgs::setArgs(int argc, char** argv) { - m_params.clear(); - m_paramsWithValue.clear(); - if (argc == 0 || argv == nullptr) { - return; - } - m_argc = argc; - m_argv = argv; - for (int i = 1; i < m_argc; ++i) { - const char* v = (strstr(m_argv[i], "=")); - if (v != nullptr && strlen(v) > 0) { - std::string key = std::string(m_argv[i]); - key = key.substr(0, key.find_first_of('=')); - if (hasParamWithValue(key.c_str())) { - ELPP_INTERNAL_INFO(1, "Skipping [" << key << "] arg since it already has value [" - << getParamValue(key.c_str()) << "]"); - } else { - m_paramsWithValue.insert(std::make_pair(key, std::string(v + 1))); - } - } - if (v == nullptr) { - if (hasParam(m_argv[i])) { - ELPP_INTERNAL_INFO(1, "Skipping [" << m_argv[i] << "] arg since it already exists"); - } else { - m_params.push_back(std::string(m_argv[i])); - } - } - } -} - -bool -CommandLineArgs::hasParamWithValue(const char* paramKey) const { - return m_paramsWithValue.find(std::string(paramKey)) != m_paramsWithValue.end(); -} - -const char* -CommandLineArgs::getParamValue(const char* paramKey) const { - std::unordered_map::const_iterator iter = m_paramsWithValue.find(std::string(paramKey)); - return iter != m_paramsWithValue.end() ? iter->second.c_str() : ""; -} - -bool -CommandLineArgs::hasParam(const char* paramKey) const { - return std::find(m_params.begin(), m_params.end(), std::string(paramKey)) != m_params.end(); -} - -bool -CommandLineArgs::empty(void) const { - return m_params.empty() && m_paramsWithValue.empty(); -} - -std::size_t -CommandLineArgs::size(void) const { - return m_params.size() + m_paramsWithValue.size(); -} - -base::type::ostream_t& -operator<<(base::type::ostream_t& os, const CommandLineArgs& c) { - for (int i = 1; i < c.m_argc; ++i) { - os << ELPP_LITERAL("[") << c.m_argv[i] << ELPP_LITERAL("]"); - if (i < c.m_argc - 1) { - os << ELPP_LITERAL(" "); - } - } - return os; -} - -} // namespace utils - -// el::base::threading -namespace threading { - -#if ELPP_THREADING_ENABLED -#if ELPP_USE_STD_THREADING -#if ELPP_ASYNC_LOGGING -static void -msleep(int ms) { - // Only when async logging enabled - this is because async is strict on compiler -#if defined(ELPP_NO_SLEEP_FOR) - usleep(ms * 1000); -#else - std::this_thread::sleep_for(std::chrono::milliseconds(ms)); -#endif // defined(ELPP_NO_SLEEP_FOR) -} -#endif // ELPP_ASYNC_LOGGING -#endif // !ELPP_USE_STD_THREADING -#endif // ELPP_THREADING_ENABLED - -} // namespace threading - -// el::base - -// SubsecondPrecision - -void -SubsecondPrecision::init(int width) { - if (width < 1 || width > 6) { - width = base::consts::kDefaultSubsecondPrecision; - } - m_width = width; - switch (m_width) { - case 3: - m_offset = 1000; - break; - case 4: - m_offset = 100; - break; - case 5: - m_offset = 10; - break; - case 6: - m_offset = 1; - break; - default: - m_offset = 1000; - break; - } -} - -// LogFormat - -LogFormat::LogFormat(void) - : m_level(Level::Unknown), - m_userFormat(base::type::string_t()), - m_format(base::type::string_t()), - m_dateTimeFormat(std::string()), - m_flags(0x0), - m_currentUser(base::utils::OS::currentUser()), - m_currentHost(base::utils::OS::currentHost()) { -} - -LogFormat::LogFormat(Level level, const base::type::string_t& format) - : m_level(level), - m_userFormat(format), - m_currentUser(base::utils::OS::currentUser()), - m_currentHost(base::utils::OS::currentHost()) { - parseFromFormat(m_userFormat); -} - -LogFormat::LogFormat(const LogFormat& logFormat) - : m_level(logFormat.m_level), - m_userFormat(logFormat.m_userFormat), - m_format(logFormat.m_format), - m_dateTimeFormat(logFormat.m_dateTimeFormat), - m_flags(logFormat.m_flags), - m_currentUser(logFormat.m_currentUser), - m_currentHost(logFormat.m_currentHost) { -} - -LogFormat::LogFormat(LogFormat&& logFormat) { - m_level = std::move(logFormat.m_level); - m_userFormat = std::move(logFormat.m_userFormat); - m_format = std::move(logFormat.m_format); - m_dateTimeFormat = std::move(logFormat.m_dateTimeFormat); - m_flags = std::move(logFormat.m_flags); - m_currentUser = std::move(logFormat.m_currentUser); - m_currentHost = std::move(logFormat.m_currentHost); -} - -LogFormat& -LogFormat::operator=(const LogFormat& logFormat) { - if (&logFormat != this) { - m_level = logFormat.m_level; - m_userFormat = logFormat.m_userFormat; - m_dateTimeFormat = logFormat.m_dateTimeFormat; - m_flags = logFormat.m_flags; - m_currentUser = logFormat.m_currentUser; - m_currentHost = logFormat.m_currentHost; - } - return *this; -} - -bool -LogFormat::operator==(const LogFormat& other) { - return m_level == other.m_level && m_userFormat == other.m_userFormat && m_format == other.m_format && - m_dateTimeFormat == other.m_dateTimeFormat && m_flags == other.m_flags; -} - -/// @brief Updates format to be used while logging. -/// @param userFormat User provided format -void -LogFormat::parseFromFormat(const base::type::string_t& userFormat) { - // We make copy because we will be changing the format - // i.e, removing user provided date format from original format - // and then storing it. - base::type::string_t formatCopy = userFormat; - m_flags = 0x0; - auto conditionalAddFlag = [&](const base::type::char_t* specifier, base::FormatFlags flag) { - std::size_t foundAt = base::type::string_t::npos; - while ((foundAt = formatCopy.find(specifier, foundAt + 1)) != base::type::string_t::npos) { - if (foundAt > 0 && formatCopy[foundAt - 1] == base::consts::kFormatSpecifierChar) { - if (hasFlag(flag)) { - // If we already have flag we remove the escape chars so that '%%' is turned to '%' - // even after specifier resolution - this is because we only replaceFirst specifier - formatCopy.erase(foundAt - 1, 1); - ++foundAt; - } - } else { - if (!hasFlag(flag)) - addFlag(flag); - } - } - }; - conditionalAddFlag(base::consts::kAppNameFormatSpecifier, base::FormatFlags::AppName); - conditionalAddFlag(base::consts::kSeverityLevelFormatSpecifier, base::FormatFlags::Level); - conditionalAddFlag(base::consts::kSeverityLevelShortFormatSpecifier, base::FormatFlags::LevelShort); - conditionalAddFlag(base::consts::kLoggerIdFormatSpecifier, base::FormatFlags::LoggerId); - conditionalAddFlag(base::consts::kThreadIdFormatSpecifier, base::FormatFlags::ThreadId); - conditionalAddFlag(base::consts::kLogFileFormatSpecifier, base::FormatFlags::File); - conditionalAddFlag(base::consts::kLogFileBaseFormatSpecifier, base::FormatFlags::FileBase); - conditionalAddFlag(base::consts::kLogLineFormatSpecifier, base::FormatFlags::Line); - conditionalAddFlag(base::consts::kLogLocationFormatSpecifier, base::FormatFlags::Location); - conditionalAddFlag(base::consts::kLogFunctionFormatSpecifier, base::FormatFlags::Function); - conditionalAddFlag(base::consts::kCurrentUserFormatSpecifier, base::FormatFlags::User); - conditionalAddFlag(base::consts::kCurrentHostFormatSpecifier, base::FormatFlags::Host); - conditionalAddFlag(base::consts::kMessageFormatSpecifier, base::FormatFlags::LogMessage); - conditionalAddFlag(base::consts::kVerboseLevelFormatSpecifier, base::FormatFlags::VerboseLevel); - // For date/time we need to extract user's date format first - std::size_t dateIndex = std::string::npos; - if ((dateIndex = formatCopy.find(base::consts::kDateTimeFormatSpecifier)) != std::string::npos) { - while (dateIndex > 0 && formatCopy[dateIndex - 1] == base::consts::kFormatSpecifierChar) { - dateIndex = formatCopy.find(base::consts::kDateTimeFormatSpecifier, dateIndex + 1); - } - if (dateIndex != std::string::npos) { - addFlag(base::FormatFlags::DateTime); - updateDateFormat(dateIndex, formatCopy); - } - } - m_format = formatCopy; - updateFormatSpec(); -} - -void -LogFormat::updateDateFormat(std::size_t index, base::type::string_t& currFormat) { - if (hasFlag(base::FormatFlags::DateTime)) { - index += ELPP_STRLEN(base::consts::kDateTimeFormatSpecifier); - } - const base::type::char_t* ptr = currFormat.c_str() + index; - if ((currFormat.size() > index) && (ptr[0] == '{')) { - // User has provided format for date/time - ++ptr; - int count = 1; // Start by 1 in order to remove starting brace - std::stringstream ss; - for (; *ptr; ++ptr, ++count) { - if (*ptr == '}') { - ++count; // In order to remove ending brace - break; - } - ss << static_cast(*ptr); - } - currFormat.erase(index, count); - m_dateTimeFormat = ss.str(); - } else { - // No format provided, use default - if (hasFlag(base::FormatFlags::DateTime)) { - m_dateTimeFormat = std::string(base::consts::kDefaultDateTimeFormat); - } - } -} - -void -LogFormat::updateFormatSpec(void) { - // Do not use switch over strongly typed enums because Intel C++ compilers dont support them yet. - if (m_level == Level::Debug) { - base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, - base::consts::kDebugLevelLogValue); - base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, - base::consts::kDebugLevelShortLogValue); - } else if (m_level == Level::Info) { - base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, - base::consts::kInfoLevelLogValue); - base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, - base::consts::kInfoLevelShortLogValue); - } else if (m_level == Level::Warning) { - base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, - base::consts::kWarningLevelLogValue); - base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, - base::consts::kWarningLevelShortLogValue); - } else if (m_level == Level::Error) { - base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, - base::consts::kErrorLevelLogValue); - base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, - base::consts::kErrorLevelShortLogValue); - } else if (m_level == Level::Fatal) { - base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, - base::consts::kFatalLevelLogValue); - base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, - base::consts::kFatalLevelShortLogValue); - } else if (m_level == Level::Verbose) { - base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, - base::consts::kVerboseLevelLogValue); - base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, - base::consts::kVerboseLevelShortLogValue); - } else if (m_level == Level::Trace) { - base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, - base::consts::kTraceLevelLogValue); - base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, - base::consts::kTraceLevelShortLogValue); - } - if (hasFlag(base::FormatFlags::User)) { - base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kCurrentUserFormatSpecifier, m_currentUser); - } - if (hasFlag(base::FormatFlags::Host)) { - base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kCurrentHostFormatSpecifier, m_currentHost); - } - // Ignore Level::Global and Level::Unknown -} - -// TypedConfigurations - -TypedConfigurations::TypedConfigurations(Configurations* configurations, - base::LogStreamsReferenceMap* logStreamsReference) { - m_configurations = configurations; - m_logStreamsReference = logStreamsReference; - build(m_configurations); -} - -TypedConfigurations::TypedConfigurations(const TypedConfigurations& other) { - this->m_configurations = other.m_configurations; - this->m_logStreamsReference = other.m_logStreamsReference; - build(m_configurations); -} - -bool -TypedConfigurations::enabled(Level level) { - return getConfigByVal(level, &m_enabledMap, "enabled"); -} - -bool -TypedConfigurations::toFile(Level level) { - return getConfigByVal(level, &m_toFileMap, "toFile"); -} - -const std::string& -TypedConfigurations::filename(Level level) { - return getConfigByRef(level, &m_filenameMap, "filename"); -} - -bool -TypedConfigurations::toStandardOutput(Level level) { - return getConfigByVal(level, &m_toStandardOutputMap, "toStandardOutput"); -} - -const base::LogFormat& -TypedConfigurations::logFormat(Level level) { - return getConfigByRef(level, &m_logFormatMap, "logFormat"); -} - -const base::SubsecondPrecision& -TypedConfigurations::subsecondPrecision(Level level) { - return getConfigByRef(level, &m_subsecondPrecisionMap, "subsecondPrecision"); -} - -const base::MillisecondsWidth& -TypedConfigurations::millisecondsWidth(Level level) { - return getConfigByRef(level, &m_subsecondPrecisionMap, "millisecondsWidth"); -} - -bool -TypedConfigurations::performanceTracking(Level level) { - return getConfigByVal(level, &m_performanceTrackingMap, "performanceTracking"); -} - -base::type::fstream_t* -TypedConfigurations::fileStream(Level level) { - return getConfigByRef(level, &m_fileStreamMap, "fileStream").get(); -} - -std::size_t -TypedConfigurations::maxLogFileSize(Level level) { - return getConfigByVal(level, &m_maxLogFileSizeMap, "maxLogFileSize"); -} - -std::size_t -TypedConfigurations::logFlushThreshold(Level level) { - return getConfigByVal(level, &m_logFlushThresholdMap, "logFlushThreshold"); -} - -void -TypedConfigurations::build(Configurations* configurations) { - base::threading::ScopedLock scopedLock(lock()); - auto getBool = [](std::string boolStr) -> bool { // Pass by value for trimming - base::utils::Str::trim(boolStr); - return (boolStr == "TRUE" || boolStr == "true" || boolStr == "1"); - }; - std::vector withFileSizeLimit; - for (Configurations::const_iterator it = configurations->begin(); it != configurations->end(); ++it) { - Configuration* conf = *it; - // We cannot use switch on strong enums because Intel C++ dont support them yet - if (conf->configurationType() == ConfigurationType::Enabled) { - setValue(conf->level(), getBool(conf->value()), &m_enabledMap); - } else if (conf->configurationType() == ConfigurationType::ToFile) { - setValue(conf->level(), getBool(conf->value()), &m_toFileMap); - } else if (conf->configurationType() == ConfigurationType::ToStandardOutput) { - setValue(conf->level(), getBool(conf->value()), &m_toStandardOutputMap); - } else if (conf->configurationType() == ConfigurationType::Filename) { - // We do not yet configure filename but we will configure in another - // loop. This is because if file cannot be created, we will force ToFile - // to be false. Because configuring logger is not necessarily performance - // sensative operation, we can live with another loop; (by the way this loop - // is not very heavy either) - } else if (conf->configurationType() == ConfigurationType::Format) { - setValue(conf->level(), - base::LogFormat(conf->level(), base::type::string_t(conf->value().begin(), conf->value().end())), - &m_logFormatMap); - } else if (conf->configurationType() == ConfigurationType::SubsecondPrecision) { - setValue(Level::Global, base::SubsecondPrecision(static_cast(getULong(conf->value()))), - &m_subsecondPrecisionMap); - } else if (conf->configurationType() == ConfigurationType::PerformanceTracking) { - setValue(Level::Global, getBool(conf->value()), &m_performanceTrackingMap); - } else if (conf->configurationType() == ConfigurationType::MaxLogFileSize) { - auto v = getULong(conf->value()); - setValue(conf->level(), static_cast(v), &m_maxLogFileSizeMap); - if (v != 0) { - withFileSizeLimit.push_back(conf); - } - } else if (conf->configurationType() == ConfigurationType::LogFlushThreshold) { - setValue(conf->level(), static_cast(getULong(conf->value())), &m_logFlushThresholdMap); - } - } - // As mentioned earlier, we will now set filename configuration in separate loop to deal with non-existent files - for (Configurations::const_iterator it = configurations->begin(); it != configurations->end(); ++it) { - Configuration* conf = *it; - if (conf->configurationType() == ConfigurationType::Filename) { - insertFile(conf->level(), conf->value()); - } - } - for (std::vector::iterator conf = withFileSizeLimit.begin(); conf != withFileSizeLimit.end(); - ++conf) { - // This is not unsafe as mutex is locked in currect scope - unsafeValidateFileRolling((*conf)->level(), base::defaultPreRollOutCallback); - } -} - -unsigned long -TypedConfigurations::getULong(std::string confVal) { - bool valid = true; - base::utils::Str::trim(confVal); - valid = !confVal.empty() && std::find_if(confVal.begin(), confVal.end(), - [](char c) { return !base::utils::Str::isDigit(c); }) == confVal.end(); - if (!valid) { - valid = false; - ELPP_ASSERT(valid, "Configuration value not a valid integer [" << confVal << "]"); - return 0; - } - return atol(confVal.c_str()); -} - -std::string -TypedConfigurations::resolveFilename(const std::string& filename) { - std::string resultingFilename = filename; - std::size_t dateIndex = std::string::npos; - std::string dateTimeFormatSpecifierStr = std::string(base::consts::kDateTimeFormatSpecifierForFilename); - if ((dateIndex = resultingFilename.find(dateTimeFormatSpecifierStr.c_str())) != std::string::npos) { - while (dateIndex > 0 && resultingFilename[dateIndex - 1] == base::consts::kFormatSpecifierChar) { - dateIndex = resultingFilename.find(dateTimeFormatSpecifierStr.c_str(), dateIndex + 1); - } - if (dateIndex != std::string::npos) { - const char* ptr = resultingFilename.c_str() + dateIndex; - // Goto end of specifier - ptr += dateTimeFormatSpecifierStr.size(); - std::string fmt; - if ((resultingFilename.size() > dateIndex) && (ptr[0] == '{')) { - // User has provided format for date/time - ++ptr; - int count = 1; // Start by 1 in order to remove starting brace - std::stringstream ss; - for (; *ptr; ++ptr, ++count) { - if (*ptr == '}') { - ++count; // In order to remove ending brace - break; - } - ss << *ptr; - } - resultingFilename.erase(dateIndex + dateTimeFormatSpecifierStr.size(), count); - fmt = ss.str(); - } else { - fmt = std::string(base::consts::kDefaultDateTimeFormatInFilename); - } - base::SubsecondPrecision ssPrec(3); - std::string now = base::utils::DateTime::getDateTime(fmt.c_str(), &ssPrec); - base::utils::Str::replaceAll(now, '/', '-'); // Replace path element since we are dealing with filename - base::utils::Str::replaceAll(resultingFilename, dateTimeFormatSpecifierStr, now); - } - } - return resultingFilename; -} - -void -TypedConfigurations::insertFile(Level level, const std::string& fullFilename) { - std::string resolvedFilename = resolveFilename(fullFilename); - if (resolvedFilename.empty()) { - std::cerr << "Could not load empty file for logging, please re-check your configurations for level [" - << LevelHelper::convertToString(level) << "]"; - } - std::string filePath = - base::utils::File::extractPathFromFilename(resolvedFilename, base::consts::kFilePathSeperator); - if (filePath.size() < resolvedFilename.size()) { - base::utils::File::createPath(filePath); - } - auto create = [&](Level level) { - base::LogStreamsReferenceMap::iterator filestreamIter = m_logStreamsReference->find(resolvedFilename); - base::type::fstream_t* fs = nullptr; - if (filestreamIter == m_logStreamsReference->end()) { - // We need a completely new stream, nothing to share with - fs = base::utils::File::newFileStream(resolvedFilename); - m_filenameMap.insert(std::make_pair(level, resolvedFilename)); - m_fileStreamMap.insert(std::make_pair(level, base::FileStreamPtr(fs))); - m_logStreamsReference->insert( - std::make_pair(resolvedFilename, base::FileStreamPtr(m_fileStreamMap.at(level)))); - } else { - // Woops! we have an existing one, share it! - m_filenameMap.insert(std::make_pair(level, filestreamIter->first)); - m_fileStreamMap.insert(std::make_pair(level, base::FileStreamPtr(filestreamIter->second))); - fs = filestreamIter->second.get(); - } - if (fs == nullptr) { - // We display bad file error from newFileStream() - ELPP_INTERNAL_ERROR("Setting [TO_FILE] of [" << LevelHelper::convertToString(level) << "] to FALSE", false); - setValue(level, false, &m_toFileMap); - } - }; - // If we dont have file conf for any level, create it for Level::Global first - // otherwise create for specified level - create(m_filenameMap.empty() && m_fileStreamMap.empty() ? Level::Global : level); -} - -bool -TypedConfigurations::unsafeValidateFileRolling(Level level, const PreRollOutCallback& preRollOutCallback) { - base::type::fstream_t* fs = unsafeGetConfigByRef(level, &m_fileStreamMap, "fileStream").get(); - if (fs == nullptr) { - return true; - } - std::size_t maxLogFileSize = unsafeGetConfigByVal(level, &m_maxLogFileSizeMap, "maxLogFileSize"); - std::size_t currFileSize = base::utils::File::getSizeOfFile(fs); - if (maxLogFileSize != 0 && currFileSize >= maxLogFileSize) { - std::string fname = unsafeGetConfigByRef(level, &m_filenameMap, "filename"); - ELPP_INTERNAL_INFO(1, "Truncating log file [" << fname << "] as a result of configurations for level [" - << LevelHelper::convertToString(level) << "]"); - fs->close(); - preRollOutCallback(fname.c_str(), currFileSize, level); - fs->open(fname, std::fstream::out | std::fstream::trunc); - return true; - } - return false; -} - -// RegisteredHitCounters - -bool -RegisteredHitCounters::validateEveryN(const char* filename, base::type::LineNumber lineNumber, std::size_t n) { - base::threading::ScopedLock scopedLock(lock()); - base::HitCounter* counter = get(filename, lineNumber); - if (counter == nullptr) { - registerNew(counter = new base::HitCounter(filename, lineNumber)); - } - counter->validateHitCounts(n); - bool result = (n >= 1 && counter->hitCounts() != 0 && counter->hitCounts() % n == 0); - return result; -} - -/// @brief Validates counter for hits >= N, i.e, registers new if does not exist otherwise updates original one -/// @return True if validation resulted in triggering hit. Meaning logs should be written everytime true is returned -bool -RegisteredHitCounters::validateAfterN(const char* filename, base::type::LineNumber lineNumber, std::size_t n) { - base::threading::ScopedLock scopedLock(lock()); - base::HitCounter* counter = get(filename, lineNumber); - if (counter == nullptr) { - registerNew(counter = new base::HitCounter(filename, lineNumber)); - } - // Do not use validateHitCounts here since we do not want to reset counter here - // Note the >= instead of > because we are incrementing - // after this check - if (counter->hitCounts() >= n) - return true; - counter->increment(); - return false; -} - -/// @brief Validates counter for hits are <= n, i.e, registers new if does not exist otherwise updates original one -/// @return True if validation resulted in triggering hit. Meaning logs should be written everytime true is returned -bool -RegisteredHitCounters::validateNTimes(const char* filename, base::type::LineNumber lineNumber, std::size_t n) { - base::threading::ScopedLock scopedLock(lock()); - base::HitCounter* counter = get(filename, lineNumber); - if (counter == nullptr) { - registerNew(counter = new base::HitCounter(filename, lineNumber)); - } - counter->increment(); - // Do not use validateHitCounts here since we do not want to reset counter here - if (counter->hitCounts() <= n) - return true; - return false; -} - -// RegisteredLoggers - -RegisteredLoggers::RegisteredLoggers(const LogBuilderPtr& defaultLogBuilder) : m_defaultLogBuilder(defaultLogBuilder) { - m_defaultConfigurations.setToDefault(); -} - -Logger* -RegisteredLoggers::get(const std::string& id, bool forceCreation) { - base::threading::ScopedLock scopedLock(lock()); - Logger* logger_ = base::utils::Registry::get(id); - if (logger_ == nullptr && forceCreation) { - bool validId = Logger::isValidId(id); - if (!validId) { - ELPP_ASSERT(validId, "Invalid logger ID [" << id << "]. Not registering this logger."); - return nullptr; - } - logger_ = new Logger(id, m_defaultConfigurations, &m_logStreamsReference); - logger_->m_logBuilder = m_defaultLogBuilder; - registerNew(id, logger_); - LoggerRegistrationCallback* callback = nullptr; - for (const std::pair& h : - m_loggerRegistrationCallbacks) { - callback = h.second.get(); - if (callback != nullptr && callback->enabled()) { - callback->handle(logger_); - } - } - } - return logger_; -} - -bool -RegisteredLoggers::remove(const std::string& id) { - if (id == base::consts::kDefaultLoggerId) { - return false; - } - // get has internal lock - Logger* logger = base::utils::Registry::get(id); - if (logger != nullptr) { - // unregister has internal lock - unregister(logger); - } - return true; -} - -void -RegisteredLoggers::unsafeFlushAll(void) { - ELPP_INTERNAL_INFO(1, "Flushing all log files"); - for (base::LogStreamsReferenceMap::iterator it = m_logStreamsReference.begin(); it != m_logStreamsReference.end(); - ++it) { - if (it->second.get() == nullptr) - continue; - it->second->flush(); - } -} - -// VRegistry - -VRegistry::VRegistry(base::type::VerboseLevel level, base::type::EnumType* pFlags) : m_level(level), m_pFlags(pFlags) { -} - -/// @brief Sets verbose level. Accepted range is 0-9 -void -VRegistry::setLevel(base::type::VerboseLevel level) { - base::threading::ScopedLock scopedLock(lock()); - if (level > 9) - m_level = base::consts::kMaxVerboseLevel; - else - m_level = level; -} - -void -VRegistry::setModules(const char* modules) { - base::threading::ScopedLock scopedLock(lock()); - auto addSuffix = [](std::stringstream& ss, const char* sfx, const char* prev) { - if (prev != nullptr && base::utils::Str::endsWith(ss.str(), std::string(prev))) { - std::string chr(ss.str().substr(0, ss.str().size() - strlen(prev))); - ss.str(std::string("")); - ss << chr; - } - if (base::utils::Str::endsWith(ss.str(), std::string(sfx))) { - std::string chr(ss.str().substr(0, ss.str().size() - strlen(sfx))); - ss.str(std::string("")); - ss << chr; - } - ss << sfx; - }; - auto insert = [&](std::stringstream& ss, base::type::VerboseLevel level) { - if (!base::utils::hasFlag(LoggingFlag::DisableVModulesExtensions, *m_pFlags)) { - addSuffix(ss, ".h", nullptr); - m_modules.insert(std::make_pair(ss.str(), level)); - addSuffix(ss, ".c", ".h"); - m_modules.insert(std::make_pair(ss.str(), level)); - addSuffix(ss, ".cpp", ".c"); - m_modules.insert(std::make_pair(ss.str(), level)); - addSuffix(ss, ".cc", ".cpp"); - m_modules.insert(std::make_pair(ss.str(), level)); - addSuffix(ss, ".cxx", ".cc"); - m_modules.insert(std::make_pair(ss.str(), level)); - addSuffix(ss, ".-inl.h", ".cxx"); - m_modules.insert(std::make_pair(ss.str(), level)); - addSuffix(ss, ".hxx", ".-inl.h"); - m_modules.insert(std::make_pair(ss.str(), level)); - addSuffix(ss, ".hpp", ".hxx"); - m_modules.insert(std::make_pair(ss.str(), level)); - addSuffix(ss, ".hh", ".hpp"); - } - m_modules.insert(std::make_pair(ss.str(), level)); - }; - bool isMod = true; - bool isLevel = false; - std::stringstream ss; - int level = -1; - for (; *modules; ++modules) { - switch (*modules) { - case '=': - isLevel = true; - isMod = false; - break; - case ',': - isLevel = false; - isMod = true; - if (!ss.str().empty() && level != -1) { - insert(ss, static_cast(level)); - ss.str(std::string("")); - level = -1; - } - break; - default: - if (isMod) { - ss << *modules; - } else if (isLevel) { - if (isdigit(*modules)) { - level = static_cast(*modules) - 48; - } - } - break; - } - } - if (!ss.str().empty() && level != -1) { - insert(ss, static_cast(level)); - } -} - -bool -VRegistry::allowed(base::type::VerboseLevel vlevel, const char* file) { - base::threading::ScopedLock scopedLock(lock()); - if (m_modules.empty() || file == nullptr) { - return vlevel <= m_level; - } else { - char baseFilename[base::consts::kSourceFilenameMaxLength] = ""; - base::utils::File::buildBaseFilename(file, baseFilename); - std::unordered_map::iterator it = m_modules.begin(); - for (; it != m_modules.end(); ++it) { - if (base::utils::Str::wildCardMatch(baseFilename, it->first.c_str())) { - return vlevel <= it->second; - } - } - if (base::utils::hasFlag(LoggingFlag::AllowVerboseIfModuleNotSpecified, *m_pFlags)) { - return true; - } - return false; - } -} - -void -VRegistry::setFromArgs(const base::utils::CommandLineArgs* commandLineArgs) { - if (commandLineArgs->hasParam("-v") || commandLineArgs->hasParam("--verbose") || commandLineArgs->hasParam("-V") || - commandLineArgs->hasParam("--VERBOSE")) { - setLevel(base::consts::kMaxVerboseLevel); - } else if (commandLineArgs->hasParamWithValue("--v")) { - setLevel(static_cast(atoi(commandLineArgs->getParamValue("--v")))); - } else if (commandLineArgs->hasParamWithValue("--V")) { - setLevel(static_cast(atoi(commandLineArgs->getParamValue("--V")))); - } else if ((commandLineArgs->hasParamWithValue("-vmodule")) && vModulesEnabled()) { - setModules(commandLineArgs->getParamValue("-vmodule")); - } else if (commandLineArgs->hasParamWithValue("-VMODULE") && vModulesEnabled()) { - setModules(commandLineArgs->getParamValue("-VMODULE")); - } -} - -#if !defined(ELPP_DEFAULT_LOGGING_FLAGS) -#define ELPP_DEFAULT_LOGGING_FLAGS 0x0 -#endif // !defined(ELPP_DEFAULT_LOGGING_FLAGS) -// Storage -#if ELPP_ASYNC_LOGGING -Storage::Storage(const LogBuilderPtr& defaultLogBuilder, base::IWorker* asyncDispatchWorker) - : -#else -Storage::Storage(const LogBuilderPtr& defaultLogBuilder) - : -#endif // ELPP_ASYNC_LOGGING - m_registeredHitCounters(new base::RegisteredHitCounters()), - m_registeredLoggers(new base::RegisteredLoggers(defaultLogBuilder)), - m_flags(ELPP_DEFAULT_LOGGING_FLAGS), - m_vRegistry(new base::VRegistry(0, &m_flags)), - -#if ELPP_ASYNC_LOGGING - m_asyncLogQueue(new base::AsyncLogQueue()), - m_asyncDispatchWorker(asyncDispatchWorker), -#endif // ELPP_ASYNC_LOGGING - - m_preRollOutCallback(base::defaultPreRollOutCallback) { - // Register default logger - m_registeredLoggers->get(std::string(base::consts::kDefaultLoggerId)); - // We register default logger anyway (worse case it's not going to register) just in case - m_registeredLoggers->get("default"); - -#if defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_PERFORMANCE_TRACKING) - // Register performance logger and reconfigure format - Logger* performanceLogger = m_registeredLoggers->get(std::string(base::consts::kPerformanceLoggerId)); - m_registeredLoggers->get("performance"); - performanceLogger->configurations()->setGlobally(ConfigurationType::Format, std::string("%datetime %level %msg")); - performanceLogger->reconfigure(); -#endif // defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_PERFORMANCE_TRACKING) - -#if defined(ELPP_SYSLOG) - // Register syslog logger and reconfigure format - Logger* sysLogLogger = m_registeredLoggers->get(std::string(base::consts::kSysLogLoggerId)); - sysLogLogger->configurations()->setGlobally(ConfigurationType::Format, std::string("%level: %msg")); - sysLogLogger->reconfigure(); -#endif // defined(ELPP_SYSLOG) - addFlag(LoggingFlag::AllowVerboseIfModuleNotSpecified); -#if ELPP_ASYNC_LOGGING - installLogDispatchCallback(std::string("AsyncLogDispatchCallback")); -#else - installLogDispatchCallback(std::string("DefaultLogDispatchCallback")); -#endif // ELPP_ASYNC_LOGGING -#if defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_PERFORMANCE_TRACKING) - installPerformanceTrackingCallback( - std::string("DefaultPerformanceTrackingCallback")); -#endif // defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_PERFORMANCE_TRACKING) - ELPP_INTERNAL_INFO(1, "Easylogging++ has been initialized"); -#if ELPP_ASYNC_LOGGING - m_asyncDispatchWorker->start(); -#endif // ELPP_ASYNC_LOGGING -} - -Storage::~Storage(void) { - ELPP_INTERNAL_INFO(4, "Destroying storage"); -#if ELPP_ASYNC_LOGGING - ELPP_INTERNAL_INFO(5, "Replacing log dispatch callback to synchronous"); - uninstallLogDispatchCallback(std::string("AsyncLogDispatchCallback")); - installLogDispatchCallback(std::string("DefaultLogDispatchCallback")); - ELPP_INTERNAL_INFO(5, "Destroying asyncDispatchWorker"); - base::utils::safeDelete(m_asyncDispatchWorker); - ELPP_INTERNAL_INFO(5, "Destroying asyncLogQueue"); - base::utils::safeDelete(m_asyncLogQueue); -#endif // ELPP_ASYNC_LOGGING - ELPP_INTERNAL_INFO(5, "Destroying registeredHitCounters"); - base::utils::safeDelete(m_registeredHitCounters); - ELPP_INTERNAL_INFO(5, "Destroying registeredLoggers"); - base::utils::safeDelete(m_registeredLoggers); - ELPP_INTERNAL_INFO(5, "Destroying vRegistry"); - base::utils::safeDelete(m_vRegistry); -} - -bool -Storage::hasCustomFormatSpecifier(const char* formatSpecifier) { - base::threading::ScopedLock scopedLock(customFormatSpecifiersLock()); - return std::find(m_customFormatSpecifiers.begin(), m_customFormatSpecifiers.end(), formatSpecifier) != - m_customFormatSpecifiers.end(); -} - -void -Storage::installCustomFormatSpecifier(const CustomFormatSpecifier& customFormatSpecifier) { - if (hasCustomFormatSpecifier(customFormatSpecifier.formatSpecifier())) { - return; - } - base::threading::ScopedLock scopedLock(customFormatSpecifiersLock()); - m_customFormatSpecifiers.push_back(customFormatSpecifier); -} - -bool -Storage::uninstallCustomFormatSpecifier(const char* formatSpecifier) { - base::threading::ScopedLock scopedLock(customFormatSpecifiersLock()); - std::vector::iterator it = - std::find(m_customFormatSpecifiers.begin(), m_customFormatSpecifiers.end(), formatSpecifier); - if (it != m_customFormatSpecifiers.end() && strcmp(formatSpecifier, it->formatSpecifier()) == 0) { - m_customFormatSpecifiers.erase(it); - return true; - } - return false; -} - -void -Storage::setApplicationArguments(int argc, char** argv) { - m_commandLineArgs.setArgs(argc, argv); - m_vRegistry->setFromArgs(commandLineArgs()); - // default log file -#if !defined(ELPP_DISABLE_LOG_FILE_FROM_ARG) - if (m_commandLineArgs.hasParamWithValue(base::consts::kDefaultLogFileParam)) { - Configurations c; - c.setGlobally(ConfigurationType::Filename, - std::string(m_commandLineArgs.getParamValue(base::consts::kDefaultLogFileParam))); - registeredLoggers()->setDefaultConfigurations(c); - for (base::RegisteredLoggers::iterator it = registeredLoggers()->begin(); it != registeredLoggers()->end(); - ++it) { - it->second->configure(c); - } - } -#endif // !defined(ELPP_DISABLE_LOG_FILE_FROM_ARG) -#if defined(ELPP_LOGGING_FLAGS_FROM_ARG) - if (m_commandLineArgs.hasParamWithValue(base::consts::kLoggingFlagsParam)) { - int userInput = atoi(m_commandLineArgs.getParamValue(base::consts::kLoggingFlagsParam)); - if (ELPP_DEFAULT_LOGGING_FLAGS == 0x0) { - m_flags = userInput; - } else { - base::utils::addFlag(userInput, &m_flags); - } - } -#endif // defined(ELPP_LOGGING_FLAGS_FROM_ARG) -} - -} // namespace base - -// LogDispatchCallback -void -LogDispatchCallback::handle(const LogDispatchData* data) { -#if defined(ELPP_THREAD_SAFE) - base::threading::ScopedLock scopedLock(m_fileLocksMapLock); - std::string filename = data->logMessage()->logger()->typedConfigurations()->filename(data->logMessage()->level()); - auto lock = m_fileLocks.find(filename); - if (lock == m_fileLocks.end()) { - m_fileLocks.emplace( - std::make_pair(filename, std::unique_ptr(new base::threading::Mutex))); - } -#endif -} - -base::threading::Mutex& -LogDispatchCallback::fileHandle(const LogDispatchData* data) { - auto it = - m_fileLocks.find(data->logMessage()->logger()->typedConfigurations()->filename(data->logMessage()->level())); - return *(it->second.get()); -} - -namespace base { -// DefaultLogDispatchCallback - -void -DefaultLogDispatchCallback::handle(const LogDispatchData* data) { -#if defined(ELPP_THREAD_SAFE) - LogDispatchCallback::handle(data); - base::threading::ScopedLock scopedLock(fileHandle(data)); -#endif - m_data = data; - dispatch(m_data->logMessage()->logger()->logBuilder()->build( - m_data->logMessage(), m_data->dispatchAction() == base::DispatchAction::NormalLog)); -} - -void -DefaultLogDispatchCallback::dispatch(base::type::string_t&& logLine) { - if (m_data->dispatchAction() == base::DispatchAction::NormalLog) { - if (m_data->logMessage()->logger()->m_typedConfigurations->toFile(m_data->logMessage()->level())) { - base::type::fstream_t* fs = - m_data->logMessage()->logger()->m_typedConfigurations->fileStream(m_data->logMessage()->level()); - if (fs != nullptr) { - fs->write(logLine.c_str(), logLine.size()); - if (fs->fail()) { - ELPP_INTERNAL_ERROR("Unable to write log to file [" - << m_data->logMessage()->logger()->m_typedConfigurations->filename( - m_data->logMessage()->level()) - << "].\n" - << "Few possible reasons (could be something else):\n" - << " * Permission denied\n" - << " * Disk full\n" - << " * Disk is not writable", - true); - } else { - if (ELPP->hasFlag(LoggingFlag::ImmediateFlush) || - (m_data->logMessage()->logger()->isFlushNeeded(m_data->logMessage()->level()))) { - m_data->logMessage()->logger()->flush(m_data->logMessage()->level(), fs); - } - } - } else { - ELPP_INTERNAL_ERROR("Log file for [" - << LevelHelper::convertToString(m_data->logMessage()->level()) << "] " - << "has not been configured but [TO_FILE] is configured to TRUE. [Logger ID: " - << m_data->logMessage()->logger()->id() << "]", - false); - } - } - if (m_data->logMessage()->logger()->m_typedConfigurations->toStandardOutput(m_data->logMessage()->level())) { - if (ELPP->hasFlag(LoggingFlag::ColoredTerminalOutput)) - m_data->logMessage()->logger()->logBuilder()->convertToColoredOutput(&logLine, - m_data->logMessage()->level()); - ELPP_COUT << ELPP_COUT_LINE(logLine); - } - } -#if defined(ELPP_SYSLOG) - else if (m_data->dispatchAction() == base::DispatchAction::SysLog) { - // Determine syslog priority - int sysLogPriority = 0; - if (m_data->logMessage()->level() == Level::Fatal) - sysLogPriority = LOG_EMERG; - else if (m_data->logMessage()->level() == Level::Error) - sysLogPriority = LOG_ERR; - else if (m_data->logMessage()->level() == Level::Warning) - sysLogPriority = LOG_WARNING; - else if (m_data->logMessage()->level() == Level::Info) - sysLogPriority = LOG_INFO; - else if (m_data->logMessage()->level() == Level::Debug) - sysLogPriority = LOG_DEBUG; - else - sysLogPriority = LOG_NOTICE; -#if defined(ELPP_UNICODE) - char* line = base::utils::Str::wcharPtrToCharPtr(logLine.c_str()); - syslog(sysLogPriority, "%s", line); - free(line); -#else - syslog(sysLogPriority, "%s", logLine.c_str()); -#endif - } -#endif // defined(ELPP_SYSLOG) -} - -#if ELPP_ASYNC_LOGGING - -// AsyncLogDispatchCallback - -void -AsyncLogDispatchCallback::handle(const LogDispatchData* data) { - base::type::string_t logLine = data->logMessage()->logger()->logBuilder()->build( - data->logMessage(), data->dispatchAction() == base::DispatchAction::NormalLog); - if (data->dispatchAction() == base::DispatchAction::NormalLog && - data->logMessage()->logger()->typedConfigurations()->toStandardOutput(data->logMessage()->level())) { - if (ELPP->hasFlag(LoggingFlag::ColoredTerminalOutput)) - data->logMessage()->logger()->logBuilder()->convertToColoredOutput(&logLine, data->logMessage()->level()); - ELPP_COUT << ELPP_COUT_LINE(logLine); - } - // Save resources and only queue if we want to write to file otherwise just ignore handler - if (data->logMessage()->logger()->typedConfigurations()->toFile(data->logMessage()->level())) { - ELPP->asyncLogQueue()->push(AsyncLogItem(*(data->logMessage()), *data, logLine)); - } -} - -// AsyncDispatchWorker -AsyncDispatchWorker::AsyncDispatchWorker() { - setContinueRunning(false); -} - -AsyncDispatchWorker::~AsyncDispatchWorker() { - setContinueRunning(false); - ELPP_INTERNAL_INFO(6, "Stopping dispatch worker - Cleaning log queue"); - clean(); - ELPP_INTERNAL_INFO(6, "Log queue cleaned"); -} - -bool -AsyncDispatchWorker::clean(void) { - std::mutex m; - std::unique_lock lk(m); - cv.wait(lk, [] { return !ELPP->asyncLogQueue()->empty(); }); - emptyQueue(); - lk.unlock(); - cv.notify_one(); - return ELPP->asyncLogQueue()->empty(); -} - -void -AsyncDispatchWorker::emptyQueue(void) { - while (!ELPP->asyncLogQueue()->empty()) { - AsyncLogItem data = ELPP->asyncLogQueue()->next(); - handle(&data); - base::threading::msleep(100); - } -} - -void -AsyncDispatchWorker::start(void) { - base::threading::msleep(5000); // 5s (why?) - setContinueRunning(true); - std::thread t1(&AsyncDispatchWorker::run, this); - t1.join(); -} - -void -AsyncDispatchWorker::handle(AsyncLogItem* logItem) { - LogDispatchData* data = logItem->data(); - LogMessage* logMessage = logItem->logMessage(); - Logger* logger = logMessage->logger(); - base::TypedConfigurations* conf = logger->typedConfigurations(); - base::type::string_t logLine = logItem->logLine(); - if (data->dispatchAction() == base::DispatchAction::NormalLog) { - if (conf->toFile(logMessage->level())) { - base::type::fstream_t* fs = conf->fileStream(logMessage->level()); - if (fs != nullptr) { - fs->write(logLine.c_str(), logLine.size()); - if (fs->fail()) { - ELPP_INTERNAL_ERROR("Unable to write log to file [" - << conf->filename(logMessage->level()) << "].\n" - << "Few possible reasons (could be something else):\n" - << " * Permission denied\n" - << " * Disk full\n" - << " * Disk is not writable", - true); - } else { - if (ELPP->hasFlag(LoggingFlag::ImmediateFlush) || (logger->isFlushNeeded(logMessage->level()))) { - logger->flush(logMessage->level(), fs); - } - } - } else { - ELPP_INTERNAL_ERROR("Log file for [" - << LevelHelper::convertToString(logMessage->level()) << "] " - << "has not been configured but [TO_FILE] is configured to TRUE. [Logger ID: " - << logger->id() << "]", - false); - } - } - } -#if defined(ELPP_SYSLOG) - else if (data->dispatchAction() == base::DispatchAction::SysLog) { - // Determine syslog priority - int sysLogPriority = 0; - if (logMessage->level() == Level::Fatal) - sysLogPriority = LOG_EMERG; - else if (logMessage->level() == Level::Error) - sysLogPriority = LOG_ERR; - else if (logMessage->level() == Level::Warning) - sysLogPriority = LOG_WARNING; - else if (logMessage->level() == Level::Info) - sysLogPriority = LOG_INFO; - else if (logMessage->level() == Level::Debug) - sysLogPriority = LOG_DEBUG; - else - sysLogPriority = LOG_NOTICE; -#if defined(ELPP_UNICODE) - char* line = base::utils::Str::wcharPtrToCharPtr(logLine.c_str()); - syslog(sysLogPriority, "%s", line); - free(line); -#else - syslog(sysLogPriority, "%s", logLine.c_str()); -#endif - } -#endif // defined(ELPP_SYSLOG) -} - -void -AsyncDispatchWorker::run(void) { - while (continueRunning()) { - emptyQueue(); - base::threading::msleep(10); // 10ms - } -} -#endif // ELPP_ASYNC_LOGGING - -// DefaultLogBuilder - -base::type::string_t -DefaultLogBuilder::build(const LogMessage* logMessage, bool appendNewLine) const { - base::TypedConfigurations* tc = logMessage->logger()->typedConfigurations(); - const base::LogFormat* logFormat = &tc->logFormat(logMessage->level()); - base::type::string_t logLine = logFormat->format(); - char buff[base::consts::kSourceFilenameMaxLength + base::consts::kSourceLineMaxLength] = ""; - const char* bufLim = buff + sizeof(buff); - if (logFormat->hasFlag(base::FormatFlags::AppName)) { - // App name - base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kAppNameFormatSpecifier, - logMessage->logger()->parentApplicationName()); - } - if (logFormat->hasFlag(base::FormatFlags::ThreadId)) { - // Thread ID - base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kThreadIdFormatSpecifier, - ELPP->getThreadName(base::threading::getCurrentThreadId())); - } - if (logFormat->hasFlag(base::FormatFlags::DateTime)) { - // DateTime - base::utils::Str::replaceFirstWithEscape( - logLine, base::consts::kDateTimeFormatSpecifier, - base::utils::DateTime::getDateTime(logFormat->dateTimeFormat().c_str(), - &tc->subsecondPrecision(logMessage->level()))); - } - if (logFormat->hasFlag(base::FormatFlags::Function)) { - // Function - base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kLogFunctionFormatSpecifier, - logMessage->func()); - } - if (logFormat->hasFlag(base::FormatFlags::File)) { - // File - base::utils::Str::clearBuff(buff, base::consts::kSourceFilenameMaxLength); - base::utils::File::buildStrippedFilename(logMessage->file().c_str(), buff); - base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kLogFileFormatSpecifier, std::string(buff)); - } - if (logFormat->hasFlag(base::FormatFlags::FileBase)) { - // FileBase - base::utils::Str::clearBuff(buff, base::consts::kSourceFilenameMaxLength); - base::utils::File::buildBaseFilename(logMessage->file(), buff); - base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kLogFileBaseFormatSpecifier, std::string(buff)); - } - if (logFormat->hasFlag(base::FormatFlags::Line)) { - // Line - char* buf = base::utils::Str::clearBuff(buff, base::consts::kSourceLineMaxLength); - buf = base::utils::Str::convertAndAddToBuff(logMessage->line(), base::consts::kSourceLineMaxLength, buf, bufLim, - false); - base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kLogLineFormatSpecifier, std::string(buff)); - } - if (logFormat->hasFlag(base::FormatFlags::Location)) { - // Location - char* buf = base::utils::Str::clearBuff( - buff, base::consts::kSourceFilenameMaxLength + base::consts::kSourceLineMaxLength); - base::utils::File::buildStrippedFilename(logMessage->file().c_str(), buff); - buf = base::utils::Str::addToBuff(buff, buf, bufLim); - buf = base::utils::Str::addToBuff(":", buf, bufLim); - buf = base::utils::Str::convertAndAddToBuff(logMessage->line(), base::consts::kSourceLineMaxLength, buf, bufLim, - false); - base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kLogLocationFormatSpecifier, std::string(buff)); - } - if (logMessage->level() == Level::Verbose && logFormat->hasFlag(base::FormatFlags::VerboseLevel)) { - // Verbose level - char* buf = base::utils::Str::clearBuff(buff, 1); - buf = base::utils::Str::convertAndAddToBuff(logMessage->verboseLevel(), 1, buf, bufLim, false); - base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kVerboseLevelFormatSpecifier, - std::string(buff)); - } - if (logFormat->hasFlag(base::FormatFlags::LogMessage)) { - // Log message - base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kMessageFormatSpecifier, logMessage->message()); - } -#if !defined(ELPP_DISABLE_CUSTOM_FORMAT_SPECIFIERS) - el::base::threading::ScopedLock lock_(ELPP->customFormatSpecifiersLock()); - ELPP_UNUSED(lock_); - for (std::vector::const_iterator it = ELPP->customFormatSpecifiers()->begin(); - it != ELPP->customFormatSpecifiers()->end(); ++it) { - std::string fs(it->formatSpecifier()); - base::type::string_t wcsFormatSpecifier(fs.begin(), fs.end()); - base::utils::Str::replaceFirstWithEscape(logLine, wcsFormatSpecifier, it->resolver()(logMessage)); - } -#endif // !defined(ELPP_DISABLE_CUSTOM_FORMAT_SPECIFIERS) - if (appendNewLine) - logLine += ELPP_LITERAL("\n"); - return logLine; -} - -// LogDispatcher - -void -LogDispatcher::dispatch(void) { - if (m_proceed && m_dispatchAction == base::DispatchAction::None) { - m_proceed = false; - } - if (!m_proceed) { - return; - } -#ifndef ELPP_NO_GLOBAL_LOCK - // see https://github.com/muflihun/easyloggingpp/issues/580 - // global lock is turned off by default unless - // ELPP_NO_GLOBAL_LOCK is defined - base::threading::ScopedLock scopedLock(ELPP->lock()); -#endif - base::TypedConfigurations* tc = m_logMessage->logger()->m_typedConfigurations; - if (ELPP->hasFlag(LoggingFlag::StrictLogFileSizeCheck)) { - tc->validateFileRolling(m_logMessage->level(), ELPP->preRollOutCallback()); - } - LogDispatchCallback* callback = nullptr; - LogDispatchData data; - for (const std::pair& h : ELPP->m_logDispatchCallbacks) { - callback = h.second.get(); - if (callback != nullptr && callback->enabled()) { - data.setLogMessage(m_logMessage); - data.setDispatchAction(m_dispatchAction); - callback->handle(&data); - } - } -} - -// MessageBuilder - -void -MessageBuilder::initialize(Logger* logger) { - m_logger = logger; - m_containerLogSeperator = - ELPP->hasFlag(LoggingFlag::NewLineForContainer) ? ELPP_LITERAL("\n ") : ELPP_LITERAL(", "); -} - -MessageBuilder& -MessageBuilder::operator<<(const wchar_t* msg) { - if (msg == nullptr) { - m_logger->stream() << base::consts::kNullPointer; - return *this; - } -#if defined(ELPP_UNICODE) - m_logger->stream() << msg; -#else - char* buff_ = base::utils::Str::wcharPtrToCharPtr(msg); - m_logger->stream() << buff_; - free(buff_); -#endif - if (ELPP->hasFlag(LoggingFlag::AutoSpacing)) { - m_logger->stream() << " "; - } - return *this; -} - -// Writer - -Writer& -Writer::construct(Logger* logger, bool needLock) { - m_logger = logger; - initializeLogger(logger->id(), false, needLock); - m_messageBuilder.initialize(m_logger); - return *this; -} - -Writer& -Writer::construct(int count, const char* loggerIds, ...) { - if (ELPP->hasFlag(LoggingFlag::MultiLoggerSupport)) { - va_list loggersList; - va_start(loggersList, loggerIds); - const char* id = loggerIds; - m_loggerIds.reserve(count); - for (int i = 0; i < count; ++i) { - m_loggerIds.push_back(std::string(id)); - id = va_arg(loggersList, const char*); - } - va_end(loggersList); - initializeLogger(m_loggerIds.at(0)); - } else { - initializeLogger(std::string(loggerIds)); - } - m_messageBuilder.initialize(m_logger); - return *this; -} - -void -Writer::initializeLogger(const std::string& loggerId, bool lookup, bool needLock) { - if (lookup) { - m_logger = ELPP->registeredLoggers()->get(loggerId, ELPP->hasFlag(LoggingFlag::CreateLoggerAutomatically)); - } - if (m_logger == nullptr) { - { - if (!ELPP->registeredLoggers()->has(std::string(base::consts::kDefaultLoggerId))) { - // Somehow default logger has been unregistered. Not good! Register again - ELPP->registeredLoggers()->get(std::string(base::consts::kDefaultLoggerId)); - } - } - Writer(Level::Debug, m_file, m_line, m_func).construct(1, base::consts::kDefaultLoggerId) - << "Logger [" << loggerId << "] is not registered yet!"; - m_proceed = false; - } else { - if (needLock) { - m_logger->acquireLock(); // This should not be unlocked by checking m_proceed because - // m_proceed can be changed by lines below - } - if (ELPP->hasFlag(LoggingFlag::HierarchicalLogging)) { - m_proceed = m_level == Level::Verbose - ? m_logger->enabled(m_level) - : LevelHelper::castToInt(m_level) >= LevelHelper::castToInt(ELPP->m_loggingLevel); - } else { - m_proceed = m_logger->enabled(m_level); - } - } -} - -void -Writer::processDispatch() { -#if ELPP_LOGGING_ENABLED - if (ELPP->hasFlag(LoggingFlag::MultiLoggerSupport)) { - bool firstDispatched = false; - base::type::string_t logMessage; - std::size_t i = 0; - do { - if (m_proceed) { - if (firstDispatched) { - m_logger->stream() << logMessage; - } else { - firstDispatched = true; - if (m_loggerIds.size() > 1) { - logMessage = m_logger->stream().str(); - } - } - triggerDispatch(); - } else if (m_logger != nullptr) { - m_logger->stream().str(ELPP_LITERAL("")); - m_logger->releaseLock(); - } - if (i + 1 < m_loggerIds.size()) { - initializeLogger(m_loggerIds.at(i + 1)); - } - } while (++i < m_loggerIds.size()); - } else { - if (m_proceed) { - triggerDispatch(); - } else if (m_logger != nullptr) { - m_logger->stream().str(ELPP_LITERAL("")); - m_logger->releaseLock(); - } - } -#else - if (m_logger != nullptr) { - m_logger->stream().str(ELPP_LITERAL("")); - m_logger->releaseLock(); - } -#endif // ELPP_LOGGING_ENABLED -} - -void -Writer::triggerDispatch(void) { - if (m_proceed) { - if (m_msg == nullptr) { - LogMessage msg(m_level, m_file, m_line, m_func, m_verboseLevel, m_logger); - base::LogDispatcher(m_proceed, &msg, m_dispatchAction).dispatch(); - } else { - base::LogDispatcher(m_proceed, m_msg, m_dispatchAction).dispatch(); - } - } - if (m_logger != nullptr) { - m_logger->stream().str(ELPP_LITERAL("")); - m_logger->releaseLock(); - } - if (m_proceed && m_level == Level::Fatal && !ELPP->hasFlag(LoggingFlag::DisableApplicationAbortOnFatalLog)) { - base::Writer(Level::Warning, m_file, m_line, m_func).construct(1, base::consts::kDefaultLoggerId) - << "Aborting application. Reason: Fatal log at [" << m_file << ":" << m_line << "]"; - std::stringstream reasonStream; - reasonStream << "Fatal log at [" << m_file << ":" << m_line << "]" - << " If you wish to disable 'abort on fatal log' please use " - << "el::Loggers::addFlag(el::LoggingFlag::DisableApplicationAbortOnFatalLog)"; - base::utils::abort(1, reasonStream.str()); - } - m_proceed = false; -} - -// PErrorWriter - -PErrorWriter::~PErrorWriter(void) { - if (m_proceed) { -#if ELPP_COMPILER_MSVC - char buff[256]; - strerror_s(buff, 256, errno); - m_logger->stream() << ": " << buff << " [" << errno << "]"; -#else - m_logger->stream() << ": " << strerror(errno) << " [" << errno << "]"; -#endif - } -} - -// PerformanceTracker - -#if defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_PERFORMANCE_TRACKING) - -PerformanceTracker::PerformanceTracker(const std::string& blockName, base::TimestampUnit timestampUnit, - const std::string& loggerId, bool scopedLog, Level level) - : m_blockName(blockName), - m_timestampUnit(timestampUnit), - m_loggerId(loggerId), - m_scopedLog(scopedLog), - m_level(level), - m_hasChecked(false), - m_lastCheckpointId(std::string()), - m_enabled(false) { -#if !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) && ELPP_LOGGING_ENABLED - // We store it locally so that if user happen to change configuration by the end of scope - // or before calling checkpoint, we still depend on state of configuraton at time of construction - el::Logger* loggerPtr = ELPP->registeredLoggers()->get(loggerId, false); - m_enabled = loggerPtr != nullptr && loggerPtr->m_typedConfigurations->performanceTracking(m_level); - if (m_enabled) { - base::utils::DateTime::gettimeofday(&m_startTime); - } -#endif // !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) && ELPP_LOGGING_ENABLED -} - -PerformanceTracker::~PerformanceTracker(void) { -#if !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) && ELPP_LOGGING_ENABLED - if (m_enabled) { - base::threading::ScopedLock scopedLock(lock()); - if (m_scopedLog) { - base::utils::DateTime::gettimeofday(&m_endTime); - base::type::string_t formattedTime = getFormattedTimeTaken(); - PerformanceTrackingData data(PerformanceTrackingData::DataType::Complete); - data.init(this); - data.m_formattedTimeTaken = formattedTime; - PerformanceTrackingCallback* callback = nullptr; - for (const std::pair& h : - ELPP->m_performanceTrackingCallbacks) { - callback = h.second.get(); - if (callback != nullptr && callback->enabled()) { - callback->handle(&data); - } - } - } - } -#endif // !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) -} - -void -PerformanceTracker::checkpoint(const std::string& id, const char* file, base::type::LineNumber line, const char* func) { -#if !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) && ELPP_LOGGING_ENABLED - if (m_enabled) { - base::threading::ScopedLock scopedLock(lock()); - base::utils::DateTime::gettimeofday(&m_endTime); - base::type::string_t formattedTime = - m_hasChecked ? getFormattedTimeTaken(m_lastCheckpointTime) : ELPP_LITERAL(""); - PerformanceTrackingData data(PerformanceTrackingData::DataType::Checkpoint); - data.init(this); - data.m_checkpointId = id; - data.m_file = file; - data.m_line = line; - data.m_func = func; - data.m_formattedTimeTaken = formattedTime; - PerformanceTrackingCallback* callback = nullptr; - for (const std::pair& h : - ELPP->m_performanceTrackingCallbacks) { - callback = h.second.get(); - if (callback != nullptr && callback->enabled()) { - callback->handle(&data); - } - } - base::utils::DateTime::gettimeofday(&m_lastCheckpointTime); - m_hasChecked = true; - m_lastCheckpointId = id; - } -#endif // !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) && ELPP_LOGGING_ENABLED - ELPP_UNUSED(id); - ELPP_UNUSED(file); - ELPP_UNUSED(line); - ELPP_UNUSED(func); -} - -const base::type::string_t -PerformanceTracker::getFormattedTimeTaken(struct timeval startTime) const { - if (ELPP->hasFlag(LoggingFlag::FixedTimeFormat)) { - base::type::stringstream_t ss; - ss << base::utils::DateTime::getTimeDifference(m_endTime, startTime, m_timestampUnit) << " " - << base::consts::kTimeFormats[static_cast(m_timestampUnit)].unit; - return ss.str(); - } - return base::utils::DateTime::formatTime( - base::utils::DateTime::getTimeDifference(m_endTime, startTime, m_timestampUnit), m_timestampUnit); -} - -#endif // defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_PERFORMANCE_TRACKING) - -namespace debug { -#if defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_CRASH_LOG) - -// StackTrace - -StackTrace::StackTraceEntry::StackTraceEntry(std::size_t index, const std::string& loc, const std::string& demang, - const std::string& hex, const std::string& addr) - : m_index(index), m_location(loc), m_demangled(demang), m_hex(hex), m_addr(addr) { -} - -std::ostream& -operator<<(std::ostream& ss, const StackTrace::StackTraceEntry& si) { - ss << "[" << si.m_index << "] " << si.m_location << (si.m_hex.empty() ? "" : "+") << si.m_hex << " " << si.m_addr - << (si.m_demangled.empty() ? "" : ":") << si.m_demangled; - return ss; -} - -std::ostream& -operator<<(std::ostream& os, const StackTrace& st) { - std::vector::const_iterator it = st.m_stack.begin(); - while (it != st.m_stack.end()) { - os << " " << *it++ << "\n"; - } - return os; -} - -void -StackTrace::generateNew(void) { -#if ELPP_STACKTRACE - m_stack.clear(); - void* stack[kMaxStack]; - unsigned int size = backtrace(stack, kMaxStack); - char** strings = backtrace_symbols(stack, size); - if (size > kStackStart) { // Skip StackTrace c'tor and generateNew - for (std::size_t i = kStackStart; i < size; ++i) { - std::string mangName; - std::string location; - std::string hex; - std::string addr; - - // entry: 2 crash.cpp.bin 0x0000000101552be5 _ZN2el4base5debug10StackTraceC1Ev + 21 - const std::string line(strings[i]); - auto p = line.find("_"); - if (p != std::string::npos) { - mangName = line.substr(p); - mangName = mangName.substr(0, mangName.find(" +")); - } - p = line.find("0x"); - if (p != std::string::npos) { - addr = line.substr(p); - addr = addr.substr(0, addr.find("_")); - } - // Perform demangling if parsed properly - if (!mangName.empty()) { - int status = 0; - char* demangName = abi::__cxa_demangle(mangName.data(), 0, 0, &status); - // if demangling is successful, output the demangled function name - if (status == 0) { - // Success (see http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.3/a01696.html) - StackTraceEntry entry(i - 1, location, demangName, hex, addr); - m_stack.push_back(entry); - } else { - // Not successful - we will use mangled name - StackTraceEntry entry(i - 1, location, mangName, hex, addr); - m_stack.push_back(entry); - } - free(demangName); - } else { - StackTraceEntry entry(i - 1, line); - m_stack.push_back(entry); - } - } - } - free(strings); -#else - ELPP_INTERNAL_INFO(1, "Stacktrace generation not supported for selected compiler"); -#endif // ELPP_STACKTRACE -} - -// Static helper functions - -static std::string -crashReason(int sig) { - std::stringstream ss; - bool foundReason = false; - for (int i = 0; i < base::consts::kCrashSignalsCount; ++i) { - if (base::consts::kCrashSignals[i].numb == sig) { - ss << "Application has crashed due to [" << base::consts::kCrashSignals[i].name << "] signal"; - if (ELPP->hasFlag(el::LoggingFlag::LogDetailedCrashReason)) { - ss << std::endl - << " " << base::consts::kCrashSignals[i].brief << std::endl - << " " << base::consts::kCrashSignals[i].detail; - } - foundReason = true; - } - } - if (!foundReason) { - ss << "Application has crashed due to unknown signal [" << sig << "]"; - } - return ss.str(); -} -/// @brief Logs reason of crash from sig -static void -logCrashReason(int sig, bool stackTraceIfAvailable, Level level, const char* logger) { - if (sig == SIGINT && ELPP->hasFlag(el::LoggingFlag::IgnoreSigInt)) { - return; - } - std::stringstream ss; - ss << "CRASH HANDLED; "; - ss << crashReason(sig); -#if ELPP_STACKTRACE - if (stackTraceIfAvailable) { - ss << std::endl << " ======= Backtrace: =========" << std::endl << base::debug::StackTrace(); - } -#else - ELPP_UNUSED(stackTraceIfAvailable); -#endif // ELPP_STACKTRACE - ELPP_WRITE_LOG(el::base::Writer, level, base::DispatchAction::NormalLog, logger) << ss.str(); -} - -static inline void -crashAbort(int sig) { - base::utils::abort(sig, std::string()); -} - -/// @brief Default application crash handler -/// -/// @detail This function writes log using 'default' logger, prints stack trace for GCC based compilers and aborts -/// program. -static inline void -defaultCrashHandler(int sig) { - base::debug::logCrashReason(sig, true, Level::Fatal, base::consts::kDefaultLoggerId); - base::debug::crashAbort(sig); -} - -// CrashHandler - -CrashHandler::CrashHandler(bool useDefault) { - if (useDefault) { - setHandler(defaultCrashHandler); - } -} - -void -CrashHandler::setHandler(const Handler& cHandler) { - m_handler = cHandler; -#if defined(ELPP_HANDLE_SIGABRT) - int i = 0; // SIGABRT is at base::consts::kCrashSignals[0] -#else - int i = 1; -#endif // defined(ELPP_HANDLE_SIGABRT) - for (; i < base::consts::kCrashSignalsCount; ++i) { - m_handler = signal(base::consts::kCrashSignals[i].numb, cHandler); - } -} - -#endif // defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_CRASH_LOG) -} // namespace debug -} // namespace base - -// el - -// Helpers - -#if defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_CRASH_LOG) - -void -Helpers::crashAbort(int sig, const char* sourceFile, unsigned int long line) { - std::stringstream ss; - ss << base::debug::crashReason(sig).c_str(); - ss << " - [Called el::Helpers::crashAbort(" << sig << ")]"; - if (sourceFile != nullptr && strlen(sourceFile) > 0) { - ss << " - Source: " << sourceFile; - if (line > 0) - ss << ":" << line; - else - ss << " (line number not specified)"; - } - base::utils::abort(sig, ss.str()); -} - -void -Helpers::logCrashReason(int sig, bool stackTraceIfAvailable, Level level, const char* logger) { - el::base::debug::logCrashReason(sig, stackTraceIfAvailable, level, logger); -} - -#endif // defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_CRASH_LOG) - -// Loggers - -Logger* -Loggers::getLogger(const std::string& identity, bool registerIfNotAvailable) { - return ELPP->registeredLoggers()->get(identity, registerIfNotAvailable); -} - -void -Loggers::setDefaultLogBuilder(el::LogBuilderPtr& logBuilderPtr) { - ELPP->registeredLoggers()->setDefaultLogBuilder(logBuilderPtr); -} - -bool -Loggers::unregisterLogger(const std::string& identity) { - return ELPP->registeredLoggers()->remove(identity); -} - -bool -Loggers::hasLogger(const std::string& identity) { - return ELPP->registeredLoggers()->has(identity); -} - -Logger* -Loggers::reconfigureLogger(Logger* logger, const Configurations& configurations) { - if (!logger) - return nullptr; - logger->configure(configurations); - return logger; -} - -Logger* -Loggers::reconfigureLogger(const std::string& identity, const Configurations& configurations) { - return Loggers::reconfigureLogger(Loggers::getLogger(identity), configurations); -} - -Logger* -Loggers::reconfigureLogger(const std::string& identity, ConfigurationType configurationType, const std::string& value) { - Logger* logger = Loggers::getLogger(identity); - if (logger == nullptr) { - return nullptr; - } - logger->configurations()->set(Level::Global, configurationType, value); - logger->reconfigure(); - return logger; -} - -void -Loggers::reconfigureAllLoggers(const Configurations& configurations) { - for (base::RegisteredLoggers::iterator it = ELPP->registeredLoggers()->begin(); - it != ELPP->registeredLoggers()->end(); ++it) { - Loggers::reconfigureLogger(it->second, configurations); - } -} - -void -Loggers::reconfigureAllLoggers(Level level, ConfigurationType configurationType, const std::string& value) { - for (base::RegisteredLoggers::iterator it = ELPP->registeredLoggers()->begin(); - it != ELPP->registeredLoggers()->end(); ++it) { - Logger* logger = it->second; - logger->configurations()->set(level, configurationType, value); - logger->reconfigure(); - } -} - -void -Loggers::setDefaultConfigurations(const Configurations& configurations, bool reconfigureExistingLoggers) { - ELPP->registeredLoggers()->setDefaultConfigurations(configurations); - if (reconfigureExistingLoggers) { - Loggers::reconfigureAllLoggers(configurations); - } -} - -const Configurations* -Loggers::defaultConfigurations(void) { - return ELPP->registeredLoggers()->defaultConfigurations(); -} - -const base::LogStreamsReferenceMap* -Loggers::logStreamsReference(void) { - return ELPP->registeredLoggers()->logStreamsReference(); -} - -base::TypedConfigurations -Loggers::defaultTypedConfigurations(void) { - return base::TypedConfigurations(ELPP->registeredLoggers()->defaultConfigurations(), - ELPP->registeredLoggers()->logStreamsReference()); -} - -std::vector* -Loggers::populateAllLoggerIds(std::vector* targetList) { - targetList->clear(); - for (base::RegisteredLoggers::iterator it = ELPP->registeredLoggers()->list().begin(); - it != ELPP->registeredLoggers()->list().end(); ++it) { - targetList->push_back(it->first); - } - return targetList; -} - -void -Loggers::configureFromGlobal(const char* globalConfigurationFilePath) { - std::ifstream gcfStream(globalConfigurationFilePath, std::ifstream::in); - ELPP_ASSERT(gcfStream.is_open(), - "Unable to open global configuration file [" << globalConfigurationFilePath << "] for parsing."); - std::string line = std::string(); - std::stringstream ss; - Logger* logger = nullptr; - auto configure = [&](void) { - ELPP_INTERNAL_INFO(8, "Configuring logger: '" << logger->id() << "' with configurations \n" - << ss.str() << "\n--------------"); - Configurations c; - c.parseFromText(ss.str()); - logger->configure(c); - }; - while (gcfStream.good()) { - std::getline(gcfStream, line); - ELPP_INTERNAL_INFO(1, "Parsing line: " << line); - base::utils::Str::trim(line); - if (Configurations::Parser::isComment(line)) - continue; - Configurations::Parser::ignoreComments(&line); - base::utils::Str::trim(line); - if (line.size() > 2 && base::utils::Str::startsWith(line, std::string(base::consts::kConfigurationLoggerId))) { - if (!ss.str().empty() && logger != nullptr) { - configure(); - } - ss.str(std::string("")); - line = line.substr(2); - base::utils::Str::trim(line); - if (line.size() > 1) { - ELPP_INTERNAL_INFO(1, "Getting logger: '" << line << "'"); - logger = getLogger(line); - } - } else { - ss << line << "\n"; - } - } - if (!ss.str().empty() && logger != nullptr) { - configure(); - } -} - -bool -Loggers::configureFromArg(const char* argKey) { -#if defined(ELPP_DISABLE_CONFIGURATION_FROM_PROGRAM_ARGS) - ELPP_UNUSED(argKey); -#else - if (!Helpers::commandLineArgs()->hasParamWithValue(argKey)) { - return false; - } - configureFromGlobal(Helpers::commandLineArgs()->getParamValue(argKey)); -#endif // defined(ELPP_DISABLE_CONFIGURATION_FROM_PROGRAM_ARGS) - return true; -} - -void -Loggers::flushAll(void) { - ELPP->registeredLoggers()->flushAll(); -} - -void -Loggers::setVerboseLevel(base::type::VerboseLevel level) { - ELPP->vRegistry()->setLevel(level); -} - -base::type::VerboseLevel -Loggers::verboseLevel(void) { - return ELPP->vRegistry()->level(); -} - -void -Loggers::setVModules(const char* modules) { - if (ELPP->vRegistry()->vModulesEnabled()) { - ELPP->vRegistry()->setModules(modules); - } -} - -void -Loggers::clearVModules(void) { - ELPP->vRegistry()->clearModules(); -} - -// VersionInfo - -const std::string -VersionInfo::version(void) { - return std::string("9.96.7"); -} -/// @brief Release date of current version -const std::string -VersionInfo::releaseDate(void) { - return std::string("24-11-2018 0728hrs"); -} - -} // namespace el diff --git a/proxy/thirdparty/easyloggingpp/easylogging++.h b/proxy/thirdparty/easyloggingpp/easylogging++.h deleted file mode 100644 index ce6c7ece48..0000000000 --- a/proxy/thirdparty/easyloggingpp/easylogging++.h +++ /dev/null @@ -1,5193 +0,0 @@ -// -// Bismillah ar-Rahmaan ar-Raheem -// -// Easylogging++ v9.96.7 -// Single-header only, cross-platform logging library for C++ applications -// -// Copyright (c) 2012-2018 Zuhd Web Services -// Copyright (c) 2012-2018 @abumusamq -// -// This library is released under the MIT Licence. -// https://github.com/zuhd-org/easyloggingpp/blob/master/LICENSE -// -// https://zuhd.org -// http://muflihun.com -// - -#ifndef EASYLOGGINGPP_H -#define EASYLOGGINGPP_H -// Compilers and C++0x/C++11 Evaluation -#if __cplusplus >= 201103L -#define ELPP_CXX11 1 -#endif // __cplusplus >= 201103L -#if (defined(__GNUC__)) -#define ELPP_COMPILER_GCC 1 -#else -#define ELPP_COMPILER_GCC 0 -#endif -#if ELPP_COMPILER_GCC -#define ELPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) -#if defined(__GXX_EXPERIMENTAL_CXX0X__) -#define ELPP_CXX0X 1 -#endif -#endif -// Visual C++ -#if defined(_MSC_VER) -#define ELPP_COMPILER_MSVC 1 -#else -#define ELPP_COMPILER_MSVC 0 -#endif -#define ELPP_CRT_DBG_WARNINGS ELPP_COMPILER_MSVC -#if ELPP_COMPILER_MSVC -#if (_MSC_VER == 1600) -#define ELPP_CXX0X 1 -#elif (_MSC_VER >= 1700) -#define ELPP_CXX11 1 -#endif -#endif -// Clang++ -#if (defined(__clang__) && (__clang__ == 1)) -#define ELPP_COMPILER_CLANG 1 -#else -#define ELPP_COMPILER_CLANG 0 -#endif -#if ELPP_COMPILER_CLANG -#if __has_include() -#include // Make __GLIBCXX__ defined when using libstdc++ -#if !defined(__GLIBCXX__) || __GLIBCXX__ >= 20150426 -#define ELPP_CLANG_SUPPORTS_THREAD -#endif // !defined(__GLIBCXX__) || __GLIBCXX__ >= 20150426 -#endif // __has_include() -#endif -#if (defined(__MINGW32__) || defined(__MINGW64__)) -#define ELPP_MINGW 1 -#else -#define ELPP_MINGW 0 -#endif -#if (defined(__CYGWIN__) && (__CYGWIN__ == 1)) -#define ELPP_CYGWIN 1 -#else -#define ELPP_CYGWIN 0 -#endif -#if (defined(__INTEL_COMPILER)) -#define ELPP_COMPILER_INTEL 1 -#else -#define ELPP_COMPILER_INTEL 0 -#endif -// Operating System Evaluation -// Windows -#if (defined(_WIN32) || defined(_WIN64)) -#define ELPP_OS_WINDOWS 1 -#else -#define ELPP_OS_WINDOWS 0 -#endif -// Linux -#if (defined(__linux) || defined(__linux__)) -#define ELPP_OS_LINUX 1 -#else -#define ELPP_OS_LINUX 0 -#endif -#if (defined(__APPLE__)) -#define ELPP_OS_MAC 1 -#else -#define ELPP_OS_MAC 0 -#endif -#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) -#define ELPP_OS_FREEBSD 1 -#else -#define ELPP_OS_FREEBSD 0 -#endif -#if (defined(__sun)) -#define ELPP_OS_SOLARIS 1 -#else -#define ELPP_OS_SOLARIS 0 -#endif -#if (defined(_AIX)) -#define ELPP_OS_AIX 1 -#else -#define ELPP_OS_AIX 0 -#endif -#if (defined(__NetBSD__)) -#define ELPP_OS_NETBSD 1 -#else -#define ELPP_OS_NETBSD 0 -#endif -#if defined(__EMSCRIPTEN__) -#define ELPP_OS_EMSCRIPTEN 1 -#else -#define ELPP_OS_EMSCRIPTEN 0 -#endif -// Unix -#if ((ELPP_OS_LINUX || ELPP_OS_MAC || ELPP_OS_FREEBSD || ELPP_OS_NETBSD || ELPP_OS_SOLARIS || ELPP_OS_AIX || \ - ELPP_OS_EMSCRIPTEN) && \ - (!ELPP_OS_WINDOWS)) -#define ELPP_OS_UNIX 1 -#else -#define ELPP_OS_UNIX 0 -#endif -#if (defined(__ANDROID__)) -#define ELPP_OS_ANDROID 1 -#else -#define ELPP_OS_ANDROID 0 -#endif -// Evaluating Cygwin as *nix OS -#if !ELPP_OS_UNIX && !ELPP_OS_WINDOWS && ELPP_CYGWIN -#undef ELPP_OS_UNIX -#undef ELPP_OS_LINUX -#define ELPP_OS_UNIX 1 -#define ELPP_OS_LINUX 1 -#endif // !ELPP_OS_UNIX && !ELPP_OS_WINDOWS && ELPP_CYGWIN -#if !defined(ELPP_INTERNAL_DEBUGGING_OUT_INFO) -#define ELPP_INTERNAL_DEBUGGING_OUT_INFO std::cout -#endif // !defined(ELPP_INTERNAL_DEBUGGING_OUT) -#if !defined(ELPP_INTERNAL_DEBUGGING_OUT_ERROR) -#define ELPP_INTERNAL_DEBUGGING_OUT_ERROR std::cerr -#endif // !defined(ELPP_INTERNAL_DEBUGGING_OUT) -#if !defined(ELPP_INTERNAL_DEBUGGING_ENDL) -#define ELPP_INTERNAL_DEBUGGING_ENDL std::endl -#endif // !defined(ELPP_INTERNAL_DEBUGGING_OUT) -#if !defined(ELPP_INTERNAL_DEBUGGING_MSG) -#define ELPP_INTERNAL_DEBUGGING_MSG(msg) msg -#endif // !defined(ELPP_INTERNAL_DEBUGGING_OUT) -// Internal Assertions and errors -#if !defined(ELPP_DISABLE_ASSERT) -#if (defined(ELPP_DEBUG_ASSERT_FAILURE)) -#define ELPP_ASSERT(expr, msg) \ - if (!(expr)) { \ - std::stringstream internalInfoStream; \ - internalInfoStream << msg; \ - ELPP_INTERNAL_DEBUGGING_OUT_ERROR \ - << "EASYLOGGING++ ASSERTION FAILED (LINE: " << __LINE__ << ") [" #expr << "] WITH MESSAGE \"" \ - << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStream.str()) << "\"" << ELPP_INTERNAL_DEBUGGING_ENDL; \ - base::utils::abort(1, "ELPP Assertion failure, please define ELPP_DEBUG_ASSERT_FAILURE"); \ - } -#else -#define ELPP_ASSERT(expr, msg) \ - if (!(expr)) { \ - std::stringstream internalInfoStream; \ - internalInfoStream << msg; \ - ELPP_INTERNAL_DEBUGGING_OUT_ERROR \ - << "ASSERTION FAILURE FROM EASYLOGGING++ (LINE: " << __LINE__ << ") [" #expr << "] WITH MESSAGE \"" \ - << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStream.str()) << "\"" << ELPP_INTERNAL_DEBUGGING_ENDL; \ - } -#endif // (defined(ELPP_DEBUG_ASSERT_FAILURE)) -#else -#define ELPP_ASSERT(x, y) -#endif //(!defined(ELPP_DISABLE_ASSERT) -#if ELPP_COMPILER_MSVC -#define ELPP_INTERNAL_DEBUGGING_WRITE_PERROR \ - { \ - char buff[256]; \ - strerror_s(buff, 256, errno); \ - ELPP_INTERNAL_DEBUGGING_OUT_ERROR << ": " << buff << " [" << errno << "]"; \ - } \ - (void)0 -#else -#define ELPP_INTERNAL_DEBUGGING_WRITE_PERROR \ - ELPP_INTERNAL_DEBUGGING_OUT_ERROR << ": " << strerror(errno) << " [" << errno << "]"; \ - (void)0 -#endif // ELPP_COMPILER_MSVC -#if defined(ELPP_DEBUG_ERRORS) -#if !defined(ELPP_INTERNAL_ERROR) -#define ELPP_INTERNAL_ERROR(msg, pe) \ - { \ - std::stringstream internalInfoStream; \ - internalInfoStream << " " << msg; \ - ELPP_INTERNAL_DEBUGGING_OUT_ERROR << "ERROR FROM EASYLOGGING++ (LINE: " << __LINE__ << ") " \ - << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStream.str()) \ - << ELPP_INTERNAL_DEBUGGING_ENDL; \ - if (pe) { \ - ELPP_INTERNAL_DEBUGGING_OUT_ERROR << " "; \ - ELPP_INTERNAL_DEBUGGING_WRITE_PERROR; \ - } \ - } \ - (void)0 -#endif -#else -#undef ELPP_INTERNAL_INFO -#define ELPP_INTERNAL_ERROR(msg, pe) -#endif // defined(ELPP_DEBUG_ERRORS) -#if (defined(ELPP_DEBUG_INFO)) -#if !(defined(ELPP_INTERNAL_INFO_LEVEL)) -#define ELPP_INTERNAL_INFO_LEVEL 9 -#endif // !(defined(ELPP_INTERNAL_INFO_LEVEL)) -#if !defined(ELPP_INTERNAL_INFO) -#define ELPP_INTERNAL_INFO(lvl, msg) \ - { \ - if (lvl <= ELPP_INTERNAL_INFO_LEVEL) { \ - std::stringstream internalInfoStream; \ - internalInfoStream << " " << msg; \ - ELPP_INTERNAL_DEBUGGING_OUT_INFO << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStream.str()) \ - << ELPP_INTERNAL_DEBUGGING_ENDL; \ - } \ - } -#endif -#else -#undef ELPP_INTERNAL_INFO -#define ELPP_INTERNAL_INFO(lvl, msg) -#endif // (defined(ELPP_DEBUG_INFO)) -#if (defined(ELPP_FEATURE_ALL)) || (defined(ELPP_FEATURE_CRASH_LOG)) -#if (ELPP_COMPILER_GCC && !ELPP_MINGW && !ELPP_OS_ANDROID && !ELPP_OS_EMSCRIPTEN) -#define ELPP_STACKTRACE 1 -#else -#if ELPP_COMPILER_MSVC -#pragma message("Stack trace not available for this compiler") -#else -#warning "Stack trace not available for this compiler"; -#endif // ELPP_COMPILER_MSVC -#define ELPP_STACKTRACE 0 -#endif // ELPP_COMPILER_GCC -#else -#define ELPP_STACKTRACE 0 -#endif // (defined(ELPP_FEATURE_ALL)) || (defined(ELPP_FEATURE_CRASH_LOG)) -// Miscellaneous macros -#define ELPP_UNUSED(x) (void)x -#if ELPP_OS_UNIX -// Log file permissions for unix-based systems -#define ELPP_LOG_PERMS S_IRUSR | S_IWUSR | S_IXUSR | S_IWGRP | S_IRGRP | S_IXGRP | S_IWOTH | S_IXOTH -#endif // ELPP_OS_UNIX -#if defined(ELPP_AS_DLL) && ELPP_COMPILER_MSVC -#if defined(ELPP_EXPORT_SYMBOLS) -#define ELPP_EXPORT __declspec(dllexport) -#else -#define ELPP_EXPORT __declspec(dllimport) -#endif // defined(ELPP_EXPORT_SYMBOLS) -#else -#define ELPP_EXPORT -#endif // defined(ELPP_AS_DLL) && ELPP_COMPILER_MSVC -// Some special functions that are VC++ specific -#undef STRTOK -#undef STRERROR -#undef STRCAT -#undef STRCPY -#if ELPP_CRT_DBG_WARNINGS -#define STRTOK(a, b, c) strtok_s(a, b, c) -#define STRERROR(a, b, c) strerror_s(a, b, c) -#define STRCAT(a, b, len) strcat_s(a, len, b) -#define STRCPY(a, b, len) strcpy_s(a, len, b) -#else -#define STRTOK(a, b, c) strtok(a, b) -#define STRERROR(a, b, c) strerror(c) -#define STRCAT(a, b, len) strcat(a, b) -#define STRCPY(a, b, len) strcpy(a, b) -#endif -// Compiler specific support evaluations -#if (ELPP_MINGW && !defined(ELPP_FORCE_USE_STD_THREAD)) -#define ELPP_USE_STD_THREADING 0 -#else -#if ((ELPP_COMPILER_CLANG && defined(ELPP_CLANG_SUPPORTS_THREAD)) || (!ELPP_COMPILER_CLANG && defined(ELPP_CXX11)) || \ - defined(ELPP_FORCE_USE_STD_THREAD)) -#define ELPP_USE_STD_THREADING 1 -#else -#define ELPP_USE_STD_THREADING 0 -#endif -#endif -#undef ELPP_FINAL -#if ELPP_COMPILER_INTEL || (ELPP_GCC_VERSION < 40702) -#define ELPP_FINAL -#else -#define ELPP_FINAL final -#endif // ELPP_COMPILER_INTEL || (ELPP_GCC_VERSION < 40702) -#if defined(ELPP_EXPERIMENTAL_ASYNC) -#define ELPP_ASYNC_LOGGING 1 -#else -#define ELPP_ASYNC_LOGGING 0 -#endif // defined(ELPP_EXPERIMENTAL_ASYNC) -#if defined(ELPP_THREAD_SAFE) || ELPP_ASYNC_LOGGING -#define ELPP_THREADING_ENABLED 1 -#else -#define ELPP_THREADING_ENABLED 0 -#endif // defined(ELPP_THREAD_SAFE) || ELPP_ASYNC_LOGGING -// Function macro ELPP_FUNC -#undef ELPP_FUNC -#if ELPP_COMPILER_MSVC // Visual C++ -#define ELPP_FUNC __FUNCSIG__ -#elif ELPP_COMPILER_GCC // GCC -#define ELPP_FUNC __PRETTY_FUNCTION__ -#elif ELPP_COMPILER_INTEL // Intel C++ -#define ELPP_FUNC __PRETTY_FUNCTION__ -#elif ELPP_COMPILER_CLANG // Clang++ -#define ELPP_FUNC __PRETTY_FUNCTION__ -#else -#if defined(__func__) -#define ELPP_FUNC __func__ -#else -#define ELPP_FUNC "" -#endif // defined(__func__) -#endif // defined(_MSC_VER) -#undef ELPP_VARIADIC_TEMPLATES_SUPPORTED -// Keep following line commented until features are fixed -#define ELPP_VARIADIC_TEMPLATES_SUPPORTED \ - (ELPP_COMPILER_GCC || ELPP_COMPILER_CLANG || ELPP_COMPILER_INTEL || (ELPP_COMPILER_MSVC && _MSC_VER >= 1800)) -// Logging Enable/Disable macros -#if defined(ELPP_DISABLE_LOGS) -#define ELPP_LOGGING_ENABLED 0 -#else -#define ELPP_LOGGING_ENABLED 1 -#endif -#if (!defined(ELPP_DISABLE_DEBUG_LOGS) && (ELPP_LOGGING_ENABLED)) -#define ELPP_DEBUG_LOG 1 -#else -#define ELPP_DEBUG_LOG 0 -#endif // (!defined(ELPP_DISABLE_DEBUG_LOGS) && (ELPP_LOGGING_ENABLED)) -#if (!defined(ELPP_DISABLE_INFO_LOGS) && (ELPP_LOGGING_ENABLED)) -#define ELPP_INFO_LOG 1 -#else -#define ELPP_INFO_LOG 0 -#endif // (!defined(ELPP_DISABLE_INFO_LOGS) && (ELPP_LOGGING_ENABLED)) -#if (!defined(ELPP_DISABLE_WARNING_LOGS) && (ELPP_LOGGING_ENABLED)) -#define ELPP_WARNING_LOG 1 -#else -#define ELPP_WARNING_LOG 0 -#endif // (!defined(ELPP_DISABLE_WARNING_LOGS) && (ELPP_LOGGING_ENABLED)) -#if (!defined(ELPP_DISABLE_ERROR_LOGS) && (ELPP_LOGGING_ENABLED)) -#define ELPP_ERROR_LOG 1 -#else -#define ELPP_ERROR_LOG 0 -#endif // (!defined(ELPP_DISABLE_ERROR_LOGS) && (ELPP_LOGGING_ENABLED)) -#if (!defined(ELPP_DISABLE_FATAL_LOGS) && (ELPP_LOGGING_ENABLED)) -#define ELPP_FATAL_LOG 1 -#else -#define ELPP_FATAL_LOG 0 -#endif // (!defined(ELPP_DISABLE_FATAL_LOGS) && (ELPP_LOGGING_ENABLED)) -#if (!defined(ELPP_DISABLE_TRACE_LOGS) && (ELPP_LOGGING_ENABLED)) -#define ELPP_TRACE_LOG 1 -#else -#define ELPP_TRACE_LOG 0 -#endif // (!defined(ELPP_DISABLE_TRACE_LOGS) && (ELPP_LOGGING_ENABLED)) -#if (!defined(ELPP_DISABLE_VERBOSE_LOGS) && (ELPP_LOGGING_ENABLED)) -#define ELPP_VERBOSE_LOG 1 -#else -#define ELPP_VERBOSE_LOG 0 -#endif // (!defined(ELPP_DISABLE_VERBOSE_LOGS) && (ELPP_LOGGING_ENABLED)) -#if (!(ELPP_CXX0X || ELPP_CXX11)) -#error "C++0x (or higher) support not detected! (Is `-std=c++11' missing?)" -#endif // (!(ELPP_CXX0X || ELPP_CXX11)) -// Headers -#if defined(ELPP_SYSLOG) -#include -#endif // defined(ELPP_SYSLOG) -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(ELPP_UNICODE) -#include -#if ELPP_OS_WINDOWS -#include -#endif // ELPP_OS_WINDOWS -#endif // defined(ELPP_UNICODE) -#if ELPP_STACKTRACE -#include -#include -#endif // ELPP_STACKTRACE -#if ELPP_OS_ANDROID -#include -#endif // ELPP_OS_ANDROID -#if ELPP_OS_UNIX -#include -#include -#elif ELPP_OS_WINDOWS -#include -#include -#if defined(WIN32_LEAN_AND_MEAN) -#if defined(ELPP_WINSOCK2) -#include -#else -#include -#endif // defined(ELPP_WINSOCK2) -#endif // defined(WIN32_LEAN_AND_MEAN) -#endif // ELPP_OS_UNIX -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if ELPP_THREADING_ENABLED -#if ELPP_USE_STD_THREADING -#include -#include -#else -#if ELPP_OS_UNIX -#include -#endif // ELPP_OS_UNIX -#endif // ELPP_USE_STD_THREADING -#endif // ELPP_THREADING_ENABLED -#if ELPP_ASYNC_LOGGING -#if defined(ELPP_NO_SLEEP_FOR) -#include -#endif // defined(ELPP_NO_SLEEP_FOR) -#include -#include -#include -#endif // ELPP_ASYNC_LOGGING -#if defined(ELPP_STL_LOGGING) -// For logging STL based templates -#include -#include -#include -#include -#include -#include -#if defined(ELPP_LOG_STD_ARRAY) -#include -#endif // defined(ELPP_LOG_STD_ARRAY) -#if defined(ELPP_LOG_UNORDERED_SET) -#include -#endif // defined(ELPP_UNORDERED_SET) -#endif // defined(ELPP_STL_LOGGING) -#if defined(ELPP_QT_LOGGING) -// For logging Qt based classes & templates -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif // defined(ELPP_QT_LOGGING) -#if defined(ELPP_BOOST_LOGGING) -// For logging boost based classes & templates -#include -#include -#include -#include -#include -#include -#include -#include -#endif // defined(ELPP_BOOST_LOGGING) -#if defined(ELPP_WXWIDGETS_LOGGING) -// For logging wxWidgets based classes & templates -#include -#endif // defined(ELPP_WXWIDGETS_LOGGING) -#if defined(ELPP_UTC_DATETIME) -#define elpptime_r gmtime_r -#define elpptime_s gmtime_s -#define elpptime gmtime -#else -#define elpptime_r localtime_r -#define elpptime_s localtime_s -#define elpptime localtime -#endif // defined(ELPP_UTC_DATETIME) -// Forward declarations -namespace el { -class Logger; -class LogMessage; -class PerformanceTrackingData; -class Loggers; -class Helpers; -template -class Callback; -class LogDispatchCallback; -class PerformanceTrackingCallback; -class LoggerRegistrationCallback; -class LogDispatchData; -namespace base { -class Storage; -class RegisteredLoggers; -class PerformanceTracker; -class MessageBuilder; -class Writer; -class PErrorWriter; -class LogDispatcher; -class DefaultLogBuilder; -class DefaultLogDispatchCallback; -#if ELPP_ASYNC_LOGGING -class AsyncLogDispatchCallback; -class AsyncDispatchWorker; -#endif // ELPP_ASYNC_LOGGING -class DefaultPerformanceTrackingCallback; -} // namespace base -} // namespace el -/// @brief Easylogging++ entry namespace -namespace el { -/// @brief Namespace containing base/internal functionality used by Easylogging++ -namespace base { -/// @brief Data types used by Easylogging++ -namespace type { -#undef ELPP_LITERAL -#undef ELPP_STRLEN -#undef ELPP_COUT -#if defined(ELPP_UNICODE) -#define ELPP_LITERAL(txt) L##txt -#define ELPP_STRLEN wcslen -#if defined ELPP_CUSTOM_COUT -#define ELPP_COUT ELPP_CUSTOM_COUT -#else -#define ELPP_COUT std::wcout -#endif // defined ELPP_CUSTOM_COUT -typedef wchar_t char_t; -typedef std::wstring string_t; -typedef std::wstringstream stringstream_t; -typedef std::wfstream fstream_t; -typedef std::wostream ostream_t; -#else -#define ELPP_LITERAL(txt) txt -#define ELPP_STRLEN strlen -#if defined ELPP_CUSTOM_COUT -#define ELPP_COUT ELPP_CUSTOM_COUT -#else -#define ELPP_COUT std::cout -#endif // defined ELPP_CUSTOM_COUT -typedef char char_t; -typedef std::string string_t; -typedef std::stringstream stringstream_t; -typedef std::fstream fstream_t; -typedef std::ostream ostream_t; -#endif // defined(ELPP_UNICODE) -#if defined(ELPP_CUSTOM_COUT_LINE) -#define ELPP_COUT_LINE(logLine) ELPP_CUSTOM_COUT_LINE(logLine) -#else -#define ELPP_COUT_LINE(logLine) logLine << std::flush -#endif // defined(ELPP_CUSTOM_COUT_LINE) -typedef unsigned int EnumType; -typedef unsigned short VerboseLevel; -typedef unsigned long int LineNumber; -typedef std::shared_ptr StoragePointer; -typedef std::shared_ptr LogDispatchCallbackPtr; -typedef std::shared_ptr PerformanceTrackingCallbackPtr; -typedef std::shared_ptr LoggerRegistrationCallbackPtr; -typedef std::unique_ptr PerformanceTrackerPtr; -} // namespace type -/// @brief Internal helper class that prevent copy constructor for class -/// -/// @detail When using this class simply inherit it privately -class NoCopy { - protected: - NoCopy(void) { - } - - private: - NoCopy(const NoCopy&); - NoCopy& - operator=(const NoCopy&); -}; -/// @brief Internal helper class that makes all default constructors private. -/// -/// @detail This prevents initializing class making it static unless an explicit constructor is declared. -/// When using this class simply inherit it privately -class StaticClass { - private: - StaticClass(void); - StaticClass(const StaticClass&); - StaticClass& - operator=(const StaticClass&); -}; -} // namespace base -/// @brief Represents enumeration for severity level used to determine level of logging -/// -/// @detail With Easylogging++, developers may disable or enable any level regardless of -/// what the severity is. Or they can choose to log using hierarchical logging flag -enum class Level : base::type::EnumType { - /// @brief Generic level that represents all the levels. Useful when setting global configuration for all levels - Global = 1, - /// @brief Information that can be useful to back-trace certain events - mostly useful than debug logs. - Trace = 2, - /// @brief Informational events most useful for developers to debug application - Debug = 4, - /// @brief Severe error information that will presumably abort application - Fatal = 8, - /// @brief Information representing errors in application but application will keep running - Error = 16, - /// @brief Useful when application has potentially harmful situtaions - Warning = 32, - /// @brief Information that can be highly useful and vary with verbose logging level. - Verbose = 64, - /// @brief Mainly useful to represent current progress of application - Info = 128, - /// @brief Represents unknown level - Unknown = 1010 -}; -} // namespace el -namespace std { -template <> -struct hash { - public: - std::size_t - operator()(const el::Level& l) const { - return hash{}(static_cast(l)); - } -}; -} // namespace std -namespace el { -/// @brief Static class that contains helper functions for el::Level -class LevelHelper : base::StaticClass { - public: - /// @brief Represents minimum valid level. Useful when iterating through enum. - static const base::type::EnumType kMinValid = static_cast(Level::Trace); - /// @brief Represents maximum valid level. This is used internally and you should not need it. - static const base::type::EnumType kMaxValid = static_cast(Level::Info); - /// @brief Casts level to int, useful for iterating through enum. - static base::type::EnumType - castToInt(Level level) { - return static_cast(level); - } - /// @brief Casts int(ushort) to level, useful for iterating through enum. - static Level - castFromInt(base::type::EnumType l) { - return static_cast(l); - } - /// @brief Converts level to associated const char* - /// @return Upper case string based level. - static const char* - convertToString(Level level); - /// @brief Converts from levelStr to Level - /// @param levelStr Upper case string based level. - /// Lower case is also valid but providing upper case is recommended. - static Level - convertFromString(const char* levelStr); - /// @brief Applies specified function to each level starting from startIndex - /// @param startIndex initial value to start the iteration from. This is passed as pointer and - /// is left-shifted so this can be used inside function (fn) to represent current level. - /// @param fn function to apply with each level. This bool represent whether or not to stop iterating through - /// levels. - static void - forEachLevel(base::type::EnumType* startIndex, const std::function& fn); -}; -/// @brief Represents enumeration of ConfigurationType used to configure or access certain aspect -/// of logging -enum class ConfigurationType : base::type::EnumType { - /// @brief Determines whether or not corresponding level and logger of logging is enabled - /// You may disable all logs by using el::Level::Global - Enabled = 1, - /// @brief Whether or not to write corresponding log to log file - ToFile = 2, - /// @brief Whether or not to write corresponding level and logger log to standard output. - /// By standard output meaning termnal, command prompt etc - ToStandardOutput = 4, - /// @brief Determines format of logging corresponding level and logger. - Format = 8, - /// @brief Determines log file (full path) to write logs to for correponding level and logger - Filename = 16, - /// @brief Specifies precision of the subsecond part. It should be within range (1-6). - SubsecondPrecision = 32, - /// @brief Alias of SubsecondPrecision (for backward compatibility) - MillisecondsWidth = SubsecondPrecision, - /// @brief Determines whether or not performance tracking is enabled. - /// - /// @detail This does not depend on logger or level. Performance tracking always uses 'performance' logger - PerformanceTracking = 64, - /// @brief Specifies log file max size. - /// - /// @detail If file size of corresponding log file (for corresponding level) is >= specified size, log file will - /// be truncated and re-initiated. - MaxLogFileSize = 128, - /// @brief Specifies number of log entries to hold until we flush pending log data - LogFlushThreshold = 256, - /// @brief Represents unknown configuration - Unknown = 1010 -}; -/// @brief Static class that contains helper functions for el::ConfigurationType -class ConfigurationTypeHelper : base::StaticClass { - public: - /// @brief Represents minimum valid configuration type. Useful when iterating through enum. - static const base::type::EnumType kMinValid = static_cast(ConfigurationType::Enabled); - /// @brief Represents maximum valid configuration type. This is used internally and you should not need it. - static const base::type::EnumType kMaxValid = static_cast(ConfigurationType::MaxLogFileSize); - /// @brief Casts configuration type to int, useful for iterating through enum. - static base::type::EnumType - castToInt(ConfigurationType configurationType) { - return static_cast(configurationType); - } - /// @brief Casts int(ushort) to configurationt type, useful for iterating through enum. - static ConfigurationType - castFromInt(base::type::EnumType c) { - return static_cast(c); - } - /// @brief Converts configuration type to associated const char* - /// @returns Upper case string based configuration type. - static const char* - convertToString(ConfigurationType configurationType); - /// @brief Converts from configStr to ConfigurationType - /// @param configStr Upper case string based configuration type. - /// Lower case is also valid but providing upper case is recommended. - static ConfigurationType - convertFromString(const char* configStr); - /// @brief Applies specified function to each configuration type starting from startIndex - /// @param startIndex initial value to start the iteration from. This is passed by pointer and is left-shifted - /// so this can be used inside function (fn) to represent current configuration type. - /// @param fn function to apply with each configuration type. - /// This bool represent whether or not to stop iterating through configurations. - static inline void - forEachConfigType(base::type::EnumType* startIndex, const std::function& fn); -}; -/// @brief Flags used while writing logs. This flags are set by user -enum class LoggingFlag : base::type::EnumType { - /// @brief Makes sure we have new line for each container log entry - NewLineForContainer = 1, - /// @brief Makes sure if -vmodule is used and does not specifies a module, then verbose - /// logging is allowed via that module. - AllowVerboseIfModuleNotSpecified = 2, - /// @brief When handling crashes by default, detailed crash reason will be logged as well - LogDetailedCrashReason = 4, - /// @brief Allows to disable application abortion when logged using FATAL level - DisableApplicationAbortOnFatalLog = 8, - /// @brief Flushes log with every log-entry (performance sensative) - Disabled by default - ImmediateFlush = 16, - /// @brief Enables strict file rolling - StrictLogFileSizeCheck = 32, - /// @brief Make terminal output colorful for supported terminals - ColoredTerminalOutput = 64, - /// @brief Supports use of multiple logging in same macro, e.g, CLOG(INFO, "default", "network") - MultiLoggerSupport = 128, - /// @brief Disables comparing performance tracker's checkpoints - DisablePerformanceTrackingCheckpointComparison = 256, - /// @brief Disable VModules - DisableVModules = 512, - /// @brief Disable VModules extensions - DisableVModulesExtensions = 1024, - /// @brief Enables hierarchical logging - HierarchicalLogging = 2048, - /// @brief Creates logger automatically when not available - CreateLoggerAutomatically = 4096, - /// @brief Adds spaces b/w logs that separated by left-shift operator - AutoSpacing = 8192, - /// @brief Preserves time format and does not convert it to sec, hour etc (performance tracking only) - FixedTimeFormat = 16384, - // @brief Ignore SIGINT or crash - IgnoreSigInt = 32768, -}; -namespace base { -/// @brief Namespace containing constants used internally. -namespace consts { -static const char kFormatSpecifierCharValue = 'v'; -static const char kFormatSpecifierChar = '%'; -static const unsigned int kMaxLogPerCounter = 100000; -static const unsigned int kMaxLogPerContainer = 100; -static const unsigned int kDefaultSubsecondPrecision = 3; - -#ifdef ELPP_DEFAULT_LOGGER -static const char* kDefaultLoggerId = ELPP_DEFAULT_LOGGER; -#else -static const char* kDefaultLoggerId = "default"; -#endif - -#if defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_PERFORMANCE_TRACKING) -#ifdef ELPP_DEFAULT_PERFORMANCE_LOGGER -static const char* kPerformanceLoggerId = ELPP_DEFAULT_PERFORMANCE_LOGGER; -#else -static const char* kPerformanceLoggerId = "performance"; -#endif // ELPP_DEFAULT_PERFORMANCE_LOGGER -#endif - -#if defined(ELPP_SYSLOG) -static const char* kSysLogLoggerId = "syslog"; -#endif // defined(ELPP_SYSLOG) - -#if ELPP_OS_WINDOWS -static const char* kFilePathSeperator = "\\"; -#else -static const char* kFilePathSeperator = "/"; -#endif // ELPP_OS_WINDOWS - -static const std::size_t kSourceFilenameMaxLength = 100; -static const std::size_t kSourceLineMaxLength = 10; -static const Level kPerformanceTrackerDefaultLevel = Level::Info; -const struct { - double value; - const base::type::char_t* unit; -} kTimeFormats[] = {{1000.0f, ELPP_LITERAL("us")}, {1000.0f, ELPP_LITERAL("ms")}, {60.0f, ELPP_LITERAL("seconds")}, - {60.0f, ELPP_LITERAL("minutes")}, {24.0f, ELPP_LITERAL("hours")}, {7.0f, ELPP_LITERAL("days")}}; -static const int kTimeFormatsCount = sizeof(kTimeFormats) / sizeof(kTimeFormats[0]); -const struct { - int numb; - const char* name; - const char* brief; - const char* detail; -} kCrashSignals[] = { - // NOTE: Do not re-order, if you do please check CrashHandler(bool) constructor and CrashHandler::setHandler(..) - {SIGABRT, "SIGABRT", "Abnormal termination", "Program was abnormally terminated."}, - {SIGFPE, "SIGFPE", "Erroneous arithmetic operation", - "Arithemetic operation issue such as division by zero or operation resulting in overflow."}, - {SIGILL, "SIGILL", "Illegal instruction", - "Generally due to a corruption in the code or to an attempt to execute data."}, - {SIGSEGV, "SIGSEGV", "Invalid access to memory", - "Program is trying to read an invalid (unallocated, deleted or corrupted) or inaccessible memory."}, - {SIGINT, "SIGINT", "Interactive attention signal", - "Interruption generated (generally) by user or operating system."}, -}; -static const int kCrashSignalsCount = sizeof(kCrashSignals) / sizeof(kCrashSignals[0]); -} // namespace consts -} // namespace base -typedef std::function PreRollOutCallback; -namespace base { -static inline void -defaultPreRollOutCallback(const char*, std::size_t, Level level) { -} -/// @brief Enum to represent timestamp unit -enum class TimestampUnit : base::type::EnumType { - Microsecond = 0, - Millisecond = 1, - Second = 2, - Minute = 3, - Hour = 4, - Day = 5 -}; -/// @brief Format flags used to determine specifiers that are active for performance improvements. -enum class FormatFlags : base::type::EnumType { - DateTime = 1 << 1, - LoggerId = 1 << 2, - File = 1 << 3, - Line = 1 << 4, - Location = 1 << 5, - Function = 1 << 6, - User = 1 << 7, - Host = 1 << 8, - LogMessage = 1 << 9, - VerboseLevel = 1 << 10, - AppName = 1 << 11, - ThreadId = 1 << 12, - Level = 1 << 13, - FileBase = 1 << 14, - LevelShort = 1 << 15 -}; -/// @brief A subsecond precision class containing actual width and offset of the subsecond part -class SubsecondPrecision { - public: - SubsecondPrecision(void) { - init(base::consts::kDefaultSubsecondPrecision); - } - explicit SubsecondPrecision(int width) { - init(width); - } - bool - operator==(const SubsecondPrecision& ssPrec) { - return m_width == ssPrec.m_width && m_offset == ssPrec.m_offset; - } - int m_width; - unsigned int m_offset; - - private: - void - init(int width); -}; -/// @brief Type alias of SubsecondPrecision -typedef SubsecondPrecision MillisecondsWidth; -/// @brief Namespace containing utility functions/static classes used internally -namespace utils { -/// @brief Deletes memory safely and points to null -template -static typename std::enable_if::value, void>::type -safeDelete(T*& pointer) { - if (pointer == nullptr) - return; - delete pointer; - pointer = nullptr; -} -/// @brief Bitwise operations for C++11 strong enum class. This casts e into Flag_T and returns value after bitwise -/// operation Use these function as
flag = bitwise::Or(MyEnum::val1, flag);
-namespace bitwise { -template -static inline base::type::EnumType -And(Enum e, base::type::EnumType flag) { - return static_cast(flag) & static_cast(e); -} -template -static inline base::type::EnumType -Not(Enum e, base::type::EnumType flag) { - return static_cast(flag) & ~(static_cast(e)); -} -template -static inline base::type::EnumType -Or(Enum e, base::type::EnumType flag) { - return static_cast(flag) | static_cast(e); -} -} // namespace bitwise -template -static inline void -addFlag(Enum e, base::type::EnumType* flag) { - *flag = base::utils::bitwise::Or(e, *flag); -} -template -static inline void -removeFlag(Enum e, base::type::EnumType* flag) { - *flag = base::utils::bitwise::Not(e, *flag); -} -template -static inline bool -hasFlag(Enum e, base::type::EnumType flag) { - return base::utils::bitwise::And(e, flag) > 0x0; -} -} // namespace utils -namespace threading { -#if ELPP_THREADING_ENABLED -#if !ELPP_USE_STD_THREADING -namespace internal { -/// @brief A mutex wrapper for compiler that dont yet support std::recursive_mutex -class Mutex : base::NoCopy { - public: - Mutex(void) { -#if ELPP_OS_UNIX - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&m_underlyingMutex, &attr); - pthread_mutexattr_destroy(&attr); -#elif ELPP_OS_WINDOWS - InitializeCriticalSection(&m_underlyingMutex); -#endif // ELPP_OS_UNIX - } - - virtual ~Mutex(void) { -#if ELPP_OS_UNIX - pthread_mutex_destroy(&m_underlyingMutex); -#elif ELPP_OS_WINDOWS - DeleteCriticalSection(&m_underlyingMutex); -#endif // ELPP_OS_UNIX - } - - inline void - lock(void) { -#if ELPP_OS_UNIX - pthread_mutex_lock(&m_underlyingMutex); -#elif ELPP_OS_WINDOWS - EnterCriticalSection(&m_underlyingMutex); -#endif // ELPP_OS_UNIX - } - - inline bool - try_lock(void) { -#if ELPP_OS_UNIX - return (pthread_mutex_trylock(&m_underlyingMutex) == 0); -#elif ELPP_OS_WINDOWS - return TryEnterCriticalSection(&m_underlyingMutex); -#endif // ELPP_OS_UNIX - } - - inline void - unlock(void) { -#if ELPP_OS_UNIX - pthread_mutex_unlock(&m_underlyingMutex); -#elif ELPP_OS_WINDOWS - LeaveCriticalSection(&m_underlyingMutex); -#endif // ELPP_OS_UNIX - } - - private: -#if ELPP_OS_UNIX - pthread_mutex_t m_underlyingMutex; -#elif ELPP_OS_WINDOWS - CRITICAL_SECTION m_underlyingMutex; -#endif // ELPP_OS_UNIX -}; -/// @brief Scoped lock for compiler that dont yet support std::lock_guard -template -class ScopedLock : base::NoCopy { - public: - explicit ScopedLock(M& mutex) { - m_mutex = &mutex; - m_mutex->lock(); - } - - virtual ~ScopedLock(void) { - m_mutex->unlock(); - } - - private: - M* m_mutex; - ScopedLock(void); -}; -} // namespace internal -typedef base::threading::internal::Mutex Mutex; -typedef base::threading::internal::ScopedLock ScopedLock; -#else -typedef std::recursive_mutex Mutex; -typedef std::lock_guard ScopedLock; -#endif // !ELPP_USE_STD_THREADING -#else -namespace internal { -/// @brief Mutex wrapper used when multi-threading is disabled. -class NoMutex : base::NoCopy { - public: - NoMutex(void) { - } - inline void - lock(void) { - } - inline bool - try_lock(void) { - return true; - } - inline void - unlock(void) { - } -}; -/// @brief Lock guard wrapper used when multi-threading is disabled. -template -class NoScopedLock : base::NoCopy { - public: - explicit NoScopedLock(Mutex&) { - } - virtual ~NoScopedLock(void) { - } - - private: - NoScopedLock(void); -}; -} // namespace internal -typedef base::threading::internal::NoMutex Mutex; -typedef base::threading::internal::NoScopedLock ScopedLock; -#endif // ELPP_THREADING_ENABLED -/// @brief Base of thread safe class, this class is inheritable-only -class ThreadSafe { - public: - virtual inline void - acquireLock(void) ELPP_FINAL { - m_mutex.lock(); - } - virtual inline void - releaseLock(void) ELPP_FINAL { - m_mutex.unlock(); - } - virtual inline base::threading::Mutex& - lock(void) ELPP_FINAL { - return m_mutex; - } - - protected: - ThreadSafe(void) { - } - virtual ~ThreadSafe(void) { - } - - private: - base::threading::Mutex m_mutex; -}; - -#if ELPP_THREADING_ENABLED -#if !ELPP_USE_STD_THREADING -/// @brief Gets ID of currently running threading in windows systems. On unix, nothing is returned. -static std::string -getCurrentThreadId(void) { - std::stringstream ss; -#if (ELPP_OS_WINDOWS) - ss << GetCurrentThreadId(); -#endif // (ELPP_OS_WINDOWS) - return ss.str(); -} -#else -/// @brief Gets ID of currently running threading using std::this_thread::get_id() -static std::string -getCurrentThreadId(void) { - std::stringstream ss; - ss << std::this_thread::get_id(); - return ss.str(); -} -#endif // !ELPP_USE_STD_THREADING -#else -static inline std::string -getCurrentThreadId(void) { - return std::string(); -} -#endif // ELPP_THREADING_ENABLED -} // namespace threading -namespace utils { -class File : base::StaticClass { - public: - /// @brief Creates new out file stream for specified filename. - /// @return Pointer to newly created fstream or nullptr - static base::type::fstream_t* - newFileStream(const std::string& filename); - - /// @brief Gets size of file provided in stream - static std::size_t - getSizeOfFile(base::type::fstream_t* fs); - - /// @brief Determines whether or not provided path exist in current file system - static bool - pathExists(const char* path, bool considerFile = false); - - /// @brief Creates specified path on file system - /// @param path Path to create. - static bool - createPath(const std::string& path); - /// @brief Extracts path of filename with leading slash - static std::string - extractPathFromFilename(const std::string& fullPath, const char* seperator = base::consts::kFilePathSeperator); - /// @brief builds stripped filename and puts it in buff - static void - buildStrippedFilename(const char* filename, char buff[], - std::size_t limit = base::consts::kSourceFilenameMaxLength); - /// @brief builds base filename and puts it in buff - static void - buildBaseFilename(const std::string& fullPath, char buff[], - std::size_t limit = base::consts::kSourceFilenameMaxLength, - const char* seperator = base::consts::kFilePathSeperator); -}; -/// @brief String utilities helper class used internally. You should not use it. -class Str : base::StaticClass { - public: - /// @brief Checks if character is digit. Dont use libc implementation of it to prevent locale issues. - static inline bool - isDigit(char c) { - return c >= '0' && c <= '9'; - } - - /// @brief Matches wildcards, '*' and '?' only supported. - static bool - wildCardMatch(const char* str, const char* pattern); - - static std::string& - ltrim(std::string& str); - static std::string& - rtrim(std::string& str); - static std::string& - trim(std::string& str); - - /// @brief Determines whether or not str starts with specified string - /// @param str String to check - /// @param start String to check against - /// @return Returns true if starts with specified string, false otherwise - static bool - startsWith(const std::string& str, const std::string& start); - - /// @brief Determines whether or not str ends with specified string - /// @param str String to check - /// @param end String to check against - /// @return Returns true if ends with specified string, false otherwise - static bool - endsWith(const std::string& str, const std::string& end); - - /// @brief Replaces all instances of replaceWhat with 'replaceWith'. Original variable is changed for performance. - /// @param [in,out] str String to replace from - /// @param replaceWhat Character to replace - /// @param replaceWith Character to replace with - /// @return Modified version of str - static std::string& - replaceAll(std::string& str, char replaceWhat, char replaceWith); - - /// @brief Replaces all instances of 'replaceWhat' with 'replaceWith'. (String version) Replaces in place - /// @param str String to replace from - /// @param replaceWhat Character to replace - /// @param replaceWith Character to replace with - /// @return Modified (original) str - static std::string& - replaceAll(std::string& str, const std::string& replaceWhat, const std::string& replaceWith); - - static void - replaceFirstWithEscape(base::type::string_t& str, const base::type::string_t& replaceWhat, - const base::type::string_t& replaceWith); -#if defined(ELPP_UNICODE) - static void - replaceFirstWithEscape(base::type::string_t& str, const base::type::string_t& replaceWhat, - const std::string& replaceWith); -#endif // defined(ELPP_UNICODE) - /// @brief Converts string to uppercase - /// @param str String to convert - /// @return Uppercase string - static std::string& - toUpper(std::string& str); - - /// @brief Compares cstring equality - uses strcmp - static bool - cStringEq(const char* s1, const char* s2); - - /// @brief Compares cstring equality (case-insensitive) - uses toupper(char) - /// Dont use strcasecmp because of CRT (VC++) - static bool - cStringCaseEq(const char* s1, const char* s2); - - /// @brief Returns true if c exist in str - static bool - contains(const char* str, char c); - - static char* - convertAndAddToBuff(std::size_t n, int len, char* buf, const char* bufLim, bool zeroPadded = true); - static char* - addToBuff(const char* str, char* buf, const char* bufLim); - static char* - clearBuff(char buff[], std::size_t lim); - - /// @brief Converst wchar* to char* - /// NOTE: Need to free return value after use! - static char* - wcharPtrToCharPtr(const wchar_t* line); -}; -/// @brief Operating System helper static class used internally. You should not use it. -class OS : base::StaticClass { - public: -#if ELPP_OS_WINDOWS - /// @brief Gets environment variables for Windows based OS. - /// We are not using getenv(const char*) because of CRT deprecation - /// @param varname Variable name to get environment variable value for - /// @return If variable exist the value of it otherwise nullptr - static const char* - getWindowsEnvironmentVariable(const char* varname); -#endif // ELPP_OS_WINDOWS -#if ELPP_OS_ANDROID - /// @brief Reads android property value - static std::string - getProperty(const char* prop); - - /// @brief Reads android device name - static std::string - getDeviceName(void); -#endif // ELPP_OS_ANDROID - - /// @brief Runs command on terminal and returns the output. - /// - /// @detail This is applicable only on unix based systems, for all other OS, an empty string is returned. - /// @param command Bash command - /// @return Result of bash output or empty string if no result found. - static const std::string - getBashOutput(const char* command); - - /// @brief Gets environment variable. This is cross-platform and CRT safe (for VC++) - /// @param variableName Environment variable name - /// @param defaultVal If no environment variable or value found the value to return by default - /// @param alternativeBashCommand If environment variable not found what would be alternative bash command - /// in order to look for value user is looking for. E.g, for 'user' alternative command will 'whoami' - static std::string - getEnvironmentVariable(const char* variableName, const char* defaultVal, - const char* alternativeBashCommand = nullptr); - /// @brief Gets current username. - static std::string - currentUser(void); - - /// @brief Gets current host name or computer name. - /// - /// @detail For android systems this is device name with its manufacturer and model seperated by hyphen - static std::string - currentHost(void); - /// @brief Whether or not terminal supports colors - static bool - termSupportsColor(void); -}; -/// @brief Contains utilities for cross-platform date/time. This class make use of el::base::utils::Str -class DateTime : base::StaticClass { - public: - /// @brief Cross platform gettimeofday for Windows and unix platform. This can be used to determine current - /// microsecond. - /// - /// @detail For unix system it uses gettimeofday(timeval*, timezone*) and for Windows, a seperate implementation is - /// provided - /// @param [in,out] tv Pointer that gets updated - static void - gettimeofday(struct timeval* tv); - - /// @brief Gets current date and time with a subsecond part. - /// @param format User provided date/time format - /// @param ssPrec A pointer to base::SubsecondPrecision from configuration (non-null) - /// @returns string based date time in specified format. - static std::string - getDateTime(const char* format, const base::SubsecondPrecision* ssPrec); - - /// @brief Converts timeval (struct from ctime) to string using specified format and subsecond precision - static std::string - timevalToString(struct timeval tval, const char* format, const el::base::SubsecondPrecision* ssPrec); - - /// @brief Formats time to get unit accordingly, units like second if > 1000 or minutes if > 60000 etc - static base::type::string_t - formatTime(unsigned long long time, base::TimestampUnit timestampUnit); - - /// @brief Gets time difference in milli/micro second depending on timestampUnit - static unsigned long long - getTimeDifference(const struct timeval& endTime, const struct timeval& startTime, - base::TimestampUnit timestampUnit); - - static struct ::tm* - buildTimeInfo(struct timeval* currTime, struct ::tm* timeInfo); - - private: - static char* - parseFormat(char* buf, std::size_t bufSz, const char* format, const struct tm* tInfo, std::size_t msec, - const base::SubsecondPrecision* ssPrec); -}; -/// @brief Command line arguments for application if specified using el::Helpers::setArgs(..) or START_EASYLOGGINGPP(..) -class CommandLineArgs { - public: - CommandLineArgs(void) { - setArgs(0, static_cast(nullptr)); - } - CommandLineArgs(int argc, const char** argv) { - setArgs(argc, argv); - } - CommandLineArgs(int argc, char** argv) { - setArgs(argc, argv); - } - virtual ~CommandLineArgs(void) { - } - /// @brief Sets arguments and parses them - inline void - setArgs(int argc, const char** argv) { - setArgs(argc, const_cast(argv)); - } - /// @brief Sets arguments and parses them - void - setArgs(int argc, char** argv); - /// @brief Returns true if arguments contain paramKey with a value (seperated by '=') - bool - hasParamWithValue(const char* paramKey) const; - /// @brief Returns value of arguments - /// @see hasParamWithValue(const char*) - const char* - getParamValue(const char* paramKey) const; - /// @brief Return true if arguments has a param (not having a value) i,e without '=' - bool - hasParam(const char* paramKey) const; - /// @brief Returns true if no params available. This exclude argv[0] - bool - empty(void) const; - /// @brief Returns total number of arguments. This exclude argv[0] - std::size_t - size(void) const; - friend base::type::ostream_t& - operator<<(base::type::ostream_t& os, const CommandLineArgs& c); - - private: - int m_argc; - char** m_argv; - std::unordered_map m_paramsWithValue; - std::vector m_params; -}; -/// @brief Abstract registry (aka repository) that provides basic interface for pointer repository specified by T_Ptr -/// type. -/// -/// @detail Most of the functions are virtual final methods but anything implementing this abstract class should -/// implement unregisterAll() and deepCopy(const AbstractRegistry&) and write registerNew() method -/// according to container and few more methods; get() to find element, unregister() to unregister single entry. Please -/// note that this is thread-unsafe and should also implement thread-safety mechanisms in implementation. -template -class AbstractRegistry : public base::threading::ThreadSafe { - public: - typedef typename Container::iterator iterator; - typedef typename Container::const_iterator const_iterator; - - /// @brief Default constructor - AbstractRegistry(void) { - } - - /// @brief Move constructor that is useful for base classes - AbstractRegistry(AbstractRegistry&& sr) { - if (this == &sr) { - return; - } - unregisterAll(); - m_list = std::move(sr.m_list); - } - - bool - operator==(const AbstractRegistry& other) { - if (size() != other.size()) { - return false; - } - for (std::size_t i = 0; i < m_list.size(); ++i) { - if (m_list.at(i) != other.m_list.at(i)) { - return false; - } - } - return true; - } - - bool - operator!=(const AbstractRegistry& other) { - if (size() != other.size()) { - return true; - } - for (std::size_t i = 0; i < m_list.size(); ++i) { - if (m_list.at(i) != other.m_list.at(i)) { - return true; - } - } - return false; - } - - /// @brief Assignment move operator - AbstractRegistry& - operator=(AbstractRegistry&& sr) { - if (this == &sr) { - return *this; - } - unregisterAll(); - m_list = std::move(sr.m_list); - return *this; - } - - virtual ~AbstractRegistry(void) { - } - - /// @return Iterator pointer from start of repository - virtual inline iterator - begin(void) ELPP_FINAL { - return m_list.begin(); - } - - /// @return Iterator pointer from end of repository - virtual inline iterator - end(void) ELPP_FINAL { - return m_list.end(); - } - - /// @return Constant iterator pointer from start of repository - virtual inline const_iterator - cbegin(void) const ELPP_FINAL { - return m_list.cbegin(); - } - - /// @return End of repository - virtual inline const_iterator - cend(void) const ELPP_FINAL { - return m_list.cend(); - } - - /// @return Whether or not repository is empty - virtual inline bool - empty(void) const ELPP_FINAL { - return m_list.empty(); - } - - /// @return Size of repository - virtual inline std::size_t - size(void) const ELPP_FINAL { - return m_list.size(); - } - - /// @brief Returns underlying container by reference - virtual inline Container& - list(void) ELPP_FINAL { - return m_list; - } - - /// @brief Returns underlying container by constant reference. - virtual inline const Container& - list(void) const ELPP_FINAL { - return m_list; - } - - /// @brief Unregisters all the pointers from current repository. - virtual void - unregisterAll(void) = 0; - - protected: - virtual void - deepCopy(const AbstractRegistry&) = 0; - void - reinitDeepCopy(const AbstractRegistry& sr) { - unregisterAll(); - deepCopy(sr); - } - - private: - Container m_list; -}; - -/// @brief A pointer registry mechanism to manage memory and provide search functionalities. (non-predicate version) -/// -/// @detail NOTE: This is thread-unsafe implementation (although it contains lock function, it does not use these -/// functions) -/// of AbstractRegistry. Any implementation of this class should be -/// explicitly (by using lock functions) -template -class Registry : public AbstractRegistry> { - public: - typedef typename Registry::iterator iterator; - typedef typename Registry::const_iterator const_iterator; - - Registry(void) { - } - - /// @brief Copy constructor that is useful for base classes. Try to avoid this constructor, use move constructor. - Registry(const Registry& sr) : AbstractRegistry>() { - if (this == &sr) { - return; - } - this->reinitDeepCopy(sr); - } - - /// @brief Assignment operator that unregisters all the existing registeries and deeply copies each of repo element - /// @see unregisterAll() - /// @see deepCopy(const AbstractRegistry&) - Registry& - operator=(const Registry& sr) { - if (this == &sr) { - return *this; - } - this->reinitDeepCopy(sr); - return *this; - } - - virtual ~Registry(void) { - unregisterAll(); - } - - protected: - virtual void - unregisterAll(void) ELPP_FINAL { - if (!this->empty()) { - for (auto&& curr : this->list()) { - base::utils::safeDelete(curr.second); - } - this->list().clear(); - } - } - - /// @brief Registers new registry to repository. - virtual void - registerNew(const T_Key& uniqKey, T_Ptr* ptr) ELPP_FINAL { - unregister(uniqKey); - this->list().insert(std::make_pair(uniqKey, ptr)); - } - - /// @brief Unregisters single entry mapped to specified unique key - void - unregister(const T_Key& uniqKey) { - T_Ptr* existing = get(uniqKey); - if (existing != nullptr) { - this->list().erase(uniqKey); - base::utils::safeDelete(existing); - } - } - - /// @brief Gets pointer from repository. If none found, nullptr is returned. - T_Ptr* - get(const T_Key& uniqKey) { - iterator it = this->list().find(uniqKey); - return it == this->list().end() ? nullptr : it->second; - } - - private: - virtual void - deepCopy(const AbstractRegistry>& sr) ELPP_FINAL { - for (const_iterator it = sr.cbegin(); it != sr.cend(); ++it) { - registerNew(it->first, new T_Ptr(*it->second)); - } - } -}; - -/// @brief A pointer registry mechanism to manage memory and provide search functionalities. (predicate version) -/// -/// @detail NOTE: This is thread-unsafe implementation of AbstractRegistry. Any implementation of this -/// class should be made thread-safe explicitly -template -class RegistryWithPred : public AbstractRegistry> { - public: - typedef typename RegistryWithPred::iterator iterator; - typedef typename RegistryWithPred::const_iterator const_iterator; - - RegistryWithPred(void) { - } - - virtual ~RegistryWithPred(void) { - unregisterAll(); - } - - /// @brief Copy constructor that is useful for base classes. Try to avoid this constructor, use move constructor. - RegistryWithPred(const RegistryWithPred& sr) : AbstractRegistry>() { - if (this == &sr) { - return; - } - this->reinitDeepCopy(sr); - } - - /// @brief Assignment operator that unregisters all the existing registeries and deeply copies each of repo element - /// @see unregisterAll() - /// @see deepCopy(const AbstractRegistry&) - RegistryWithPred& - operator=(const RegistryWithPred& sr) { - if (this == &sr) { - return *this; - } - this->reinitDeepCopy(sr); - return *this; - } - - friend base::type::ostream_t& - operator<<(base::type::ostream_t& os, const RegistryWithPred& sr) { - for (const_iterator it = sr.list().begin(); it != sr.list().end(); ++it) { - os << ELPP_LITERAL(" ") << **it << ELPP_LITERAL("\n"); - } - return os; - } - - protected: - virtual void - unregisterAll(void) ELPP_FINAL { - if (!this->empty()) { - for (auto&& curr : this->list()) { - base::utils::safeDelete(curr); - } - this->list().clear(); - } - } - - virtual void - unregister(T_Ptr*& ptr) ELPP_FINAL { - if (ptr) { - iterator iter = this->begin(); - for (; iter != this->end(); ++iter) { - if (ptr == *iter) { - break; - } - } - if (iter != this->end() && *iter != nullptr) { - this->list().erase(iter); - base::utils::safeDelete(*iter); - } - } - } - - virtual inline void - registerNew(T_Ptr* ptr) ELPP_FINAL { - this->list().push_back(ptr); - } - - /// @brief Gets pointer from repository with speicifed arguments. Arguments are passed to predicate - /// in order to validate pointer. - template - T_Ptr* - get(const T& arg1, const T2 arg2) { - iterator iter = std::find_if(this->list().begin(), this->list().end(), Pred(arg1, arg2)); - if (iter != this->list().end() && *iter != nullptr) { - return *iter; - } - return nullptr; - } - - private: - virtual void - deepCopy(const AbstractRegistry>& sr) { - for (const_iterator it = sr.list().begin(); it != sr.list().end(); ++it) { - registerNew(new T_Ptr(**it)); - } - } -}; -class Utils { - public: - template - static bool - installCallback(const std::string& id, std::unordered_map* mapT) { - if (mapT->find(id) == mapT->end()) { - mapT->insert(std::make_pair(id, TPtr(new T()))); - return true; - } - return false; - } - - template - static void - uninstallCallback(const std::string& id, std::unordered_map* mapT) { - if (mapT->find(id) != mapT->end()) { - mapT->erase(id); - } - } - - template - static T* - callback(const std::string& id, std::unordered_map* mapT) { - typename std::unordered_map::iterator iter = mapT->find(id); - if (iter != mapT->end()) { - return static_cast(iter->second.get()); - } - return nullptr; - } -}; -} // namespace utils -} // namespace base -/// @brief Base of Easylogging++ friendly class -/// -/// @detail After inheriting this class publicly, implement pure-virtual function `void log(std::ostream&) const` -class Loggable { - public: - virtual ~Loggable(void) { - } - virtual void - log(el::base::type::ostream_t&) const = 0; - - private: - friend inline el::base::type::ostream_t& - operator<<(el::base::type::ostream_t& os, const Loggable& loggable) { - loggable.log(os); - return os; - } -}; -namespace base { -/// @brief Represents log format containing flags and date format. This is used internally to start initial log -class LogFormat : public Loggable { - public: - LogFormat(void); - LogFormat(Level level, const base::type::string_t& format); - LogFormat(const LogFormat& logFormat); - LogFormat(LogFormat&& logFormat); - LogFormat& - operator=(const LogFormat& logFormat); - virtual ~LogFormat(void) { - } - bool - operator==(const LogFormat& other); - - /// @brief Updates format to be used while logging. - /// @param userFormat User provided format - void - parseFromFormat(const base::type::string_t& userFormat); - - inline Level - level(void) const { - return m_level; - } - - inline const base::type::string_t& - userFormat(void) const { - return m_userFormat; - } - - inline const base::type::string_t& - format(void) const { - return m_format; - } - - inline const std::string& - dateTimeFormat(void) const { - return m_dateTimeFormat; - } - - inline base::type::EnumType - flags(void) const { - return m_flags; - } - - inline bool - hasFlag(base::FormatFlags flag) const { - return base::utils::hasFlag(flag, m_flags); - } - - virtual void - log(el::base::type::ostream_t& os) const { - os << m_format; - } - - protected: - /// @brief Updates date time format if available in currFormat. - /// @param index Index where %datetime, %date or %time was found - /// @param [in,out] currFormat current format that is being used to format - virtual void - updateDateFormat(std::size_t index, base::type::string_t& currFormat) ELPP_FINAL; - - /// @brief Updates %level from format. This is so that we dont have to do it at log-writing-time. It uses m_format - /// and m_level - virtual void - updateFormatSpec(void) ELPP_FINAL; - - inline void - addFlag(base::FormatFlags flag) { - base::utils::addFlag(flag, &m_flags); - } - - private: - Level m_level; - base::type::string_t m_userFormat; - base::type::string_t m_format; - std::string m_dateTimeFormat; - base::type::EnumType m_flags; - std::string m_currentUser; - std::string m_currentHost; - friend class el::Logger; // To resolve loggerId format specifier easily -}; -} // namespace base -/// @brief Resolving function for format specifier -typedef std::function FormatSpecifierValueResolver; -/// @brief User-provided custom format specifier -/// @see el::Helpers::installCustomFormatSpecifier -/// @see FormatSpecifierValueResolver -class CustomFormatSpecifier { - public: - CustomFormatSpecifier(const char* formatSpecifier, const FormatSpecifierValueResolver& resolver) - : m_formatSpecifier(formatSpecifier), m_resolver(resolver) { - } - inline const char* - formatSpecifier(void) const { - return m_formatSpecifier; - } - inline const FormatSpecifierValueResolver& - resolver(void) const { - return m_resolver; - } - inline bool - operator==(const char* formatSpecifier) { - return strcmp(m_formatSpecifier, formatSpecifier) == 0; - } - - private: - const char* m_formatSpecifier; - FormatSpecifierValueResolver m_resolver; -}; -/// @brief Represents single configuration that has representing level, configuration type and a string based value. -/// -/// @detail String based value means any value either its boolean, integer or string itself, it will be embedded inside -/// quotes and will be parsed later. -/// -/// Consider some examples below: -/// * el::Configuration confEnabledInfo(el::Level::Info, el::ConfigurationType::Enabled, "true"); -/// * el::Configuration confMaxLogFileSizeInfo(el::Level::Info, el::ConfigurationType::MaxLogFileSize, "2048"); -/// * el::Configuration confFilenameInfo(el::Level::Info, el::ConfigurationType::Filename, "/var/log/my.log"); -class Configuration : public Loggable { - public: - Configuration(const Configuration& c); - Configuration& - operator=(const Configuration& c); - - virtual ~Configuration(void) { - } - - /// @brief Full constructor used to sets value of configuration - Configuration(Level level, ConfigurationType configurationType, const std::string& value); - - /// @brief Gets level of current configuration - inline Level - level(void) const { - return m_level; - } - - /// @brief Gets configuration type of current configuration - inline ConfigurationType - configurationType(void) const { - return m_configurationType; - } - - /// @brief Gets string based configuration value - inline const std::string& - value(void) const { - return m_value; - } - - /// @brief Set string based configuration value - /// @param value Value to set. Values have to be std::string; For boolean values use "true", "false", for any - /// integral values - /// use them in quotes. They will be parsed when configuring - inline void - setValue(const std::string& value) { - m_value = value; - } - - virtual void - log(el::base::type::ostream_t& os) const; - - /// @brief Used to find configuration from configuration (pointers) repository. Avoid using it. - class Predicate { - public: - Predicate(Level level, ConfigurationType configurationType); - - bool - operator()(const Configuration* conf) const; - - private: - Level m_level; - ConfigurationType m_configurationType; - }; - - private: - Level m_level; - ConfigurationType m_configurationType; - std::string m_value; -}; - -/// @brief Thread-safe Configuration repository -/// -/// @detail This repository represents configurations for all the levels and configuration type mapped to a value. -class Configurations : public base::utils::RegistryWithPred { - public: - /// @brief Default constructor with empty repository - Configurations(void); - - /// @brief Constructor used to set configurations using configuration file. - /// @param configurationFile Full path to configuration file - /// @param useDefaultsForRemaining Lets you set the remaining configurations to default. - /// @param base If provided, this configuration will be based off existing repository that this argument is pointing - /// to. - /// @see parseFromFile(const std::string&, Configurations* base) - /// @see setRemainingToDefault() - Configurations(const std::string& configurationFile, bool useDefaultsForRemaining = true, - Configurations* base = nullptr); - - virtual ~Configurations(void) { - } - - /// @brief Parses configuration from file. - /// @param configurationFile Full path to configuration file - /// @param base Configurations to base new configuration repository off. This value is used when you want to use - /// existing Configurations to base all the values and then set rest of configuration via configuration file. - /// @return True if successfully parsed, false otherwise. You may define 'ELPP_DEBUG_ASSERT_FAILURE' to make sure - /// you - /// do not proceed without successful parse. - bool - parseFromFile(const std::string& configurationFile, Configurations* base = nullptr); - - /// @brief Parse configurations from configuration string. - /// - /// @detail This configuration string has same syntax as configuration file contents. Make sure all the necessary - /// new line characters are provided. - /// @param base Configurations to base new configuration repository off. This value is used when you want to use - /// existing Configurations to base all the values and then set rest of configuration via configuration text. - /// @return True if successfully parsed, false otherwise. You may define 'ELPP_DEBUG_ASSERT_FAILURE' to make sure - /// you - /// do not proceed without successful parse. - bool - parseFromText(const std::string& configurationsString, Configurations* base = nullptr); - - /// @brief Sets configuration based-off an existing configurations. - /// @param base Pointer to existing configurations. - void - setFromBase(Configurations* base); - - /// @brief Determines whether or not specified configuration type exists in the repository. - /// - /// @detail Returns as soon as first level is found. - /// @param configurationType Type of configuration to check existence for. - bool - hasConfiguration(ConfigurationType configurationType); - - /// @brief Determines whether or not specified configuration type exists for specified level - /// @param level Level to check - /// @param configurationType Type of configuration to check existence for. - bool - hasConfiguration(Level level, ConfigurationType configurationType); - - /// @brief Sets value of configuration for specified level. - /// - /// @detail Any existing configuration for specified level will be replaced. Also note that configuration types - /// ConfigurationType::SubsecondPrecision and ConfigurationType::PerformanceTracking will be ignored if not set for - /// Level::Global because these configurations are not dependant on level. - /// @param level Level to set configuration for (el::Level). - /// @param configurationType Type of configuration (el::ConfigurationType) - /// @param value A string based value. Regardless of what the data type of configuration is, it will always be - /// string from users' point of view. This is then parsed later to be used internally. - /// @see Configuration::setValue(const std::string& value) - /// @see el::Level - /// @see el::ConfigurationType - void - set(Level level, ConfigurationType configurationType, const std::string& value); - - /// @brief Sets single configuration based on other single configuration. - /// @see set(Level level, ConfigurationType configurationType, const std::string& value) - void - set(Configuration* conf); - - inline Configuration* - get(Level level, ConfigurationType configurationType) { - base::threading::ScopedLock scopedLock(lock()); - return RegistryWithPred::get(level, configurationType); - } - - /// @brief Sets configuration for all levels. - /// @param configurationType Type of configuration - /// @param value String based value - /// @see Configurations::set(Level level, ConfigurationType configurationType, const std::string& value) - inline void - setGlobally(ConfigurationType configurationType, const std::string& value) { - setGlobally(configurationType, value, false); - } - - /// @brief Clears repository so that all the configurations are unset - inline void - clear(void) { - base::threading::ScopedLock scopedLock(lock()); - unregisterAll(); - } - - /// @brief Gets configuration file used in parsing this configurations. - /// - /// @detail If this repository was set manually or by text this returns empty string. - inline const std::string& - configurationFile(void) const { - return m_configurationFile; - } - - /// @brief Sets configurations to "factory based" configurations. - void - setToDefault(void); - - /// @brief Lets you set the remaining configurations to default. - /// - /// @detail By remaining, it means that the level/type a configuration does not exist for. - /// This function is useful when you want to minimize chances of failures, e.g, if you have a configuration file - /// that sets configuration for all the configurations except for Enabled or not, we use this so that ENABLED is set - /// to default i.e, true. If you dont do this explicitly (either by calling this function or by using second param - /// in Constructor and try to access a value, an error is thrown - void - setRemainingToDefault(void); - - /// @brief Parser used internally to parse configurations from file or text. - /// - /// @detail This class makes use of base::utils::Str. - /// You should not need this unless you are working on some tool for Easylogging++ - class Parser : base::StaticClass { - public: - /// @brief Parses configuration from file. - /// @param configurationFile Full path to configuration file - /// @param sender Sender configurations pointer. Usually 'this' is used from calling class - /// @param base Configurations to base new configuration repository off. This value is used when you want to use - /// existing Configurations to base all the values and then set rest of configuration via configuration - /// file. - /// @return True if successfully parsed, false otherwise. You may define '_STOP_ON_FIRSTELPP_ASSERTION' to make - /// sure you - /// do not proceed without successful parse. - static bool - parseFromFile(const std::string& configurationFile, Configurations* sender, Configurations* base = nullptr); - - /// @brief Parse configurations from configuration string. - /// - /// @detail This configuration string has same syntax as configuration file contents. Make sure all the - /// necessary new line characters are provided. You may define '_STOP_ON_FIRSTELPP_ASSERTION' to make sure you - /// do not proceed without successful parse (This is recommended) - /// @param configurationsString the configuration in plain text format - /// @param sender Sender configurations pointer. Usually 'this' is used from calling class - /// @param base Configurations to base new configuration repository off. This value is used when you want to use - /// existing Configurations to base all the values and then set rest of configuration via configuration - /// text. - /// @return True if successfully parsed, false otherwise. - static bool - parseFromText(const std::string& configurationsString, Configurations* sender, Configurations* base = nullptr); - - private: - friend class el::Loggers; - static void - ignoreComments(std::string* line); - static bool - isLevel(const std::string& line); - static bool - isComment(const std::string& line); - static inline bool - isConfig(const std::string& line); - static bool - parseLine(std::string* line, std::string* currConfigStr, std::string* currLevelStr, Level* currLevel, - Configurations* conf); - }; - - private: - std::string m_configurationFile; - bool m_isFromFile; - friend class el::Loggers; - - /// @brief Unsafely sets configuration if does not already exist - void - unsafeSetIfNotExist(Level level, ConfigurationType configurationType, const std::string& value); - - /// @brief Thread unsafe set - void - unsafeSet(Level level, ConfigurationType configurationType, const std::string& value); - - /// @brief Sets configurations for all levels including Level::Global if includeGlobalLevel is true - /// @see Configurations::setGlobally(ConfigurationType configurationType, const std::string& value) - void - setGlobally(ConfigurationType configurationType, const std::string& value, bool includeGlobalLevel); - - /// @brief Sets configurations (Unsafely) for all levels including Level::Global if includeGlobalLevel is true - /// @see Configurations::setGlobally(ConfigurationType configurationType, const std::string& value) - void - unsafeSetGlobally(ConfigurationType configurationType, const std::string& value, bool includeGlobalLevel); -}; - -namespace base { -typedef std::shared_ptr FileStreamPtr; -typedef std::unordered_map LogStreamsReferenceMap; -/// @brief Configurations with data types. -/// -/// @detail el::Configurations have string based values. This is whats used internally in order to read correct -/// configurations. This is to perform faster while writing logs using correct configurations. -/// -/// This is thread safe and final class containing non-virtual destructor (means nothing should inherit this class) -class TypedConfigurations : public base::threading::ThreadSafe { - public: - /// @brief Constructor to initialize (construct) the object off el::Configurations - /// @param configurations Configurations pointer/reference to base this typed configurations off. - /// @param logStreamsReference Use ELPP->registeredLoggers()->logStreamsReference() - TypedConfigurations(Configurations* configurations, base::LogStreamsReferenceMap* logStreamsReference); - - TypedConfigurations(const TypedConfigurations& other); - - virtual ~TypedConfigurations(void) { - } - - const Configurations* - configurations(void) const { - return m_configurations; - } - - bool - enabled(Level level); - bool - toFile(Level level); - const std::string& - filename(Level level); - bool - toStandardOutput(Level level); - const base::LogFormat& - logFormat(Level level); - const base::SubsecondPrecision& - subsecondPrecision(Level level = Level::Global); - const base::MillisecondsWidth& - millisecondsWidth(Level level = Level::Global); - bool - performanceTracking(Level level = Level::Global); - base::type::fstream_t* - fileStream(Level level); - std::size_t - maxLogFileSize(Level level); - std::size_t - logFlushThreshold(Level level); - - private: - Configurations* m_configurations; - std::unordered_map m_enabledMap; - std::unordered_map m_toFileMap; - std::unordered_map m_filenameMap; - std::unordered_map m_toStandardOutputMap; - std::unordered_map m_logFormatMap; - std::unordered_map m_subsecondPrecisionMap; - std::unordered_map m_performanceTrackingMap; - std::unordered_map m_fileStreamMap; - std::unordered_map m_maxLogFileSizeMap; - std::unordered_map m_logFlushThresholdMap; - base::LogStreamsReferenceMap* m_logStreamsReference; - - friend class el::Helpers; - friend class el::base::MessageBuilder; - friend class el::base::Writer; - friend class el::base::DefaultLogDispatchCallback; - friend class el::base::LogDispatcher; - - template - inline Conf_T - getConfigByVal(Level level, const std::unordered_map* confMap, const char* confName) { - base::threading::ScopedLock scopedLock(lock()); - return unsafeGetConfigByVal(level, confMap, confName); // This is not unsafe anymore - mutex locked in scope - } - - template - inline Conf_T& - getConfigByRef(Level level, std::unordered_map* confMap, const char* confName) { - base::threading::ScopedLock scopedLock(lock()); - return unsafeGetConfigByRef(level, confMap, confName); // This is not unsafe anymore - mutex locked in scope - } - - template - Conf_T - unsafeGetConfigByVal(Level level, const std::unordered_map* confMap, const char* confName) { - ELPP_UNUSED(confName); - typename std::unordered_map::const_iterator it = confMap->find(level); - if (it == confMap->end()) { - try { - return confMap->at(Level::Global); - } catch (...) { - ELPP_INTERNAL_ERROR("Unable to get configuration [" - << confName << "] for level [" << LevelHelper::convertToString(level) << "]" - << std::endl - << "Please ensure you have properly configured logger.", - false); - return Conf_T(); - } - } - return it->second; - } - - template - Conf_T& - unsafeGetConfigByRef(Level level, std::unordered_map* confMap, const char* confName) { - ELPP_UNUSED(confName); - typename std::unordered_map::iterator it = confMap->find(level); - if (it == confMap->end()) { - try { - return confMap->at(Level::Global); - } catch (...) { - ELPP_INTERNAL_ERROR("Unable to get configuration [" - << confName << "] for level [" << LevelHelper::convertToString(level) << "]" - << std::endl - << "Please ensure you have properly configured logger.", - false); - } - } - return it->second; - } - - template - void - setValue(Level level, const Conf_T& value, std::unordered_map* confMap, - bool includeGlobalLevel = true) { - // If map is empty and we are allowed to add into generic level (Level::Global), do it! - if (confMap->empty() && includeGlobalLevel) { - confMap->insert(std::make_pair(Level::Global, value)); - return; - } - // If same value exist in generic level already, dont add it to explicit level - typename std::unordered_map::iterator it = confMap->find(Level::Global); - if (it != confMap->end() && it->second == value) { - return; - } - // Now make sure we dont double up values if we really need to add it to explicit level - it = confMap->find(level); - if (it == confMap->end()) { - // Value not found for level, add new - confMap->insert(std::make_pair(level, value)); - } else { - // Value found, just update value - confMap->at(level) = value; - } - } - - void - build(Configurations* configurations); - unsigned long - getULong(std::string confVal); - std::string - resolveFilename(const std::string& filename); - void - insertFile(Level level, const std::string& fullFilename); - bool - unsafeValidateFileRolling(Level level, const PreRollOutCallback& preRollOutCallback); - - inline bool - validateFileRolling(Level level, const PreRollOutCallback& preRollOutCallback) { - base::threading::ScopedLock scopedLock(lock()); - return unsafeValidateFileRolling(level, preRollOutCallback); - } -}; -/// @brief Class that keeps record of current line hit for occasional logging -class HitCounter { - public: - HitCounter(void) : m_filename(""), m_lineNumber(0), m_hitCounts(0) { - } - - HitCounter(const char* filename, base::type::LineNumber lineNumber) - : m_filename(filename), m_lineNumber(lineNumber), m_hitCounts(0) { - } - - HitCounter(const HitCounter& hitCounter) - : m_filename(hitCounter.m_filename), - m_lineNumber(hitCounter.m_lineNumber), - m_hitCounts(hitCounter.m_hitCounts) { - } - - HitCounter& - operator=(const HitCounter& hitCounter) { - if (&hitCounter != this) { - m_filename = hitCounter.m_filename; - m_lineNumber = hitCounter.m_lineNumber; - m_hitCounts = hitCounter.m_hitCounts; - } - return *this; - } - - virtual ~HitCounter(void) { - } - - /// @brief Resets location of current hit counter - inline void - resetLocation(const char* filename, base::type::LineNumber lineNumber) { - m_filename = filename; - m_lineNumber = lineNumber; - } - - /// @brief Validates hit counts and resets it if necessary - inline void - validateHitCounts(std::size_t n) { - if (m_hitCounts >= base::consts::kMaxLogPerCounter) { - m_hitCounts = (n >= 1 ? base::consts::kMaxLogPerCounter % n : 0); - } - ++m_hitCounts; - } - - inline const char* - filename(void) const { - return m_filename; - } - - inline base::type::LineNumber - lineNumber(void) const { - return m_lineNumber; - } - - inline std::size_t - hitCounts(void) const { - return m_hitCounts; - } - - inline void - increment(void) { - ++m_hitCounts; - } - - class Predicate { - public: - Predicate(const char* filename, base::type::LineNumber lineNumber) - : m_filename(filename), m_lineNumber(lineNumber) { - } - inline bool - operator()(const HitCounter* counter) { - return ((counter != nullptr) && (strcmp(counter->m_filename, m_filename) == 0) && - (counter->m_lineNumber == m_lineNumber)); - } - - private: - const char* m_filename; - base::type::LineNumber m_lineNumber; - }; - - private: - const char* m_filename; - base::type::LineNumber m_lineNumber; - std::size_t m_hitCounts; -}; -/// @brief Repository for hit counters used across the application -class RegisteredHitCounters : public base::utils::RegistryWithPred { - public: - /// @brief Validates counter for every N, i.e, registers new if does not exist otherwise updates original one - /// @return True if validation resulted in triggering hit. Meaning logs should be written everytime true is returned - bool - validateEveryN(const char* filename, base::type::LineNumber lineNumber, std::size_t n); - - /// @brief Validates counter for hits >= N, i.e, registers new if does not exist otherwise updates original one - /// @return True if validation resulted in triggering hit. Meaning logs should be written everytime true is returned - bool - validateAfterN(const char* filename, base::type::LineNumber lineNumber, std::size_t n); - - /// @brief Validates counter for hits are <= n, i.e, registers new if does not exist otherwise updates original one - /// @return True if validation resulted in triggering hit. Meaning logs should be written everytime true is returned - bool - validateNTimes(const char* filename, base::type::LineNumber lineNumber, std::size_t n); - - /// @brief Gets hit counter registered at specified position - inline const base::HitCounter* - getCounter(const char* filename, base::type::LineNumber lineNumber) { - base::threading::ScopedLock scopedLock(lock()); - return get(filename, lineNumber); - } -}; -/// @brief Action to be taken for dispatching -enum class DispatchAction : base::type::EnumType { None = 1, NormalLog = 2, SysLog = 4 }; -} // namespace base -template -class Callback : protected base::threading::ThreadSafe { - public: - Callback(void) : m_enabled(true) { - } - inline bool - enabled(void) const { - return m_enabled; - } - inline void - setEnabled(bool enabled) { - base::threading::ScopedLock scopedLock(lock()); - m_enabled = enabled; - } - - protected: - virtual void - handle(const T* handlePtr) = 0; - - private: - bool m_enabled; -}; -class LogDispatchData { - public: - LogDispatchData() : m_logMessage(nullptr), m_dispatchAction(base::DispatchAction::None) { - } - inline const LogMessage* - logMessage(void) const { - return m_logMessage; - } - inline base::DispatchAction - dispatchAction(void) const { - return m_dispatchAction; - } - inline void - setLogMessage(LogMessage* logMessage) { - m_logMessage = logMessage; - } - inline void - setDispatchAction(base::DispatchAction dispatchAction) { - m_dispatchAction = dispatchAction; - } - - private: - LogMessage* m_logMessage; - base::DispatchAction m_dispatchAction; - friend class base::LogDispatcher; -}; -class LogDispatchCallback : public Callback { - protected: - virtual void - handle(const LogDispatchData* data); - base::threading::Mutex& - fileHandle(const LogDispatchData* data); - - private: - friend class base::LogDispatcher; - std::unordered_map> m_fileLocks; - base::threading::Mutex m_fileLocksMapLock; -}; -class PerformanceTrackingCallback : public Callback { - private: - friend class base::PerformanceTracker; -}; -class LoggerRegistrationCallback : public Callback { - private: - friend class base::RegisteredLoggers; -}; -class LogBuilder : base::NoCopy { - public: - LogBuilder() : m_termSupportsColor(base::utils::OS::termSupportsColor()) { - } - virtual ~LogBuilder(void) { - ELPP_INTERNAL_INFO(3, "Destroying log builder...") - } - virtual base::type::string_t - build(const LogMessage* logMessage, bool appendNewLine) const = 0; - void - convertToColoredOutput(base::type::string_t* logLine, Level level); - - private: - bool m_termSupportsColor; - friend class el::base::DefaultLogDispatchCallback; -}; -typedef std::shared_ptr LogBuilderPtr; -/// @brief Represents a logger holding ID and configurations we need to write logs -/// -/// @detail This class does not write logs itself instead its used by writer to read configuations from. -class Logger : public base::threading::ThreadSafe, public Loggable { - public: - Logger(const std::string& id, base::LogStreamsReferenceMap* logStreamsReference); - Logger(const std::string& id, const Configurations& configurations, - base::LogStreamsReferenceMap* logStreamsReference); - Logger(const Logger& logger); - Logger& - operator=(const Logger& logger); - - virtual ~Logger(void) { - base::utils::safeDelete(m_typedConfigurations); - } - - virtual inline void - log(el::base::type::ostream_t& os) const { - os << m_id.c_str(); - } - - /// @brief Configures the logger using specified configurations. - void - configure(const Configurations& configurations); - - /// @brief Reconfigures logger using existing configurations - void - reconfigure(void); - - inline const std::string& - id(void) const { - return m_id; - } - - inline const std::string& - parentApplicationName(void) const { - return m_parentApplicationName; - } - - inline void - setParentApplicationName(const std::string& parentApplicationName) { - m_parentApplicationName = parentApplicationName; - } - - inline Configurations* - configurations(void) { - return &m_configurations; - } - - inline base::TypedConfigurations* - typedConfigurations(void) { - return m_typedConfigurations; - } - - static bool - isValidId(const std::string& id); - - /// @brief Flushes logger to sync all log files for all levels - void - flush(void); - - void - flush(Level level, base::type::fstream_t* fs); - - inline bool - isFlushNeeded(Level level) { - return ++m_unflushedCount.find(level)->second >= m_typedConfigurations->logFlushThreshold(level); - } - - inline LogBuilder* - logBuilder(void) const { - return m_logBuilder.get(); - } - - inline void - setLogBuilder(const LogBuilderPtr& logBuilder) { - m_logBuilder = logBuilder; - } - - inline bool - enabled(Level level) const { - return m_typedConfigurations->enabled(level); - } - -#if ELPP_VARIADIC_TEMPLATES_SUPPORTED -#define LOGGER_LEVEL_WRITERS_SIGNATURES(FUNCTION_NAME) \ - template \ - inline void FUNCTION_NAME(const char*, const T&, const Args&...); \ - template \ - inline void FUNCTION_NAME(const T&); - - template - inline void - verbose(int, const char*, const T&, const Args&...); - - template - inline void - verbose(int, const T&); - - LOGGER_LEVEL_WRITERS_SIGNATURES(info) - LOGGER_LEVEL_WRITERS_SIGNATURES(debug) - LOGGER_LEVEL_WRITERS_SIGNATURES(warn) - LOGGER_LEVEL_WRITERS_SIGNATURES(error) - LOGGER_LEVEL_WRITERS_SIGNATURES(fatal) - LOGGER_LEVEL_WRITERS_SIGNATURES(trace) -#undef LOGGER_LEVEL_WRITERS_SIGNATURES -#endif // ELPP_VARIADIC_TEMPLATES_SUPPORTED - private: - std::string m_id; - base::TypedConfigurations* m_typedConfigurations; - base::type::stringstream_t m_stream; - std::string m_parentApplicationName; - bool m_isConfigured; - Configurations m_configurations; - std::unordered_map m_unflushedCount; - base::LogStreamsReferenceMap* m_logStreamsReference; - LogBuilderPtr m_logBuilder; - - friend class el::LogMessage; - friend class el::Loggers; - friend class el::Helpers; - friend class el::base::RegisteredLoggers; - friend class el::base::DefaultLogDispatchCallback; - friend class el::base::MessageBuilder; - friend class el::base::Writer; - friend class el::base::PErrorWriter; - friend class el::base::Storage; - friend class el::base::PerformanceTracker; - friend class el::base::LogDispatcher; - - Logger(void); - -#if ELPP_VARIADIC_TEMPLATES_SUPPORTED - template - void - log_(Level, int, const char*, const T&, const Args&...); - - template - inline void - log_(Level, int, const T&); - - template - void - log(Level, const char*, const T&, const Args&...); - - template - inline void - log(Level, const T&); -#endif // ELPP_VARIADIC_TEMPLATES_SUPPORTED - - void - initUnflushedCount(void); - - inline base::type::stringstream_t& - stream(void) { - return m_stream; - } - - void - resolveLoggerFormatSpec(void) const; -}; -namespace base { -/// @brief Loggers repository -class RegisteredLoggers : public base::utils::Registry { - public: - explicit RegisteredLoggers(const LogBuilderPtr& defaultLogBuilder); - - virtual ~RegisteredLoggers(void) { - unsafeFlushAll(); - } - - inline void - setDefaultConfigurations(const Configurations& configurations) { - base::threading::ScopedLock scopedLock(lock()); - m_defaultConfigurations.setFromBase(const_cast(&configurations)); - } - - inline Configurations* - defaultConfigurations(void) { - return &m_defaultConfigurations; - } - - Logger* - get(const std::string& id, bool forceCreation = true); - - template - inline bool - installLoggerRegistrationCallback(const std::string& id) { - return base::utils::Utils::installCallback( - id, &m_loggerRegistrationCallbacks); - } - - template - inline void - uninstallLoggerRegistrationCallback(const std::string& id) { - base::utils::Utils::uninstallCallback( - id, &m_loggerRegistrationCallbacks); - } - - template - inline T* - loggerRegistrationCallback(const std::string& id) { - return base::utils::Utils::callback( - id, &m_loggerRegistrationCallbacks); - } - - bool - remove(const std::string& id); - - inline bool - has(const std::string& id) { - return get(id, false) != nullptr; - } - - inline void - unregister(Logger*& logger) { - base::threading::ScopedLock scopedLock(lock()); - base::utils::Registry::unregister(logger->id()); - } - - inline base::LogStreamsReferenceMap* - logStreamsReference(void) { - return &m_logStreamsReference; - } - - inline void - flushAll(void) { - base::threading::ScopedLock scopedLock(lock()); - unsafeFlushAll(); - } - - inline void - setDefaultLogBuilder(LogBuilderPtr& logBuilderPtr) { - base::threading::ScopedLock scopedLock(lock()); - m_defaultLogBuilder = logBuilderPtr; - } - - private: - LogBuilderPtr m_defaultLogBuilder; - Configurations m_defaultConfigurations; - base::LogStreamsReferenceMap m_logStreamsReference; - std::unordered_map m_loggerRegistrationCallbacks; - friend class el::base::Storage; - - void - unsafeFlushAll(void); -}; -/// @brief Represents registries for verbose logging -class VRegistry : base::NoCopy, public base::threading::ThreadSafe { - public: - explicit VRegistry(base::type::VerboseLevel level, base::type::EnumType* pFlags); - - /// @brief Sets verbose level. Accepted range is 0-9 - void - setLevel(base::type::VerboseLevel level); - - inline base::type::VerboseLevel - level(void) const { - return m_level; - } - - inline void - clearModules(void) { - base::threading::ScopedLock scopedLock(lock()); - m_modules.clear(); - } - - void - setModules(const char* modules); - - bool - allowed(base::type::VerboseLevel vlevel, const char* file); - - inline const std::unordered_map& - modules(void) const { - return m_modules; - } - - void - setFromArgs(const base::utils::CommandLineArgs* commandLineArgs); - - /// @brief Whether or not vModules enabled - inline bool - vModulesEnabled(void) { - return !base::utils::hasFlag(LoggingFlag::DisableVModules, *m_pFlags); - } - - private: - base::type::VerboseLevel m_level; - base::type::EnumType* m_pFlags; - std::unordered_map m_modules; -}; -} // namespace base -class LogMessage { - public: - LogMessage(Level level, const std::string& file, base::type::LineNumber line, const std::string& func, - base::type::VerboseLevel verboseLevel, Logger* logger) - : m_level(level), - m_file(file), - m_line(line), - m_func(func), - m_verboseLevel(verboseLevel), - m_logger(logger), - m_message(logger->stream().str()) { - } - inline Level - level(void) const { - return m_level; - } - inline const std::string& - file(void) const { - return m_file; - } - inline base::type::LineNumber - line(void) const { - return m_line; - } - inline const std::string& - func(void) const { - return m_func; - } - inline base::type::VerboseLevel - verboseLevel(void) const { - return m_verboseLevel; - } - inline Logger* - logger(void) const { - return m_logger; - } - inline const base::type::string_t& - message(void) const { - return m_message; - } - - private: - Level m_level; - std::string m_file; - base::type::LineNumber m_line; - std::string m_func; - base::type::VerboseLevel m_verboseLevel; - Logger* m_logger; - base::type::string_t m_message; -}; -namespace base { -#if ELPP_ASYNC_LOGGING -class AsyncLogItem { - public: - explicit AsyncLogItem(const LogMessage& logMessage, const LogDispatchData& data, - const base::type::string_t& logLine) - : m_logMessage(logMessage), m_dispatchData(data), m_logLine(logLine) { - } - virtual ~AsyncLogItem() { - } - inline LogMessage* - logMessage(void) { - return &m_logMessage; - } - inline LogDispatchData* - data(void) { - return &m_dispatchData; - } - inline base::type::string_t - logLine(void) { - return m_logLine; - } - - private: - LogMessage m_logMessage; - LogDispatchData m_dispatchData; - base::type::string_t m_logLine; -}; -class AsyncLogQueue : public base::threading::ThreadSafe { - public: - virtual ~AsyncLogQueue() { - ELPP_INTERNAL_INFO(6, "~AsyncLogQueue"); - } - - inline AsyncLogItem - next(void) { - base::threading::ScopedLock scopedLock(lock()); - AsyncLogItem result = m_queue.front(); - m_queue.pop(); - return result; - } - - inline void - push(const AsyncLogItem& item) { - base::threading::ScopedLock scopedLock(lock()); - m_queue.push(item); - } - inline void - pop(void) { - base::threading::ScopedLock scopedLock(lock()); - m_queue.pop(); - } - inline AsyncLogItem - front(void) { - base::threading::ScopedLock scopedLock(lock()); - return m_queue.front(); - } - inline bool - empty(void) { - base::threading::ScopedLock scopedLock(lock()); - return m_queue.empty(); - } - - private: - std::queue m_queue; -}; -class IWorker { - public: - virtual ~IWorker() { - } - virtual void - start() = 0; -}; -#endif // ELPP_ASYNC_LOGGING -/// @brief Easylogging++ management storage -class Storage : base::NoCopy, public base::threading::ThreadSafe { - public: -#if ELPP_ASYNC_LOGGING - Storage(const LogBuilderPtr& defaultLogBuilder, base::IWorker* asyncDispatchWorker); -#else - explicit Storage(const LogBuilderPtr& defaultLogBuilder); -#endif // ELPP_ASYNC_LOGGING - - virtual ~Storage(void); - - inline bool - validateEveryNCounter(const char* filename, base::type::LineNumber lineNumber, std::size_t occasion) { - return hitCounters()->validateEveryN(filename, lineNumber, occasion); - } - - inline bool - validateAfterNCounter(const char* filename, base::type::LineNumber lineNumber, std::size_t n) { - return hitCounters()->validateAfterN(filename, lineNumber, n); - } - - inline bool - validateNTimesCounter(const char* filename, base::type::LineNumber lineNumber, std::size_t n) { - return hitCounters()->validateNTimes(filename, lineNumber, n); - } - - inline base::RegisteredHitCounters* - hitCounters(void) const { - return m_registeredHitCounters; - } - - inline base::RegisteredLoggers* - registeredLoggers(void) const { - return m_registeredLoggers; - } - - inline base::VRegistry* - vRegistry(void) const { - return m_vRegistry; - } - -#if ELPP_ASYNC_LOGGING - inline base::AsyncLogQueue* - asyncLogQueue(void) const { - return m_asyncLogQueue; - } -#endif // ELPP_ASYNC_LOGGING - - inline const base::utils::CommandLineArgs* - commandLineArgs(void) const { - return &m_commandLineArgs; - } - - inline void - addFlag(LoggingFlag flag) { - base::utils::addFlag(flag, &m_flags); - } - - inline void - removeFlag(LoggingFlag flag) { - base::utils::removeFlag(flag, &m_flags); - } - - inline bool - hasFlag(LoggingFlag flag) const { - return base::utils::hasFlag(flag, m_flags); - } - - inline base::type::EnumType - flags(void) const { - return m_flags; - } - - inline void - setFlags(base::type::EnumType flags) { - m_flags = flags; - } - - inline void - setPreRollOutCallback(const PreRollOutCallback& callback) { - m_preRollOutCallback = callback; - } - - inline void - unsetPreRollOutCallback(void) { - m_preRollOutCallback = base::defaultPreRollOutCallback; - } - - inline PreRollOutCallback& - preRollOutCallback(void) { - return m_preRollOutCallback; - } - - bool - hasCustomFormatSpecifier(const char* formatSpecifier); - void - installCustomFormatSpecifier(const CustomFormatSpecifier& customFormatSpecifier); - bool - uninstallCustomFormatSpecifier(const char* formatSpecifier); - - const std::vector* - customFormatSpecifiers(void) const { - return &m_customFormatSpecifiers; - } - - base::threading::Mutex& - customFormatSpecifiersLock() { - return m_customFormatSpecifiersLock; - } - - inline void - setLoggingLevel(Level level) { - m_loggingLevel = level; - } - - template - inline bool - installLogDispatchCallback(const std::string& id) { - return base::utils::Utils::installCallback(id, &m_logDispatchCallbacks); - } - - template - inline void - uninstallLogDispatchCallback(const std::string& id) { - base::utils::Utils::uninstallCallback(id, &m_logDispatchCallbacks); - } - template - inline T* - logDispatchCallback(const std::string& id) { - return base::utils::Utils::callback(id, &m_logDispatchCallbacks); - } - -#if defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_PERFORMANCE_TRACKING) - template - inline bool - installPerformanceTrackingCallback(const std::string& id) { - return base::utils::Utils::installCallback( - id, &m_performanceTrackingCallbacks); - } - - template - inline void - uninstallPerformanceTrackingCallback(const std::string& id) { - base::utils::Utils::uninstallCallback( - id, &m_performanceTrackingCallbacks); - } - - template - inline T* - performanceTrackingCallback(const std::string& id) { - return base::utils::Utils::callback( - id, &m_performanceTrackingCallbacks); - } -#endif // defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_PERFORMANCE_TRACKING) - - /// @brief Sets thread name for current thread. Requires std::thread - inline void - setThreadName(const std::string& name) { - if (name.empty()) - return; - base::threading::ScopedLock scopedLock(m_threadNamesLock); - m_threadNames[base::threading::getCurrentThreadId()] = name; - } - - inline std::string - getThreadName(const std::string& threadId) { - base::threading::ScopedLock scopedLock(m_threadNamesLock); - std::unordered_map::const_iterator it = m_threadNames.find(threadId); - if (it == m_threadNames.end()) { - return threadId; - } - return it->second; - } - - private: - base::RegisteredHitCounters* m_registeredHitCounters; - base::RegisteredLoggers* m_registeredLoggers; - base::type::EnumType m_flags; - base::VRegistry* m_vRegistry; -#if ELPP_ASYNC_LOGGING - base::AsyncLogQueue* m_asyncLogQueue; - base::IWorker* m_asyncDispatchWorker; -#endif // ELPP_ASYNC_LOGGING - base::utils::CommandLineArgs m_commandLineArgs; - PreRollOutCallback m_preRollOutCallback; - std::unordered_map m_logDispatchCallbacks; - std::unordered_map m_performanceTrackingCallbacks; - std::unordered_map m_threadNames; - std::vector m_customFormatSpecifiers; - base::threading::Mutex m_customFormatSpecifiersLock; - base::threading::Mutex m_threadNamesLock; - Level m_loggingLevel; - - friend class el::Helpers; - friend class el::base::DefaultLogDispatchCallback; - friend class el::LogBuilder; - friend class el::base::MessageBuilder; - friend class el::base::Writer; - friend class el::base::PerformanceTracker; - friend class el::base::LogDispatcher; - - void - setApplicationArguments(int argc, char** argv); - - inline void - setApplicationArguments(int argc, const char** argv) { - setApplicationArguments(argc, const_cast(argv)); - } -}; -extern ELPP_EXPORT base::type::StoragePointer elStorage; -#define ELPP el::base::elStorage -class DefaultLogDispatchCallback : public LogDispatchCallback { - protected: - void - handle(const LogDispatchData* data); - - private: - const LogDispatchData* m_data; - void - dispatch(base::type::string_t&& logLine); -}; -#if ELPP_ASYNC_LOGGING -class AsyncLogDispatchCallback : public LogDispatchCallback { - protected: - void - handle(const LogDispatchData* data); -}; -class AsyncDispatchWorker : public base::IWorker, public base::threading::ThreadSafe { - public: - AsyncDispatchWorker(); - virtual ~AsyncDispatchWorker(); - - bool - clean(void); - void - emptyQueue(void); - virtual void - start(void); - void - handle(AsyncLogItem* logItem); - void - run(void); - - void - setContinueRunning(bool value) { - base::threading::ScopedLock scopedLock(m_continueRunningLock); - m_continueRunning = value; - } - - bool - continueRunning(void) const { - return m_continueRunning; - } - - private: - std::condition_variable cv; - bool m_continueRunning; - base::threading::Mutex m_continueRunningLock; -}; -#endif // ELPP_ASYNC_LOGGING -} // namespace base -namespace base { -class DefaultLogBuilder : public LogBuilder { - public: - base::type::string_t - build(const LogMessage* logMessage, bool appendNewLine) const; -}; -/// @brief Dispatches log messages -class LogDispatcher : base::NoCopy { - public: - LogDispatcher(bool proceed, LogMessage* logMessage, base::DispatchAction dispatchAction) - : m_proceed(proceed), m_logMessage(logMessage), m_dispatchAction(std::move(dispatchAction)) { - } - - void - dispatch(void); - - private: - bool m_proceed; - LogMessage* m_logMessage; - base::DispatchAction m_dispatchAction; -}; -#if defined(ELPP_STL_LOGGING) -/// @brief Workarounds to write some STL logs -/// -/// @detail There is workaround needed to loop through some stl containers. In order to do that, we need iterable -/// containers of same type and provide iterator interface and pass it on to writeIterator(). Remember, this is passed -/// by value in constructor so that we dont change original containers. This operation is as expensive as -/// Big-O(std::min(class_.size(), base::consts::kMaxLogPerContainer)) -namespace workarounds { -/// @brief Abstract IterableContainer template that provides interface for iterable classes of type T -template -class IterableContainer { - public: - typedef typename Container::iterator iterator; - typedef typename Container::const_iterator const_iterator; - IterableContainer(void) { - } - virtual ~IterableContainer(void) { - } - iterator - begin(void) { - return getContainer().begin(); - } - iterator - end(void) { - return getContainer().end(); - } - - private: - virtual Container& - getContainer(void) = 0; -}; -/// @brief Implements IterableContainer and provides iterable std::priority_queue class -template , - typename Comparator = std::less> -class IterablePriorityQueue : public IterableContainer, - public std::priority_queue { - public: - IterablePriorityQueue(std::priority_queue queue_) { - std::size_t count_ = 0; - while (++count_ < base::consts::kMaxLogPerContainer && !queue_.empty()) { - this->push(queue_.top()); - queue_.pop(); - } - } - - private: - inline Container& - getContainer(void) { - return this->c; - } -}; -/// @brief Implements IterableContainer and provides iterable std::queue class -template > -class IterableQueue : public IterableContainer, public std::queue { - public: - IterableQueue(std::queue queue_) { - std::size_t count_ = 0; - while (++count_ < base::consts::kMaxLogPerContainer && !queue_.empty()) { - this->push(queue_.front()); - queue_.pop(); - } - } - - private: - inline Container& - getContainer(void) { - return this->c; - } -}; -/// @brief Implements IterableContainer and provides iterable std::stack class -template > -class IterableStack : public IterableContainer, public std::stack { - public: - IterableStack(std::stack stack_) { - std::size_t count_ = 0; - while (++count_ < base::consts::kMaxLogPerContainer && !stack_.empty()) { - this->push(stack_.top()); - stack_.pop(); - } - } - - private: - inline Container& - getContainer(void) { - return this->c; - } -}; -} // namespace workarounds -#endif // defined(ELPP_STL_LOGGING) -// Log message builder -class MessageBuilder { - public: - MessageBuilder(void) : m_logger(nullptr), m_containerLogSeperator(ELPP_LITERAL("")) { - } - void - initialize(Logger* logger); - -#define ELPP_SIMPLE_LOG(LOG_TYPE) \ - MessageBuilder& operator<<(LOG_TYPE msg) { \ - m_logger->stream() << msg; \ - if (ELPP->hasFlag(LoggingFlag::AutoSpacing)) { \ - m_logger->stream() << " "; \ - } \ - return *this; \ - } - - inline MessageBuilder& - operator<<(const std::string& msg) { - return operator<<(msg.c_str()); - } - ELPP_SIMPLE_LOG(char) - ELPP_SIMPLE_LOG(bool) - ELPP_SIMPLE_LOG(signed short) - ELPP_SIMPLE_LOG(unsigned short) - ELPP_SIMPLE_LOG(signed int) - ELPP_SIMPLE_LOG(unsigned int) - ELPP_SIMPLE_LOG(signed long) - ELPP_SIMPLE_LOG(unsigned long) - ELPP_SIMPLE_LOG(float) - ELPP_SIMPLE_LOG(double) - ELPP_SIMPLE_LOG(char*) - ELPP_SIMPLE_LOG(const char*) - ELPP_SIMPLE_LOG(const void*) - ELPP_SIMPLE_LOG(long double) - inline MessageBuilder& - operator<<(const std::wstring& msg) { - return operator<<(msg.c_str()); - } - MessageBuilder& - operator<<(const wchar_t* msg); - // ostream manipulators - inline MessageBuilder& - operator<<(std::ostream& (*OStreamMani)(std::ostream&)) { - m_logger->stream() << OStreamMani; - return *this; - } -#define ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(temp) \ - template \ - inline MessageBuilder& operator<<(const temp& template_inst) { \ - return writeIterator(template_inst.begin(), template_inst.end(), template_inst.size()); \ - } -#define ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(temp) \ - template \ - inline MessageBuilder& operator<<(const temp& template_inst) { \ - return writeIterator(template_inst.begin(), template_inst.end(), template_inst.size()); \ - } -#define ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG(temp) \ - template \ - inline MessageBuilder& operator<<(const temp& template_inst) { \ - return writeIterator(template_inst.begin(), template_inst.end(), template_inst.size()); \ - } -#define ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(temp) \ - template \ - inline MessageBuilder& operator<<(const temp& template_inst) { \ - return writeIterator(template_inst.begin(), template_inst.end(), template_inst.size()); \ - } -#define ELPP_ITERATOR_CONTAINER_LOG_FIVE_ARG(temp) \ - template \ - inline MessageBuilder& operator<<(const temp& template_inst) { \ - return writeIterator(template_inst.begin(), template_inst.end(), template_inst.size()); \ - } - -#if defined(ELPP_STL_LOGGING) - ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(std::vector) - ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(std::list) - ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(std::deque) - ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG(std::set) - ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG(std::multiset) - ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(std::map) - ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(std::multimap) - template - inline MessageBuilder& - operator<<(const std::queue& queue_) { - base::workarounds::IterableQueue iterableQueue_ = - static_cast>(queue_); - return writeIterator(iterableQueue_.begin(), iterableQueue_.end(), iterableQueue_.size()); - } - template - inline MessageBuilder& - operator<<(const std::stack& stack_) { - base::workarounds::IterableStack iterableStack_ = - static_cast>(stack_); - return writeIterator(iterableStack_.begin(), iterableStack_.end(), iterableStack_.size()); - } - template - inline MessageBuilder& - operator<<(const std::priority_queue& priorityQueue_) { - base::workarounds::IterablePriorityQueue iterablePriorityQueue_ = - static_cast>(priorityQueue_); - return writeIterator(iterablePriorityQueue_.begin(), iterablePriorityQueue_.end(), - iterablePriorityQueue_.size()); - } - template - MessageBuilder& - operator<<(const std::pair& pair_) { - m_logger->stream() << ELPP_LITERAL("("); - operator<<(static_cast(pair_.first)); - m_logger->stream() << ELPP_LITERAL(", "); - operator<<(static_cast(pair_.second)); - m_logger->stream() << ELPP_LITERAL(")"); - return *this; - } - template - MessageBuilder& - operator<<(const std::bitset& bitset_) { - m_logger->stream() << ELPP_LITERAL("["); - operator<<(bitset_.to_string()); - m_logger->stream() << ELPP_LITERAL("]"); - return *this; - } -#if defined(ELPP_LOG_STD_ARRAY) - template - inline MessageBuilder& - operator<<(const std::array& array) { - return writeIterator(array.begin(), array.end(), array.size()); - } -#endif // defined(ELPP_LOG_STD_ARRAY) -#if defined(ELPP_LOG_UNORDERED_MAP) - ELPP_ITERATOR_CONTAINER_LOG_FIVE_ARG(std::unordered_map) - ELPP_ITERATOR_CONTAINER_LOG_FIVE_ARG(std::unordered_multimap) -#endif // defined(ELPP_LOG_UNORDERED_MAP) -#if defined(ELPP_LOG_UNORDERED_SET) - ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(std::unordered_set) - ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(std::unordered_multiset) -#endif // defined(ELPP_LOG_UNORDERED_SET) -#endif // defined(ELPP_STL_LOGGING) -#if defined(ELPP_QT_LOGGING) - inline MessageBuilder& - operator<<(const QString& msg) { -#if defined(ELPP_UNICODE) - m_logger->stream() << msg.toStdWString(); -#else - m_logger->stream() << msg.toStdString(); -#endif // defined(ELPP_UNICODE) - return *this; - } - inline MessageBuilder& - operator<<(const QByteArray& msg) { - return operator<<(QString(msg)); - } - inline MessageBuilder& - operator<<(const QStringRef& msg) { - return operator<<(msg.toString()); - } - inline MessageBuilder& - operator<<(qint64 msg) { -#if defined(ELPP_UNICODE) - m_logger->stream() << QString::number(msg).toStdWString(); -#else - m_logger->stream() << QString::number(msg).toStdString(); -#endif // defined(ELPP_UNICODE) - return *this; - } - inline MessageBuilder& - operator<<(quint64 msg) { -#if defined(ELPP_UNICODE) - m_logger->stream() << QString::number(msg).toStdWString(); -#else - m_logger->stream() << QString::number(msg).toStdString(); -#endif // defined(ELPP_UNICODE) - return *this; - } - inline MessageBuilder& - operator<<(QChar msg) { - m_logger->stream() << msg.toLatin1(); - return *this; - } - inline MessageBuilder& - operator<<(const QLatin1String& msg) { - m_logger->stream() << msg.latin1(); - return *this; - } - ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QList) - ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QVector) - ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QQueue) - ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QSet) - ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QLinkedList) - ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QStack) - template - MessageBuilder& - operator<<(const QPair& pair_) { - m_logger->stream() << ELPP_LITERAL("("); - operator<<(static_cast(pair_.first)); - m_logger->stream() << ELPP_LITERAL(", "); - operator<<(static_cast(pair_.second)); - m_logger->stream() << ELPP_LITERAL(")"); - return *this; - } - template - MessageBuilder& - operator<<(const QMap& map_) { - m_logger->stream() << ELPP_LITERAL("["); - QList keys = map_.keys(); - typename QList::const_iterator begin = keys.begin(); - typename QList::const_iterator end = keys.end(); - int max_ = static_cast(base::consts::kMaxLogPerContainer); // to prevent warning - for (int index_ = 0; begin != end && index_ < max_; ++index_, ++begin) { - m_logger->stream() << ELPP_LITERAL("("); - operator<<(static_cast(*begin)); - m_logger->stream() << ELPP_LITERAL(", "); - operator<<(static_cast(map_.value(*begin))); - m_logger->stream() << ELPP_LITERAL(")"); - m_logger->stream() << ((index_ < keys.size() - 1) ? m_containerLogSeperator : ELPP_LITERAL("")); - } - if (begin != end) { - m_logger->stream() << ELPP_LITERAL("..."); - } - m_logger->stream() << ELPP_LITERAL("]"); - return *this; - } - template - inline MessageBuilder& - operator<<(const QMultiMap& map_) { - operator<<(static_cast>(map_)); - return *this; - } - template - MessageBuilder& - operator<<(const QHash& hash_) { - m_logger->stream() << ELPP_LITERAL("["); - QList keys = hash_.keys(); - typename QList::const_iterator begin = keys.begin(); - typename QList::const_iterator end = keys.end(); - int max_ = static_cast(base::consts::kMaxLogPerContainer); // prevent type warning - for (int index_ = 0; begin != end && index_ < max_; ++index_, ++begin) { - m_logger->stream() << ELPP_LITERAL("("); - operator<<(static_cast(*begin)); - m_logger->stream() << ELPP_LITERAL(", "); - operator<<(static_cast(hash_.value(*begin))); - m_logger->stream() << ELPP_LITERAL(")"); - m_logger->stream() << ((index_ < keys.size() - 1) ? m_containerLogSeperator : ELPP_LITERAL("")); - } - if (begin != end) { - m_logger->stream() << ELPP_LITERAL("..."); - } - m_logger->stream() << ELPP_LITERAL("]"); - return *this; - } - template - inline MessageBuilder& - operator<<(const QMultiHash& multiHash_) { - operator<<(static_cast>(multiHash_)); - return *this; - } -#endif // defined(ELPP_QT_LOGGING) -#if defined(ELPP_BOOST_LOGGING) - ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(boost::container::vector) - ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(boost::container::stable_vector) - ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(boost::container::list) - ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(boost::container::deque) - ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(boost::container::map) - ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(boost::container::flat_map) - ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG(boost::container::set) - ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG(boost::container::flat_set) -#endif // defined(ELPP_BOOST_LOGGING) - - /// @brief Macro used internally that can be used externally to make containers easylogging++ friendly - /// - /// @detail This macro expands to write an ostream& operator<< for container. This container is expected to - /// have begin() and end() methods that return respective iterators - /// @param ContainerType Type of container e.g, MyList from WX_DECLARE_LIST(int, MyList); in wxwidgets - /// @param SizeMethod Method used to get size of container. - /// @param ElementInstance Instance of element to be fed out. Insance name is "elem". See WXELPP_ENABLED macro - /// for an example usage -#define MAKE_CONTAINERELPP_FRIENDLY(ContainerType, SizeMethod, ElementInstance) \ - el::base::type::ostream_t& operator<<(el::base::type::ostream_t& ss, const ContainerType& container) { \ - const el::base::type::char_t* sep = \ - ELPP->hasFlag(el::LoggingFlag::NewLineForContainer) ? ELPP_LITERAL("\n ") : ELPP_LITERAL(", "); \ - ContainerType::const_iterator elem = container.begin(); \ - ContainerType::const_iterator endElem = container.end(); \ - std::size_t size_ = container.SizeMethod; \ - ss << ELPP_LITERAL("["); \ - for (std::size_t i = 0; elem != endElem && i < el::base::consts::kMaxLogPerContainer; ++i, ++elem) { \ - ss << ElementInstance; \ - ss << ((i < size_ - 1) ? sep : ELPP_LITERAL("")); \ - } \ - if (elem != endElem) { \ - ss << ELPP_LITERAL("..."); \ - } \ - ss << ELPP_LITERAL("]"); \ - return ss; \ - } -#if defined(ELPP_WXWIDGETS_LOGGING) - ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(wxVector) -#define ELPP_WX_PTR_ENABLED(ContainerType) MAKE_CONTAINERELPP_FRIENDLY(ContainerType, size(), *(*elem)) -#define ELPP_WX_ENABLED(ContainerType) MAKE_CONTAINERELPP_FRIENDLY(ContainerType, size(), (*elem)) -#define ELPP_WX_HASH_MAP_ENABLED(ContainerType) MAKE_CONTAINERELPP_FRIENDLY(ContainerType, size(), \ -ELPP_LITERAL("(") << elem->first << ELPP_LITERAL(", ") << elem->second << ELPP_LITERAL(")") -#else -#define ELPP_WX_PTR_ENABLED(ContainerType) -#define ELPP_WX_ENABLED(ContainerType) -#define ELPP_WX_HASH_MAP_ENABLED(ContainerType) -#endif // defined(ELPP_WXWIDGETS_LOGGING) - // Other classes - template - ELPP_SIMPLE_LOG(const Class&) -#undef ELPP_SIMPLE_LOG -#undef ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG -#undef ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG -#undef ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG -#undef ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG -#undef ELPP_ITERATOR_CONTAINER_LOG_FIVE_ARG - private : Logger* m_logger; - const base::type::char_t* m_containerLogSeperator; - - template - MessageBuilder& - writeIterator(Iterator begin_, Iterator end_, std::size_t size_) { - m_logger->stream() << ELPP_LITERAL("["); - for (std::size_t i = 0; begin_ != end_ && i < base::consts::kMaxLogPerContainer; ++i, ++begin_) { - operator<<(*begin_); - m_logger->stream() << ((i < size_ - 1) ? m_containerLogSeperator : ELPP_LITERAL("")); - } - if (begin_ != end_) { - m_logger->stream() << ELPP_LITERAL("..."); - } - m_logger->stream() << ELPP_LITERAL("]"); - if (ELPP->hasFlag(LoggingFlag::AutoSpacing)) { - m_logger->stream() << " "; - } - return *this; - } -}; -/// @brief Writes nothing - Used when certain log is disabled -class NullWriter : base::NoCopy { - public: - NullWriter(void) { - } - - // Null manipulator - inline NullWriter& - operator<<(std::ostream& (*)(std::ostream&)) { - return *this; - } - - template - inline NullWriter& - operator<<(const T&) { - return *this; - } - - inline operator bool() { - return true; - } -}; -/// @brief Main entry point of each logging -class Writer : base::NoCopy { - public: - Writer(Level level, const char* file, base::type::LineNumber line, const char* func, - base::DispatchAction dispatchAction = base::DispatchAction::NormalLog, - base::type::VerboseLevel verboseLevel = 0) - : m_msg(nullptr), - m_level(level), - m_file(file), - m_line(line), - m_func(func), - m_verboseLevel(verboseLevel), - m_logger(nullptr), - m_proceed(false), - m_dispatchAction(dispatchAction) { - } - - Writer(LogMessage* msg, base::DispatchAction dispatchAction = base::DispatchAction::NormalLog) - : m_msg(msg), - m_level(msg != nullptr ? msg->level() : Level::Unknown), - m_line(0), - m_logger(nullptr), - m_proceed(false), - m_dispatchAction(dispatchAction) { - } - - virtual ~Writer(void) { - processDispatch(); - } - - template - inline Writer& - operator<<(const T& log) { -#if ELPP_LOGGING_ENABLED - if (m_proceed) { - m_messageBuilder << log; - } -#endif // ELPP_LOGGING_ENABLED - return *this; - } - - inline Writer& - operator<<(std::ostream& (*log)(std::ostream&)) { -#if ELPP_LOGGING_ENABLED - if (m_proceed) { - m_messageBuilder << log; - } -#endif // ELPP_LOGGING_ENABLED - return *this; - } - - inline operator bool() { - return true; - } - - Writer& - construct(Logger* logger, bool needLock = true); - Writer& - construct(int count, const char* loggerIds, ...); - - protected: - LogMessage* m_msg; - Level m_level; - const char* m_file; - const base::type::LineNumber m_line; - const char* m_func; - base::type::VerboseLevel m_verboseLevel; - Logger* m_logger; - bool m_proceed; - base::MessageBuilder m_messageBuilder; - base::DispatchAction m_dispatchAction; - std::vector m_loggerIds; - friend class el::Helpers; - - void - initializeLogger(const std::string& loggerId, bool lookup = true, bool needLock = true); - void - processDispatch(); - void - triggerDispatch(void); -}; -class PErrorWriter : public base::Writer { - public: - PErrorWriter(Level level, const char* file, base::type::LineNumber line, const char* func, - base::DispatchAction dispatchAction = base::DispatchAction::NormalLog, - base::type::VerboseLevel verboseLevel = 0) - : base::Writer(level, file, line, func, dispatchAction, verboseLevel) { - } - - virtual ~PErrorWriter(void); -}; -} // namespace base -// Logging from Logger class. Why this is here? Because we have Storage and Writer class available -#if ELPP_VARIADIC_TEMPLATES_SUPPORTED -template -void -Logger::log_(Level level, int vlevel, const char* s, const T& value, const Args&... args) { - base::MessageBuilder b; - b.initialize(this); - while (*s) { - if (*s == base::consts::kFormatSpecifierChar) { - if (*(s + 1) == base::consts::kFormatSpecifierChar) { - ++s; - } else { - if (*(s + 1) == base::consts::kFormatSpecifierCharValue) { - ++s; - b << value; - log_(level, vlevel, ++s, args...); - return; - } - } - } - b << *s++; - } - ELPP_INTERNAL_ERROR("Too many arguments provided. Unable to handle. Please provide more format specifiers", false); -} -template -void -Logger::log_(Level level, int vlevel, const T& log) { - if (level == Level::Verbose) { - if (ELPP->vRegistry()->allowed(vlevel, __FILE__)) { - base::Writer(Level::Verbose, "FILE", 0, "FUNCTION", base::DispatchAction::NormalLog, vlevel) - .construct(this, false) - << log; - } else { - stream().str(ELPP_LITERAL("")); - releaseLock(); - } - } else { - base::Writer(level, "FILE", 0, "FUNCTION").construct(this, false) << log; - } -} -template -inline void -Logger::log(Level level, const char* s, const T& value, const Args&... args) { - acquireLock(); // released in Writer! - log_(level, 0, s, value, args...); -} -template -inline void -Logger::log(Level level, const T& log) { - acquireLock(); // released in Writer! - log_(level, 0, log); -} -#if ELPP_VERBOSE_LOG -template -inline void -Logger::verbose(int vlevel, const char* s, const T& value, const Args&... args) { - acquireLock(); // released in Writer! - log_(el::Level::Verbose, vlevel, s, value, args...); -} -template -inline void -Logger::verbose(int vlevel, const T& log) { - acquireLock(); // released in Writer! - log_(el::Level::Verbose, vlevel, log); -} -#else -template -inline void -Logger::verbose(int, const char*, const T&, const Args&...) { - return; -} -template -inline void -Logger::verbose(int, const T&) { - return; -} -#endif // ELPP_VERBOSE_LOG -#define LOGGER_LEVEL_WRITERS(FUNCTION_NAME, LOG_LEVEL) \ - template \ - inline void Logger::FUNCTION_NAME(const char* s, const T& value, const Args&... args) { \ - log(LOG_LEVEL, s, value, args...); \ - } \ - template \ - inline void Logger::FUNCTION_NAME(const T& value) { \ - log(LOG_LEVEL, value); \ - } -#define LOGGER_LEVEL_WRITERS_DISABLED(FUNCTION_NAME, LOG_LEVEL) \ - template \ - inline void Logger::FUNCTION_NAME(const char*, const T&, const Args&...) { \ - return; \ - } \ - template \ - inline void Logger::FUNCTION_NAME(const T&) { \ - return; \ - } - -#if ELPP_INFO_LOG -LOGGER_LEVEL_WRITERS(info, Level::Info) -#else -LOGGER_LEVEL_WRITERS_DISABLED(info, Level::Info) -#endif // ELPP_INFO_LOG -#if ELPP_DEBUG_LOG -LOGGER_LEVEL_WRITERS(debug, Level::Debug) -#else -LOGGER_LEVEL_WRITERS_DISABLED(debug, Level::Debug) -#endif // ELPP_DEBUG_LOG -#if ELPP_WARNING_LOG -LOGGER_LEVEL_WRITERS(warn, Level::Warning) -#else -LOGGER_LEVEL_WRITERS_DISABLED(warn, Level::Warning) -#endif // ELPP_WARNING_LOG -#if ELPP_ERROR_LOG -LOGGER_LEVEL_WRITERS(error, Level::Error) -#else -LOGGER_LEVEL_WRITERS_DISABLED(error, Level::Error) -#endif // ELPP_ERROR_LOG -#if ELPP_FATAL_LOG -LOGGER_LEVEL_WRITERS(fatal, Level::Fatal) -#else -LOGGER_LEVEL_WRITERS_DISABLED(fatal, Level::Fatal) -#endif // ELPP_FATAL_LOG -#if ELPP_TRACE_LOG -LOGGER_LEVEL_WRITERS(trace, Level::Trace) -#else -LOGGER_LEVEL_WRITERS_DISABLED(trace, Level::Trace) -#endif // ELPP_TRACE_LOG -#undef LOGGER_LEVEL_WRITERS -#undef LOGGER_LEVEL_WRITERS_DISABLED -#endif // ELPP_VARIADIC_TEMPLATES_SUPPORTED -#if ELPP_COMPILER_MSVC -#define ELPP_VARIADIC_FUNC_MSVC(variadicFunction, variadicArgs) variadicFunction variadicArgs -#define ELPP_VARIADIC_FUNC_MSVC_RUN(variadicFunction, ...) ELPP_VARIADIC_FUNC_MSVC(variadicFunction, (__VA_ARGS__)) -#define el_getVALength(...) \ - ELPP_VARIADIC_FUNC_MSVC_RUN(el_resolveVALength, 0, ##__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) -#else -#if ELPP_COMPILER_CLANG -#define el_getVALength(...) el_resolveVALength(0, __VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) -#else -#define el_getVALength(...) el_resolveVALength(0, ##__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) -#endif // ELPP_COMPILER_CLANG -#endif // ELPP_COMPILER_MSVC -#define el_resolveVALength(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N -#define ELPP_WRITE_LOG(writer, level, dispatchAction, ...) \ - writer(level, __FILE__, __LINE__, ELPP_FUNC, dispatchAction).construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) -#define ELPP_WRITE_LOG_IF(writer, condition, level, dispatchAction, ...) \ - if (condition) \ - writer(level, __FILE__, __LINE__, ELPP_FUNC, dispatchAction).construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) -#define ELPP_WRITE_LOG_EVERY_N(writer, occasion, level, dispatchAction, ...) \ - ELPP->validateEveryNCounter(__FILE__, __LINE__, occasion) && \ - writer(level, __FILE__, __LINE__, ELPP_FUNC, dispatchAction) \ - .construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) -#define ELPP_WRITE_LOG_AFTER_N(writer, n, level, dispatchAction, ...) \ - ELPP->validateAfterNCounter(__FILE__, __LINE__, n) && writer(level, __FILE__, __LINE__, ELPP_FUNC, dispatchAction) \ - .construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) -#define ELPP_WRITE_LOG_N_TIMES(writer, n, level, dispatchAction, ...) \ - ELPP->validateNTimesCounter(__FILE__, __LINE__, n) && writer(level, __FILE__, __LINE__, ELPP_FUNC, dispatchAction) \ - .construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) -#if defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_PERFORMANCE_TRACKING) -class PerformanceTrackingData { - public: - enum class DataType : base::type::EnumType { Checkpoint = 1, Complete = 2 }; - // Do not use constructor, will run into multiple definition error, use init(PerformanceTracker*) - explicit PerformanceTrackingData(DataType dataType) - : m_performanceTracker(nullptr), - m_dataType(dataType), - m_firstCheckpoint(false), - m_file(""), - m_line(0), - m_func("") { - } - inline const std::string* - blockName(void) const; - inline const struct timeval* - startTime(void) const; - inline const struct timeval* - endTime(void) const; - inline const struct timeval* - lastCheckpointTime(void) const; - inline const base::PerformanceTracker* - performanceTracker(void) const { - return m_performanceTracker; - } - inline PerformanceTrackingData::DataType - dataType(void) const { - return m_dataType; - } - inline bool - firstCheckpoint(void) const { - return m_firstCheckpoint; - } - inline std::string - checkpointId(void) const { - return m_checkpointId; - } - inline const char* - file(void) const { - return m_file; - } - inline base::type::LineNumber - line(void) const { - return m_line; - } - inline const char* - func(void) const { - return m_func; - } - inline const base::type::string_t* - formattedTimeTaken() const { - return &m_formattedTimeTaken; - } - inline const std::string& - loggerId(void) const; - - private: - base::PerformanceTracker* m_performanceTracker; - base::type::string_t m_formattedTimeTaken; - PerformanceTrackingData::DataType m_dataType; - bool m_firstCheckpoint; - std::string m_checkpointId; - const char* m_file; - base::type::LineNumber m_line; - const char* m_func; - inline void - init(base::PerformanceTracker* performanceTracker, bool firstCheckpoint = false) { - m_performanceTracker = performanceTracker; - m_firstCheckpoint = firstCheckpoint; - } - - friend class el::base::PerformanceTracker; -}; -namespace base { -/// @brief Represents performanceTracker block of code that conditionally adds performance status to log -/// either when goes outside the scope of when checkpoint() is called -class PerformanceTracker : public base::threading::ThreadSafe, public Loggable { - public: - PerformanceTracker(const std::string& blockName, - base::TimestampUnit timestampUnit = base::TimestampUnit::Millisecond, - const std::string& loggerId = std::string(el::base::consts::kPerformanceLoggerId), - bool scopedLog = true, Level level = base::consts::kPerformanceTrackerDefaultLevel); - /// @brief Copy constructor - PerformanceTracker(const PerformanceTracker& t) - : m_blockName(t.m_blockName), - m_timestampUnit(t.m_timestampUnit), - m_loggerId(t.m_loggerId), - m_scopedLog(t.m_scopedLog), - m_level(t.m_level), - m_hasChecked(t.m_hasChecked), - m_lastCheckpointId(t.m_lastCheckpointId), - m_enabled(t.m_enabled), - m_startTime(t.m_startTime), - m_endTime(t.m_endTime), - m_lastCheckpointTime(t.m_lastCheckpointTime) { - } - virtual ~PerformanceTracker(void); - /// @brief A checkpoint for current performanceTracker block. - void - checkpoint(const std::string& id = std::string(), const char* file = __FILE__, - base::type::LineNumber line = __LINE__, const char* func = ""); - inline Level - level(void) const { - return m_level; - } - - private: - std::string m_blockName; - base::TimestampUnit m_timestampUnit; - std::string m_loggerId; - bool m_scopedLog; - Level m_level; - bool m_hasChecked; - std::string m_lastCheckpointId; - bool m_enabled; - struct timeval m_startTime, m_endTime, m_lastCheckpointTime; - - PerformanceTracker(void); - - friend class el::PerformanceTrackingData; - friend class base::DefaultPerformanceTrackingCallback; - - const inline base::type::string_t - getFormattedTimeTaken() const { - return getFormattedTimeTaken(m_startTime); - } - - const base::type::string_t - getFormattedTimeTaken(struct timeval startTime) const; - - virtual inline void - log(el::base::type::ostream_t& os) const { - os << getFormattedTimeTaken(); - } -}; -class DefaultPerformanceTrackingCallback : public PerformanceTrackingCallback { - protected: - void - handle(const PerformanceTrackingData* data) { - m_data = data; - base::type::stringstream_t ss; - if (m_data->dataType() == PerformanceTrackingData::DataType::Complete) { - ss << ELPP_LITERAL("Executed [") << m_data->blockName()->c_str() << ELPP_LITERAL("] in [") - << *m_data->formattedTimeTaken() << ELPP_LITERAL("]"); - } else { - ss << ELPP_LITERAL("Performance checkpoint"); - if (!m_data->checkpointId().empty()) { - ss << ELPP_LITERAL(" [") << m_data->checkpointId().c_str() << ELPP_LITERAL("]"); - } - ss << ELPP_LITERAL(" for block [") << m_data->blockName()->c_str() << ELPP_LITERAL("] : [") - << *m_data->performanceTracker(); - if (!ELPP->hasFlag(LoggingFlag::DisablePerformanceTrackingCheckpointComparison) && - m_data->performanceTracker()->m_hasChecked) { - ss << ELPP_LITERAL(" ([") << *m_data->formattedTimeTaken() << ELPP_LITERAL("] from "); - if (m_data->performanceTracker()->m_lastCheckpointId.empty()) { - ss << ELPP_LITERAL("last checkpoint"); - } else { - ss << ELPP_LITERAL("checkpoint '") << m_data->performanceTracker()->m_lastCheckpointId.c_str() - << ELPP_LITERAL("'"); - } - ss << ELPP_LITERAL(")]"); - } else { - ss << ELPP_LITERAL("]"); - } - } - el::base::Writer(m_data->performanceTracker()->level(), m_data->file(), m_data->line(), m_data->func()) - .construct(1, m_data->loggerId().c_str()) - << ss.str(); - } - - private: - const PerformanceTrackingData* m_data; -}; -} // namespace base -inline const std::string* -PerformanceTrackingData::blockName() const { - return const_cast(&m_performanceTracker->m_blockName); -} -inline const struct timeval* -PerformanceTrackingData::startTime() const { - return const_cast(&m_performanceTracker->m_startTime); -} -inline const struct timeval* -PerformanceTrackingData::endTime() const { - return const_cast(&m_performanceTracker->m_endTime); -} -inline const struct timeval* -PerformanceTrackingData::lastCheckpointTime() const { - return const_cast(&m_performanceTracker->m_lastCheckpointTime); -} -inline const std::string& -PerformanceTrackingData::loggerId(void) const { - return m_performanceTracker->m_loggerId; -} -#endif // defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_PERFORMANCE_TRACKING) -namespace base { -/// @brief Contains some internal debugging tools like crash handler and stack tracer -namespace debug { -#if defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_CRASH_LOG) -class StackTrace : base::NoCopy { - public: - static const unsigned int kMaxStack = 64; - static const unsigned int kStackStart = 2; // We want to skip c'tor and StackTrace::generateNew() - class StackTraceEntry { - public: - StackTraceEntry(std::size_t index, const std::string& loc, const std::string& demang, const std::string& hex, - const std::string& addr); - StackTraceEntry(std::size_t index, const std::string& loc) : m_index(index), m_location(loc) { - } - std::size_t m_index; - std::string m_location; - std::string m_demangled; - std::string m_hex; - std::string m_addr; - friend std::ostream& - operator<<(std::ostream& ss, const StackTraceEntry& si); - - private: - StackTraceEntry(void); - }; - - StackTrace(void) { - generateNew(); - } - - virtual ~StackTrace(void) { - } - - inline std::vector& - getLatestStack(void) { - return m_stack; - } - - friend std::ostream& - operator<<(std::ostream& os, const StackTrace& st); - - private: - std::vector m_stack; - - void - generateNew(void); -}; -/// @brief Handles unexpected crashes -class CrashHandler : base::NoCopy { - public: - typedef void (*Handler)(int); - - explicit CrashHandler(bool useDefault); - explicit CrashHandler(const Handler& cHandler) { - setHandler(cHandler); - } - void - setHandler(const Handler& cHandler); - - private: - Handler m_handler; -}; -#else -class CrashHandler { - public: - explicit CrashHandler(bool) { - } -}; -#endif // defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_CRASH_LOG) -} // namespace debug -} // namespace base -extern base::debug::CrashHandler elCrashHandler; -#define MAKE_LOGGABLE(ClassType, ClassInstance, OutputStreamInstance) \ - el::base::type::ostream_t& operator<<(el::base::type::ostream_t& OutputStreamInstance, \ - const ClassType& ClassInstance) -/// @brief Initializes syslog with process ID, options and facility. calls closelog() on d'tor -class SysLogInitializer { - public: - SysLogInitializer(const char* processIdent, int options = 0, int facility = 0) { -#if defined(ELPP_SYSLOG) - openlog(processIdent, options, facility); -#else - ELPP_UNUSED(processIdent); - ELPP_UNUSED(options); - ELPP_UNUSED(facility); -#endif // defined(ELPP_SYSLOG) - } - virtual ~SysLogInitializer(void) { -#if defined(ELPP_SYSLOG) - closelog(); -#endif // defined(ELPP_SYSLOG) - } -}; -#define ELPP_INITIALIZE_SYSLOG(id, opt, fac) el::SysLogInitializer elSyslogInit(id, opt, fac) -/// @brief Static helpers for developers -class Helpers : base::StaticClass { - public: - /// @brief Shares logging repository (base::Storage) - static inline void - setStorage(base::type::StoragePointer storage) { - ELPP = storage; - } - /// @return Main storage repository - static inline base::type::StoragePointer - storage() { - return ELPP; - } - /// @brief Sets application arguments and figures out whats active for logging and whats not. - static inline void - setArgs(int argc, char** argv) { - ELPP->setApplicationArguments(argc, argv); - } - /// @copydoc setArgs(int argc, char** argv) - static inline void - setArgs(int argc, const char** argv) { - ELPP->setApplicationArguments(argc, const_cast(argv)); - } - /// @brief Sets thread name for current thread. Requires std::thread - static inline void - setThreadName(const std::string& name) { - ELPP->setThreadName(name); - } - static inline std::string - getThreadName() { - return ELPP->getThreadName(base::threading::getCurrentThreadId()); - } -#if defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_CRASH_LOG) - /// @brief Overrides default crash handler and installs custom handler. - /// @param crashHandler A functor with no return type that takes single int argument. - /// Handler is a typedef with specification: void (*Handler)(int) - static inline void - setCrashHandler(const el::base::debug::CrashHandler::Handler& crashHandler) { - el::elCrashHandler.setHandler(crashHandler); - } - /// @brief Abort due to crash with signal in parameter - /// @param sig Crash signal - static void - crashAbort(int sig, const char* sourceFile = "", unsigned int long line = 0); - /// @brief Logs reason of crash as per sig - /// @param sig Crash signal - /// @param stackTraceIfAvailable Includes stack trace if available - /// @param level Logging level - /// @param logger Logger to use for logging - static void - logCrashReason(int sig, bool stackTraceIfAvailable = false, Level level = Level::Fatal, - const char* logger = base::consts::kDefaultLoggerId); -#endif // defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_CRASH_LOG) - /// @brief Installs pre rollout callback, this callback is triggered when log file is about to be rolled out - /// (can be useful for backing up) - static inline void - installPreRollOutCallback(const PreRollOutCallback& callback) { - ELPP->setPreRollOutCallback(callback); - } - /// @brief Uninstalls pre rollout callback - static inline void - uninstallPreRollOutCallback(void) { - ELPP->unsetPreRollOutCallback(); - } - /// @brief Installs post log dispatch callback, this callback is triggered when log is dispatched - template - static inline bool - installLogDispatchCallback(const std::string& id) { - return ELPP->installLogDispatchCallback(id); - } - /// @brief Uninstalls log dispatch callback - template - static inline void - uninstallLogDispatchCallback(const std::string& id) { - ELPP->uninstallLogDispatchCallback(id); - } - template - static inline T* - logDispatchCallback(const std::string& id) { - return ELPP->logDispatchCallback(id); - } -#if defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_PERFORMANCE_TRACKING) - /// @brief Installs post performance tracking callback, this callback is triggered when performance tracking is - /// finished - template - static inline bool - installPerformanceTrackingCallback(const std::string& id) { - return ELPP->installPerformanceTrackingCallback(id); - } - /// @brief Uninstalls post performance tracking handler - template - static inline void - uninstallPerformanceTrackingCallback(const std::string& id) { - ELPP->uninstallPerformanceTrackingCallback(id); - } - template - static inline T* - performanceTrackingCallback(const std::string& id) { - return ELPP->performanceTrackingCallback(id); - } -#endif // defined(ELPP_FEATURE_ALL) || defined(ELPP_FEATURE_PERFORMANCE_TRACKING) - /// @brief Converts template to std::string - useful for loggable classes to log containers within - /// log(std::ostream&) const - template - static std::string - convertTemplateToStdString(const T& templ) { - el::Logger* logger = ELPP->registeredLoggers()->get(el::base::consts::kDefaultLoggerId); - if (logger == nullptr) { - return std::string(); - } - base::MessageBuilder b; - b.initialize(logger); - logger->acquireLock(); - b << templ; -#if defined(ELPP_UNICODE) - std::string s = std::string(logger->stream().str().begin(), logger->stream().str().end()); -#else - std::string s = logger->stream().str(); -#endif // defined(ELPP_UNICODE) - logger->stream().str(ELPP_LITERAL("")); - logger->releaseLock(); - return s; - } - /// @brief Returns command line arguments (pointer) provided to easylogging++ - static inline const el::base::utils::CommandLineArgs* - commandLineArgs(void) { - return ELPP->commandLineArgs(); - } - /// @brief Reserve space for custom format specifiers for performance - /// @see std::vector::reserve - static inline void - reserveCustomFormatSpecifiers(std::size_t size) { - ELPP->m_customFormatSpecifiers.reserve(size); - } - /// @brief Installs user defined format specifier and handler - static inline void - installCustomFormatSpecifier(const CustomFormatSpecifier& customFormatSpecifier) { - ELPP->installCustomFormatSpecifier(customFormatSpecifier); - } - /// @brief Uninstalls user defined format specifier and handler - static inline bool - uninstallCustomFormatSpecifier(const char* formatSpecifier) { - return ELPP->uninstallCustomFormatSpecifier(formatSpecifier); - } - /// @brief Returns true if custom format specifier is installed - static inline bool - hasCustomFormatSpecifier(const char* formatSpecifier) { - return ELPP->hasCustomFormatSpecifier(formatSpecifier); - } - static inline void - validateFileRolling(Logger* logger, Level level) { - if (ELPP == nullptr || logger == nullptr) - return; - logger->m_typedConfigurations->validateFileRolling(level, ELPP->preRollOutCallback()); - } -}; -/// @brief Static helpers to deal with loggers and their configurations -class Loggers : base::StaticClass { - public: - /// @brief Gets existing or registers new logger - static Logger* - getLogger(const std::string& identity, bool registerIfNotAvailable = true); - /// @brief Changes default log builder for future loggers - static void - setDefaultLogBuilder(el::LogBuilderPtr& logBuilderPtr); - /// @brief Installs logger registration callback, this callback is triggered when new logger is registered - template - static inline bool - installLoggerRegistrationCallback(const std::string& id) { - return ELPP->registeredLoggers()->installLoggerRegistrationCallback(id); - } - /// @brief Uninstalls log dispatch callback - template - static inline void - uninstallLoggerRegistrationCallback(const std::string& id) { - ELPP->registeredLoggers()->uninstallLoggerRegistrationCallback(id); - } - template - static inline T* - loggerRegistrationCallback(const std::string& id) { - return ELPP->registeredLoggers()->loggerRegistrationCallback(id); - } - /// @brief Unregisters logger - use it only when you know what you are doing, you may unregister - /// loggers initialized / used by third-party libs. - static bool - unregisterLogger(const std::string& identity); - /// @brief Whether or not logger with id is registered - static bool - hasLogger(const std::string& identity); - /// @brief Reconfigures specified logger with new configurations - static Logger* - reconfigureLogger(Logger* logger, const Configurations& configurations); - /// @brief Reconfigures logger with new configurations after looking it up using identity - static Logger* - reconfigureLogger(const std::string& identity, const Configurations& configurations); - /// @brief Reconfigures logger's single configuration - static Logger* - reconfigureLogger(const std::string& identity, ConfigurationType configurationType, const std::string& value); - /// @brief Reconfigures all the existing loggers with new configurations - static void - reconfigureAllLoggers(const Configurations& configurations); - /// @brief Reconfigures single configuration for all the loggers - static inline void - reconfigureAllLoggers(ConfigurationType configurationType, const std::string& value) { - reconfigureAllLoggers(Level::Global, configurationType, value); - } - /// @brief Reconfigures single configuration for all the loggers for specified level - static void - reconfigureAllLoggers(Level level, ConfigurationType configurationType, const std::string& value); - /// @brief Sets default configurations. This configuration is used for future (and conditionally for existing) - /// loggers - static void - setDefaultConfigurations(const Configurations& configurations, bool reconfigureExistingLoggers = false); - /// @brief Returns current default - static const Configurations* - defaultConfigurations(void); - /// @brief Returns log stream reference pointer if needed by user - static const base::LogStreamsReferenceMap* - logStreamsReference(void); - /// @brief Default typed configuration based on existing defaultConf - static base::TypedConfigurations - defaultTypedConfigurations(void); - /// @brief Populates all logger IDs in current repository. - /// @param [out] targetList List of fill up. - static std::vector* - populateAllLoggerIds(std::vector* targetList); - /// @brief Sets configurations from global configuration file. - static void - configureFromGlobal(const char* globalConfigurationFilePath); - /// @brief Configures loggers using command line arg. Ensure you have already set command line args, - /// @return False if invalid argument or argument with no value provided, true if attempted to configure logger. - /// If true is returned that does not mean it has been configured successfully, it only means that it - /// has attempeted to configure logger using configuration file provided in argument - static bool - configureFromArg(const char* argKey); - /// @brief Flushes all loggers for all levels - Be careful if you dont know how many loggers are registered - static void - flushAll(void); - /// @brief Adds logging flag used internally. - static inline void - addFlag(LoggingFlag flag) { - ELPP->addFlag(flag); - } - /// @brief Removes logging flag used internally. - static inline void - removeFlag(LoggingFlag flag) { - ELPP->removeFlag(flag); - } - /// @brief Determines whether or not certain flag is active - static inline bool - hasFlag(LoggingFlag flag) { - return ELPP->hasFlag(flag); - } - /// @brief Adds flag and removes it when scope goes out - class ScopedAddFlag { - public: - ScopedAddFlag(LoggingFlag flag) : m_flag(flag) { - Loggers::addFlag(m_flag); - } - ~ScopedAddFlag(void) { - Loggers::removeFlag(m_flag); - } - - private: - LoggingFlag m_flag; - }; - /// @brief Removes flag and add it when scope goes out - class ScopedRemoveFlag { - public: - ScopedRemoveFlag(LoggingFlag flag) : m_flag(flag) { - Loggers::removeFlag(m_flag); - } - ~ScopedRemoveFlag(void) { - Loggers::addFlag(m_flag); - } - - private: - LoggingFlag m_flag; - }; - /// @brief Sets hierarchy for logging. Needs to enable logging flag (HierarchicalLogging) - static void - setLoggingLevel(Level level) { - ELPP->setLoggingLevel(level); - } - /// @brief Sets verbose level on the fly - static void - setVerboseLevel(base::type::VerboseLevel level); - /// @brief Gets current verbose level - static base::type::VerboseLevel - verboseLevel(void); - /// @brief Sets vmodules as specified (on the fly) - static void - setVModules(const char* modules); - /// @brief Clears vmodules - static void - clearVModules(void); -}; -class VersionInfo : base::StaticClass { - public: - /// @brief Current version number - static const std::string - version(void); - - /// @brief Release date of current version - static const std::string - releaseDate(void); -}; -} // namespace el -#undef VLOG_IS_ON -/// @brief Determines whether verbose logging is on for specified level current file. -#define VLOG_IS_ON(verboseLevel) (ELPP->vRegistry()->allowed(verboseLevel, __FILE__)) -#undef TIMED_BLOCK -#undef TIMED_SCOPE -#undef TIMED_SCOPE_IF -#undef TIMED_FUNC -#undef TIMED_FUNC_IF -#undef ELPP_MIN_UNIT -#if defined(ELPP_PERFORMANCE_MICROSECONDS) -#define ELPP_MIN_UNIT el::base::TimestampUnit::Microsecond -#else -#define ELPP_MIN_UNIT el::base::TimestampUnit::Millisecond -#endif // (defined(ELPP_PERFORMANCE_MICROSECONDS)) -/// @brief Performance tracked scope. Performance gets written when goes out of scope using -/// 'performance' logger. -/// -/// @detail Please note in order to check the performance at a certain time you can use obj->checkpoint(); -/// @see el::base::PerformanceTracker -/// @see el::base::PerformanceTracker::checkpoint -// Note: Do not surround this definition with null macro because of obj instance -#define TIMED_SCOPE_IF(obj, blockname, condition) \ - el::base::type::PerformanceTrackerPtr obj(condition ? new el::base::PerformanceTracker(blockname, ELPP_MIN_UNIT) \ - : nullptr) -#define TIMED_SCOPE(obj, blockname) TIMED_SCOPE_IF(obj, blockname, true) -#define TIMED_BLOCK(obj, blockName) \ - for (struct { \ - int i; \ - el::base::type::PerformanceTrackerPtr timer; \ - } obj = {0, \ - el::base::type::PerformanceTrackerPtr(new el::base::PerformanceTracker(blockName, ELPP_MIN_UNIT))}; \ - obj.i < 1; ++obj.i) -/// @brief Performance tracked function. Performance gets written when goes out of scope using -/// 'performance' logger. -/// -/// @detail Please note in order to check the performance at a certain time you can use obj->checkpoint(); -/// @see el::base::PerformanceTracker -/// @see el::base::PerformanceTracker::checkpoint -#define TIMED_FUNC_IF(obj, condition) TIMED_SCOPE_IF(obj, ELPP_FUNC, condition) -#define TIMED_FUNC(obj) TIMED_SCOPE(obj, ELPP_FUNC) -#undef PERFORMANCE_CHECKPOINT -#undef PERFORMANCE_CHECKPOINT_WITH_ID -#define PERFORMANCE_CHECKPOINT(obj) obj->checkpoint(std::string(), __FILE__, __LINE__, ELPP_FUNC) -#define PERFORMANCE_CHECKPOINT_WITH_ID(obj, id) obj->checkpoint(id, __FILE__, __LINE__, ELPP_FUNC) -#undef ELPP_COUNTER -#undef ELPP_COUNTER_POS -/// @brief Gets hit counter for file/line -#define ELPP_COUNTER (ELPP->hitCounters()->getCounter(__FILE__, __LINE__)) -/// @brief Gets hit counter position for file/line, -1 if not registered yet -#define ELPP_COUNTER_POS (ELPP_COUNTER == nullptr ? -1 : ELPP_COUNTER->hitCounts()) -// Undef levels to support LOG(LEVEL) -#undef INFO -#undef WARNING -#undef DEBUG -#undef ERROR -#undef FATAL -#undef TRACE -#undef VERBOSE -// Undef existing -#undef CINFO -#undef CWARNING -#undef CDEBUG -#undef CFATAL -#undef CERROR -#undef CTRACE -#undef CVERBOSE -#undef CINFO_IF -#undef CWARNING_IF -#undef CDEBUG_IF -#undef CERROR_IF -#undef CFATAL_IF -#undef CTRACE_IF -#undef CVERBOSE_IF -#undef CINFO_EVERY_N -#undef CWARNING_EVERY_N -#undef CDEBUG_EVERY_N -#undef CERROR_EVERY_N -#undef CFATAL_EVERY_N -#undef CTRACE_EVERY_N -#undef CVERBOSE_EVERY_N -#undef CINFO_AFTER_N -#undef CWARNING_AFTER_N -#undef CDEBUG_AFTER_N -#undef CERROR_AFTER_N -#undef CFATAL_AFTER_N -#undef CTRACE_AFTER_N -#undef CVERBOSE_AFTER_N -#undef CINFO_N_TIMES -#undef CWARNING_N_TIMES -#undef CDEBUG_N_TIMES -#undef CERROR_N_TIMES -#undef CFATAL_N_TIMES -#undef CTRACE_N_TIMES -#undef CVERBOSE_N_TIMES -// Normal logs -#if ELPP_INFO_LOG -#define CINFO(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Info, dispatchAction, __VA_ARGS__) -#else -#define CINFO(writer, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_INFO_LOG -#if ELPP_WARNING_LOG -#define CWARNING(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Warning, dispatchAction, __VA_ARGS__) -#else -#define CWARNING(writer, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_WARNING_LOG -#if ELPP_DEBUG_LOG -#define CDEBUG(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Debug, dispatchAction, __VA_ARGS__) -#else -#define CDEBUG(writer, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_DEBUG_LOG -#if ELPP_ERROR_LOG -#define CERROR(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Error, dispatchAction, __VA_ARGS__) -#else -#define CERROR(writer, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_ERROR_LOG -#if ELPP_FATAL_LOG -#define CFATAL(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Fatal, dispatchAction, __VA_ARGS__) -#else -#define CFATAL(writer, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_FATAL_LOG -#if ELPP_TRACE_LOG -#define CTRACE(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Trace, dispatchAction, __VA_ARGS__) -#else -#define CTRACE(writer, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_TRACE_LOG -#if ELPP_VERBOSE_LOG -#define CVERBOSE(writer, vlevel, dispatchAction, ...) \ - if (VLOG_IS_ON(vlevel)) \ - writer(el::Level::Verbose, __FILE__, __LINE__, ELPP_FUNC, dispatchAction, vlevel) \ - .construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) -#else -#define CVERBOSE(writer, vlevel, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_VERBOSE_LOG -// Conditional logs -#if ELPP_INFO_LOG -#define CINFO_IF(writer, condition_, dispatchAction, ...) \ - ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Info, dispatchAction, __VA_ARGS__) -#else -#define CINFO_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_INFO_LOG -#if ELPP_WARNING_LOG -#define CWARNING_IF(writer, condition_, dispatchAction, ...) \ - ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Warning, dispatchAction, __VA_ARGS__) -#else -#define CWARNING_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_WARNING_LOG -#if ELPP_DEBUG_LOG -#define CDEBUG_IF(writer, condition_, dispatchAction, ...) \ - ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Debug, dispatchAction, __VA_ARGS__) -#else -#define CDEBUG_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_DEBUG_LOG -#if ELPP_ERROR_LOG -#define CERROR_IF(writer, condition_, dispatchAction, ...) \ - ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Error, dispatchAction, __VA_ARGS__) -#else -#define CERROR_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_ERROR_LOG -#if ELPP_FATAL_LOG -#define CFATAL_IF(writer, condition_, dispatchAction, ...) \ - ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Fatal, dispatchAction, __VA_ARGS__) -#else -#define CFATAL_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_FATAL_LOG -#if ELPP_TRACE_LOG -#define CTRACE_IF(writer, condition_, dispatchAction, ...) \ - ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Trace, dispatchAction, __VA_ARGS__) -#else -#define CTRACE_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_TRACE_LOG -#if ELPP_VERBOSE_LOG -#define CVERBOSE_IF(writer, condition_, vlevel, dispatchAction, ...) \ - if (VLOG_IS_ON(vlevel) && (condition_)) \ - writer(el::Level::Verbose, __FILE__, __LINE__, ELPP_FUNC, dispatchAction, vlevel) \ - .construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) -#else -#define CVERBOSE_IF(writer, condition_, vlevel, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_VERBOSE_LOG -// Occasional logs -#if ELPP_INFO_LOG -#define CINFO_EVERY_N(writer, occasion, dispatchAction, ...) \ - ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Info, dispatchAction, __VA_ARGS__) -#else -#define CINFO_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_INFO_LOG -#if ELPP_WARNING_LOG -#define CWARNING_EVERY_N(writer, occasion, dispatchAction, ...) \ - ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Warning, dispatchAction, __VA_ARGS__) -#else -#define CWARNING_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_WARNING_LOG -#if ELPP_DEBUG_LOG -#define CDEBUG_EVERY_N(writer, occasion, dispatchAction, ...) \ - ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Debug, dispatchAction, __VA_ARGS__) -#else -#define CDEBUG_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_DEBUG_LOG -#if ELPP_ERROR_LOG -#define CERROR_EVERY_N(writer, occasion, dispatchAction, ...) \ - ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Error, dispatchAction, __VA_ARGS__) -#else -#define CERROR_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_ERROR_LOG -#if ELPP_FATAL_LOG -#define CFATAL_EVERY_N(writer, occasion, dispatchAction, ...) \ - ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Fatal, dispatchAction, __VA_ARGS__) -#else -#define CFATAL_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_FATAL_LOG -#if ELPP_TRACE_LOG -#define CTRACE_EVERY_N(writer, occasion, dispatchAction, ...) \ - ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Trace, dispatchAction, __VA_ARGS__) -#else -#define CTRACE_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_TRACE_LOG -#if ELPP_VERBOSE_LOG -#define CVERBOSE_EVERY_N(writer, occasion, vlevel, dispatchAction, ...) \ - CVERBOSE_IF(writer, ELPP->validateEveryNCounter(__FILE__, __LINE__, occasion), vlevel, dispatchAction, __VA_ARGS__) -#else -#define CVERBOSE_EVERY_N(writer, occasion, vlevel, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_VERBOSE_LOG -// After N logs -#if ELPP_INFO_LOG -#define CINFO_AFTER_N(writer, n, dispatchAction, ...) \ - ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Info, dispatchAction, __VA_ARGS__) -#else -#define CINFO_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_INFO_LOG -#if ELPP_WARNING_LOG -#define CWARNING_AFTER_N(writer, n, dispatchAction, ...) \ - ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Warning, dispatchAction, __VA_ARGS__) -#else -#define CWARNING_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_WARNING_LOG -#if ELPP_DEBUG_LOG -#define CDEBUG_AFTER_N(writer, n, dispatchAction, ...) \ - ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Debug, dispatchAction, __VA_ARGS__) -#else -#define CDEBUG_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_DEBUG_LOG -#if ELPP_ERROR_LOG -#define CERROR_AFTER_N(writer, n, dispatchAction, ...) \ - ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Error, dispatchAction, __VA_ARGS__) -#else -#define CERROR_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_ERROR_LOG -#if ELPP_FATAL_LOG -#define CFATAL_AFTER_N(writer, n, dispatchAction, ...) \ - ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Fatal, dispatchAction, __VA_ARGS__) -#else -#define CFATAL_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_FATAL_LOG -#if ELPP_TRACE_LOG -#define CTRACE_AFTER_N(writer, n, dispatchAction, ...) \ - ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Trace, dispatchAction, __VA_ARGS__) -#else -#define CTRACE_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_TRACE_LOG -#if ELPP_VERBOSE_LOG -#define CVERBOSE_AFTER_N(writer, n, vlevel, dispatchAction, ...) \ - CVERBOSE_IF(writer, ELPP->validateAfterNCounter(__FILE__, __LINE__, n), vlevel, dispatchAction, __VA_ARGS__) -#else -#define CVERBOSE_AFTER_N(writer, n, vlevel, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_VERBOSE_LOG -// N Times logs -#if ELPP_INFO_LOG -#define CINFO_N_TIMES(writer, n, dispatchAction, ...) \ - ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Info, dispatchAction, __VA_ARGS__) -#else -#define CINFO_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_INFO_LOG -#if ELPP_WARNING_LOG -#define CWARNING_N_TIMES(writer, n, dispatchAction, ...) \ - ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Warning, dispatchAction, __VA_ARGS__) -#else -#define CWARNING_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_WARNING_LOG -#if ELPP_DEBUG_LOG -#define CDEBUG_N_TIMES(writer, n, dispatchAction, ...) \ - ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Debug, dispatchAction, __VA_ARGS__) -#else -#define CDEBUG_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_DEBUG_LOG -#if ELPP_ERROR_LOG -#define CERROR_N_TIMES(writer, n, dispatchAction, ...) \ - ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Error, dispatchAction, __VA_ARGS__) -#else -#define CERROR_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_ERROR_LOG -#if ELPP_FATAL_LOG -#define CFATAL_N_TIMES(writer, n, dispatchAction, ...) \ - ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Fatal, dispatchAction, __VA_ARGS__) -#else -#define CFATAL_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_FATAL_LOG -#if ELPP_TRACE_LOG -#define CTRACE_N_TIMES(writer, n, dispatchAction, ...) \ - ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Trace, dispatchAction, __VA_ARGS__) -#else -#define CTRACE_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_TRACE_LOG -#if ELPP_VERBOSE_LOG -#define CVERBOSE_N_TIMES(writer, n, vlevel, dispatchAction, ...) \ - CVERBOSE_IF(writer, ELPP->validateNTimesCounter(__FILE__, __LINE__, n), vlevel, dispatchAction, __VA_ARGS__) -#else -#define CVERBOSE_N_TIMES(writer, n, vlevel, dispatchAction, ...) el::base::NullWriter() -#endif // ELPP_VERBOSE_LOG -// -// Custom Loggers - Requires (level, dispatchAction, loggerId/s) -// -// undef existing -#undef CLOG -#undef CLOG_VERBOSE -#undef CVLOG -#undef CLOG_IF -#undef CLOG_VERBOSE_IF -#undef CVLOG_IF -#undef CLOG_EVERY_N -#undef CVLOG_EVERY_N -#undef CLOG_AFTER_N -#undef CVLOG_AFTER_N -#undef CLOG_N_TIMES -#undef CVLOG_N_TIMES -// Normal logs -#define CLOG(LEVEL, ...) C##LEVEL(el::base::Writer, el::base::DispatchAction::NormalLog, __VA_ARGS__) -#define CVLOG(vlevel, ...) CVERBOSE(el::base::Writer, vlevel, el::base::DispatchAction::NormalLog, __VA_ARGS__) -// Conditional logs -#define CLOG_IF(condition, LEVEL, ...) \ - C##LEVEL##_IF(el::base::Writer, condition, el::base::DispatchAction::NormalLog, __VA_ARGS__) -#define CVLOG_IF(condition, vlevel, ...) \ - CVERBOSE_IF(el::base::Writer, condition, vlevel, el::base::DispatchAction::NormalLog, __VA_ARGS__) -// Hit counts based logs -#define CLOG_EVERY_N(n, LEVEL, ...) \ - C##LEVEL##_EVERY_N(el::base::Writer, n, el::base::DispatchAction::NormalLog, __VA_ARGS__) -#define CVLOG_EVERY_N(n, vlevel, ...) \ - CVERBOSE_EVERY_N(el::base::Writer, n, vlevel, el::base::DispatchAction::NormalLog, __VA_ARGS__) -#define CLOG_AFTER_N(n, LEVEL, ...) \ - C##LEVEL##_AFTER_N(el::base::Writer, n, el::base::DispatchAction::NormalLog, __VA_ARGS__) -#define CVLOG_AFTER_N(n, vlevel, ...) \ - CVERBOSE_AFTER_N(el::base::Writer, n, vlevel, el::base::DispatchAction::NormalLog, __VA_ARGS__) -#define CLOG_N_TIMES(n, LEVEL, ...) \ - C##LEVEL##_N_TIMES(el::base::Writer, n, el::base::DispatchAction::NormalLog, __VA_ARGS__) -#define CVLOG_N_TIMES(n, vlevel, ...) \ - CVERBOSE_N_TIMES(el::base::Writer, n, vlevel, el::base::DispatchAction::NormalLog, __VA_ARGS__) -// -// Default Loggers macro using CLOG(), CLOG_VERBOSE() and CVLOG() macros -// -// undef existing -#undef LOG -#undef VLOG -#undef LOG_IF -#undef VLOG_IF -#undef LOG_EVERY_N -#undef VLOG_EVERY_N -#undef LOG_AFTER_N -#undef VLOG_AFTER_N -#undef LOG_N_TIMES -#undef VLOG_N_TIMES -#undef ELPP_CURR_FILE_LOGGER_ID -#if defined(ELPP_DEFAULT_LOGGER) -#define ELPP_CURR_FILE_LOGGER_ID ELPP_DEFAULT_LOGGER -#else -#define ELPP_CURR_FILE_LOGGER_ID el::base::consts::kDefaultLoggerId -#endif -#undef ELPP_TRACE -#define ELPP_TRACE CLOG(TRACE, ELPP_CURR_FILE_LOGGER_ID) -// Normal logs -#define LOG(LEVEL) CLOG(LEVEL, ELPP_CURR_FILE_LOGGER_ID) -#define VLOG(vlevel) CVLOG(vlevel, ELPP_CURR_FILE_LOGGER_ID) -// Conditional logs -#define LOG_IF(condition, LEVEL) CLOG_IF(condition, LEVEL, ELPP_CURR_FILE_LOGGER_ID) -#define VLOG_IF(condition, vlevel) CVLOG_IF(condition, vlevel, ELPP_CURR_FILE_LOGGER_ID) -// Hit counts based logs -#define LOG_EVERY_N(n, LEVEL) CLOG_EVERY_N(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) -#define VLOG_EVERY_N(n, vlevel) CVLOG_EVERY_N(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) -#define LOG_AFTER_N(n, LEVEL) CLOG_AFTER_N(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) -#define VLOG_AFTER_N(n, vlevel) CVLOG_AFTER_N(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) -#define LOG_N_TIMES(n, LEVEL) CLOG_N_TIMES(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) -#define VLOG_N_TIMES(n, vlevel) CVLOG_N_TIMES(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) -// Generic PLOG() -#undef CPLOG -#undef CPLOG_IF -#undef PLOG -#undef PLOG_IF -#undef DCPLOG -#undef DCPLOG_IF -#undef DPLOG -#undef DPLOG_IF -#define CPLOG(LEVEL, ...) C##LEVEL(el::base::PErrorWriter, el::base::DispatchAction::NormalLog, __VA_ARGS__) -#define CPLOG_IF(condition, LEVEL, ...) \ - C##LEVEL##_IF(el::base::PErrorWriter, condition, el::base::DispatchAction::NormalLog, __VA_ARGS__) -#define DCPLOG(LEVEL, ...) \ - if (ELPP_DEBUG_LOG) \ - C##LEVEL(el::base::PErrorWriter, el::base::DispatchAction::NormalLog, __VA_ARGS__) -#define DCPLOG_IF(condition, LEVEL, ...) \ - C##LEVEL##_IF(el::base::PErrorWriter, (ELPP_DEBUG_LOG) && (condition), el::base::DispatchAction::NormalLog, \ - __VA_ARGS__) -#define PLOG(LEVEL) CPLOG(LEVEL, ELPP_CURR_FILE_LOGGER_ID) -#define PLOG_IF(condition, LEVEL) CPLOG_IF(condition, LEVEL, ELPP_CURR_FILE_LOGGER_ID) -#define DPLOG(LEVEL) DCPLOG(LEVEL, ELPP_CURR_FILE_LOGGER_ID) -#define DPLOG_IF(condition, LEVEL) DCPLOG_IF(condition, LEVEL, ELPP_CURR_FILE_LOGGER_ID) -// Generic SYSLOG() -#undef CSYSLOG -#undef CSYSLOG_IF -#undef CSYSLOG_EVERY_N -#undef CSYSLOG_AFTER_N -#undef CSYSLOG_N_TIMES -#undef SYSLOG -#undef SYSLOG_IF -#undef SYSLOG_EVERY_N -#undef SYSLOG_AFTER_N -#undef SYSLOG_N_TIMES -#undef DCSYSLOG -#undef DCSYSLOG_IF -#undef DCSYSLOG_EVERY_N -#undef DCSYSLOG_AFTER_N -#undef DCSYSLOG_N_TIMES -#undef DSYSLOG -#undef DSYSLOG_IF -#undef DSYSLOG_EVERY_N -#undef DSYSLOG_AFTER_N -#undef DSYSLOG_N_TIMES -#if defined(ELPP_SYSLOG) -#define CSYSLOG(LEVEL, ...) C##LEVEL(el::base::Writer, el::base::DispatchAction::SysLog, __VA_ARGS__) -#define CSYSLOG_IF(condition, LEVEL, ...) \ - C##LEVEL##_IF(el::base::Writer, condition, el::base::DispatchAction::SysLog, __VA_ARGS__) -#define CSYSLOG_EVERY_N(n, LEVEL, ...) \ - C##LEVEL##_EVERY_N(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) -#define CSYSLOG_AFTER_N(n, LEVEL, ...) \ - C##LEVEL##_AFTER_N(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) -#define CSYSLOG_N_TIMES(n, LEVEL, ...) \ - C##LEVEL##_N_TIMES(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) -#define SYSLOG(LEVEL) CSYSLOG(LEVEL, el::base::consts::kSysLogLoggerId) -#define SYSLOG_IF(condition, LEVEL) CSYSLOG_IF(condition, LEVEL, el::base::consts::kSysLogLoggerId) -#define SYSLOG_EVERY_N(n, LEVEL) CSYSLOG_EVERY_N(n, LEVEL, el::base::consts::kSysLogLoggerId) -#define SYSLOG_AFTER_N(n, LEVEL) CSYSLOG_AFTER_N(n, LEVEL, el::base::consts::kSysLogLoggerId) -#define SYSLOG_N_TIMES(n, LEVEL) CSYSLOG_N_TIMES(n, LEVEL, el::base::consts::kSysLogLoggerId) -#define DCSYSLOG(LEVEL, ...) \ - if (ELPP_DEBUG_LOG) \ - C##LEVEL(el::base::Writer, el::base::DispatchAction::SysLog, __VA_ARGS__) -#define DCSYSLOG_IF(condition, LEVEL, ...) \ - C##LEVEL##_IF(el::base::Writer, (ELPP_DEBUG_LOG) && (condition), el::base::DispatchAction::SysLog, __VA_ARGS__) -#define DCSYSLOG_EVERY_N(n, LEVEL, ...) \ - if (ELPP_DEBUG_LOG) \ - C##LEVEL##_EVERY_N(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) -#define DCSYSLOG_AFTER_N(n, LEVEL, ...) \ - if (ELPP_DEBUG_LOG) \ - C##LEVEL##_AFTER_N(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) -#define DCSYSLOG_N_TIMES(n, LEVEL, ...) \ - if (ELPP_DEBUG_LOG) \ - C##LEVEL##_EVERY_N(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) -#define DSYSLOG(LEVEL) DCSYSLOG(LEVEL, el::base::consts::kSysLogLoggerId) -#define DSYSLOG_IF(condition, LEVEL) DCSYSLOG_IF(condition, LEVEL, el::base::consts::kSysLogLoggerId) -#define DSYSLOG_EVERY_N(n, LEVEL) DCSYSLOG_EVERY_N(n, LEVEL, el::base::consts::kSysLogLoggerId) -#define DSYSLOG_AFTER_N(n, LEVEL) DCSYSLOG_AFTER_N(n, LEVEL, el::base::consts::kSysLogLoggerId) -#define DSYSLOG_N_TIMES(n, LEVEL) DCSYSLOG_N_TIMES(n, LEVEL, el::base::consts::kSysLogLoggerId) -#else -#define CSYSLOG(LEVEL, ...) el::base::NullWriter() -#define CSYSLOG_IF(condition, LEVEL, ...) el::base::NullWriter() -#define CSYSLOG_EVERY_N(n, LEVEL, ...) el::base::NullWriter() -#define CSYSLOG_AFTER_N(n, LEVEL, ...) el::base::NullWriter() -#define CSYSLOG_N_TIMES(n, LEVEL, ...) el::base::NullWriter() -#define SYSLOG(LEVEL) el::base::NullWriter() -#define SYSLOG_IF(condition, LEVEL) el::base::NullWriter() -#define SYSLOG_EVERY_N(n, LEVEL) el::base::NullWriter() -#define SYSLOG_AFTER_N(n, LEVEL) el::base::NullWriter() -#define SYSLOG_N_TIMES(n, LEVEL) el::base::NullWriter() -#define DCSYSLOG(LEVEL, ...) el::base::NullWriter() -#define DCSYSLOG_IF(condition, LEVEL, ...) el::base::NullWriter() -#define DCSYSLOG_EVERY_N(n, LEVEL, ...) el::base::NullWriter() -#define DCSYSLOG_AFTER_N(n, LEVEL, ...) el::base::NullWriter() -#define DCSYSLOG_N_TIMES(n, LEVEL, ...) el::base::NullWriter() -#define DSYSLOG(LEVEL) el::base::NullWriter() -#define DSYSLOG_IF(condition, LEVEL) el::base::NullWriter() -#define DSYSLOG_EVERY_N(n, LEVEL) el::base::NullWriter() -#define DSYSLOG_AFTER_N(n, LEVEL) el::base::NullWriter() -#define DSYSLOG_N_TIMES(n, LEVEL) el::base::NullWriter() -#endif // defined(ELPP_SYSLOG) -// -// Custom Debug Only Loggers - Requires (level, loggerId/s) -// -// undef existing -#undef DCLOG -#undef DCVLOG -#undef DCLOG_IF -#undef DCVLOG_IF -#undef DCLOG_EVERY_N -#undef DCVLOG_EVERY_N -#undef DCLOG_AFTER_N -#undef DCVLOG_AFTER_N -#undef DCLOG_N_TIMES -#undef DCVLOG_N_TIMES -// Normal logs -#define DCLOG(LEVEL, ...) \ - if (ELPP_DEBUG_LOG) \ - CLOG(LEVEL, __VA_ARGS__) -#define DCLOG_VERBOSE(vlevel, ...) \ - if (ELPP_DEBUG_LOG) \ - CLOG_VERBOSE(vlevel, __VA_ARGS__) -#define DCVLOG(vlevel, ...) \ - if (ELPP_DEBUG_LOG) \ - CVLOG(vlevel, __VA_ARGS__) -// Conditional logs -#define DCLOG_IF(condition, LEVEL, ...) \ - if (ELPP_DEBUG_LOG) \ - CLOG_IF(condition, LEVEL, __VA_ARGS__) -#define DCVLOG_IF(condition, vlevel, ...) \ - if (ELPP_DEBUG_LOG) \ - CVLOG_IF(condition, vlevel, __VA_ARGS__) -// Hit counts based logs -#define DCLOG_EVERY_N(n, LEVEL, ...) \ - if (ELPP_DEBUG_LOG) \ - CLOG_EVERY_N(n, LEVEL, __VA_ARGS__) -#define DCVLOG_EVERY_N(n, vlevel, ...) \ - if (ELPP_DEBUG_LOG) \ - CVLOG_EVERY_N(n, vlevel, __VA_ARGS__) -#define DCLOG_AFTER_N(n, LEVEL, ...) \ - if (ELPP_DEBUG_LOG) \ - CLOG_AFTER_N(n, LEVEL, __VA_ARGS__) -#define DCVLOG_AFTER_N(n, vlevel, ...) \ - if (ELPP_DEBUG_LOG) \ - CVLOG_AFTER_N(n, vlevel, __VA_ARGS__) -#define DCLOG_N_TIMES(n, LEVEL, ...) \ - if (ELPP_DEBUG_LOG) \ - CLOG_N_TIMES(n, LEVEL, __VA_ARGS__) -#define DCVLOG_N_TIMES(n, vlevel, ...) \ - if (ELPP_DEBUG_LOG) \ - CVLOG_N_TIMES(n, vlevel, __VA_ARGS__) -// -// Default Debug Only Loggers macro using CLOG(), CLOG_VERBOSE() and CVLOG() macros -// -#if !defined(ELPP_NO_DEBUG_MACROS) -// undef existing -#undef DLOG -#undef DVLOG -#undef DLOG_IF -#undef DVLOG_IF -#undef DLOG_EVERY_N -#undef DVLOG_EVERY_N -#undef DLOG_AFTER_N -#undef DVLOG_AFTER_N -#undef DLOG_N_TIMES -#undef DVLOG_N_TIMES -// Normal logs -#define DLOG(LEVEL) DCLOG(LEVEL, ELPP_CURR_FILE_LOGGER_ID) -#define DVLOG(vlevel) DCVLOG(vlevel, ELPP_CURR_FILE_LOGGER_ID) -// Conditional logs -#define DLOG_IF(condition, LEVEL) DCLOG_IF(condition, LEVEL, ELPP_CURR_FILE_LOGGER_ID) -#define DVLOG_IF(condition, vlevel) DCVLOG_IF(condition, vlevel, ELPP_CURR_FILE_LOGGER_ID) -// Hit counts based logs -#define DLOG_EVERY_N(n, LEVEL) DCLOG_EVERY_N(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) -#define DVLOG_EVERY_N(n, vlevel) DCVLOG_EVERY_N(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) -#define DLOG_AFTER_N(n, LEVEL) DCLOG_AFTER_N(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) -#define DVLOG_AFTER_N(n, vlevel) DCVLOG_AFTER_N(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) -#define DLOG_N_TIMES(n, LEVEL) DCLOG_N_TIMES(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) -#define DVLOG_N_TIMES(n, vlevel) DCVLOG_N_TIMES(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) -#endif // defined(ELPP_NO_DEBUG_MACROS) -#if !defined(ELPP_NO_CHECK_MACROS) -// Check macros -#undef CCHECK -#undef CPCHECK -#undef CCHECK_EQ -#undef CCHECK_NE -#undef CCHECK_LT -#undef CCHECK_GT -#undef CCHECK_LE -#undef CCHECK_GE -#undef CCHECK_BOUNDS -#undef CCHECK_NOTNULL -#undef CCHECK_STRCASEEQ -#undef CCHECK_STRCASENE -#undef CHECK -#undef PCHECK -#undef CHECK_EQ -#undef CHECK_NE -#undef CHECK_LT -#undef CHECK_GT -#undef CHECK_LE -#undef CHECK_GE -#undef CHECK_BOUNDS -#undef CHECK_NOTNULL -#undef CHECK_STRCASEEQ -#undef CHECK_STRCASENE -#define CCHECK(condition, ...) CLOG_IF(!(condition), FATAL, __VA_ARGS__) << "Check failed: [" << #condition << "] " -#define CPCHECK(condition, ...) CPLOG_IF(!(condition), FATAL, __VA_ARGS__) << "Check failed: [" << #condition << "] " -#define CHECK(condition) CCHECK(condition, ELPP_CURR_FILE_LOGGER_ID) -#define PCHECK(condition) CPCHECK(condition, ELPP_CURR_FILE_LOGGER_ID) -#define CCHECK_EQ(a, b, ...) CCHECK(a == b, __VA_ARGS__) -#define CCHECK_NE(a, b, ...) CCHECK(a != b, __VA_ARGS__) -#define CCHECK_LT(a, b, ...) CCHECK(a < b, __VA_ARGS__) -#define CCHECK_GT(a, b, ...) CCHECK(a > b, __VA_ARGS__) -#define CCHECK_LE(a, b, ...) CCHECK(a <= b, __VA_ARGS__) -#define CCHECK_GE(a, b, ...) CCHECK(a >= b, __VA_ARGS__) -#define CCHECK_BOUNDS(val, min, max, ...) CCHECK(val >= min && val <= max, __VA_ARGS__) -#define CHECK_EQ(a, b) CCHECK_EQ(a, b, ELPP_CURR_FILE_LOGGER_ID) -#define CHECK_NE(a, b) CCHECK_NE(a, b, ELPP_CURR_FILE_LOGGER_ID) -#define CHECK_LT(a, b) CCHECK_LT(a, b, ELPP_CURR_FILE_LOGGER_ID) -#define CHECK_GT(a, b) CCHECK_GT(a, b, ELPP_CURR_FILE_LOGGER_ID) -#define CHECK_LE(a, b) CCHECK_LE(a, b, ELPP_CURR_FILE_LOGGER_ID) -#define CHECK_GE(a, b) CCHECK_GE(a, b, ELPP_CURR_FILE_LOGGER_ID) -#define CHECK_BOUNDS(val, min, max) CCHECK_BOUNDS(val, min, max, ELPP_CURR_FILE_LOGGER_ID) -#define CCHECK_NOTNULL(ptr, ...) CCHECK((ptr) != nullptr, __VA_ARGS__) -#define CCHECK_STREQ(str1, str2, ...) \ - CLOG_IF(!el::base::utils::Str::cStringEq(str1, str2), FATAL, __VA_ARGS__) \ - << "Check failed: [" << #str1 << " == " << #str2 << "] " -#define CCHECK_STRNE(str1, str2, ...) \ - CLOG_IF(el::base::utils::Str::cStringEq(str1, str2), FATAL, __VA_ARGS__) \ - << "Check failed: [" << #str1 << " != " << #str2 << "] " -#define CCHECK_STRCASEEQ(str1, str2, ...) \ - CLOG_IF(!el::base::utils::Str::cStringCaseEq(str1, str2), FATAL, __VA_ARGS__) \ - << "Check failed: [" << #str1 << " == " << #str2 << "] " -#define CCHECK_STRCASENE(str1, str2, ...) \ - CLOG_IF(el::base::utils::Str::cStringCaseEq(str1, str2), FATAL, __VA_ARGS__) \ - << "Check failed: [" << #str1 << " != " << #str2 << "] " -#define CHECK_NOTNULL(ptr) CCHECK_NOTNULL((ptr), ELPP_CURR_FILE_LOGGER_ID) -#define CHECK_STREQ(str1, str2) CCHECK_STREQ(str1, str2, ELPP_CURR_FILE_LOGGER_ID) -#define CHECK_STRNE(str1, str2) CCHECK_STRNE(str1, str2, ELPP_CURR_FILE_LOGGER_ID) -#define CHECK_STRCASEEQ(str1, str2) CCHECK_STRCASEEQ(str1, str2, ELPP_CURR_FILE_LOGGER_ID) -#define CHECK_STRCASENE(str1, str2) CCHECK_STRCASENE(str1, str2, ELPP_CURR_FILE_LOGGER_ID) -#undef DCCHECK -#undef DCCHECK_EQ -#undef DCCHECK_NE -#undef DCCHECK_LT -#undef DCCHECK_GT -#undef DCCHECK_LE -#undef DCCHECK_GE -#undef DCCHECK_BOUNDS -#undef DCCHECK_NOTNULL -#undef DCCHECK_STRCASEEQ -#undef DCCHECK_STRCASENE -#undef DCPCHECK -#undef DCHECK -#undef DCHECK_EQ -#undef DCHECK_NE -#undef DCHECK_LT -#undef DCHECK_GT -#undef DCHECK_LE -#undef DCHECK_GE -#undef DCHECK_BOUNDS_ -#undef DCHECK_NOTNULL -#undef DCHECK_STRCASEEQ -#undef DCHECK_STRCASENE -#undef DPCHECK -#define DCCHECK(condition, ...) \ - if (ELPP_DEBUG_LOG) \ - CCHECK(condition, __VA_ARGS__) -#define DCCHECK_EQ(a, b, ...) \ - if (ELPP_DEBUG_LOG) \ - CCHECK_EQ(a, b, __VA_ARGS__) -#define DCCHECK_NE(a, b, ...) \ - if (ELPP_DEBUG_LOG) \ - CCHECK_NE(a, b, __VA_ARGS__) -#define DCCHECK_LT(a, b, ...) \ - if (ELPP_DEBUG_LOG) \ - CCHECK_LT(a, b, __VA_ARGS__) -#define DCCHECK_GT(a, b, ...) \ - if (ELPP_DEBUG_LOG) \ - CCHECK_GT(a, b, __VA_ARGS__) -#define DCCHECK_LE(a, b, ...) \ - if (ELPP_DEBUG_LOG) \ - CCHECK_LE(a, b, __VA_ARGS__) -#define DCCHECK_GE(a, b, ...) \ - if (ELPP_DEBUG_LOG) \ - CCHECK_GE(a, b, __VA_ARGS__) -#define DCCHECK_BOUNDS(val, min, max, ...) \ - if (ELPP_DEBUG_LOG) \ - CCHECK_BOUNDS(val, min, max, __VA_ARGS__) -#define DCCHECK_NOTNULL(ptr, ...) \ - if (ELPP_DEBUG_LOG) \ - CCHECK_NOTNULL((ptr), __VA_ARGS__) -#define DCCHECK_STREQ(str1, str2, ...) \ - if (ELPP_DEBUG_LOG) \ - CCHECK_STREQ(str1, str2, __VA_ARGS__) -#define DCCHECK_STRNE(str1, str2, ...) \ - if (ELPP_DEBUG_LOG) \ - CCHECK_STRNE(str1, str2, __VA_ARGS__) -#define DCCHECK_STRCASEEQ(str1, str2, ...) \ - if (ELPP_DEBUG_LOG) \ - CCHECK_STRCASEEQ(str1, str2, __VA_ARGS__) -#define DCCHECK_STRCASENE(str1, str2, ...) \ - if (ELPP_DEBUG_LOG) \ - CCHECK_STRCASENE(str1, str2, __VA_ARGS__) -#define DCPCHECK(condition, ...) \ - if (ELPP_DEBUG_LOG) \ - CPCHECK(condition, __VA_ARGS__) -#define DCHECK(condition) DCCHECK(condition, ELPP_CURR_FILE_LOGGER_ID) -#define DCHECK_EQ(a, b) DCCHECK_EQ(a, b, ELPP_CURR_FILE_LOGGER_ID) -#define DCHECK_NE(a, b) DCCHECK_NE(a, b, ELPP_CURR_FILE_LOGGER_ID) -#define DCHECK_LT(a, b) DCCHECK_LT(a, b, ELPP_CURR_FILE_LOGGER_ID) -#define DCHECK_GT(a, b) DCCHECK_GT(a, b, ELPP_CURR_FILE_LOGGER_ID) -#define DCHECK_LE(a, b) DCCHECK_LE(a, b, ELPP_CURR_FILE_LOGGER_ID) -#define DCHECK_GE(a, b) DCCHECK_GE(a, b, ELPP_CURR_FILE_LOGGER_ID) -#define DCHECK_BOUNDS(val, min, max) DCCHECK_BOUNDS(val, min, max, ELPP_CURR_FILE_LOGGER_ID) -#define DCHECK_NOTNULL(ptr) DCCHECK_NOTNULL((ptr), ELPP_CURR_FILE_LOGGER_ID) -#define DCHECK_STREQ(str1, str2) DCCHECK_STREQ(str1, str2, ELPP_CURR_FILE_LOGGER_ID) -#define DCHECK_STRNE(str1, str2) DCCHECK_STRNE(str1, str2, ELPP_CURR_FILE_LOGGER_ID) -#define DCHECK_STRCASEEQ(str1, str2) DCCHECK_STRCASEEQ(str1, str2, ELPP_CURR_FILE_LOGGER_ID) -#define DCHECK_STRCASENE(str1, str2) DCCHECK_STRCASENE(str1, str2, ELPP_CURR_FILE_LOGGER_ID) -#define DPCHECK(condition) DCPCHECK(condition, ELPP_CURR_FILE_LOGGER_ID) -#endif // defined(ELPP_NO_CHECK_MACROS) -#if defined(ELPP_DISABLE_DEFAULT_CRASH_HANDLING) -#define ELPP_USE_DEF_CRASH_HANDLER false -#else -#define ELPP_USE_DEF_CRASH_HANDLER true -#endif // defined(ELPP_DISABLE_DEFAULT_CRASH_HANDLING) -#define ELPP_CRASH_HANDLER_INIT -#define ELPP_INIT_EASYLOGGINGPP(val) \ - namespace el { \ - namespace base { \ - el::base::type::StoragePointer elStorage(val); \ - } \ - el::base::debug::CrashHandler elCrashHandler(ELPP_USE_DEF_CRASH_HANDLER); \ - } - -#if ELPP_ASYNC_LOGGING -#define INITIALIZE_EASYLOGGINGPP \ - ELPP_INIT_EASYLOGGINGPP(new el::base::Storage(el::LogBuilderPtr(new el::base::DefaultLogBuilder()), \ - new el::base::AsyncDispatchWorker())) -#else -#define INITIALIZE_EASYLOGGINGPP \ - ELPP_INIT_EASYLOGGINGPP(new el::base::Storage(el::LogBuilderPtr(new el::base::DefaultLogBuilder()))) -#endif // ELPP_ASYNC_LOGGING -#define INITIALIZE_NULL_EASYLOGGINGPP \ - namespace el { \ - namespace base { \ - el::base::type::StoragePointer elStorage; \ - } \ - el::base::debug::CrashHandler elCrashHandler(ELPP_USE_DEF_CRASH_HANDLER); \ - } -#define SHARE_EASYLOGGINGPP(initializedStorage) \ - namespace el { \ - namespace base { \ - el::base::type::StoragePointer elStorage(initializedStorage); \ - } \ - el::base::debug::CrashHandler elCrashHandler(ELPP_USE_DEF_CRASH_HANDLER); \ - } - -#if defined(ELPP_UNICODE) -#define START_EASYLOGGINGPP(argc, argv) \ - el::Helpers::setArgs(argc, argv); \ - std::locale::global(std::locale("")) -#else -#define START_EASYLOGGINGPP(argc, argv) el::Helpers::setArgs(argc, argv) -#endif // defined(ELPP_UNICODE) -#endif // EASYLOGGINGPP_H diff --git a/proxy/thirdparty/grpc/CMakeLists.txt b/proxy/thirdparty/grpc/CMakeLists.txt deleted file mode 100644 index b39512ff57..0000000000 --- a/proxy/thirdparty/grpc/CMakeLists.txt +++ /dev/null @@ -1,76 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. -#------------------------------------------------------------------------------- - -if ( DEFINED ENV{MILVUS_GRPC_URL} ) - set( GRPC_SOURCE_URL "$ENV{MILVUS_GRPC_URL}" ) -else() - set( GRPC_SOURCE_URL - "https://github.com/milvus-io/grpc-milvus/archive/${GRPC_VERSION}.zip" - ) -endif() - -message( STATUS "Building GRPC-${GRPC_VERSION} from source" ) -FetchContent_Declare( - grpc - URL ${GRPC_SOURCE_URL} - URL_MD5 "f11a28bebdc14e7790dab64743a96836" - DOWNLOAD_DIR ${MILVUS_BINARY_DIR}/3rdparty_download/download - SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/grpc-src - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/grpc-build ) - -# using openSSL rather than boringssl -set(gRPC_SSL_PROVIDER "package" CACHE STRING "OPENSSL" FORCE) -FetchContent_GetProperties( grpc ) - -if ( NOT grpc_POPULATED ) - FetchContent_Populate( grpc ) - - # Adding the following targets: - # libprotobuf - # grpc++_reflection - # protoc (excutable) - # grpc++ - add_subdirectory( ${grpc_SOURCE_DIR} - ${grpc_BINARY_DIR} - EXCLUDE_FROM_ALL ) -endif() - -# get grpc COMPILE_OPTIONS ) -get_property( var DIRECTORY "${grpc_SOURCE_DIR}" PROPERTY COMPILE_OPTIONS ) -message( STATUS "grpc src compile options: ${var}" ) - - -# ************************************************************************** -# TODO grpc file dependee -# generate cc files -# ************************************************************************** -set( PROTOC_EXCUTABLE $ ) -set( GRPC_CPP_PLUGIN_EXCUTABLE $ ) -set( PROTO_PATH "${MILVUS_SOURCE_DIR}/src/grpc" ) -set( PROTO_GEN_SCRIPTS_DIR "${PROJECT_SOURCE_DIR}/../scripts") - -add_custom_target(generate_suvlim_pb_grpc ALL DEPENDS protoc grpc_cpp_plugin) - -add_custom_command(TARGET generate_suvlim_pb_grpc - POST_BUILD - COMMAND echo "${PROTOC_EXCUTABLE}" - COMMAND bash "${PROTO_GEN_SCRIPTS_DIR}/generate_go.sh" -p "${PROTOC_EXCUTABLE}" - COMMAND bash "${PROTO_GEN_SCRIPTS_DIR}/generate_cpp.sh" -p "${PROTOC_EXCUTABLE}" -g "${GRPC_CPP_PLUGIN_EXCUTABLE}" - COMMAND ${PROTOC_EXCUTABLE} -I "${PROTO_PATH}/proto" --grpc_out "${PROTO_PATH}" --cpp_out "${PROTO_PATH}" - --plugin=protoc-gen-grpc="${GRPC_CPP_PLUGIN_EXCUTABLE}" - "${PROTO_PATH}/proto/etcd.proto" - DEPENDS "${PROTO_PATH}/proto/etcd.proto" - ) - -set_property( GLOBAL PROPERTY PROTOC_EXCUTABLE ${PROTOC_EXCUTABLE}) -set_property( GLOBAL PROPERTY GRPC_CPP_PLUGIN_EXCUTABLE ${GRPC_CPP_PLUGIN_EXCUTABLE}) diff --git a/proxy/thirdparty/gtest/CMakeLists.txt b/proxy/thirdparty/gtest/CMakeLists.txt deleted file mode 100644 index 139fbfc5ac..0000000000 --- a/proxy/thirdparty/gtest/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. -#------------------------------------------------------------------------------- - -if ( DEFINED ENV{MILVUS_GTEST_URL} ) - set( GTEST_SOURCE_URL "$ENV{MILVUS_GTEST_URL}" ) -else() - set( GTEST_SOURCE_URL - "https://gitee.com/quicksilver/googletest/repository/archive/release-${GTEST_VERSION}.zip" ) -endif() - -message( STATUS "Building gtest-${GTEST_VERSION} from source" ) -include( FetchContent ) -set( CMAKE_POLICY_DEFAULT_CMP0022 NEW ) # for googletest only - -FetchContent_Declare( - googletest - URL ${GTEST_SOURCE_URL} - URL_MD5 "f9137c5bc18b7d74027936f0f1bfa5c8" - DOWNLOAD_DIR ${MILVUS_BINARY_DIR}/3rdparty_download/download - SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest-src - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest-build - -) - -if ( NOT googletest_POPULATED ) - FetchContent_Populate( googletest ) - - # Adding the following targets: - # gtest, gtest_main, gmock, gmock_main - add_subdirectory( ${googletest_SOURCE_DIR} - ${googletest_BINARY_DIR} - EXCLUDE_FROM_ALL ) -endif() - -# **************************************************************** -# Create ALIAS Target -# **************************************************************** -# if (NOT TARGET GTest:gtest) -# add_library( GTest::gtest ALIAS gtest ) -# endif() -# if (NOT TARGET GTest:main) -# add_library( GTest::main ALIAS gtest_main ) -# endif() -# if (NOT TARGET GMock:gmock) -# target_link_libraries( gmock INTERFACE GTest::gtest ) -# add_library( GMock::gmock ALIAS gmock ) -# endif() -# if (NOT TARGET GMock:main) -# target_link_libraries( gmock_main INTERFACE GTest::gtest ) -# add_library( GMock::main ALIAS gmock_main ) -# endif() - - -get_property( var DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/googletest-src" PROPERTY COMPILE_OPTIONS ) -message( STATUS "gtest compile options: ${var}" ) diff --git a/proxy/thirdparty/nlohmann/json.hpp b/proxy/thirdparty/nlohmann/json.hpp deleted file mode 100644 index 4acdcd3aea..0000000000 --- a/proxy/thirdparty/nlohmann/json.hpp +++ /dev/null @@ -1,21006 +0,0 @@ -/* - __ _____ _____ _____ - __| | __| | | | JSON for Modern C++ -| | |__ | | | | | | version 3.7.0 -|_____|_____|_____|_|___| https://github.com/nlohmann/json - -Licensed under the MIT License . -SPDX-License-Identifier: MIT -Copyright (c) 2013-2019 Niels Lohmann . - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#ifndef INCLUDE_NLOHMANN_JSON_HPP_ -#define INCLUDE_NLOHMANN_JSON_HPP_ - -#define NLOHMANN_JSON_VERSION_MAJOR 3 -#define NLOHMANN_JSON_VERSION_MINOR 7 -#define NLOHMANN_JSON_VERSION_PATCH 0 - -#include // all_of, find, for_each -#include // assert -#include // and, not, or -#include // nullptr_t, ptrdiff_t, size_t -#include // hash, less -#include // initializer_list -#include // istream, ostream -#include // random_access_iterator_tag -#include // unique_ptr -#include // accumulate -#include // string, stoi, to_string -#include // declval, forward, move, pair, swap -#include // vector - -// #include - -#include - -// #include - -#include // transform -#include // array -#include // and, not -#include // forward_list -#include // inserter, front_inserter, end -#include // map -#include // string -#include // tuple, make_tuple -#include // is_arithmetic, is_same, is_enum, underlying_type, is_convertible -#include // unordered_map -#include // pair, declval -#include // valarray - -// #include - -#include // exception -#include // runtime_error -#include // to_string - -// #include - -#include // size_t - -namespace nlohmann { -namespace detail { -/// struct to capture the start position of the current token -struct position_t { - /// the total number of characters read - std::size_t chars_read_total = 0; - /// the number of characters read in the current line - std::size_t chars_read_current_line = 0; - /// the number of lines read - std::size_t lines_read = 0; - - /// conversion to size_t to preserve SAX interface - constexpr operator size_t() const { - return chars_read_total; - } -}; - -} // namespace detail -} // namespace nlohmann - -// #include - -#include // pair -// #include -/* Hedley - https://nemequ.github.io/hedley - * Created by Evan Nemerson - * - * To the extent possible under law, the author(s) have dedicated all - * copyright and related and neighboring rights to this software to - * the public domain worldwide. This software is distributed without - * any warranty. - * - * For details, see . - * SPDX-License-Identifier: CC0-1.0 - */ - -#if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 9) -#if defined(JSON_HEDLEY_VERSION) -#undef JSON_HEDLEY_VERSION -#endif -#define JSON_HEDLEY_VERSION 9 - -#if defined(JSON_HEDLEY_STRINGIFY_EX) -#undef JSON_HEDLEY_STRINGIFY_EX -#endif -#define JSON_HEDLEY_STRINGIFY_EX(x) #x - -#if defined(JSON_HEDLEY_STRINGIFY) -#undef JSON_HEDLEY_STRINGIFY -#endif -#define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x) - -#if defined(JSON_HEDLEY_CONCAT_EX) -#undef JSON_HEDLEY_CONCAT_EX -#endif -#define JSON_HEDLEY_CONCAT_EX(a, b) a##b - -#if defined(JSON_HEDLEY_CONCAT) -#undef JSON_HEDLEY_CONCAT -#endif -#define JSON_HEDLEY_CONCAT(a, b) JSON_HEDLEY_CONCAT_EX(a, b) - -#if defined(JSON_HEDLEY_VERSION_ENCODE) -#undef JSON_HEDLEY_VERSION_ENCODE -#endif -#define JSON_HEDLEY_VERSION_ENCODE(major, minor, revision) (((major)*1000000) + ((minor)*1000) + (revision)) - -#if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR) -#undef JSON_HEDLEY_VERSION_DECODE_MAJOR -#endif -#define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) - -#if defined(JSON_HEDLEY_VERSION_DECODE_MINOR) -#undef JSON_HEDLEY_VERSION_DECODE_MINOR -#endif -#define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) - -#if defined(JSON_HEDLEY_VERSION_DECODE_REVISION) -#undef JSON_HEDLEY_VERSION_DECODE_REVISION -#endif -#define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) - -#if defined(JSON_HEDLEY_GNUC_VERSION) -#undef JSON_HEDLEY_GNUC_VERSION -#endif -#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) -#define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) -#elif defined(__GNUC__) -#define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) -#endif - -#if defined(JSON_HEDLEY_GNUC_VERSION_CHECK) -#undef JSON_HEDLEY_GNUC_VERSION_CHECK -#endif -#if defined(JSON_HEDLEY_GNUC_VERSION) -#define JSON_HEDLEY_GNUC_VERSION_CHECK(major, minor, patch) \ - (JSON_HEDLEY_GNUC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) -#else -#define JSON_HEDLEY_GNUC_VERSION_CHECK(major, minor, patch) (0) -#endif - -#if defined(JSON_HEDLEY_MSVC_VERSION) -#undef JSON_HEDLEY_MSVC_VERSION -#endif -#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) -#define JSON_HEDLEY_MSVC_VERSION \ - JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, \ - (_MSC_FULL_VER % 100000) / 100) -#elif defined(_MSC_FULL_VER) -#define JSON_HEDLEY_MSVC_VERSION \ - JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) -#elif defined(_MSC_VER) -#define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) -#endif - -#if defined(JSON_HEDLEY_MSVC_VERSION_CHECK) -#undef JSON_HEDLEY_MSVC_VERSION_CHECK -#endif -#if !defined(_MSC_VER) -#define JSON_HEDLEY_MSVC_VERSION_CHECK(major, minor, patch) (0) -#elif defined(_MSC_VER) && (_MSC_VER >= 1400) -#define JSON_HEDLEY_MSVC_VERSION_CHECK(major, minor, patch) \ - (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) -#elif defined(_MSC_VER) && (_MSC_VER >= 1200) -#define JSON_HEDLEY_MSVC_VERSION_CHECK(major, minor, patch) \ - (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) -#else -#define JSON_HEDLEY_MSVC_VERSION_CHECK(major, minor, patch) (_MSC_VER >= ((major * 100) + (minor))) -#endif - -#if defined(JSON_HEDLEY_INTEL_VERSION) -#undef JSON_HEDLEY_INTEL_VERSION -#endif -#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) -#define JSON_HEDLEY_INTEL_VERSION \ - JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) -#elif defined(__INTEL_COMPILER) -#define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) -#endif - -#if defined(JSON_HEDLEY_INTEL_VERSION_CHECK) -#undef JSON_HEDLEY_INTEL_VERSION_CHECK -#endif -#if defined(JSON_HEDLEY_INTEL_VERSION) -#define JSON_HEDLEY_INTEL_VERSION_CHECK(major, minor, patch) \ - (JSON_HEDLEY_INTEL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) -#else -#define JSON_HEDLEY_INTEL_VERSION_CHECK(major, minor, patch) (0) -#endif - -#if defined(JSON_HEDLEY_PGI_VERSION) -#undef JSON_HEDLEY_PGI_VERSION -#endif -#if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) -#define JSON_HEDLEY_PGI_VERSION JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) -#endif - -#if defined(JSON_HEDLEY_PGI_VERSION_CHECK) -#undef JSON_HEDLEY_PGI_VERSION_CHECK -#endif -#if defined(JSON_HEDLEY_PGI_VERSION) -#define JSON_HEDLEY_PGI_VERSION_CHECK(major, minor, patch) \ - (JSON_HEDLEY_PGI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) -#else -#define JSON_HEDLEY_PGI_VERSION_CHECK(major, minor, patch) (0) -#endif - -#if defined(JSON_HEDLEY_SUNPRO_VERSION) -#undef JSON_HEDLEY_SUNPRO_VERSION -#endif -#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) -#define JSON_HEDLEY_SUNPRO_VERSION \ - JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), \ - (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) -#elif defined(__SUNPRO_C) -#define JSON_HEDLEY_SUNPRO_VERSION \ - JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C)&0xf) -#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) -#define JSON_HEDLEY_SUNPRO_VERSION \ - JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), \ - (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), \ - (__SUNPRO_CC & 0xf) * 10) -#elif defined(__SUNPRO_CC) -#define JSON_HEDLEY_SUNPRO_VERSION \ - JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC)&0xf) -#endif - -#if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK) -#undef JSON_HEDLEY_SUNPRO_VERSION_CHECK -#endif -#if defined(JSON_HEDLEY_SUNPRO_VERSION) -#define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major, minor, patch) \ - (JSON_HEDLEY_SUNPRO_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) -#else -#define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major, minor, patch) (0) -#endif - -#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) -#undef JSON_HEDLEY_EMSCRIPTEN_VERSION -#endif -#if defined(__EMSCRIPTEN__) -#define JSON_HEDLEY_EMSCRIPTEN_VERSION \ - JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) -#endif - -#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) -#undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK -#endif -#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) -#define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major, minor, patch) \ - (JSON_HEDLEY_EMSCRIPTEN_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) -#else -#define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major, minor, patch) (0) -#endif - -#if defined(JSON_HEDLEY_ARM_VERSION) -#undef JSON_HEDLEY_ARM_VERSION -#endif -#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) -#define JSON_HEDLEY_ARM_VERSION \ - JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, \ - (__ARMCOMPILER_VERSION % 10000) / 100) -#elif defined(__CC_ARM) && defined(__ARMCC_VERSION) -#define JSON_HEDLEY_ARM_VERSION \ - JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, \ - (__ARMCC_VERSION % 10000) / 100) -#endif - -#if defined(JSON_HEDLEY_ARM_VERSION_CHECK) -#undef JSON_HEDLEY_ARM_VERSION_CHECK -#endif -#if defined(JSON_HEDLEY_ARM_VERSION) -#define JSON_HEDLEY_ARM_VERSION_CHECK(major, minor, patch) \ - (JSON_HEDLEY_ARM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) -#else -#define JSON_HEDLEY_ARM_VERSION_CHECK(major, minor, patch) (0) -#endif - -#if defined(JSON_HEDLEY_IBM_VERSION) -#undef JSON_HEDLEY_IBM_VERSION -#endif -#if defined(__ibmxl__) -#define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) -#elif defined(__xlC__) && defined(__xlC_ver__) -#define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) -#elif defined(__xlC__) -#define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) -#endif - -#if defined(JSON_HEDLEY_IBM_VERSION_CHECK) -#undef JSON_HEDLEY_IBM_VERSION_CHECK -#endif -#if defined(JSON_HEDLEY_IBM_VERSION) -#define JSON_HEDLEY_IBM_VERSION_CHECK(major, minor, patch) \ - (JSON_HEDLEY_IBM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) -#else -#define JSON_HEDLEY_IBM_VERSION_CHECK(major, minor, patch) (0) -#endif - -#if defined(JSON_HEDLEY_TI_VERSION) -#undef JSON_HEDLEY_TI_VERSION -#endif -#if defined(__TI_COMPILER_VERSION__) -#define JSON_HEDLEY_TI_VERSION \ - JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, \ - (__TI_COMPILER_VERSION__ % 1000)) -#endif - -#if defined(JSON_HEDLEY_TI_VERSION_CHECK) -#undef JSON_HEDLEY_TI_VERSION_CHECK -#endif -#if defined(JSON_HEDLEY_TI_VERSION) -#define JSON_HEDLEY_TI_VERSION_CHECK(major, minor, patch) \ - (JSON_HEDLEY_TI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) -#else -#define JSON_HEDLEY_TI_VERSION_CHECK(major, minor, patch) (0) -#endif - -#if defined(JSON_HEDLEY_CRAY_VERSION) -#undef JSON_HEDLEY_CRAY_VERSION -#endif -#if defined(_CRAYC) -#if defined(_RELEASE_PATCHLEVEL) -#define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) -#else -#define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) -#endif -#endif - -#if defined(JSON_HEDLEY_CRAY_VERSION_CHECK) -#undef JSON_HEDLEY_CRAY_VERSION_CHECK -#endif -#if defined(JSON_HEDLEY_CRAY_VERSION) -#define JSON_HEDLEY_CRAY_VERSION_CHECK(major, minor, patch) \ - (JSON_HEDLEY_CRAY_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) -#else -#define JSON_HEDLEY_CRAY_VERSION_CHECK(major, minor, patch) (0) -#endif - -#if defined(JSON_HEDLEY_IAR_VERSION) -#undef JSON_HEDLEY_IAR_VERSION -#endif -#if defined(__IAR_SYSTEMS_ICC__) -#if __VER__ > 1000 -#define JSON_HEDLEY_IAR_VERSION \ - JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) -#else -#define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0) -#endif -#endif - -#if defined(JSON_HEDLEY_IAR_VERSION_CHECK) -#undef JSON_HEDLEY_IAR_VERSION_CHECK -#endif -#if defined(JSON_HEDLEY_IAR_VERSION) -#define JSON_HEDLEY_IAR_VERSION_CHECK(major, minor, patch) \ - (JSON_HEDLEY_IAR_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) -#else -#define JSON_HEDLEY_IAR_VERSION_CHECK(major, minor, patch) (0) -#endif - -#if defined(JSON_HEDLEY_TINYC_VERSION) -#undef JSON_HEDLEY_TINYC_VERSION -#endif -#if defined(__TINYC__) -#define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) -#endif - -#if defined(JSON_HEDLEY_TINYC_VERSION_CHECK) -#undef JSON_HEDLEY_TINYC_VERSION_CHECK -#endif -#if defined(JSON_HEDLEY_TINYC_VERSION) -#define JSON_HEDLEY_TINYC_VERSION_CHECK(major, minor, patch) \ - (JSON_HEDLEY_TINYC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) -#else -#define JSON_HEDLEY_TINYC_VERSION_CHECK(major, minor, patch) (0) -#endif - -#if defined(JSON_HEDLEY_DMC_VERSION) -#undef JSON_HEDLEY_DMC_VERSION -#endif -#if defined(__DMC__) -#define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) -#endif - -#if defined(JSON_HEDLEY_DMC_VERSION_CHECK) -#undef JSON_HEDLEY_DMC_VERSION_CHECK -#endif -#if defined(JSON_HEDLEY_DMC_VERSION) -#define JSON_HEDLEY_DMC_VERSION_CHECK(major, minor, patch) \ - (JSON_HEDLEY_DMC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) -#else -#define JSON_HEDLEY_DMC_VERSION_CHECK(major, minor, patch) (0) -#endif - -#if defined(JSON_HEDLEY_COMPCERT_VERSION) -#undef JSON_HEDLEY_COMPCERT_VERSION -#endif -#if defined(__COMPCERT_VERSION__) -#define JSON_HEDLEY_COMPCERT_VERSION \ - JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, \ - __COMPCERT_VERSION__ % 100) -#endif - -#if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK) -#undef JSON_HEDLEY_COMPCERT_VERSION_CHECK -#endif -#if defined(JSON_HEDLEY_COMPCERT_VERSION) -#define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major, minor, patch) \ - (JSON_HEDLEY_COMPCERT_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) -#else -#define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major, minor, patch) (0) -#endif - -#if defined(JSON_HEDLEY_PELLES_VERSION) -#undef JSON_HEDLEY_PELLES_VERSION -#endif -#if defined(__POCC__) -#define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) -#endif - -#if defined(JSON_HEDLEY_PELLES_VERSION_CHECK) -#undef JSON_HEDLEY_PELLES_VERSION_CHECK -#endif -#if defined(JSON_HEDLEY_PELLES_VERSION) -#define JSON_HEDLEY_PELLES_VERSION_CHECK(major, minor, patch) \ - (JSON_HEDLEY_PELLES_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) -#else -#define JSON_HEDLEY_PELLES_VERSION_CHECK(major, minor, patch) (0) -#endif - -#if defined(JSON_HEDLEY_GCC_VERSION) -#undef JSON_HEDLEY_GCC_VERSION -#endif -#if defined(JSON_HEDLEY_GNUC_VERSION) && !defined(__clang__) && !defined(JSON_HEDLEY_INTEL_VERSION) && \ - !defined(JSON_HEDLEY_PGI_VERSION) && !defined(JSON_HEDLEY_ARM_VERSION) && !defined(JSON_HEDLEY_TI_VERSION) && \ - !defined(__COMPCERT__) -#define JSON_HEDLEY_GCC_VERSION JSON_HEDLEY_GNUC_VERSION -#endif - -#if defined(JSON_HEDLEY_GCC_VERSION_CHECK) -#undef JSON_HEDLEY_GCC_VERSION_CHECK -#endif -#if defined(JSON_HEDLEY_GCC_VERSION) -#define JSON_HEDLEY_GCC_VERSION_CHECK(major, minor, patch) \ - (JSON_HEDLEY_GCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) -#else -#define JSON_HEDLEY_GCC_VERSION_CHECK(major, minor, patch) (0) -#endif - -#if defined(JSON_HEDLEY_HAS_ATTRIBUTE) -#undef JSON_HEDLEY_HAS_ATTRIBUTE -#endif -#if defined(__has_attribute) -#define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) -#else -#define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) -#endif - -#if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) -#undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE -#endif -#if defined(__has_attribute) -#define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute, major, minor, patch) __has_attribute(attribute) -#else -#define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute, major, minor, patch) \ - JSON_HEDLEY_GNUC_VERSION_CHECK(major, minor, patch) -#endif - -#if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE) -#undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE -#endif -#if defined(__has_attribute) -#define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute, major, minor, patch) __has_attribute(attribute) -#else -#define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute, major, minor, patch) JSON_HEDLEY_GCC_VERSION_CHECK(major, minor, patch) -#endif - -#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE) -#undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE -#endif -#if defined(__has_cpp_attribute) && defined(__cplusplus) -#define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) -#else -#define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) -#endif - -#if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) -#undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE -#endif -#if defined(__has_cpp_attribute) && defined(__cplusplus) -#define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute, major, minor, patch) __has_cpp_attribute(attribute) -#else -#define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute, major, minor, patch) \ - JSON_HEDLEY_GNUC_VERSION_CHECK(major, minor, patch) -#endif - -#if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) -#undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE -#endif -#if defined(__has_cpp_attribute) && defined(__cplusplus) -#define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute, major, minor, patch) __has_cpp_attribute(attribute) -#else -#define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute, major, minor, patch) \ - JSON_HEDLEY_GCC_VERSION_CHECK(major, minor, patch) -#endif - -#if defined(JSON_HEDLEY_HAS_BUILTIN) -#undef JSON_HEDLEY_HAS_BUILTIN -#endif -#if defined(__has_builtin) -#define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) -#else -#define JSON_HEDLEY_HAS_BUILTIN(builtin) (0) -#endif - -#if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN) -#undef JSON_HEDLEY_GNUC_HAS_BUILTIN -#endif -#if defined(__has_builtin) -#define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin, major, minor, patch) __has_builtin(builtin) -#else -#define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin, major, minor, patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major, minor, patch) -#endif - -#if defined(JSON_HEDLEY_GCC_HAS_BUILTIN) -#undef JSON_HEDLEY_GCC_HAS_BUILTIN -#endif -#if defined(__has_builtin) -#define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin, major, minor, patch) __has_builtin(builtin) -#else -#define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin, major, minor, patch) JSON_HEDLEY_GCC_VERSION_CHECK(major, minor, patch) -#endif - -#if defined(JSON_HEDLEY_HAS_FEATURE) -#undef JSON_HEDLEY_HAS_FEATURE -#endif -#if defined(__has_feature) -#define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) -#else -#define JSON_HEDLEY_HAS_FEATURE(feature) (0) -#endif - -#if defined(JSON_HEDLEY_GNUC_HAS_FEATURE) -#undef JSON_HEDLEY_GNUC_HAS_FEATURE -#endif -#if defined(__has_feature) -#define JSON_HEDLEY_GNUC_HAS_FEATURE(feature, major, minor, patch) __has_feature(feature) -#else -#define JSON_HEDLEY_GNUC_HAS_FEATURE(feature, major, minor, patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major, minor, patch) -#endif - -#if defined(JSON_HEDLEY_GCC_HAS_FEATURE) -#undef JSON_HEDLEY_GCC_HAS_FEATURE -#endif -#if defined(__has_feature) -#define JSON_HEDLEY_GCC_HAS_FEATURE(feature, major, minor, patch) __has_feature(feature) -#else -#define JSON_HEDLEY_GCC_HAS_FEATURE(feature, major, minor, patch) JSON_HEDLEY_GCC_VERSION_CHECK(major, minor, patch) -#endif - -#if defined(JSON_HEDLEY_HAS_EXTENSION) -#undef JSON_HEDLEY_HAS_EXTENSION -#endif -#if defined(__has_extension) -#define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) -#else -#define JSON_HEDLEY_HAS_EXTENSION(extension) (0) -#endif - -#if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION) -#undef JSON_HEDLEY_GNUC_HAS_EXTENSION -#endif -#if defined(__has_extension) -#define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension, major, minor, patch) __has_extension(extension) -#else -#define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension, major, minor, patch) \ - JSON_HEDLEY_GNUC_VERSION_CHECK(major, minor, patch) -#endif - -#if defined(JSON_HEDLEY_GCC_HAS_EXTENSION) -#undef JSON_HEDLEY_GCC_HAS_EXTENSION -#endif -#if defined(__has_extension) -#define JSON_HEDLEY_GCC_HAS_EXTENSION(extension, major, minor, patch) __has_extension(extension) -#else -#define JSON_HEDLEY_GCC_HAS_EXTENSION(extension, major, minor, patch) JSON_HEDLEY_GCC_VERSION_CHECK(major, minor, patch) -#endif - -#if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) -#undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE -#endif -#if defined(__has_declspec_attribute) -#define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) -#else -#define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) -#endif - -#if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) -#undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE -#endif -#if defined(__has_declspec_attribute) -#define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute, major, minor, patch) __has_declspec_attribute(attribute) -#else -#define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute, major, minor, patch) \ - JSON_HEDLEY_GNUC_VERSION_CHECK(major, minor, patch) -#endif - -#if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) -#undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE -#endif -#if defined(__has_declspec_attribute) -#define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute, major, minor, patch) __has_declspec_attribute(attribute) -#else -#define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute, major, minor, patch) \ - JSON_HEDLEY_GCC_VERSION_CHECK(major, minor, patch) -#endif - -#if defined(JSON_HEDLEY_HAS_WARNING) -#undef JSON_HEDLEY_HAS_WARNING -#endif -#if defined(__has_warning) -#define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) -#else -#define JSON_HEDLEY_HAS_WARNING(warning) (0) -#endif - -#if defined(JSON_HEDLEY_GNUC_HAS_WARNING) -#undef JSON_HEDLEY_GNUC_HAS_WARNING -#endif -#if defined(__has_warning) -#define JSON_HEDLEY_GNUC_HAS_WARNING(warning, major, minor, patch) __has_warning(warning) -#else -#define JSON_HEDLEY_GNUC_HAS_WARNING(warning, major, minor, patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major, minor, patch) -#endif - -#if defined(JSON_HEDLEY_GCC_HAS_WARNING) -#undef JSON_HEDLEY_GCC_HAS_WARNING -#endif -#if defined(__has_warning) -#define JSON_HEDLEY_GCC_HAS_WARNING(warning, major, minor, patch) __has_warning(warning) -#else -#define JSON_HEDLEY_GCC_HAS_WARNING(warning, major, minor, patch) JSON_HEDLEY_GCC_VERSION_CHECK(major, minor, patch) -#endif - -#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || defined(__clang__) || \ - JSON_HEDLEY_GCC_VERSION_CHECK(3, 0, 0) || JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \ - JSON_HEDLEY_IAR_VERSION_CHECK(8, 0, 0) || JSON_HEDLEY_PGI_VERSION_CHECK(18, 4, 0) || \ - JSON_HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || JSON_HEDLEY_TI_VERSION_CHECK(6, 0, 0) || \ - JSON_HEDLEY_CRAY_VERSION_CHECK(5, 0, 0) || JSON_HEDLEY_TINYC_VERSION_CHECK(0, 9, 17) || \ - JSON_HEDLEY_SUNPRO_VERSION_CHECK(8, 0, 0) || \ - (JSON_HEDLEY_IBM_VERSION_CHECK(10, 1, 0) && defined(__C99_PRAGMA_OPERATOR)) -#define JSON_HEDLEY_PRAGMA(value) _Pragma(#value) -#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15, 0, 0) -#define JSON_HEDLEY_PRAGMA(value) __pragma(value) -#else -#define JSON_HEDLEY_PRAGMA(value) -#endif - -#if defined(JSON_HEDLEY_DIAGNOSTIC_PUSH) -#undef JSON_HEDLEY_DIAGNOSTIC_PUSH -#endif -#if defined(JSON_HEDLEY_DIAGNOSTIC_POP) -#undef JSON_HEDLEY_DIAGNOSTIC_POP -#endif -#if defined(__clang__) -#define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") -#define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") -#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) -#define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") -#define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") -#elif JSON_HEDLEY_GCC_VERSION_CHECK(4, 6, 0) -#define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") -#define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") -#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15, 0, 0) -#define JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) -#define JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) -#elif JSON_HEDLEY_ARM_VERSION_CHECK(5, 6, 0) -#define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") -#define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop") -#elif JSON_HEDLEY_TI_VERSION_CHECK(8, 1, 0) -#define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") -#define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") -#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2, 90, 0) -#define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") -#define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") -#else -#define JSON_HEDLEY_DIAGNOSTIC_PUSH -#define JSON_HEDLEY_DIAGNOSTIC_POP -#endif - -#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) -#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED -#endif -#if JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations") -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") -#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") -#elif JSON_HEDLEY_PGI_VERSION_CHECK(17, 10, 0) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") -#elif JSON_HEDLEY_GCC_VERSION_CHECK(4, 3, 0) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") -#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15, 0, 0) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable : 4996)) -#elif JSON_HEDLEY_TI_VERSION_CHECK(8, 0, 0) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") -#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5, 13, 0) && !defined(__cplusplus) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") -#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5, 13, 0) && defined(__cplusplus) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") -#elif JSON_HEDLEY_IAR_VERSION_CHECK(8, 0, 0) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") -#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2, 90, 0) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") -#else -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED -#endif - -#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) -#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS -#endif -#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") -#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") -#elif JSON_HEDLEY_PGI_VERSION_CHECK(17, 10, 0) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") -#elif JSON_HEDLEY_GCC_VERSION_CHECK(4, 3, 0) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") -#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15, 0, 0) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable : 4068)) -#elif JSON_HEDLEY_TI_VERSION_CHECK(8, 0, 0) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") -#elif JSON_HEDLEY_IAR_VERSION_CHECK(8, 0, 0) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") -#else -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS -#endif - -#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) -#undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL -#endif -#if JSON_HEDLEY_HAS_WARNING("-Wcast-qual") -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") -#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") -#elif JSON_HEDLEY_GCC_VERSION_CHECK(3, 0, 0) -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") -#else -#define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL -#endif - -#if defined(JSON_HEDLEY_DEPRECATED) -#undef JSON_HEDLEY_DEPRECATED -#endif -#if defined(JSON_HEDLEY_DEPRECATED_FOR) -#undef JSON_HEDLEY_DEPRECATED_FOR -#endif -#if defined(__cplusplus) && (__cplusplus >= 201402L) -#define JSON_HEDLEY_DEPRECATED(since) [[deprecated("Since " #since)]] -#define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] -#elif JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || JSON_HEDLEY_GCC_VERSION_CHECK(4, 5, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || JSON_HEDLEY_ARM_VERSION_CHECK(5, 6, 0) || \ - JSON_HEDLEY_SUNPRO_VERSION_CHECK(5, 13, 0) || JSON_HEDLEY_PGI_VERSION_CHECK(17, 10, 0) || \ - JSON_HEDLEY_TI_VERSION_CHECK(8, 3, 0) -#define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) -#define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) \ - __attribute__((__deprecated__("Since " #since "; use " #replacement))) -#elif JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || JSON_HEDLEY_GCC_VERSION_CHECK(3, 1, 0) || \ - JSON_HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || JSON_HEDLEY_TI_VERSION_CHECK(8, 0, 0) || \ - (JSON_HEDLEY_TI_VERSION_CHECK(7, 3, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) -#define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) -#define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) -#elif JSON_HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) -#define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " #since)) -#define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) -#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13, 10, 0) || JSON_HEDLEY_PELLES_VERSION_CHECK(6, 50, 0) -#define JSON_HEDLEY_DEPRECATED(since) _declspec(deprecated) -#define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) -#elif JSON_HEDLEY_IAR_VERSION_CHECK(8, 0, 0) -#define JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated") -#define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") -#else -#define JSON_HEDLEY_DEPRECATED(since) -#define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) -#endif - -#if defined(JSON_HEDLEY_UNAVAILABLE) -#undef JSON_HEDLEY_UNAVAILABLE -#endif -#if JSON_HEDLEY_HAS_ATTRIBUTE(warning) || JSON_HEDLEY_GCC_VERSION_CHECK(4, 3, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) -#define JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) -#else -#define JSON_HEDLEY_UNAVAILABLE(available_since) -#endif - -#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT) -#undef JSON_HEDLEY_WARN_UNUSED_RESULT -#endif -#if defined(__cplusplus) && (__cplusplus >= 201703L) -#define JSON_HEDLEY_WARN_UNUSED_RESULT [[nodiscard]] -#elif JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || JSON_HEDLEY_GCC_VERSION_CHECK(3, 4, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || JSON_HEDLEY_TI_VERSION_CHECK(8, 0, 0) || \ - (JSON_HEDLEY_TI_VERSION_CHECK(7, 3, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ - (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5, 15, 0) && defined(__cplusplus)) || JSON_HEDLEY_PGI_VERSION_CHECK(17, 10, 0) -#define JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) -#elif defined(_Check_return_) /* SAL */ -#define JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_ -#else -#define JSON_HEDLEY_WARN_UNUSED_RESULT -#endif - -#if defined(JSON_HEDLEY_SENTINEL) -#undef JSON_HEDLEY_SENTINEL -#endif -#if JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || JSON_HEDLEY_GCC_VERSION_CHECK(4, 0, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || JSON_HEDLEY_ARM_VERSION_CHECK(5, 4, 0) -#define JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) -#else -#define JSON_HEDLEY_SENTINEL(position) -#endif - -#if defined(JSON_HEDLEY_NO_RETURN) -#undef JSON_HEDLEY_NO_RETURN -#endif -#if JSON_HEDLEY_IAR_VERSION_CHECK(8, 0, 0) -#define JSON_HEDLEY_NO_RETURN __noreturn -#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) -#define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) -#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L -#define JSON_HEDLEY_NO_RETURN _Noreturn -#elif defined(__cplusplus) && (__cplusplus >= 201103L) -#define JSON_HEDLEY_NO_RETURN [[noreturn]] -#elif JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || JSON_HEDLEY_GCC_VERSION_CHECK(3, 2, 0) || \ - JSON_HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || JSON_HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \ - JSON_HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || JSON_HEDLEY_TI_VERSION_CHECK(18, 0, 0) || \ - (JSON_HEDLEY_TI_VERSION_CHECK(17, 3, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) -#define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) -#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13, 10, 0) -#define JSON_HEDLEY_NO_RETURN __declspec(noreturn) -#elif JSON_HEDLEY_TI_VERSION_CHECK(6, 0, 0) && defined(__cplusplus) -#define JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") -#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3, 2, 0) -#define JSON_HEDLEY_NO_RETURN __attribute((noreturn)) -#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9, 0, 0) -#define JSON_HEDLEY_NO_RETURN __declspec(noreturn) -#else -#define JSON_HEDLEY_NO_RETURN -#endif - -#if defined(JSON_HEDLEY_UNREACHABLE) -#undef JSON_HEDLEY_UNREACHABLE -#endif -#if defined(JSON_HEDLEY_UNREACHABLE_RETURN) -#undef JSON_HEDLEY_UNREACHABLE_RETURN -#endif -#if (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(JSON_HEDLEY_ARM_VERSION))) || \ - JSON_HEDLEY_GCC_VERSION_CHECK(4, 5, 0) || JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \ - JSON_HEDLEY_IBM_VERSION_CHECK(13, 1, 5) -#define JSON_HEDLEY_UNREACHABLE() __builtin_unreachable() -#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13, 10, 0) -#define JSON_HEDLEY_UNREACHABLE() __assume(0) -#elif JSON_HEDLEY_TI_VERSION_CHECK(6, 0, 0) -#if defined(__cplusplus) -#define JSON_HEDLEY_UNREACHABLE() std::_nassert(0) -#else -#define JSON_HEDLEY_UNREACHABLE() _nassert(0) -#endif -#define JSON_HEDLEY_UNREACHABLE_RETURN(value) return value -#elif defined(EXIT_FAILURE) -#define JSON_HEDLEY_UNREACHABLE() abort() -#else -#define JSON_HEDLEY_UNREACHABLE() -#define JSON_HEDLEY_UNREACHABLE_RETURN(value) return value -#endif -#if !defined(JSON_HEDLEY_UNREACHABLE_RETURN) -#define JSON_HEDLEY_UNREACHABLE_RETURN(value) JSON_HEDLEY_UNREACHABLE() -#endif - -#if defined(JSON_HEDLEY_ASSUME) -#undef JSON_HEDLEY_ASSUME -#endif -#if JSON_HEDLEY_MSVC_VERSION_CHECK(13, 10, 0) || JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) -#define JSON_HEDLEY_ASSUME(expr) __assume(expr) -#elif JSON_HEDLEY_HAS_BUILTIN(__builtin_assume) -#define JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr) -#elif JSON_HEDLEY_TI_VERSION_CHECK(6, 0, 0) -#if defined(__cplusplus) -#define JSON_HEDLEY_ASSUME(expr) std::_nassert(expr) -#else -#define JSON_HEDLEY_ASSUME(expr) _nassert(expr) -#endif -#elif (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && !defined(JSON_HEDLEY_ARM_VERSION)) || \ - JSON_HEDLEY_GCC_VERSION_CHECK(4, 5, 0) || JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \ - JSON_HEDLEY_IBM_VERSION_CHECK(13, 1, 5) -#define JSON_HEDLEY_ASSUME(expr) ((void)((expr) ? 1 : (__builtin_unreachable(), 1))) -#else -#define JSON_HEDLEY_ASSUME(expr) ((void)(expr)) -#endif - -JSON_HEDLEY_DIAGNOSTIC_PUSH -#if JSON_HEDLEY_HAS_WARNING("-Wvariadic-macros") || JSON_HEDLEY_GCC_VERSION_CHECK(4, 0, 0) -#if defined(__clang__) -#pragma clang diagnostic ignored "-Wvariadic-macros" -#elif defined(JSON_HEDLEY_GCC_VERSION) -#pragma GCC diagnostic ignored "-Wvariadic-macros" -#endif -#endif -#if defined(JSON_HEDLEY_NON_NULL) -#undef JSON_HEDLEY_NON_NULL -#endif -#if JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || JSON_HEDLEY_GCC_VERSION_CHECK(3, 3, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || JSON_HEDLEY_ARM_VERSION_CHECK(4, 1, 0) -#define JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) -#else -#define JSON_HEDLEY_NON_NULL(...) -#endif -JSON_HEDLEY_DIAGNOSTIC_POP - -#if defined(JSON_HEDLEY_PRINTF_FORMAT) -#undef JSON_HEDLEY_PRINTF_FORMAT -#endif -#if defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format, 4, 4, 0) && !defined(__USE_MINGW_ANSI_STDIO) -#define JSON_HEDLEY_PRINTF_FORMAT(string_idx, first_to_check) \ - __attribute__((__format__(ms_printf, string_idx, first_to_check))) -#elif defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format, 4, 4, 0) && defined(__USE_MINGW_ANSI_STDIO) -#define JSON_HEDLEY_PRINTF_FORMAT(string_idx, first_to_check) \ - __attribute__((__format__(gnu_printf, string_idx, first_to_check))) -#elif JSON_HEDLEY_HAS_ATTRIBUTE(format) || JSON_HEDLEY_GCC_VERSION_CHECK(3, 1, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || JSON_HEDLEY_ARM_VERSION_CHECK(5, 6, 0) || \ - JSON_HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || JSON_HEDLEY_TI_VERSION_CHECK(8, 0, 0) || \ - (JSON_HEDLEY_TI_VERSION_CHECK(7, 3, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) -#define JSON_HEDLEY_PRINTF_FORMAT(string_idx, first_to_check) \ - __attribute__((__format__(__printf__, string_idx, first_to_check))) -#elif JSON_HEDLEY_PELLES_VERSION_CHECK(6, 0, 0) -#define JSON_HEDLEY_PRINTF_FORMAT(string_idx, first_to_check) __declspec(vaformat(printf, string_idx, first_to_check)) -#else -#define JSON_HEDLEY_PRINTF_FORMAT(string_idx, first_to_check) -#endif - -#if defined(JSON_HEDLEY_CONSTEXPR) -#undef JSON_HEDLEY_CONSTEXPR -#endif -#if defined(__cplusplus) -#if __cplusplus >= 201103L -#define JSON_HEDLEY_CONSTEXPR constexpr -#endif -#endif -#if !defined(JSON_HEDLEY_CONSTEXPR) -#define JSON_HEDLEY_CONSTEXPR -#endif - -#if defined(JSON_HEDLEY_PREDICT) -#undef JSON_HEDLEY_PREDICT -#endif -#if defined(JSON_HEDLEY_LIKELY) -#undef JSON_HEDLEY_LIKELY -#endif -#if defined(JSON_HEDLEY_UNLIKELY) -#undef JSON_HEDLEY_UNLIKELY -#endif -#if defined(JSON_HEDLEY_UNPREDICTABLE) -#undef JSON_HEDLEY_UNPREDICTABLE -#endif -#if JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable) -#define JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable(!!(expr)) -#endif -#if JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) || JSON_HEDLEY_GCC_VERSION_CHECK(9, 0, 0) -#define JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability(expr, value, probability) -#define JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1, probability) -#define JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0, probability) -#define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) -#define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) -#if !defined(JSON_HEDLEY_BUILTIN_UNPREDICTABLE) -#define JSON_HEDLEY_BUILTIN_UNPREDICTABLE(expr) __builtin_expect_with_probability(!!(expr), 1, 0.5) -#endif -#elif JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) || JSON_HEDLEY_GCC_VERSION_CHECK(3, 0, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \ - (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5, 15, 0) && defined(__cplusplus)) || JSON_HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \ - JSON_HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || JSON_HEDLEY_TI_VERSION_CHECK(6, 1, 0) || \ - JSON_HEDLEY_TINYC_VERSION_CHECK(0, 9, 27) -#define JSON_HEDLEY_PREDICT(expr, expected, probability) \ - (((probability) >= 0.9) ? __builtin_expect(!!(expr), (expected)) : (((void)(expected)), !!(expr))) -#define JSON_HEDLEY_PREDICT_TRUE(expr, probability) \ - (__extension__({ \ - JSON_HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ - ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) \ - : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ - })) -#define JSON_HEDLEY_PREDICT_FALSE(expr, probability) \ - (__extension__({ \ - JSON_HEDLEY_CONSTEXPR double hedley_probability_ = (probability); \ - ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) \ - : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ - })) -#define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) -#define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) -#else -#define JSON_HEDLEY_PREDICT(expr, expected, probability) (((void)(expected)), !!(expr)) -#define JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) -#define JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) -#define JSON_HEDLEY_LIKELY(expr) (!!(expr)) -#define JSON_HEDLEY_UNLIKELY(expr) (!!(expr)) -#endif -#if !defined(JSON_HEDLEY_UNPREDICTABLE) -#define JSON_HEDLEY_UNPREDICTABLE(expr) JSON_HEDLEY_PREDICT(expr, 1, 0.5) -#endif - -#if defined(JSON_HEDLEY_MALLOC) -#undef JSON_HEDLEY_MALLOC -#endif -#if JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || JSON_HEDLEY_GCC_VERSION_CHECK(3, 1, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || \ - JSON_HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || JSON_HEDLEY_IBM_VERSION_CHECK(12, 1, 0) || \ - JSON_HEDLEY_TI_VERSION_CHECK(8, 0, 0) || \ - (JSON_HEDLEY_TI_VERSION_CHECK(7, 3, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) -#define JSON_HEDLEY_MALLOC __attribute__((__malloc__)) -#elif JSON_HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) -#define JSON_HEDLEY_MALLOC __declspec(restrict) -#else -#define JSON_HEDLEY_MALLOC -#endif - -#if defined(JSON_HEDLEY_PURE) -#undef JSON_HEDLEY_PURE -#endif -#if JSON_HEDLEY_HAS_ATTRIBUTE(pure) || JSON_HEDLEY_GCC_VERSION_CHECK(2, 96, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || \ - JSON_HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || JSON_HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || \ - JSON_HEDLEY_TI_VERSION_CHECK(8, 0, 0) || \ - (JSON_HEDLEY_TI_VERSION_CHECK(7, 3, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ - JSON_HEDLEY_PGI_VERSION_CHECK(17, 10, 0) -#define JSON_HEDLEY_PURE __attribute__((__pure__)) -#elif JSON_HEDLEY_TI_VERSION_CHECK(6, 0, 0) && defined(__cplusplus) -#define JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;") -#else -#define JSON_HEDLEY_PURE -#endif - -#if defined(JSON_HEDLEY_CONST) -#undef JSON_HEDLEY_CONST -#endif -#if JSON_HEDLEY_HAS_ATTRIBUTE(const) || JSON_HEDLEY_GCC_VERSION_CHECK(2, 5, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || \ - JSON_HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || JSON_HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || \ - JSON_HEDLEY_TI_VERSION_CHECK(8, 0, 0) || \ - (JSON_HEDLEY_TI_VERSION_CHECK(7, 3, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ - JSON_HEDLEY_PGI_VERSION_CHECK(17, 10, 0) -#define JSON_HEDLEY_CONST __attribute__((__const__)) -#else -#define JSON_HEDLEY_CONST JSON_HEDLEY_PURE -#endif - -#if defined(JSON_HEDLEY_RESTRICT) -#undef JSON_HEDLEY_RESTRICT -#endif -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) -#define JSON_HEDLEY_RESTRICT restrict -#elif JSON_HEDLEY_GCC_VERSION_CHECK(3, 1, 0) || JSON_HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || JSON_HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \ - JSON_HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || JSON_HEDLEY_PGI_VERSION_CHECK(17, 10, 0) || \ - JSON_HEDLEY_TI_VERSION_CHECK(8, 0, 0) || (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5, 14, 0) && defined(__cplusplus)) || \ - JSON_HEDLEY_IAR_VERSION_CHECK(8, 0, 0) || defined(__clang__) -#define JSON_HEDLEY_RESTRICT __restrict -#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5, 3, 0) && !defined(__cplusplus) -#define JSON_HEDLEY_RESTRICT _Restrict -#else -#define JSON_HEDLEY_RESTRICT -#endif - -#if defined(JSON_HEDLEY_INLINE) -#undef JSON_HEDLEY_INLINE -#endif -#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || (defined(__cplusplus) && (__cplusplus >= 199711L)) -#define JSON_HEDLEY_INLINE inline -#elif defined(JSON_HEDLEY_GCC_VERSION) || JSON_HEDLEY_ARM_VERSION_CHECK(6, 2, 0) -#define JSON_HEDLEY_INLINE __inline__ -#elif JSON_HEDLEY_MSVC_VERSION_CHECK(12, 0, 0) || JSON_HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \ - JSON_HEDLEY_TI_VERSION_CHECK(8, 0, 0) -#define JSON_HEDLEY_INLINE __inline -#else -#define JSON_HEDLEY_INLINE -#endif - -#if defined(JSON_HEDLEY_ALWAYS_INLINE) -#undef JSON_HEDLEY_ALWAYS_INLINE -#endif -#if JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || JSON_HEDLEY_GCC_VERSION_CHECK(4, 0, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || \ - JSON_HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || JSON_HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || \ - JSON_HEDLEY_TI_VERSION_CHECK(8, 0, 0) || \ - (JSON_HEDLEY_TI_VERSION_CHECK(7, 3, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) -#define JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) JSON_HEDLEY_INLINE -#elif JSON_HEDLEY_MSVC_VERSION_CHECK(12, 0, 0) -#define JSON_HEDLEY_ALWAYS_INLINE __forceinline -#elif JSON_HEDLEY_TI_VERSION_CHECK(7, 0, 0) && defined(__cplusplus) -#define JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") -#elif JSON_HEDLEY_IAR_VERSION_CHECK(8, 0, 0) -#define JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") -#else -#define JSON_HEDLEY_ALWAYS_INLINE JSON_HEDLEY_INLINE -#endif - -#if defined(JSON_HEDLEY_NEVER_INLINE) -#undef JSON_HEDLEY_NEVER_INLINE -#endif -#if JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || JSON_HEDLEY_GCC_VERSION_CHECK(4, 0, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || \ - JSON_HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || JSON_HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || \ - JSON_HEDLEY_TI_VERSION_CHECK(8, 0, 0) || \ - (JSON_HEDLEY_TI_VERSION_CHECK(7, 3, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) -#define JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__)) -#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13, 10, 0) -#define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) -#elif JSON_HEDLEY_PGI_VERSION_CHECK(10, 2, 0) -#define JSON_HEDLEY_NEVER_INLINE _Pragma("noinline") -#elif JSON_HEDLEY_TI_VERSION_CHECK(6, 0, 0) && defined(__cplusplus) -#define JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") -#elif JSON_HEDLEY_IAR_VERSION_CHECK(8, 0, 0) -#define JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never") -#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3, 2, 0) -#define JSON_HEDLEY_NEVER_INLINE __attribute((noinline)) -#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9, 0, 0) -#define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) -#else -#define JSON_HEDLEY_NEVER_INLINE -#endif - -#if defined(JSON_HEDLEY_PRIVATE) -#undef JSON_HEDLEY_PRIVATE -#endif -#if defined(JSON_HEDLEY_PUBLIC) -#undef JSON_HEDLEY_PUBLIC -#endif -#if defined(JSON_HEDLEY_IMPORT) -#undef JSON_HEDLEY_IMPORT -#endif -#if defined(_WIN32) || defined(__CYGWIN__) -#define JSON_HEDLEY_PRIVATE -#define JSON_HEDLEY_PUBLIC __declspec(dllexport) -#define JSON_HEDLEY_IMPORT __declspec(dllimport) -#else -#if JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || JSON_HEDLEY_GCC_VERSION_CHECK(3, 3, 0) || \ - JSON_HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \ - JSON_HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || JSON_HEDLEY_IBM_VERSION_CHECK(13, 1, 0) || \ - JSON_HEDLEY_TI_VERSION_CHECK(8, 0, 0) || \ - (JSON_HEDLEY_TI_VERSION_CHECK(7, 3, 0) && defined(__TI_EABI__) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) -#define JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) -#define JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default"))) -#else -#define JSON_HEDLEY_PRIVATE -#define JSON_HEDLEY_PUBLIC -#endif -#define JSON_HEDLEY_IMPORT extern -#endif - -#if defined(JSON_HEDLEY_NO_THROW) -#undef JSON_HEDLEY_NO_THROW -#endif -#if JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || JSON_HEDLEY_GCC_VERSION_CHECK(3, 3, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) -#define JSON_HEDLEY_NO_THROW __attribute__((__nothrow__)) -#elif JSON_HEDLEY_MSVC_VERSION_CHECK(13, 1, 0) || JSON_HEDLEY_ARM_VERSION_CHECK(4, 1, 0) -#define JSON_HEDLEY_NO_THROW __declspec(nothrow) -#else -#define JSON_HEDLEY_NO_THROW -#endif - -#if defined(JSON_HEDLEY_FALL_THROUGH) -#undef JSON_HEDLEY_FALL_THROUGH -#endif -#if defined(__cplusplus) && (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5, 15, 0)) && \ - !defined(JSON_HEDLEY_PGI_VERSION) -#if (__cplusplus >= 201703L) || ((__cplusplus >= 201103L) && JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)) -#define JSON_HEDLEY_FALL_THROUGH [[fallthrough]] -#elif (__cplusplus >= 201103L) && JSON_HEDLEY_HAS_CPP_ATTRIBUTE(clang::fallthrough) -#define JSON_HEDLEY_FALL_THROUGH [[clang::fallthrough]] -#elif (__cplusplus >= 201103L) && JSON_HEDLEY_GCC_VERSION_CHECK(7, 0, 0) -#define JSON_HEDLEY_FALL_THROUGH [[gnu::fallthrough]] -#endif -#endif -#if !defined(JSON_HEDLEY_FALL_THROUGH) -#if JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(fallthrough, 7, 0, 0) && !defined(JSON_HEDLEY_PGI_VERSION) -#define JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) -#elif defined(__fallthrough) /* SAL */ -#define JSON_HEDLEY_FALL_THROUGH __fallthrough -#else -#define JSON_HEDLEY_FALL_THROUGH -#endif -#endif - -#if defined(JSON_HEDLEY_RETURNS_NON_NULL) -#undef JSON_HEDLEY_RETURNS_NON_NULL -#endif -#if JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || JSON_HEDLEY_GCC_VERSION_CHECK(4, 9, 0) -#define JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) -#elif defined(_Ret_notnull_) /* SAL */ -#define JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_ -#else -#define JSON_HEDLEY_RETURNS_NON_NULL -#endif - -#if defined(JSON_HEDLEY_ARRAY_PARAM) -#undef JSON_HEDLEY_ARRAY_PARAM -#endif -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__STDC_NO_VLA__) && \ - !defined(__cplusplus) && !defined(JSON_HEDLEY_PGI_VERSION) && !defined(JSON_HEDLEY_TINYC_VERSION) -#define JSON_HEDLEY_ARRAY_PARAM(name) (name) -#else -#define JSON_HEDLEY_ARRAY_PARAM(name) -#endif - -#if defined(JSON_HEDLEY_IS_CONSTANT) -#undef JSON_HEDLEY_IS_CONSTANT -#endif -#if defined(JSON_HEDLEY_REQUIRE_CONSTEXPR) -#undef JSON_HEDLEY_REQUIRE_CONSTEXPR -#endif -/* Note the double-underscore. For internal use only; no API - * guarantees! */ -#if defined(JSON_HEDLEY__IS_CONSTEXPR) -#undef JSON_HEDLEY__IS_CONSTEXPR -#endif - -#if JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || JSON_HEDLEY_GCC_VERSION_CHECK(3, 4, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || JSON_HEDLEY_TINYC_VERSION_CHECK(0, 9, 19) || \ - JSON_HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || JSON_HEDLEY_IBM_VERSION_CHECK(13, 1, 0) || \ - JSON_HEDLEY_TI_VERSION_CHECK(6, 1, 0) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5, 10, 0) || \ - JSON_HEDLEY_CRAY_VERSION_CHECK(8, 1, 0) -#define JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) -#endif -#if !defined(__cplusplus) -#if JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || JSON_HEDLEY_GCC_VERSION_CHECK(3, 4, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || JSON_HEDLEY_IBM_VERSION_CHECK(13, 1, 0) || \ - JSON_HEDLEY_CRAY_VERSION_CHECK(8, 1, 0) || JSON_HEDLEY_ARM_VERSION_CHECK(5, 4, 0) || \ - JSON_HEDLEY_TINYC_VERSION_CHECK(0, 9, 24) -#if defined(__INTPTR_TYPE__) -#define JSON_HEDLEY__IS_CONSTEXPR(expr) \ - __builtin_types_compatible_p(__typeof__((1 ? (void*)((__INTPTR_TYPE__)((expr)*0)) : (int*)0)), int*) -#else -#include -#define JSON_HEDLEY__IS_CONSTEXPR(expr) \ - __builtin_types_compatible_p(__typeof__((1 ? (void*)((intptr_t)((expr)*0)) : (int*)0)), int*) -#endif -#elif (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(JSON_HEDLEY_SUNPRO_VERSION) && \ - !defined(JSON_HEDLEY_PGI_VERSION)) || \ - JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) || JSON_HEDLEY_GCC_VERSION_CHECK(4, 9, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(17, 0, 0) || JSON_HEDLEY_IBM_VERSION_CHECK(12, 1, 0) || \ - JSON_HEDLEY_ARM_VERSION_CHECK(5, 3, 0) -#if defined(__INTPTR_TYPE__) -#define JSON_HEDLEY__IS_CONSTEXPR(expr) \ - _Generic((1 ? (void*)((__INTPTR_TYPE__)((expr)*0)) : (int*)0), int* : 1, void* : 0) -#else -#include -#define JSON_HEDLEY__IS_CONSTEXPR(expr) _Generic((1 ? (void*)((intptr_t)*0) : (int*)0), int* : 1, void* : 0) -#endif -#elif defined(JSON_HEDLEY_GCC_VERSION) || defined(JSON_HEDLEY_INTEL_VERSION) || defined(JSON_HEDLEY_TINYC_VERSION) || \ - defined(JSON_HEDLEY_TI_VERSION) || defined(__clang__) -#define JSON_HEDLEY__IS_CONSTEXPR(expr) \ - (sizeof(void) != sizeof(*(1 ? ((void*)((expr)*0L)) : ((struct { char v[sizeof(void) * 2]; }*)1)))) -#endif -#endif -#if defined(JSON_HEDLEY__IS_CONSTEXPR) -#if !defined(JSON_HEDLEY_IS_CONSTANT) -#define JSON_HEDLEY_IS_CONSTANT(expr) JSON_HEDLEY__IS_CONSTEXPR(expr) -#endif -#define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (JSON_HEDLEY__IS_CONSTEXPR(expr) ? (expr) : (-1)) -#else -#if !defined(JSON_HEDLEY_IS_CONSTANT) -#define JSON_HEDLEY_IS_CONSTANT(expr) (0) -#endif -#define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) -#endif - -#if defined(JSON_HEDLEY_BEGIN_C_DECLS) -#undef JSON_HEDLEY_BEGIN_C_DECLS -#endif -#if defined(JSON_HEDLEY_END_C_DECLS) -#undef JSON_HEDLEY_END_C_DECLS -#endif -#if defined(JSON_HEDLEY_C_DECL) -#undef JSON_HEDLEY_C_DECL -#endif -#if defined(__cplusplus) -#define JSON_HEDLEY_BEGIN_C_DECLS extern "C" { -#define JSON_HEDLEY_END_C_DECLS } -#define JSON_HEDLEY_C_DECL extern "C" -#else -#define JSON_HEDLEY_BEGIN_C_DECLS -#define JSON_HEDLEY_END_C_DECLS -#define JSON_HEDLEY_C_DECL -#endif - -#if defined(JSON_HEDLEY_STATIC_ASSERT) -#undef JSON_HEDLEY_STATIC_ASSERT -#endif -#if !defined(__cplusplus) && \ - ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || JSON_HEDLEY_HAS_FEATURE(c_static_assert) || \ - JSON_HEDLEY_GCC_VERSION_CHECK(6, 0, 0) || JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || defined(_Static_assert)) -#define JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) -#elif (defined(__cplusplus) && (__cplusplus >= 201703L)) || JSON_HEDLEY_MSVC_VERSION_CHECK(16, 0, 0) || \ - (defined(__cplusplus) && JSON_HEDLEY_TI_VERSION_CHECK(8, 3, 0)) -#define JSON_HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr, message) -#elif defined(__cplusplus) && (__cplusplus >= 201103L) -#define JSON_HEDLEY_STATIC_ASSERT(expr, message) static_assert(expr) -#else -#define JSON_HEDLEY_STATIC_ASSERT(expr, message) -#endif - -#if defined(JSON_HEDLEY_CONST_CAST) -#undef JSON_HEDLEY_CONST_CAST -#endif -#if defined(__cplusplus) -#define JSON_HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) -#elif JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || JSON_HEDLEY_GCC_VERSION_CHECK(4, 6, 0) || \ - JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) -#define JSON_HEDLEY_CONST_CAST(T, expr) \ - (__extension__({ \ - JSON_HEDLEY_DIAGNOSTIC_PUSH \ - JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL((T)(expr)); \ - JSON_HEDLEY_DIAGNOSTIC_POP \ - })) -#else -#define JSON_HEDLEY_CONST_CAST(T, expr) ((T)(expr)) -#endif - -#if defined(JSON_HEDLEY_REINTERPRET_CAST) -#undef JSON_HEDLEY_REINTERPRET_CAST -#endif -#if defined(__cplusplus) -#define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) -#else -#define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (*((T*)&(expr))) -#endif - -#if defined(JSON_HEDLEY_STATIC_CAST) -#undef JSON_HEDLEY_STATIC_CAST -#endif -#if defined(__cplusplus) -#define JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) -#else -#define JSON_HEDLEY_STATIC_CAST(T, expr) ((T)(expr)) -#endif - -#if defined(JSON_HEDLEY_CPP_CAST) -#undef JSON_HEDLEY_CPP_CAST -#endif -#if defined(__cplusplus) -#define JSON_HEDLEY_CPP_CAST(T, expr) static_cast(expr) -#else -#define JSON_HEDLEY_CPP_CAST(T, expr) (expr) -#endif - -#if defined(JSON_HEDLEY_MESSAGE) -#undef JSON_HEDLEY_MESSAGE -#endif -#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") -#define JSON_HEDLEY_MESSAGE(msg) \ - JSON_HEDLEY_DIAGNOSTIC_PUSH \ - JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ - JSON_HEDLEY_PRAGMA(message msg) \ - JSON_HEDLEY_DIAGNOSTIC_POP -#elif JSON_HEDLEY_GCC_VERSION_CHECK(4, 4, 0) || JSON_HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) -#define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message msg) -#elif JSON_HEDLEY_CRAY_VERSION_CHECK(5, 0, 0) -#define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(_CRI message msg) -#elif JSON_HEDLEY_IAR_VERSION_CHECK(8, 0, 0) -#define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) -#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2, 0, 0) -#define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) -#else -#define JSON_HEDLEY_MESSAGE(msg) -#endif - -#if defined(JSON_HEDLEY_WARNING) -#undef JSON_HEDLEY_WARNING -#endif -#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") -#define JSON_HEDLEY_WARNING(msg) \ - JSON_HEDLEY_DIAGNOSTIC_PUSH \ - JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ - JSON_HEDLEY_PRAGMA(clang warning msg) \ - JSON_HEDLEY_DIAGNOSTIC_POP -#elif JSON_HEDLEY_GCC_VERSION_CHECK(4, 8, 0) || JSON_HEDLEY_PGI_VERSION_CHECK(18, 4, 0) -#define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(GCC warning msg) -#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15, 0, 0) -#define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(message(msg)) -#else -#define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_MESSAGE(msg) -#endif - -#if defined(JSON_HEDLEY_REQUIRE_MSG) -#undef JSON_HEDLEY_REQUIRE_MSG -#endif -#if JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if) -#if JSON_HEDLEY_HAS_WARNING("-Wgcc-compat") -#define JSON_HEDLEY_REQUIRE_MSG(expr, msg) \ - JSON_HEDLEY_DIAGNOSTIC_PUSH \ - _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") __attribute__((__diagnose_if__(!(expr), msg, "error"))) \ - JSON_HEDLEY_DIAGNOSTIC_POP -#else -#define JSON_HEDLEY_REQUIRE_MSG(expr, msg) __attribute__((__diagnose_if__(!(expr), msg, "error"))) -#endif -#else -#define JSON_HEDLEY_REQUIRE_MSG(expr, msg) -#endif - -#if defined(JSON_HEDLEY_REQUIRE) -#undef JSON_HEDLEY_REQUIRE -#endif -#define JSON_HEDLEY_REQUIRE(expr) JSON_HEDLEY_REQUIRE_MSG(expr, #expr) - -#if defined(JSON_HEDLEY_FLAGS) -#undef JSON_HEDLEY_FLAGS -#endif -#if JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) -#define JSON_HEDLEY_FLAGS __attribute__((__flag_enum__)) -#endif - -#if defined(JSON_HEDLEY_FLAGS_CAST) -#undef JSON_HEDLEY_FLAGS_CAST -#endif -#if JSON_HEDLEY_INTEL_VERSION_CHECK(19, 0, 0) -#define JSON_HEDLEY_FLAGS_CAST(T, expr) \ - (__extension__({ \ - JSON_HEDLEY_DIAGNOSTIC_PUSH \ - _Pragma("warning(disable:188)")((T)(expr)); \ - JSON_HEDLEY_DIAGNOSTIC_POP \ - })) -#else -#define JSON_HEDLEY_FLAGS_CAST(T, expr) JSON_HEDLEY_STATIC_CAST(T, expr) -#endif - -/* Remaining macros are deprecated. */ - -#if defined(JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) -#undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK -#endif -#if defined(__clang__) -#define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major, minor, patch) (0) -#else -#define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major, minor, patch) JSON_HEDLEY_GCC_VERSION_CHECK(major, minor, patch) -#endif - -#if defined(JSON_HEDLEY_CLANG_HAS_ATTRIBUTE) -#undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE -#endif -#define JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) - -#if defined(JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) -#undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE -#endif -#define JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) - -#if defined(JSON_HEDLEY_CLANG_HAS_BUILTIN) -#undef JSON_HEDLEY_CLANG_HAS_BUILTIN -#endif -#define JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) JSON_HEDLEY_HAS_BUILTIN(builtin) - -#if defined(JSON_HEDLEY_CLANG_HAS_FEATURE) -#undef JSON_HEDLEY_CLANG_HAS_FEATURE -#endif -#define JSON_HEDLEY_CLANG_HAS_FEATURE(feature) JSON_HEDLEY_HAS_FEATURE(feature) - -#if defined(JSON_HEDLEY_CLANG_HAS_EXTENSION) -#undef JSON_HEDLEY_CLANG_HAS_EXTENSION -#endif -#define JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) JSON_HEDLEY_HAS_EXTENSION(extension) - -#if defined(JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) -#undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE -#endif -#define JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) - -#if defined(JSON_HEDLEY_CLANG_HAS_WARNING) -#undef JSON_HEDLEY_CLANG_HAS_WARNING -#endif -#define JSON_HEDLEY_CLANG_HAS_WARNING(warning) JSON_HEDLEY_HAS_WARNING(warning) - -#endif /* !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < X) */ - -// This file contains all internal macro definitions -// You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them - -// exclude unsupported compilers -#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK) -#if defined(__clang__) -#if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400 -#error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" -#endif -#elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) -#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 -#error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" -#endif -#endif -#endif - -// C++ language standard detection -#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464 -#define JSON_HAS_CPP_17 -#define JSON_HAS_CPP_14 -#elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) -#define JSON_HAS_CPP_14 -#endif - -// disable float-equal warnings on GCC/clang -#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wfloat-equal" -#endif - -// disable documentation warnings on clang -#if defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdocumentation" -#endif - -// allow to disable exceptions -#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION) -#define JSON_THROW(exception) throw exception -#define JSON_TRY try -#define JSON_CATCH(exception) catch (exception) -#define JSON_INTERNAL_CATCH(exception) catch (exception) -#else -#include -#define JSON_THROW(exception) std::abort() -#define JSON_TRY if (true) -#define JSON_CATCH(exception) if (false) -#define JSON_INTERNAL_CATCH(exception) if (false) -#endif - -// override exception macros -#if defined(JSON_THROW_USER) -#undef JSON_THROW -#define JSON_THROW JSON_THROW_USER -#endif -#if defined(JSON_TRY_USER) -#undef JSON_TRY -#define JSON_TRY JSON_TRY_USER -#endif -#if defined(JSON_CATCH_USER) -#undef JSON_CATCH -#define JSON_CATCH JSON_CATCH_USER -#undef JSON_INTERNAL_CATCH -#define JSON_INTERNAL_CATCH JSON_CATCH_USER -#endif -#if defined(JSON_INTERNAL_CATCH_USER) -#undef JSON_INTERNAL_CATCH -#define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER -#endif - -/*! -@brief macro to briefly define a mapping between an enum and JSON -@def NLOHMANN_JSON_SERIALIZE_ENUM -@since version 3.4.0 -*/ -#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \ - template \ - inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) { \ - static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ - static const std::pair m[] = __VA_ARGS__; \ - auto it = std::find_if( \ - std::begin(m), std::end(m), \ - [e](const std::pair& ej_pair) -> bool { return ej_pair.first == e; }); \ - j = ((it != std::end(m)) ? it : std::begin(m))->second; \ - } \ - template \ - inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) { \ - static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ - static const std::pair m[] = __VA_ARGS__; \ - auto it = std::find_if( \ - std::begin(m), std::end(m), \ - [j](const std::pair& ej_pair) -> bool { return ej_pair.second == j; }); \ - e = ((it != std::end(m)) ? it : std::begin(m))->first; \ - } - -// Ugly macros to avoid uglier copy-paste when specializing basic_json. They -// may be removed in the future once the class is split. - -#define NLOHMANN_BASIC_JSON_TPL_DECLARATION \ - template