diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index e45b63fc..193c4b94 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -18,7 +18,7 @@ jobs: lint: name: lint if: ${{ contains(github.event.pull_request.labels.*.name, 'ready-for-testing') }} - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 with: @@ -33,13 +33,13 @@ jobs: build: name: build needs: lint - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: os: - centos7 - - ubuntu1804 + - ubuntu2004 compiler: - gcc-9.2 - clang-9 @@ -61,19 +61,19 @@ jobs: centos7) # build with Release type cmake \ - -DCMAKE_CXX_COMPILER=$TOOLSET_CLANG_DIR/bin/g++ \ - -DCMAKE_C_COMPILER=$TOOLSET_CLANG_DIR/bin/gcc \ + -DCMAKE_CXX_COMPILER=$TOOLSET_GCC_DIR/bin/g++ \ + -DCMAKE_C_COMPILER=$TOOLSET_GCC_DIR/bin/gcc \ -DCMAKE_BUILD_TYPE=Release \ -DENABLE_TESTING=on \ -DCMAKE_INSTALL_PREFIX=/usr/local/nebula \ -DDISABLE_CXX11_ABI=ON \ -B build ;; - ubuntu1804) + ubuntu2004) # build with Debug type cmake \ - -DCMAKE_CXX_COMPILER=$TOOLSET_CLANG_DIR/bin/g++ \ - -DCMAKE_C_COMPILER=$TOOLSET_CLANG_DIR/bin/gcc \ + -DCMAKE_CXX_COMPILER=$TOOLSET_GCC_DIR/bin/g++ \ + -DCMAKE_C_COMPILER=$TOOLSET_GCC_DIR/bin/gcc \ -DCMAKE_BUILD_TYPE=Debug \ -DENABLE_TESTING=on \ -DCMAKE_INSTALL_PREFIX=/usr/local/nebula \ @@ -109,11 +109,11 @@ jobs: done set -e ;; - ubuntu1804) + ubuntu2004) set +e for i in {0..10}; do - wget https://oss-cdn.nebula-graph.com.cn/package/nightly/$(./date.py --day_diff=$i)/nebula-graph-$(./date.py --day_diff=$i)-nightly.ubuntu1804.amd64.deb - dpkg -i nebula-graph-$(./date.py --day_diff=$i)-nightly.ubuntu1804.amd64.deb + wget https://oss-cdn.nebula-graph.com.cn/package/nightly/$(./date.py --day_diff=$i)/nebula-graph-$(./date.py --day_diff=$i)-nightly.ubuntu2004.amd64.deb + dpkg -i nebula-graph-$(./date.py --day_diff=$i)-nightly.ubuntu2004.amd64.deb if [ $? -eq 0 ]; then break; fi @@ -121,12 +121,6 @@ jobs: set -e ;; esac - chmod u+w /usr/local/nebula/etc/nebula-graphd.conf /usr/local/nebula/etc/nebula-storaged.conf /usr/local/nebula/etc/nebula-metad.conf - echo '--cert_path=share/resources/test.ca.pem' | tee -a /usr/local/nebula/etc/nebula-graphd.conf /usr/local/nebula/etc/nebula-storaged.conf /usr/local/nebula/etc/nebula-metad.conf - echo '--key_path=share/resources/test.ca.key' | tee -a /usr/local/nebula/etc/nebula-graphd.conf /usr/local/nebula/etc/nebula-storaged.conf /usr/local/nebula/etc/nebula-metad.conf - echo '--password_path=share/resources/test.ca.password' | tee -a /usr/local/nebula/etc/nebula-graphd.conf /usr/local/nebula/etc/nebula-storaged.conf /usr/local/nebula/etc/nebula-metad.conf - echo '--enable_ssl=true' | tee -a /usr/local/nebula/etc/nebula-graphd.conf /usr/local/nebula/etc/nebula-storaged.conf /usr/local/nebula/etc/nebula-metad.conf - cp certs/* /usr/local/nebula/share/resources /usr/local/nebula/scripts/nebula.service start all /usr/local/nebula/scripts/nebula.service status all echo '127.0.0.1 graphd' >> /etc/hosts @@ -139,7 +133,9 @@ jobs: ASAN_OPTIONS: fast_unwind_on_malloc=1 run: | pushd build - ctest -j $(nproc) --timeout 10000 --output-on-failure + # register storage to meta + ./bin/regist_host --host=127.0.0.1:9779 + ctest -j $(nproc) -E '\w*_ssl_test' --timeout 10000 --output-on-failure make install popd timeout-minutes: 10 @@ -175,3 +171,122 @@ jobs: - name: Cleanup if: ${{ always() }} run: rm -rf build modules + + build_ssl: + name: build ssl + needs: lint + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + os: + - centos7 + - ubuntu2004 + compiler: + - gcc-9.2 + - clang-9 + exclude: + - os: centos7 + compiler: clang-9 + container: + image: vesoft/nebula-dev:${{ matrix.os }} + volumes: + - /tmp/nebula-graph-client/${{ matrix.os }}-${{ matrix.compiler }}:/tmp/nebula-graph-client/nebula-graph/${{ matrix.os }}-${{ matrix.compiler }} + options: --mount type=tmpfs,destination=/tmp/ccache/nebula-graph,tmpfs-size=1073741824 --cap-add=SYS_PTRACE + steps: + - uses: actions/checkout@v2 + - name: CMake + run: | + case ${{ matrix.compiler }} in + gcc-*) + case ${{ matrix.os }} in + centos7) + # build with Release type + cmake \ + -DCMAKE_CXX_COMPILER=$TOOLSET_GCC_DIR/bin/g++ \ + -DCMAKE_C_COMPILER=$TOOLSET_GCC_DIR/bin/gcc \ + -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_TESTING=on \ + -DCMAKE_INSTALL_PREFIX=/usr/local/nebula \ + -DDISABLE_CXX11_ABI=ON \ + -B build + ;; + ubuntu2004) + # build with Debug type + cmake \ + -DCMAKE_CXX_COMPILER=$TOOLSET_GCC_DIR/bin/g++ \ + -DCMAKE_C_COMPILER=$TOOLSET_GCC_DIR/bin/gcc \ + -DCMAKE_BUILD_TYPE=Debug \ + -DENABLE_TESTING=on \ + -DCMAKE_INSTALL_PREFIX=/usr/local/nebula \ + -B build + ;; + esac + ;; + clang-*) + # build with Sanitizer + cmake \ + -DCMAKE_CXX_COMPILER=$TOOLSET_CLANG_DIR/bin/clang++ \ + -DCMAKE_C_COMPILER=$TOOLSET_CLANG_DIR/bin/clang \ + -DCMAKE_BUILD_TYPE=Debug \ + -DENABLE_ASAN=on \ + -DENABLE_TESTING=on \ + -DCMAKE_INSTALL_PREFIX=/usr/local/nebula \ + -B build + ;; + esac + - name: Make + run: cmake --build build/ -j $(nproc) + - name: Nebula Server + run: | + case ${{ matrix.os }} in + centos7) + set +e + for i in {0..10}; do + wget https://oss-cdn.nebula-graph.com.cn/package/nightly/$(./date.py --day_diff=$i)/nebula-graph-$(./date.py --day_diff=$i)-nightly.el7.x86_64.rpm + rpm -ivh nebula-graph-$(./date.py --day_diff=$i)-nightly.el7.x86_64.rpm + if [ $? -eq 0 ]; then + break; + fi + done + set -e + ;; + ubuntu2004) + set +e + for i in {0..10}; do + wget https://oss-cdn.nebula-graph.com.cn/package/nightly/$(./date.py --day_diff=$i)/nebula-graph-$(./date.py --day_diff=$i)-nightly.ubuntu2004.amd64.deb + dpkg -i nebula-graph-$(./date.py --day_diff=$i)-nightly.ubuntu2004.amd64.deb + if [ $? -eq 0 ]; then + break; + fi + done + set -e + ;; + esac + chmod u+w /usr/local/nebula/etc/nebula-graphd.conf /usr/local/nebula/etc/nebula-storaged.conf /usr/local/nebula/etc/nebula-metad.conf + echo '--cert_path=share/resources/test.derive.crt' | tee -a /usr/local/nebula/etc/nebula-graphd.conf /usr/local/nebula/etc/nebula-storaged.conf /usr/local/nebula/etc/nebula-metad.conf + echo '--key_path=share/resources/test.derive.key' | tee -a /usr/local/nebula/etc/nebula-graphd.conf /usr/local/nebula/etc/nebula-storaged.conf /usr/local/nebula/etc/nebula-metad.conf + echo '--ca_path=share/resources/test.ca.pem' | tee -a /usr/local/nebula/etc/nebula-graphd.conf /usr/local/nebula/etc/nebula-storaged.conf /usr/local/nebula/etc/nebula-metad.conf + echo '--enable_ssl=true' | tee -a /usr/local/nebula/etc/nebula-graphd.conf /usr/local/nebula/etc/nebula-storaged.conf /usr/local/nebula/etc/nebula-metad.conf + cp certs/* /usr/local/nebula/share/resources + /usr/local/nebula/scripts/nebula.service start all + /usr/local/nebula/scripts/nebula.service status all + echo '127.0.0.1 graphd' >> /etc/hosts + echo '127.0.0.1 graphd1' >> /etc/hosts + echo '127.0.0.1 graphd2' >> /etc/hosts + # The connection maybe unstable, so we wait a while + sleep 10 + - name: CTest SSL + env: + ASAN_OPTIONS: fast_unwind_on_malloc=1 + run: | + pushd build + # register storage to meta + ./bin/regist_host --enable_ssl=true --host=127.0.0.1:9779 + ctest -j $(nproc) -R '\w*_ssl_test' --timeout 10000 --output-on-failure + make install + popd + timeout-minutes: 10 + - name: Cleanup + if: ${{ always() }} + run: rm -rf build modules diff --git a/src/client/tests/CMakeLists.txt b/src/client/tests/CMakeLists.txt index 3e0f0bb2..abe778ab 100644 --- a/src/client/tests/CMakeLists.txt +++ b/src/client/tests/CMakeLists.txt @@ -16,6 +16,20 @@ nebula_add_test( ${NEBULA_THIRD_PARTY_LIBRARIES} ) +nebula_add_test( + NAME + connection_ssl_test + SOURCES + ConnectionSSLTest.cpp + OBJECTS + ${NEBULA_CLIENT_OBJS} + $ + $ + LIBRARIES + gtest + ${NEBULA_THIRD_PARTY_LIBRARIES} +) + nebula_add_test( NAME session_test @@ -30,6 +44,33 @@ nebula_add_test( ${NEBULA_THIRD_PARTY_LIBRARIES} ) +nebula_add_executable( + NAME + regist_host + SOURCES + RegistHost.cpp + OBJECTS + ${NEBULA_CLIENT_OBJS} + $ + $ + LIBRARIES + ${NEBULA_THIRD_PARTY_LIBRARIES} +) + +nebula_add_test( + NAME + session_ssl_test + SOURCES + SessionSSLTest.cpp + OBJECTS + ${NEBULA_CLIENT_OBJS} + $ + $ + LIBRARIES + gtest + ${NEBULA_THIRD_PARTY_LIBRARIES} +) + nebula_add_test( NAME address_test diff --git a/src/client/tests/ConnectionSSLTest.cpp b/src/client/tests/ConnectionSSLTest.cpp new file mode 100644 index 00000000..d202eecb --- /dev/null +++ b/src/client/tests/ConnectionSSLTest.cpp @@ -0,0 +1,44 @@ +/* Copyright (c) 2020 vesoft inc. All rights reserved. + * + * This source code is licensed under Apache 2.0 License. + */ + +#include +#include +#include +#include +#include +#include + +#include "./ClientTest.h" + +// Require a nebula server could access + +static constexpr char kServerHost[] = "graphd"; + +class ConnectionTest : public ClientTest {}; + +TEST_F(ConnectionTest, SSL) { + nebula::Connection c; + + ASSERT_TRUE(c.open(kServerHost, 9669, 10, true, "")); + + // auth + auto authResp = c.authenticate("root", "nebula"); + ASSERT_EQ(authResp.errorCode, nebula::ErrorCode::SUCCEEDED) << *authResp.errorMsg; + + // execute + auto resp = c.execute(*authResp.sessionId, "YIELD 1"); + ASSERT_EQ(resp.errorCode, nebula::ErrorCode::SUCCEEDED); + nebula::DataSet expected({"1"}); + expected.emplace_back(nebula::List({1})); + EXPECT_TRUE(verifyResultWithoutOrder(*resp.data, expected)); +} + +int main(int argc, char **argv) { + testing::InitGoogleTest(&argc, argv); + nebula::init(&argc, &argv); + google::SetStderrLogging(google::INFO); + + return RUN_ALL_TESTS(); +} diff --git a/src/client/tests/ConnectionTest.cpp b/src/client/tests/ConnectionTest.cpp index 79f0d8ab..02bb2fb5 100644 --- a/src/client/tests/ConnectionTest.cpp +++ b/src/client/tests/ConnectionTest.cpp @@ -162,23 +162,6 @@ TEST_F(ConnectionTest, Timeout) { ASSERT_EQ(resp.errorCode, nebula::ErrorCode::SUCCEEDED); } -TEST_F(ConnectionTest, SSL) { - nebula::Connection c; - - ASSERT_TRUE(c.open(kServerHost, 9669, 10, true, "")); - - // auth - auto authResp = c.authenticate("root", "nebula"); - ASSERT_EQ(authResp.errorCode, nebula::ErrorCode::SUCCEEDED) << *authResp.errorMsg; - - // execute - auto resp = c.execute(*authResp.sessionId, "YIELD 1"); - ASSERT_EQ(resp.errorCode, nebula::ErrorCode::SUCCEEDED); - nebula::DataSet expected({"1"}); - expected.emplace_back(nebula::List({1})); - EXPECT_TRUE(verifyResultWithoutOrder(*resp.data, expected)); -} - TEST_F(ConnectionTest, JsonResult) { nebula::Connection c; diff --git a/src/client/tests/RegistHost.cpp b/src/client/tests/RegistHost.cpp new file mode 100644 index 00000000..9326b12c --- /dev/null +++ b/src/client/tests/RegistHost.cpp @@ -0,0 +1,37 @@ +/* Copyright (c) 2021 vesoft inc. All rights reserved. + * + * This source code is licensed under Apache 2.0 License. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +// Require a nebula server could access + +DEFINE_string(host, "", "Register host address."); +DEFINE_string(server, "127.0.0.1:9669", "Nebula server address."); +DEFINE_bool(enable_ssl, false, "Enable SSL."); + +int main(int argc, char** argv) { + nebula::init(&argc, &argv); + google::SetStderrLogging(google::INFO); + + nebula::ConnectionPool pool; + nebula::Config c{10, 0, 300, 0, "", FLAGS_enable_ssl}; + pool.init({FLAGS_server}, c); + auto session = pool.getSession("root", "nebula"); + CHECK(session.valid()); + + auto resp = + session.execute(folly::format("ADD HOSTS {} INTO NEW ZONE 'default_zone'", FLAGS_host).str()); + CHECK_EQ(resp.errorCode, nebula::ErrorCode::SUCCEEDED) << *resp.errorMsg; + return 0; +} diff --git a/src/client/tests/SessionSSLTest.cpp b/src/client/tests/SessionSSLTest.cpp new file mode 100644 index 00000000..ef036cff --- /dev/null +++ b/src/client/tests/SessionSSLTest.cpp @@ -0,0 +1,50 @@ +/* Copyright (c) 2020 vesoft inc. All rights reserved. + * + * This source code is licensed under Apache 2.0 License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "./ClientTest.h" + +// Require a nebula server could access + +#define kServerHost "graphd" + +class SessionTest : public ClientTest {}; + +TEST_F(SessionTest, SSL) { + nebula::ConnectionPool pool; + nebula::Config c{10, 0, 10, 0, "", true}; + pool.init({kServerHost ":9669"}, c); + auto session = pool.getSession("root", "nebula"); + ASSERT_TRUE(session.valid()); + + // execute + auto result = session.execute("YIELD 1"); + ASSERT_EQ(result.errorCode, nebula::ErrorCode::SUCCEEDED); + nebula::DataSet expected({"1"}); + expected.emplace_back(nebula::List({1})); + EXPECT_TRUE(verifyResultWithoutOrder(*result.data, expected)); +} + +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + nebula::init(&argc, &argv); + google::SetStderrLogging(google::INFO); + + return RUN_ALL_TESTS(); +} diff --git a/src/client/tests/SessionTest.cpp b/src/client/tests/SessionTest.cpp index 79e65e1f..afde7b40 100644 --- a/src/client/tests/SessionTest.cpp +++ b/src/client/tests/SessionTest.cpp @@ -225,21 +225,6 @@ TEST_F(SessionTest, Timeout) { ASSERT_EQ(resp.errorCode, nebula::ErrorCode::SUCCEEDED); } -TEST_F(SessionTest, SSL) { - nebula::ConnectionPool pool; - nebula::Config c{10, 0, 10, 0, "", true}; - pool.init({kServerHost ":9669"}, c); - auto session = pool.getSession("root", "nebula"); - ASSERT_TRUE(session.valid()); - - // execute - auto result = session.execute("YIELD 1"); - ASSERT_EQ(result.errorCode, nebula::ErrorCode::SUCCEEDED); - nebula::DataSet expected({"1"}); - expected.emplace_back(nebula::List({1})); - EXPECT_TRUE(verifyResultWithoutOrder(*result.data, expected)); -} - TEST_F(SessionTest, JsonResult) { nebula::ConnectionPool pool; nebula::Config c{10, 0, 10, 0, "", false}; diff --git a/src/interface/common.thrift b/src/interface/common.thrift index abcc25fa..8fa6ed9a 100644 --- a/src/interface/common.thrift +++ b/src/interface/common.thrift @@ -311,7 +311,7 @@ enum ErrorCode { E_TAG_PROP_NOT_FOUND = -10, E_ROLE_NOT_FOUND = -11, E_CONFIG_NOT_FOUND = -12, - E_GROUP_NOT_FOUND = -13, + E_MACHINE_NOT_FOUND = -13, E_ZONE_NOT_FOUND = -14, E_LISTENER_NOT_FOUND = -15, E_PART_NOT_FOUND = -16, diff --git a/src/interface/gen-cpp2/MetaService.cpp b/src/interface/gen-cpp2/MetaService.cpp index f0dc7786..1095b6d7 100644 --- a/src/interface/gen-cpp2/MetaService.cpp +++ b/src/interface/gen-cpp2/MetaService.cpp @@ -330,6 +330,69 @@ void MetaServiceSvIf::async_tm_listEdges(std::unique_ptr MetaServiceSvIf::semifuture_addHosts(const ::nebula::meta::cpp2::AddHostsReq& p_req) { + return apache::thrift::detail::si::semifuture_returning([&]( ::nebula::meta::cpp2::ExecResp& _return) { addHosts(_return, p_req); }); +} + +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceSvIf::future_addHosts(const ::nebula::meta::cpp2::AddHostsReq& p_req) { + using Source = apache::thrift::concurrency::ThreadManager::Source; + auto scope = getRequestContext()->getRequestExecutionScope(); + auto ka = getThreadManager()->getKeepAlive(std::move(scope), Source::INTERNAL); + return apache::thrift::detail::si::future(semifuture_addHosts(p_req), std::move(ka)); +} + +void MetaServiceSvIf::async_tm_addHosts(std::unique_ptr> callback, const ::nebula::meta::cpp2::AddHostsReq& p_req) { + apache::thrift::detail::si::async_tm(this, std::move(callback), [&] { + return future_addHosts(p_req); + }); +} + +void MetaServiceSvIf::addHostsIntoZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& /*req*/) { + apache::thrift::detail::si::throw_app_exn_unimplemented("addHostsIntoZone"); +} + +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceSvIf::semifuture_addHostsIntoZone(const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + return apache::thrift::detail::si::semifuture_returning([&]( ::nebula::meta::cpp2::ExecResp& _return) { addHostsIntoZone(_return, p_req); }); +} + +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceSvIf::future_addHostsIntoZone(const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + using Source = apache::thrift::concurrency::ThreadManager::Source; + auto scope = getRequestContext()->getRequestExecutionScope(); + auto ka = getThreadManager()->getKeepAlive(std::move(scope), Source::INTERNAL); + return apache::thrift::detail::si::future(semifuture_addHostsIntoZone(p_req), std::move(ka)); +} + +void MetaServiceSvIf::async_tm_addHostsIntoZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + apache::thrift::detail::si::async_tm(this, std::move(callback), [&] { + return future_addHostsIntoZone(p_req); + }); +} + +void MetaServiceSvIf::dropHosts( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::DropHostsReq& /*req*/) { + apache::thrift::detail::si::throw_app_exn_unimplemented("dropHosts"); +} + +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceSvIf::semifuture_dropHosts(const ::nebula::meta::cpp2::DropHostsReq& p_req) { + return apache::thrift::detail::si::semifuture_returning([&]( ::nebula::meta::cpp2::ExecResp& _return) { dropHosts(_return, p_req); }); +} + +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceSvIf::future_dropHosts(const ::nebula::meta::cpp2::DropHostsReq& p_req) { + using Source = apache::thrift::concurrency::ThreadManager::Source; + auto scope = getRequestContext()->getRequestExecutionScope(); + auto ka = getThreadManager()->getKeepAlive(std::move(scope), Source::INTERNAL); + return apache::thrift::detail::si::future(semifuture_dropHosts(p_req), std::move(ka)); +} + +void MetaServiceSvIf::async_tm_dropHosts(std::unique_ptr> callback, const ::nebula::meta::cpp2::DropHostsReq& p_req) { + apache::thrift::detail::si::async_tm(this, std::move(callback), [&] { + return future_dropHosts(p_req); + }); +} + void MetaServiceSvIf::listHosts( ::nebula::meta::cpp2::ListHostsResp& /*_return*/, const ::nebula::meta::cpp2::ListHostsReq& /*req*/) { apache::thrift::detail::si::throw_app_exn_unimplemented("listHosts"); } @@ -1149,24 +1212,24 @@ void MetaServiceSvIf::async_tm_runAdminJob(std::unique_ptr MetaServiceSvIf::semifuture_addZone(const ::nebula::meta::cpp2::AddZoneReq& p_req) { - return apache::thrift::detail::si::semifuture_returning([&]( ::nebula::meta::cpp2::ExecResp& _return) { addZone(_return, p_req); }); +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceSvIf::semifuture_mergeZone(const ::nebula::meta::cpp2::MergeZoneReq& p_req) { + return apache::thrift::detail::si::semifuture_returning([&]( ::nebula::meta::cpp2::ExecResp& _return) { mergeZone(_return, p_req); }); } -folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceSvIf::future_addZone(const ::nebula::meta::cpp2::AddZoneReq& p_req) { +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceSvIf::future_mergeZone(const ::nebula::meta::cpp2::MergeZoneReq& p_req) { using Source = apache::thrift::concurrency::ThreadManager::Source; auto scope = getRequestContext()->getRequestExecutionScope(); auto ka = getThreadManager()->getKeepAlive(std::move(scope), Source::INTERNAL); - return apache::thrift::detail::si::future(semifuture_addZone(p_req), std::move(ka)); + return apache::thrift::detail::si::future(semifuture_mergeZone(p_req), std::move(ka)); } -void MetaServiceSvIf::async_tm_addZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::AddZoneReq& p_req) { +void MetaServiceSvIf::async_tm_mergeZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::MergeZoneReq& p_req) { apache::thrift::detail::si::async_tm(this, std::move(callback), [&] { - return future_addZone(p_req); + return future_mergeZone(p_req); }); } @@ -1191,45 +1254,45 @@ void MetaServiceSvIf::async_tm_dropZone(std::unique_ptr MetaServiceSvIf::semifuture_addHostIntoZone(const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { - return apache::thrift::detail::si::semifuture_returning([&]( ::nebula::meta::cpp2::ExecResp& _return) { addHostIntoZone(_return, p_req); }); +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceSvIf::semifuture_splitZone(const ::nebula::meta::cpp2::SplitZoneReq& p_req) { + return apache::thrift::detail::si::semifuture_returning([&]( ::nebula::meta::cpp2::ExecResp& _return) { splitZone(_return, p_req); }); } -folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceSvIf::future_addHostIntoZone(const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceSvIf::future_splitZone(const ::nebula::meta::cpp2::SplitZoneReq& p_req) { using Source = apache::thrift::concurrency::ThreadManager::Source; auto scope = getRequestContext()->getRequestExecutionScope(); auto ka = getThreadManager()->getKeepAlive(std::move(scope), Source::INTERNAL); - return apache::thrift::detail::si::future(semifuture_addHostIntoZone(p_req), std::move(ka)); + return apache::thrift::detail::si::future(semifuture_splitZone(p_req), std::move(ka)); } -void MetaServiceSvIf::async_tm_addHostIntoZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { +void MetaServiceSvIf::async_tm_splitZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::SplitZoneReq& p_req) { apache::thrift::detail::si::async_tm(this, std::move(callback), [&] { - return future_addHostIntoZone(p_req); + return future_splitZone(p_req); }); } -void MetaServiceSvIf::dropHostFromZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::DropHostFromZoneReq& /*req*/) { - apache::thrift::detail::si::throw_app_exn_unimplemented("dropHostFromZone"); +void MetaServiceSvIf::renameZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::RenameZoneReq& /*req*/) { + apache::thrift::detail::si::throw_app_exn_unimplemented("renameZone"); } -folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceSvIf::semifuture_dropHostFromZone(const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { - return apache::thrift::detail::si::semifuture_returning([&]( ::nebula::meta::cpp2::ExecResp& _return) { dropHostFromZone(_return, p_req); }); +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceSvIf::semifuture_renameZone(const ::nebula::meta::cpp2::RenameZoneReq& p_req) { + return apache::thrift::detail::si::semifuture_returning([&]( ::nebula::meta::cpp2::ExecResp& _return) { renameZone(_return, p_req); }); } -folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceSvIf::future_dropHostFromZone(const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceSvIf::future_renameZone(const ::nebula::meta::cpp2::RenameZoneReq& p_req) { using Source = apache::thrift::concurrency::ThreadManager::Source; auto scope = getRequestContext()->getRequestExecutionScope(); auto ka = getThreadManager()->getKeepAlive(std::move(scope), Source::INTERNAL); - return apache::thrift::detail::si::future(semifuture_dropHostFromZone(p_req), std::move(ka)); + return apache::thrift::detail::si::future(semifuture_renameZone(p_req), std::move(ka)); } -void MetaServiceSvIf::async_tm_dropHostFromZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { +void MetaServiceSvIf::async_tm_renameZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::RenameZoneReq& p_req) { apache::thrift::detail::si::async_tm(this, std::move(callback), [&] { - return future_dropHostFromZone(p_req); + return future_renameZone(p_req); }); } @@ -1767,6 +1830,12 @@ void MetaServiceSvNull::getEdge( ::nebula::meta::cpp2::GetEdgeResp& /*_return*/, void MetaServiceSvNull::listEdges( ::nebula::meta::cpp2::ListEdgesResp& /*_return*/, const ::nebula::meta::cpp2::ListEdgesReq& /*req*/) {} +void MetaServiceSvNull::addHosts( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::AddHostsReq& /*req*/) {} + +void MetaServiceSvNull::addHostsIntoZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& /*req*/) {} + +void MetaServiceSvNull::dropHosts( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::DropHostsReq& /*req*/) {} + void MetaServiceSvNull::listHosts( ::nebula::meta::cpp2::ListHostsResp& /*_return*/, const ::nebula::meta::cpp2::ListHostsReq& /*req*/) {} void MetaServiceSvNull::getPartsAlloc( ::nebula::meta::cpp2::GetPartsAllocResp& /*_return*/, const ::nebula::meta::cpp2::GetPartsAllocReq& /*req*/) {} @@ -1845,13 +1914,13 @@ void MetaServiceSvNull::listSnapshots( ::nebula::meta::cpp2::ListSnapshotsResp& void MetaServiceSvNull::runAdminJob( ::nebula::meta::cpp2::AdminJobResp& /*_return*/, const ::nebula::meta::cpp2::AdminJobReq& /*req*/) {} -void MetaServiceSvNull::addZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::AddZoneReq& /*req*/) {} +void MetaServiceSvNull::mergeZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::MergeZoneReq& /*req*/) {} void MetaServiceSvNull::dropZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::DropZoneReq& /*req*/) {} -void MetaServiceSvNull::addHostIntoZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::AddHostIntoZoneReq& /*req*/) {} +void MetaServiceSvNull::splitZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::SplitZoneReq& /*req*/) {} -void MetaServiceSvNull::dropHostFromZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::DropHostFromZoneReq& /*req*/) {} +void MetaServiceSvNull::renameZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::RenameZoneReq& /*req*/) {} void MetaServiceSvNull::getZone( ::nebula::meta::cpp2::GetZoneResp& /*_return*/, const ::nebula::meta::cpp2::GetZoneReq& /*req*/) {} @@ -1939,6 +2008,9 @@ const MetaServiceAsyncProcessor::ProcessMap MetaServiceAsyncProcessor::binaryPro {"dropEdge", &MetaServiceAsyncProcessor::setUpAndProcess_dropEdge}, {"getEdge", &MetaServiceAsyncProcessor::setUpAndProcess_getEdge}, {"listEdges", &MetaServiceAsyncProcessor::setUpAndProcess_listEdges}, + {"addHosts", &MetaServiceAsyncProcessor::setUpAndProcess_addHosts}, + {"addHostsIntoZone", &MetaServiceAsyncProcessor::setUpAndProcess_addHostsIntoZone}, + {"dropHosts", &MetaServiceAsyncProcessor::setUpAndProcess_dropHosts}, {"listHosts", &MetaServiceAsyncProcessor::setUpAndProcess_listHosts}, {"getPartsAlloc", &MetaServiceAsyncProcessor::setUpAndProcess_getPartsAlloc}, {"listParts", &MetaServiceAsyncProcessor::setUpAndProcess_listParts}, @@ -1978,10 +2050,10 @@ const MetaServiceAsyncProcessor::ProcessMap MetaServiceAsyncProcessor::binaryPro {"dropSnapshot", &MetaServiceAsyncProcessor::setUpAndProcess_dropSnapshot}, {"listSnapshots", &MetaServiceAsyncProcessor::setUpAndProcess_listSnapshots}, {"runAdminJob", &MetaServiceAsyncProcessor::setUpAndProcess_runAdminJob}, - {"addZone", &MetaServiceAsyncProcessor::setUpAndProcess_addZone}, + {"mergeZone", &MetaServiceAsyncProcessor::setUpAndProcess_mergeZone}, {"dropZone", &MetaServiceAsyncProcessor::setUpAndProcess_dropZone}, - {"addHostIntoZone", &MetaServiceAsyncProcessor::setUpAndProcess_addHostIntoZone}, - {"dropHostFromZone", &MetaServiceAsyncProcessor::setUpAndProcess_dropHostFromZone}, + {"splitZone", &MetaServiceAsyncProcessor::setUpAndProcess_splitZone}, + {"renameZone", &MetaServiceAsyncProcessor::setUpAndProcess_renameZone}, {"getZone", &MetaServiceAsyncProcessor::setUpAndProcess_getZone}, {"listZones", &MetaServiceAsyncProcessor::setUpAndProcess_listZones}, {"createBackup", &MetaServiceAsyncProcessor::setUpAndProcess_createBackup}, @@ -2028,6 +2100,9 @@ const MetaServiceAsyncProcessor::ProcessMap MetaServiceAsyncProcessor::compactPr {"dropEdge", &MetaServiceAsyncProcessor::setUpAndProcess_dropEdge}, {"getEdge", &MetaServiceAsyncProcessor::setUpAndProcess_getEdge}, {"listEdges", &MetaServiceAsyncProcessor::setUpAndProcess_listEdges}, + {"addHosts", &MetaServiceAsyncProcessor::setUpAndProcess_addHosts}, + {"addHostsIntoZone", &MetaServiceAsyncProcessor::setUpAndProcess_addHostsIntoZone}, + {"dropHosts", &MetaServiceAsyncProcessor::setUpAndProcess_dropHosts}, {"listHosts", &MetaServiceAsyncProcessor::setUpAndProcess_listHosts}, {"getPartsAlloc", &MetaServiceAsyncProcessor::setUpAndProcess_getPartsAlloc}, {"listParts", &MetaServiceAsyncProcessor::setUpAndProcess_listParts}, @@ -2067,10 +2142,10 @@ const MetaServiceAsyncProcessor::ProcessMap MetaServiceAsyncProcessor::compactPr {"dropSnapshot", &MetaServiceAsyncProcessor::setUpAndProcess_dropSnapshot}, {"listSnapshots", &MetaServiceAsyncProcessor::setUpAndProcess_listSnapshots}, {"runAdminJob", &MetaServiceAsyncProcessor::setUpAndProcess_runAdminJob}, - {"addZone", &MetaServiceAsyncProcessor::setUpAndProcess_addZone}, + {"mergeZone", &MetaServiceAsyncProcessor::setUpAndProcess_mergeZone}, {"dropZone", &MetaServiceAsyncProcessor::setUpAndProcess_dropZone}, - {"addHostIntoZone", &MetaServiceAsyncProcessor::setUpAndProcess_addHostIntoZone}, - {"dropHostFromZone", &MetaServiceAsyncProcessor::setUpAndProcess_dropHostFromZone}, + {"splitZone", &MetaServiceAsyncProcessor::setUpAndProcess_splitZone}, + {"renameZone", &MetaServiceAsyncProcessor::setUpAndProcess_renameZone}, {"getZone", &MetaServiceAsyncProcessor::setUpAndProcess_getZone}, {"listZones", &MetaServiceAsyncProcessor::setUpAndProcess_listZones}, {"createBackup", &MetaServiceAsyncProcessor::setUpAndProcess_createBackup}, diff --git a/src/interface/gen-cpp2/MetaService.h b/src/interface/gen-cpp2/MetaService.h index bcbe4915..b4beb164 100644 --- a/src/interface/gen-cpp2/MetaService.h +++ b/src/interface/gen-cpp2/MetaService.h @@ -73,6 +73,15 @@ class MetaServiceSvAsyncIf { virtual void async_tm_listEdges(std::unique_ptr> callback, const ::nebula::meta::cpp2::ListEdgesReq& p_req) = 0; virtual folly::Future< ::nebula::meta::cpp2::ListEdgesResp> future_listEdges(const ::nebula::meta::cpp2::ListEdgesReq& p_req) = 0; virtual folly::SemiFuture< ::nebula::meta::cpp2::ListEdgesResp> semifuture_listEdges(const ::nebula::meta::cpp2::ListEdgesReq& p_req) = 0; + virtual void async_tm_addHosts(std::unique_ptr> callback, const ::nebula::meta::cpp2::AddHostsReq& p_req) = 0; + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_addHosts(const ::nebula::meta::cpp2::AddHostsReq& p_req) = 0; + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_addHosts(const ::nebula::meta::cpp2::AddHostsReq& p_req) = 0; + virtual void async_tm_addHostsIntoZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) = 0; + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_addHostsIntoZone(const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) = 0; + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_addHostsIntoZone(const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) = 0; + virtual void async_tm_dropHosts(std::unique_ptr> callback, const ::nebula::meta::cpp2::DropHostsReq& p_req) = 0; + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_dropHosts(const ::nebula::meta::cpp2::DropHostsReq& p_req) = 0; + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_dropHosts(const ::nebula::meta::cpp2::DropHostsReq& p_req) = 0; virtual void async_tm_listHosts(std::unique_ptr> callback, const ::nebula::meta::cpp2::ListHostsReq& p_req) = 0; virtual folly::Future< ::nebula::meta::cpp2::ListHostsResp> future_listHosts(const ::nebula::meta::cpp2::ListHostsReq& p_req) = 0; virtual folly::SemiFuture< ::nebula::meta::cpp2::ListHostsResp> semifuture_listHosts(const ::nebula::meta::cpp2::ListHostsReq& p_req) = 0; @@ -190,18 +199,18 @@ class MetaServiceSvAsyncIf { virtual void async_tm_runAdminJob(std::unique_ptr> callback, const ::nebula::meta::cpp2::AdminJobReq& p_req) = 0; virtual folly::Future< ::nebula::meta::cpp2::AdminJobResp> future_runAdminJob(const ::nebula::meta::cpp2::AdminJobReq& p_req) = 0; virtual folly::SemiFuture< ::nebula::meta::cpp2::AdminJobResp> semifuture_runAdminJob(const ::nebula::meta::cpp2::AdminJobReq& p_req) = 0; - virtual void async_tm_addZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::AddZoneReq& p_req) = 0; - virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_addZone(const ::nebula::meta::cpp2::AddZoneReq& p_req) = 0; - virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_addZone(const ::nebula::meta::cpp2::AddZoneReq& p_req) = 0; + virtual void async_tm_mergeZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::MergeZoneReq& p_req) = 0; + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_mergeZone(const ::nebula::meta::cpp2::MergeZoneReq& p_req) = 0; + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_mergeZone(const ::nebula::meta::cpp2::MergeZoneReq& p_req) = 0; virtual void async_tm_dropZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::DropZoneReq& p_req) = 0; virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_dropZone(const ::nebula::meta::cpp2::DropZoneReq& p_req) = 0; virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_dropZone(const ::nebula::meta::cpp2::DropZoneReq& p_req) = 0; - virtual void async_tm_addHostIntoZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) = 0; - virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_addHostIntoZone(const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) = 0; - virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_addHostIntoZone(const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) = 0; - virtual void async_tm_dropHostFromZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) = 0; - virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_dropHostFromZone(const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) = 0; - virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_dropHostFromZone(const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) = 0; + virtual void async_tm_splitZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::SplitZoneReq& p_req) = 0; + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_splitZone(const ::nebula::meta::cpp2::SplitZoneReq& p_req) = 0; + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_splitZone(const ::nebula::meta::cpp2::SplitZoneReq& p_req) = 0; + virtual void async_tm_renameZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::RenameZoneReq& p_req) = 0; + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_renameZone(const ::nebula::meta::cpp2::RenameZoneReq& p_req) = 0; + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_renameZone(const ::nebula::meta::cpp2::RenameZoneReq& p_req) = 0; virtual void async_tm_getZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::GetZoneReq& p_req) = 0; virtual folly::Future< ::nebula::meta::cpp2::GetZoneResp> future_getZone(const ::nebula::meta::cpp2::GetZoneReq& p_req) = 0; virtual folly::SemiFuture< ::nebula::meta::cpp2::GetZoneResp> semifuture_getZone(const ::nebula::meta::cpp2::GetZoneReq& p_req) = 0; @@ -344,6 +353,18 @@ class MetaServiceSvIf : public MetaServiceSvAsyncIf, public apache::thrift::Serv folly::Future< ::nebula::meta::cpp2::ListEdgesResp> future_listEdges(const ::nebula::meta::cpp2::ListEdgesReq& p_req) override; folly::SemiFuture< ::nebula::meta::cpp2::ListEdgesResp> semifuture_listEdges(const ::nebula::meta::cpp2::ListEdgesReq& p_req) override; void async_tm_listEdges(std::unique_ptr> callback, const ::nebula::meta::cpp2::ListEdgesReq& p_req) override; + virtual void addHosts( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::AddHostsReq& /*req*/); + folly::Future< ::nebula::meta::cpp2::ExecResp> future_addHosts(const ::nebula::meta::cpp2::AddHostsReq& p_req) override; + folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_addHosts(const ::nebula::meta::cpp2::AddHostsReq& p_req) override; + void async_tm_addHosts(std::unique_ptr> callback, const ::nebula::meta::cpp2::AddHostsReq& p_req) override; + virtual void addHostsIntoZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& /*req*/); + folly::Future< ::nebula::meta::cpp2::ExecResp> future_addHostsIntoZone(const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) override; + folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_addHostsIntoZone(const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) override; + void async_tm_addHostsIntoZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) override; + virtual void dropHosts( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::DropHostsReq& /*req*/); + folly::Future< ::nebula::meta::cpp2::ExecResp> future_dropHosts(const ::nebula::meta::cpp2::DropHostsReq& p_req) override; + folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_dropHosts(const ::nebula::meta::cpp2::DropHostsReq& p_req) override; + void async_tm_dropHosts(std::unique_ptr> callback, const ::nebula::meta::cpp2::DropHostsReq& p_req) override; virtual void listHosts( ::nebula::meta::cpp2::ListHostsResp& /*_return*/, const ::nebula::meta::cpp2::ListHostsReq& /*req*/); folly::Future< ::nebula::meta::cpp2::ListHostsResp> future_listHosts(const ::nebula::meta::cpp2::ListHostsReq& p_req) override; folly::SemiFuture< ::nebula::meta::cpp2::ListHostsResp> semifuture_listHosts(const ::nebula::meta::cpp2::ListHostsReq& p_req) override; @@ -500,22 +521,22 @@ class MetaServiceSvIf : public MetaServiceSvAsyncIf, public apache::thrift::Serv folly::Future< ::nebula::meta::cpp2::AdminJobResp> future_runAdminJob(const ::nebula::meta::cpp2::AdminJobReq& p_req) override; folly::SemiFuture< ::nebula::meta::cpp2::AdminJobResp> semifuture_runAdminJob(const ::nebula::meta::cpp2::AdminJobReq& p_req) override; void async_tm_runAdminJob(std::unique_ptr> callback, const ::nebula::meta::cpp2::AdminJobReq& p_req) override; - virtual void addZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::AddZoneReq& /*req*/); - folly::Future< ::nebula::meta::cpp2::ExecResp> future_addZone(const ::nebula::meta::cpp2::AddZoneReq& p_req) override; - folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_addZone(const ::nebula::meta::cpp2::AddZoneReq& p_req) override; - void async_tm_addZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::AddZoneReq& p_req) override; + virtual void mergeZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::MergeZoneReq& /*req*/); + folly::Future< ::nebula::meta::cpp2::ExecResp> future_mergeZone(const ::nebula::meta::cpp2::MergeZoneReq& p_req) override; + folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_mergeZone(const ::nebula::meta::cpp2::MergeZoneReq& p_req) override; + void async_tm_mergeZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::MergeZoneReq& p_req) override; virtual void dropZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::DropZoneReq& /*req*/); folly::Future< ::nebula::meta::cpp2::ExecResp> future_dropZone(const ::nebula::meta::cpp2::DropZoneReq& p_req) override; folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_dropZone(const ::nebula::meta::cpp2::DropZoneReq& p_req) override; void async_tm_dropZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::DropZoneReq& p_req) override; - virtual void addHostIntoZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::AddHostIntoZoneReq& /*req*/); - folly::Future< ::nebula::meta::cpp2::ExecResp> future_addHostIntoZone(const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) override; - folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_addHostIntoZone(const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) override; - void async_tm_addHostIntoZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) override; - virtual void dropHostFromZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::DropHostFromZoneReq& /*req*/); - folly::Future< ::nebula::meta::cpp2::ExecResp> future_dropHostFromZone(const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) override; - folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_dropHostFromZone(const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) override; - void async_tm_dropHostFromZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) override; + virtual void splitZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::SplitZoneReq& /*req*/); + folly::Future< ::nebula::meta::cpp2::ExecResp> future_splitZone(const ::nebula::meta::cpp2::SplitZoneReq& p_req) override; + folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_splitZone(const ::nebula::meta::cpp2::SplitZoneReq& p_req) override; + void async_tm_splitZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::SplitZoneReq& p_req) override; + virtual void renameZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::RenameZoneReq& /*req*/); + folly::Future< ::nebula::meta::cpp2::ExecResp> future_renameZone(const ::nebula::meta::cpp2::RenameZoneReq& p_req) override; + folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_renameZone(const ::nebula::meta::cpp2::RenameZoneReq& p_req) override; + void async_tm_renameZone(std::unique_ptr> callback, const ::nebula::meta::cpp2::RenameZoneReq& p_req) override; virtual void getZone( ::nebula::meta::cpp2::GetZoneResp& /*_return*/, const ::nebula::meta::cpp2::GetZoneReq& /*req*/); folly::Future< ::nebula::meta::cpp2::GetZoneResp> future_getZone(const ::nebula::meta::cpp2::GetZoneReq& p_req) override; folly::SemiFuture< ::nebula::meta::cpp2::GetZoneResp> semifuture_getZone(const ::nebula::meta::cpp2::GetZoneReq& p_req) override; @@ -631,6 +652,9 @@ class MetaServiceSvNull : public MetaServiceSvIf { void dropEdge( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::DropEdgeReq& /*req*/) override; void getEdge( ::nebula::meta::cpp2::GetEdgeResp& /*_return*/, const ::nebula::meta::cpp2::GetEdgeReq& /*req*/) override; void listEdges( ::nebula::meta::cpp2::ListEdgesResp& /*_return*/, const ::nebula::meta::cpp2::ListEdgesReq& /*req*/) override; + void addHosts( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::AddHostsReq& /*req*/) override; + void addHostsIntoZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& /*req*/) override; + void dropHosts( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::DropHostsReq& /*req*/) override; void listHosts( ::nebula::meta::cpp2::ListHostsResp& /*_return*/, const ::nebula::meta::cpp2::ListHostsReq& /*req*/) override; void getPartsAlloc( ::nebula::meta::cpp2::GetPartsAllocResp& /*_return*/, const ::nebula::meta::cpp2::GetPartsAllocReq& /*req*/) override; void listParts( ::nebula::meta::cpp2::ListPartsResp& /*_return*/, const ::nebula::meta::cpp2::ListPartsReq& /*req*/) override; @@ -670,10 +694,10 @@ class MetaServiceSvNull : public MetaServiceSvIf { void dropSnapshot( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::DropSnapshotReq& /*req*/) override; void listSnapshots( ::nebula::meta::cpp2::ListSnapshotsResp& /*_return*/, const ::nebula::meta::cpp2::ListSnapshotsReq& /*req*/) override; void runAdminJob( ::nebula::meta::cpp2::AdminJobResp& /*_return*/, const ::nebula::meta::cpp2::AdminJobReq& /*req*/) override; - void addZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::AddZoneReq& /*req*/) override; + void mergeZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::MergeZoneReq& /*req*/) override; void dropZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::DropZoneReq& /*req*/) override; - void addHostIntoZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::AddHostIntoZoneReq& /*req*/) override; - void dropHostFromZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::DropHostFromZoneReq& /*req*/) override; + void splitZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::SplitZoneReq& /*req*/) override; + void renameZone( ::nebula::meta::cpp2::ExecResp& /*_return*/, const ::nebula::meta::cpp2::RenameZoneReq& /*req*/) override; void getZone( ::nebula::meta::cpp2::GetZoneResp& /*_return*/, const ::nebula::meta::cpp2::GetZoneReq& /*req*/) override; void listZones( ::nebula::meta::cpp2::ListZonesResp& /*_return*/, const ::nebula::meta::cpp2::ListZonesReq& /*req*/) override; void createBackup( ::nebula::meta::cpp2::CreateBackupResp& /*_return*/, const ::nebula::meta::cpp2::CreateBackupReq& /*req*/) override; @@ -841,6 +865,30 @@ class MetaServiceAsyncProcessor : public ::apache::thrift::GeneratedAsyncProcess template static void throw_wrapped_listEdges(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); template + void setUpAndProcess_addHosts(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); + template + void process_addHosts(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); + template + static folly::IOBufQueue return_addHosts(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return); + template + static void throw_wrapped_addHosts(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); + template + void setUpAndProcess_addHostsIntoZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); + template + void process_addHostsIntoZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); + template + static folly::IOBufQueue return_addHostsIntoZone(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return); + template + static void throw_wrapped_addHostsIntoZone(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); + template + void setUpAndProcess_dropHosts(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); + template + void process_dropHosts(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); + template + static folly::IOBufQueue return_dropHosts(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return); + template + static void throw_wrapped_dropHosts(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); + template void setUpAndProcess_listHosts(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); template void process_listHosts(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); @@ -1153,13 +1201,13 @@ class MetaServiceAsyncProcessor : public ::apache::thrift::GeneratedAsyncProcess template static void throw_wrapped_runAdminJob(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); template - void setUpAndProcess_addZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); + void setUpAndProcess_mergeZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); template - void process_addZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); + void process_mergeZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); template - static folly::IOBufQueue return_addZone(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return); + static folly::IOBufQueue return_mergeZone(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return); template - static void throw_wrapped_addZone(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); + static void throw_wrapped_mergeZone(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); template void setUpAndProcess_dropZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); template @@ -1169,21 +1217,21 @@ class MetaServiceAsyncProcessor : public ::apache::thrift::GeneratedAsyncProcess template static void throw_wrapped_dropZone(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); template - void setUpAndProcess_addHostIntoZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); + void setUpAndProcess_splitZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); template - void process_addHostIntoZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); + void process_splitZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); template - static folly::IOBufQueue return_addHostIntoZone(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return); + static folly::IOBufQueue return_splitZone(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return); template - static void throw_wrapped_addHostIntoZone(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); + static void throw_wrapped_splitZone(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); template - void setUpAndProcess_dropHostFromZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); + void setUpAndProcess_renameZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); template - void process_dropHostFromZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); + void process_renameZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); template - static folly::IOBufQueue return_dropHostFromZone(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return); + static folly::IOBufQueue return_renameZone(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return); template - static void throw_wrapped_dropHostFromZone(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); + static void throw_wrapped_renameZone(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); template void setUpAndProcess_getZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); template diff --git a/src/interface/gen-cpp2/MetaService.tcc b/src/interface/gen-cpp2/MetaService.tcc index 389933fb..fd271d5c 100644 --- a/src/interface/gen-cpp2/MetaService.tcc +++ b/src/interface/gen-cpp2/MetaService.tcc @@ -41,6 +41,12 @@ typedef apache::thrift::ThriftPresult> MetaService_getEdge_presult; typedef apache::thrift::ThriftPresult> MetaService_listEdges_pargs; typedef apache::thrift::ThriftPresult> MetaService_listEdges_presult; +typedef apache::thrift::ThriftPresult> MetaService_addHosts_pargs; +typedef apache::thrift::ThriftPresult> MetaService_addHosts_presult; +typedef apache::thrift::ThriftPresult> MetaService_addHostsIntoZone_pargs; +typedef apache::thrift::ThriftPresult> MetaService_addHostsIntoZone_presult; +typedef apache::thrift::ThriftPresult> MetaService_dropHosts_pargs; +typedef apache::thrift::ThriftPresult> MetaService_dropHosts_presult; typedef apache::thrift::ThriftPresult> MetaService_listHosts_pargs; typedef apache::thrift::ThriftPresult> MetaService_listHosts_presult; typedef apache::thrift::ThriftPresult> MetaService_getPartsAlloc_pargs; @@ -119,14 +125,14 @@ typedef apache::thrift::ThriftPresult> MetaService_listSnapshots_presult; typedef apache::thrift::ThriftPresult> MetaService_runAdminJob_pargs; typedef apache::thrift::ThriftPresult> MetaService_runAdminJob_presult; -typedef apache::thrift::ThriftPresult> MetaService_addZone_pargs; -typedef apache::thrift::ThriftPresult> MetaService_addZone_presult; +typedef apache::thrift::ThriftPresult> MetaService_mergeZone_pargs; +typedef apache::thrift::ThriftPresult> MetaService_mergeZone_presult; typedef apache::thrift::ThriftPresult> MetaService_dropZone_pargs; typedef apache::thrift::ThriftPresult> MetaService_dropZone_presult; -typedef apache::thrift::ThriftPresult> MetaService_addHostIntoZone_pargs; -typedef apache::thrift::ThriftPresult> MetaService_addHostIntoZone_presult; -typedef apache::thrift::ThriftPresult> MetaService_dropHostFromZone_pargs; -typedef apache::thrift::ThriftPresult> MetaService_dropHostFromZone_presult; +typedef apache::thrift::ThriftPresult> MetaService_splitZone_pargs; +typedef apache::thrift::ThriftPresult> MetaService_splitZone_presult; +typedef apache::thrift::ThriftPresult> MetaService_renameZone_pargs; +typedef apache::thrift::ThriftPresult> MetaService_renameZone_presult; typedef apache::thrift::ThriftPresult> MetaService_getZone_pargs; typedef apache::thrift::ThriftPresult> MetaService_getZone_presult; typedef apache::thrift::ThriftPresult> MetaService_listZones_pargs; @@ -1030,6 +1036,177 @@ void MetaServiceAsyncProcessor::throw_wrapped_listEdges(apache::thrift::Response } } +template +void MetaServiceAsyncProcessor::setUpAndProcess_addHosts(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { + if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { + return; + } + auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); + ctx->setRequestExecutionScope(std::move(scope)); + processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MetaServiceAsyncProcessor::process_addHosts, this); +} + +template +void MetaServiceAsyncProcessor::process_addHosts(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { + // make sure getRequestContext is null + // so async calls don't accidentally use it + iface_->setRequestContext(nullptr); + MetaService_addHosts_pargs args; + ::nebula::meta::cpp2::AddHostsReq uarg_req; + args.get<0>().value = &uarg_req; + std::unique_ptr ctxStack(this->getContextStack(this->getServiceName(), "MetaService.addHosts", ctx)); + try { + deserializeRequest(args, ctx->getMethodName(), serializedRequest, ctxStack.get()); + } + catch (const std::exception& ex) { + apache::thrift::detail::ap::process_handle_exn_deserialization( + ex, std::move(req), ctx, eb, "addHosts"); + return; + } + req->setStartedProcessing(); + auto callback = std::make_unique>(std::move(req), std::move(ctxStack), return_addHosts, throw_wrapped_addHosts, ctx->getProtoSeqId(), eb, tm, ctx); + if (!callback->isRequestActive()) { + return; + } + iface_->async_tm_addHosts(std::move(callback), args.get<0>().ref()); +} + +template +folly::IOBufQueue MetaServiceAsyncProcessor::return_addHosts(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return) { + ProtocolOut_ prot; + MetaService_addHosts_presult result; + result.get<0>().value = const_cast< ::nebula::meta::cpp2::ExecResp*>(&_return); + result.setIsSet(0, true); + return serializeResponse("addHosts", &prot, protoSeqId, ctx, result); +} + +template +void MetaServiceAsyncProcessor::throw_wrapped_addHosts(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { + if (!ew) { + return; + } + { + (void)protoSeqId; + apache::thrift::detail::ap::process_throw_wrapped_handler_error( + ew, std::move(req), reqCtx, ctx, "addHosts"); + return; + } +} + +template +void MetaServiceAsyncProcessor::setUpAndProcess_addHostsIntoZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { + if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { + return; + } + auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); + ctx->setRequestExecutionScope(std::move(scope)); + processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MetaServiceAsyncProcessor::process_addHostsIntoZone, this); +} + +template +void MetaServiceAsyncProcessor::process_addHostsIntoZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { + // make sure getRequestContext is null + // so async calls don't accidentally use it + iface_->setRequestContext(nullptr); + MetaService_addHostsIntoZone_pargs args; + ::nebula::meta::cpp2::AddHostsIntoZoneReq uarg_req; + args.get<0>().value = &uarg_req; + std::unique_ptr ctxStack(this->getContextStack(this->getServiceName(), "MetaService.addHostsIntoZone", ctx)); + try { + deserializeRequest(args, ctx->getMethodName(), serializedRequest, ctxStack.get()); + } + catch (const std::exception& ex) { + apache::thrift::detail::ap::process_handle_exn_deserialization( + ex, std::move(req), ctx, eb, "addHostsIntoZone"); + return; + } + req->setStartedProcessing(); + auto callback = std::make_unique>(std::move(req), std::move(ctxStack), return_addHostsIntoZone, throw_wrapped_addHostsIntoZone, ctx->getProtoSeqId(), eb, tm, ctx); + if (!callback->isRequestActive()) { + return; + } + iface_->async_tm_addHostsIntoZone(std::move(callback), args.get<0>().ref()); +} + +template +folly::IOBufQueue MetaServiceAsyncProcessor::return_addHostsIntoZone(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return) { + ProtocolOut_ prot; + MetaService_addHostsIntoZone_presult result; + result.get<0>().value = const_cast< ::nebula::meta::cpp2::ExecResp*>(&_return); + result.setIsSet(0, true); + return serializeResponse("addHostsIntoZone", &prot, protoSeqId, ctx, result); +} + +template +void MetaServiceAsyncProcessor::throw_wrapped_addHostsIntoZone(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { + if (!ew) { + return; + } + { + (void)protoSeqId; + apache::thrift::detail::ap::process_throw_wrapped_handler_error( + ew, std::move(req), reqCtx, ctx, "addHostsIntoZone"); + return; + } +} + +template +void MetaServiceAsyncProcessor::setUpAndProcess_dropHosts(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { + if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { + return; + } + auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); + ctx->setRequestExecutionScope(std::move(scope)); + processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MetaServiceAsyncProcessor::process_dropHosts, this); +} + +template +void MetaServiceAsyncProcessor::process_dropHosts(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { + // make sure getRequestContext is null + // so async calls don't accidentally use it + iface_->setRequestContext(nullptr); + MetaService_dropHosts_pargs args; + ::nebula::meta::cpp2::DropHostsReq uarg_req; + args.get<0>().value = &uarg_req; + std::unique_ptr ctxStack(this->getContextStack(this->getServiceName(), "MetaService.dropHosts", ctx)); + try { + deserializeRequest(args, ctx->getMethodName(), serializedRequest, ctxStack.get()); + } + catch (const std::exception& ex) { + apache::thrift::detail::ap::process_handle_exn_deserialization( + ex, std::move(req), ctx, eb, "dropHosts"); + return; + } + req->setStartedProcessing(); + auto callback = std::make_unique>(std::move(req), std::move(ctxStack), return_dropHosts, throw_wrapped_dropHosts, ctx->getProtoSeqId(), eb, tm, ctx); + if (!callback->isRequestActive()) { + return; + } + iface_->async_tm_dropHosts(std::move(callback), args.get<0>().ref()); +} + +template +folly::IOBufQueue MetaServiceAsyncProcessor::return_dropHosts(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return) { + ProtocolOut_ prot; + MetaService_dropHosts_presult result; + result.get<0>().value = const_cast< ::nebula::meta::cpp2::ExecResp*>(&_return); + result.setIsSet(0, true); + return serializeResponse("dropHosts", &prot, protoSeqId, ctx, result); +} + +template +void MetaServiceAsyncProcessor::throw_wrapped_dropHosts(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { + if (!ew) { + return; + } + { + (void)protoSeqId; + apache::thrift::detail::ap::process_throw_wrapped_handler_error( + ew, std::move(req), reqCtx, ctx, "dropHosts"); + return; + } +} + template void MetaServiceAsyncProcessor::setUpAndProcess_listHosts(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { @@ -3254,58 +3431,58 @@ void MetaServiceAsyncProcessor::throw_wrapped_runAdminJob(apache::thrift::Respon } template -void MetaServiceAsyncProcessor::setUpAndProcess_addZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { +void MetaServiceAsyncProcessor::setUpAndProcess_mergeZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); - processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MetaServiceAsyncProcessor::process_addZone, this); + processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MetaServiceAsyncProcessor::process_mergeZone, this); } template -void MetaServiceAsyncProcessor::process_addZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { +void MetaServiceAsyncProcessor::process_mergeZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); - MetaService_addZone_pargs args; - ::nebula::meta::cpp2::AddZoneReq uarg_req; + MetaService_mergeZone_pargs args; + ::nebula::meta::cpp2::MergeZoneReq uarg_req; args.get<0>().value = &uarg_req; - std::unique_ptr ctxStack(this->getContextStack(this->getServiceName(), "MetaService.addZone", ctx)); + std::unique_ptr ctxStack(this->getContextStack(this->getServiceName(), "MetaService.mergeZone", ctx)); try { deserializeRequest(args, ctx->getMethodName(), serializedRequest, ctxStack.get()); } catch (const std::exception& ex) { apache::thrift::detail::ap::process_handle_exn_deserialization( - ex, std::move(req), ctx, eb, "addZone"); + ex, std::move(req), ctx, eb, "mergeZone"); return; } req->setStartedProcessing(); - auto callback = std::make_unique>(std::move(req), std::move(ctxStack), return_addZone, throw_wrapped_addZone, ctx->getProtoSeqId(), eb, tm, ctx); + auto callback = std::make_unique>(std::move(req), std::move(ctxStack), return_mergeZone, throw_wrapped_mergeZone, ctx->getProtoSeqId(), eb, tm, ctx); if (!callback->isRequestActive()) { return; } - iface_->async_tm_addZone(std::move(callback), args.get<0>().ref()); + iface_->async_tm_mergeZone(std::move(callback), args.get<0>().ref()); } template -folly::IOBufQueue MetaServiceAsyncProcessor::return_addZone(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return) { +folly::IOBufQueue MetaServiceAsyncProcessor::return_mergeZone(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return) { ProtocolOut_ prot; - MetaService_addZone_presult result; + MetaService_mergeZone_presult result; result.get<0>().value = const_cast< ::nebula::meta::cpp2::ExecResp*>(&_return); result.setIsSet(0, true); - return serializeResponse("addZone", &prot, protoSeqId, ctx, result); + return serializeResponse("mergeZone", &prot, protoSeqId, ctx, result); } template -void MetaServiceAsyncProcessor::throw_wrapped_addZone(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { +void MetaServiceAsyncProcessor::throw_wrapped_mergeZone(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { (void)protoSeqId; apache::thrift::detail::ap::process_throw_wrapped_handler_error( - ew, std::move(req), reqCtx, ctx, "addZone"); + ew, std::move(req), reqCtx, ctx, "mergeZone"); return; } } @@ -3368,115 +3545,115 @@ void MetaServiceAsyncProcessor::throw_wrapped_dropZone(apache::thrift::ResponseC } template -void MetaServiceAsyncProcessor::setUpAndProcess_addHostIntoZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { +void MetaServiceAsyncProcessor::setUpAndProcess_splitZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); - processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MetaServiceAsyncProcessor::process_addHostIntoZone, this); + processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MetaServiceAsyncProcessor::process_splitZone, this); } template -void MetaServiceAsyncProcessor::process_addHostIntoZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { +void MetaServiceAsyncProcessor::process_splitZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); - MetaService_addHostIntoZone_pargs args; - ::nebula::meta::cpp2::AddHostIntoZoneReq uarg_req; + MetaService_splitZone_pargs args; + ::nebula::meta::cpp2::SplitZoneReq uarg_req; args.get<0>().value = &uarg_req; - std::unique_ptr ctxStack(this->getContextStack(this->getServiceName(), "MetaService.addHostIntoZone", ctx)); + std::unique_ptr ctxStack(this->getContextStack(this->getServiceName(), "MetaService.splitZone", ctx)); try { deserializeRequest(args, ctx->getMethodName(), serializedRequest, ctxStack.get()); } catch (const std::exception& ex) { apache::thrift::detail::ap::process_handle_exn_deserialization( - ex, std::move(req), ctx, eb, "addHostIntoZone"); + ex, std::move(req), ctx, eb, "splitZone"); return; } req->setStartedProcessing(); - auto callback = std::make_unique>(std::move(req), std::move(ctxStack), return_addHostIntoZone, throw_wrapped_addHostIntoZone, ctx->getProtoSeqId(), eb, tm, ctx); + auto callback = std::make_unique>(std::move(req), std::move(ctxStack), return_splitZone, throw_wrapped_splitZone, ctx->getProtoSeqId(), eb, tm, ctx); if (!callback->isRequestActive()) { return; } - iface_->async_tm_addHostIntoZone(std::move(callback), args.get<0>().ref()); + iface_->async_tm_splitZone(std::move(callback), args.get<0>().ref()); } template -folly::IOBufQueue MetaServiceAsyncProcessor::return_addHostIntoZone(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return) { +folly::IOBufQueue MetaServiceAsyncProcessor::return_splitZone(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return) { ProtocolOut_ prot; - MetaService_addHostIntoZone_presult result; + MetaService_splitZone_presult result; result.get<0>().value = const_cast< ::nebula::meta::cpp2::ExecResp*>(&_return); result.setIsSet(0, true); - return serializeResponse("addHostIntoZone", &prot, protoSeqId, ctx, result); + return serializeResponse("splitZone", &prot, protoSeqId, ctx, result); } template -void MetaServiceAsyncProcessor::throw_wrapped_addHostIntoZone(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { +void MetaServiceAsyncProcessor::throw_wrapped_splitZone(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { (void)protoSeqId; apache::thrift::detail::ap::process_throw_wrapped_handler_error( - ew, std::move(req), reqCtx, ctx, "addHostIntoZone"); + ew, std::move(req), reqCtx, ctx, "splitZone"); return; } } template -void MetaServiceAsyncProcessor::setUpAndProcess_dropHostFromZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { +void MetaServiceAsyncProcessor::setUpAndProcess_renameZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); - processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MetaServiceAsyncProcessor::process_dropHostFromZone, this); + processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MetaServiceAsyncProcessor::process_renameZone, this); } template -void MetaServiceAsyncProcessor::process_dropHostFromZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { +void MetaServiceAsyncProcessor::process_renameZone(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); - MetaService_dropHostFromZone_pargs args; - ::nebula::meta::cpp2::DropHostFromZoneReq uarg_req; + MetaService_renameZone_pargs args; + ::nebula::meta::cpp2::RenameZoneReq uarg_req; args.get<0>().value = &uarg_req; - std::unique_ptr ctxStack(this->getContextStack(this->getServiceName(), "MetaService.dropHostFromZone", ctx)); + std::unique_ptr ctxStack(this->getContextStack(this->getServiceName(), "MetaService.renameZone", ctx)); try { deserializeRequest(args, ctx->getMethodName(), serializedRequest, ctxStack.get()); } catch (const std::exception& ex) { apache::thrift::detail::ap::process_handle_exn_deserialization( - ex, std::move(req), ctx, eb, "dropHostFromZone"); + ex, std::move(req), ctx, eb, "renameZone"); return; } req->setStartedProcessing(); - auto callback = std::make_unique>(std::move(req), std::move(ctxStack), return_dropHostFromZone, throw_wrapped_dropHostFromZone, ctx->getProtoSeqId(), eb, tm, ctx); + auto callback = std::make_unique>(std::move(req), std::move(ctxStack), return_renameZone, throw_wrapped_renameZone, ctx->getProtoSeqId(), eb, tm, ctx); if (!callback->isRequestActive()) { return; } - iface_->async_tm_dropHostFromZone(std::move(callback), args.get<0>().ref()); + iface_->async_tm_renameZone(std::move(callback), args.get<0>().ref()); } template -folly::IOBufQueue MetaServiceAsyncProcessor::return_dropHostFromZone(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return) { +folly::IOBufQueue MetaServiceAsyncProcessor::return_renameZone(int32_t protoSeqId, apache::thrift::ContextStack* ctx, ::nebula::meta::cpp2::ExecResp const& _return) { ProtocolOut_ prot; - MetaService_dropHostFromZone_presult result; + MetaService_renameZone_presult result; result.get<0>().value = const_cast< ::nebula::meta::cpp2::ExecResp*>(&_return); result.setIsSet(0, true); - return serializeResponse("dropHostFromZone", &prot, protoSeqId, ctx, result); + return serializeResponse("renameZone", &prot, protoSeqId, ctx, result); } template -void MetaServiceAsyncProcessor::throw_wrapped_dropHostFromZone(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { +void MetaServiceAsyncProcessor::throw_wrapped_renameZone(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { (void)protoSeqId; apache::thrift::detail::ap::process_throw_wrapped_handler_error( - ew, std::move(req), reqCtx, ctx, "dropHostFromZone"); + ew, std::move(req), reqCtx, ctx, "renameZone"); return; } } diff --git a/src/interface/gen-cpp2/MetaServiceAsyncClient.cpp b/src/interface/gen-cpp2/MetaServiceAsyncClient.cpp index a9d3edc2..4e308ae3 100644 --- a/src/interface/gen-cpp2/MetaServiceAsyncClient.cpp +++ b/src/interface/gen-cpp2/MetaServiceAsyncClient.cpp @@ -40,6 +40,12 @@ typedef apache::thrift::ThriftPresult> MetaService_getEdge_presult; typedef apache::thrift::ThriftPresult> MetaService_listEdges_pargs; typedef apache::thrift::ThriftPresult> MetaService_listEdges_presult; +typedef apache::thrift::ThriftPresult> MetaService_addHosts_pargs; +typedef apache::thrift::ThriftPresult> MetaService_addHosts_presult; +typedef apache::thrift::ThriftPresult> MetaService_addHostsIntoZone_pargs; +typedef apache::thrift::ThriftPresult> MetaService_addHostsIntoZone_presult; +typedef apache::thrift::ThriftPresult> MetaService_dropHosts_pargs; +typedef apache::thrift::ThriftPresult> MetaService_dropHosts_presult; typedef apache::thrift::ThriftPresult> MetaService_listHosts_pargs; typedef apache::thrift::ThriftPresult> MetaService_listHosts_presult; typedef apache::thrift::ThriftPresult> MetaService_getPartsAlloc_pargs; @@ -118,14 +124,14 @@ typedef apache::thrift::ThriftPresult> MetaService_listSnapshots_presult; typedef apache::thrift::ThriftPresult> MetaService_runAdminJob_pargs; typedef apache::thrift::ThriftPresult> MetaService_runAdminJob_presult; -typedef apache::thrift::ThriftPresult> MetaService_addZone_pargs; -typedef apache::thrift::ThriftPresult> MetaService_addZone_presult; +typedef apache::thrift::ThriftPresult> MetaService_mergeZone_pargs; +typedef apache::thrift::ThriftPresult> MetaService_mergeZone_presult; typedef apache::thrift::ThriftPresult> MetaService_dropZone_pargs; typedef apache::thrift::ThriftPresult> MetaService_dropZone_presult; -typedef apache::thrift::ThriftPresult> MetaService_addHostIntoZone_pargs; -typedef apache::thrift::ThriftPresult> MetaService_addHostIntoZone_presult; -typedef apache::thrift::ThriftPresult> MetaService_dropHostFromZone_pargs; -typedef apache::thrift::ThriftPresult> MetaService_dropHostFromZone_presult; +typedef apache::thrift::ThriftPresult> MetaService_splitZone_pargs; +typedef apache::thrift::ThriftPresult> MetaService_splitZone_presult; +typedef apache::thrift::ThriftPresult> MetaService_renameZone_pargs; +typedef apache::thrift::ThriftPresult> MetaService_renameZone_presult; typedef apache::thrift::ThriftPresult> MetaService_getZone_pargs; typedef apache::thrift::ThriftPresult> MetaService_getZone_presult; typedef apache::thrift::ThriftPresult> MetaService_listZones_pargs; @@ -370,6 +376,45 @@ void MetaServiceAsyncClient::listEdgesT(Protocol_* prot, apache::thrift::RpcOpti ctx->reqContext.setRequestHeader(nullptr); } +template +void MetaServiceAsyncClient::addHostsT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AddHostsReq& p_req) { + + std::shared_ptr header(ctx, &ctx->header); + MetaService_addHosts_pargs args; + args.get<0>().value = const_cast< ::nebula::meta::cpp2::AddHostsReq*>(&p_req); + auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; + auto writer = [&](Protocol_* p) { args.write(p); }; + static constexpr const folly::StringPiece methodName = "addHosts"; + apache::thrift::clientSendT(prot, std::move(rpcOptions), std::move(callback), ctx->ctx, std::move(header), channel_.get(), apache::thrift::ManagedStringView(methodName, false), writer, sizer); + ctx->reqContext.setRequestHeader(nullptr); +} + +template +void MetaServiceAsyncClient::addHostsIntoZoneT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + + std::shared_ptr header(ctx, &ctx->header); + MetaService_addHostsIntoZone_pargs args; + args.get<0>().value = const_cast< ::nebula::meta::cpp2::AddHostsIntoZoneReq*>(&p_req); + auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; + auto writer = [&](Protocol_* p) { args.write(p); }; + static constexpr const folly::StringPiece methodName = "addHostsIntoZone"; + apache::thrift::clientSendT(prot, std::move(rpcOptions), std::move(callback), ctx->ctx, std::move(header), channel_.get(), apache::thrift::ManagedStringView(methodName, false), writer, sizer); + ctx->reqContext.setRequestHeader(nullptr); +} + +template +void MetaServiceAsyncClient::dropHostsT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::DropHostsReq& p_req) { + + std::shared_ptr header(ctx, &ctx->header); + MetaService_dropHosts_pargs args; + args.get<0>().value = const_cast< ::nebula::meta::cpp2::DropHostsReq*>(&p_req); + auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; + auto writer = [&](Protocol_* p) { args.write(p); }; + static constexpr const folly::StringPiece methodName = "dropHosts"; + apache::thrift::clientSendT(prot, std::move(rpcOptions), std::move(callback), ctx->ctx, std::move(header), channel_.get(), apache::thrift::ManagedStringView(methodName, false), writer, sizer); + ctx->reqContext.setRequestHeader(nullptr); +} + template void MetaServiceAsyncClient::listHostsT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::ListHostsReq& p_req) { @@ -878,14 +923,14 @@ void MetaServiceAsyncClient::runAdminJobT(Protocol_* prot, apache::thrift::RpcOp } template -void MetaServiceAsyncClient::addZoneT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AddZoneReq& p_req) { +void MetaServiceAsyncClient::mergeZoneT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::MergeZoneReq& p_req) { std::shared_ptr header(ctx, &ctx->header); - MetaService_addZone_pargs args; - args.get<0>().value = const_cast< ::nebula::meta::cpp2::AddZoneReq*>(&p_req); + MetaService_mergeZone_pargs args; + args.get<0>().value = const_cast< ::nebula::meta::cpp2::MergeZoneReq*>(&p_req); auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; - static constexpr const folly::StringPiece methodName = "addZone"; + static constexpr const folly::StringPiece methodName = "mergeZone"; apache::thrift::clientSendT(prot, std::move(rpcOptions), std::move(callback), ctx->ctx, std::move(header), channel_.get(), apache::thrift::ManagedStringView(methodName, false), writer, sizer); ctx->reqContext.setRequestHeader(nullptr); } @@ -904,27 +949,27 @@ void MetaServiceAsyncClient::dropZoneT(Protocol_* prot, apache::thrift::RpcOptio } template -void MetaServiceAsyncClient::addHostIntoZoneT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { +void MetaServiceAsyncClient::splitZoneT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::SplitZoneReq& p_req) { std::shared_ptr header(ctx, &ctx->header); - MetaService_addHostIntoZone_pargs args; - args.get<0>().value = const_cast< ::nebula::meta::cpp2::AddHostIntoZoneReq*>(&p_req); + MetaService_splitZone_pargs args; + args.get<0>().value = const_cast< ::nebula::meta::cpp2::SplitZoneReq*>(&p_req); auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; - static constexpr const folly::StringPiece methodName = "addHostIntoZone"; + static constexpr const folly::StringPiece methodName = "splitZone"; apache::thrift::clientSendT(prot, std::move(rpcOptions), std::move(callback), ctx->ctx, std::move(header), channel_.get(), apache::thrift::ManagedStringView(methodName, false), writer, sizer); ctx->reqContext.setRequestHeader(nullptr); } template -void MetaServiceAsyncClient::dropHostFromZoneT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { +void MetaServiceAsyncClient::renameZoneT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::RenameZoneReq& p_req) { std::shared_ptr header(ctx, &ctx->header); - MetaService_dropHostFromZone_pargs args; - args.get<0>().value = const_cast< ::nebula::meta::cpp2::DropHostFromZoneReq*>(&p_req); + MetaService_renameZone_pargs args; + args.get<0>().value = const_cast< ::nebula::meta::cpp2::RenameZoneReq*>(&p_req); auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; - static constexpr const folly::StringPiece methodName = "dropHostFromZone"; + static constexpr const folly::StringPiece methodName = "renameZone"; apache::thrift::clientSendT(prot, std::move(rpcOptions), std::move(callback), ctx->ctx, std::move(header), channel_.get(), apache::thrift::ManagedStringView(methodName, false), writer, sizer); ctx->reqContext.setRequestHeader(nullptr); } @@ -3748,6 +3793,507 @@ folly::exception_wrapper MetaServiceAsyncClient::recv_instance_wrapped_listEdges return recv_wrapped_listEdges(_return, state); } +void MetaServiceAsyncClient::addHosts(std::unique_ptr callback, const ::nebula::meta::cpp2::AddHostsReq& p_req) { + ::apache::thrift::RpcOptions rpcOptions; + addHosts(rpcOptions, std::move(callback), p_req); +} + +void MetaServiceAsyncClient::addHosts(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::AddHostsReq& p_req) { + auto ctx = addHostsCtx(&rpcOptions); + apache::thrift::RequestCallback::Context callbackContext; + callbackContext.protocolId = + apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); + callbackContext.ctx = std::shared_ptr(ctx, &ctx->ctx); + auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); + addHostsImpl(rpcOptions, std::move(ctx), std::move(wrappedCallback), p_req); +} + +void MetaServiceAsyncClient::addHostsImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AddHostsReq& p_req) { + switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { + case apache::thrift::protocol::T_BINARY_PROTOCOL: + { + apache::thrift::BinaryProtocolWriter writer; + addHostsT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); + break; + } + case apache::thrift::protocol::T_COMPACT_PROTOCOL: + { + apache::thrift::CompactProtocolWriter writer; + addHostsT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); + break; + } + default: + { + apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); + } + } +} + +std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> MetaServiceAsyncClient::addHostsCtx(apache::thrift::RpcOptions* rpcOptions) { + return std::make_shared( + channel_->getProtocolId(), + rpcOptions ? rpcOptions->releaseWriteHeaders() : std::map{}, + handlers_, + getServiceName(), + "MetaService.addHosts"); +} + +void MetaServiceAsyncClient::sync_addHosts( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::AddHostsReq& p_req) { + ::apache::thrift::RpcOptions rpcOptions; + sync_addHosts(rpcOptions, _return, p_req); +} + +void MetaServiceAsyncClient::sync_addHosts(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::AddHostsReq& p_req) { + apache::thrift::ClientReceiveState returnState; + apache::thrift::ClientSyncCallback callback(&returnState); + auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); + auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); + auto ctx = addHostsCtx(&rpcOptions); + auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); + addHostsImpl(rpcOptions, ctx, std::move(wrappedCallback), p_req); + callback.waitUntilDone(evb); + + if (returnState.isException()) { + returnState.exception().throw_exception(); + } + returnState.resetProtocolId(protocolId); + returnState.resetCtx(std::shared_ptr(ctx, &ctx->ctx)); + SCOPE_EXIT { + if (returnState.header() && !returnState.header()->getHeaders().empty()) { + rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); + } + }; + return folly::fibers::runInMainContext([&] { + recv_addHosts(_return, returnState); + }); +} + + +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_addHosts(const ::nebula::meta::cpp2::AddHostsReq& p_req) { + ::apache::thrift::RpcOptions rpcOptions; + return future_addHosts(rpcOptions, p_req); +} + +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_addHosts(const ::nebula::meta::cpp2::AddHostsReq& p_req) { + ::apache::thrift::RpcOptions rpcOptions; + return semifuture_addHosts(rpcOptions, p_req); +} + +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_addHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsReq& p_req) { + folly::Promise< ::nebula::meta::cpp2::ExecResp> promise; + auto future = promise.getFuture(); + auto callback = std::make_unique>(std::move(promise), recv_wrapped_addHosts, channel_); + addHosts(rpcOptions, std::move(callback), p_req); + return future; +} + +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_addHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsReq& p_req) { + auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_addHosts, channel_); + auto callback = std::move(callbackAndFuture.first); + addHosts(rpcOptions, std::move(callback), p_req); + return std::move(callbackAndFuture.second); +} + +folly::Future>> MetaServiceAsyncClient::header_future_addHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsReq& p_req) { + folly::Promise>> promise; + auto future = promise.getFuture(); + auto callback = std::make_unique>(std::move(promise), recv_wrapped_addHosts, channel_); + addHosts(rpcOptions, std::move(callback), p_req); + return future; +} + +folly::SemiFuture>> MetaServiceAsyncClient::header_semifuture_addHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsReq& p_req) { + auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_addHosts, channel_); + auto callback = std::move(callbackAndFuture.first); + addHosts(rpcOptions, std::move(callback), p_req); + return std::move(callbackAndFuture.second); +} + +void MetaServiceAsyncClient::addHosts(folly::Function callback, const ::nebula::meta::cpp2::AddHostsReq& p_req) { + addHosts(std::make_unique(std::move(callback)), p_req); +} + +#if FOLLY_HAS_COROUTINES +#endif // FOLLY_HAS_COROUTINES +folly::exception_wrapper MetaServiceAsyncClient::recv_wrapped_addHosts( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + if (state.isException()) { + return std::move(state.exception()); + } + if (!state.buf()) { + return folly::make_exception_wrapper("recv_ called without result"); + } + + using result = MetaService_addHosts_presult; + constexpr auto const fname = "addHosts"; + switch (state.protocolId()) { + case apache::thrift::protocol::T_BINARY_PROTOCOL: + { + apache::thrift::BinaryProtocolReader reader; + return apache::thrift::detail::ac::recv_wrapped( + fname, &reader, state, _return); + } + case apache::thrift::protocol::T_COMPACT_PROTOCOL: + { + apache::thrift::CompactProtocolReader reader; + return apache::thrift::detail::ac::recv_wrapped( + fname, &reader, state, _return); + } + default: + { + } + } + return folly::make_exception_wrapper("Could not find Protocol"); +} + +void MetaServiceAsyncClient::recv_addHosts( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + auto ew = recv_wrapped_addHosts(_return, state); + if (ew) { + ew.throw_exception(); + } +} + +void MetaServiceAsyncClient::recv_instance_addHosts( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + return recv_addHosts(_return, state); +} + +folly::exception_wrapper MetaServiceAsyncClient::recv_instance_wrapped_addHosts( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + return recv_wrapped_addHosts(_return, state); +} + +void MetaServiceAsyncClient::addHostsIntoZone(std::unique_ptr callback, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + ::apache::thrift::RpcOptions rpcOptions; + addHostsIntoZone(rpcOptions, std::move(callback), p_req); +} + +void MetaServiceAsyncClient::addHostsIntoZone(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + auto ctx = addHostsIntoZoneCtx(&rpcOptions); + apache::thrift::RequestCallback::Context callbackContext; + callbackContext.protocolId = + apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); + callbackContext.ctx = std::shared_ptr(ctx, &ctx->ctx); + auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); + addHostsIntoZoneImpl(rpcOptions, std::move(ctx), std::move(wrappedCallback), p_req); +} + +void MetaServiceAsyncClient::addHostsIntoZoneImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { + case apache::thrift::protocol::T_BINARY_PROTOCOL: + { + apache::thrift::BinaryProtocolWriter writer; + addHostsIntoZoneT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); + break; + } + case apache::thrift::protocol::T_COMPACT_PROTOCOL: + { + apache::thrift::CompactProtocolWriter writer; + addHostsIntoZoneT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); + break; + } + default: + { + apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); + } + } +} + +std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> MetaServiceAsyncClient::addHostsIntoZoneCtx(apache::thrift::RpcOptions* rpcOptions) { + return std::make_shared( + channel_->getProtocolId(), + rpcOptions ? rpcOptions->releaseWriteHeaders() : std::map{}, + handlers_, + getServiceName(), + "MetaService.addHostsIntoZone"); +} + +void MetaServiceAsyncClient::sync_addHostsIntoZone( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + ::apache::thrift::RpcOptions rpcOptions; + sync_addHostsIntoZone(rpcOptions, _return, p_req); +} + +void MetaServiceAsyncClient::sync_addHostsIntoZone(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + apache::thrift::ClientReceiveState returnState; + apache::thrift::ClientSyncCallback callback(&returnState); + auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); + auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); + auto ctx = addHostsIntoZoneCtx(&rpcOptions); + auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); + addHostsIntoZoneImpl(rpcOptions, ctx, std::move(wrappedCallback), p_req); + callback.waitUntilDone(evb); + + if (returnState.isException()) { + returnState.exception().throw_exception(); + } + returnState.resetProtocolId(protocolId); + returnState.resetCtx(std::shared_ptr(ctx, &ctx->ctx)); + SCOPE_EXIT { + if (returnState.header() && !returnState.header()->getHeaders().empty()) { + rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); + } + }; + return folly::fibers::runInMainContext([&] { + recv_addHostsIntoZone(_return, returnState); + }); +} + + +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_addHostsIntoZone(const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + ::apache::thrift::RpcOptions rpcOptions; + return future_addHostsIntoZone(rpcOptions, p_req); +} + +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_addHostsIntoZone(const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + ::apache::thrift::RpcOptions rpcOptions; + return semifuture_addHostsIntoZone(rpcOptions, p_req); +} + +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_addHostsIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + folly::Promise< ::nebula::meta::cpp2::ExecResp> promise; + auto future = promise.getFuture(); + auto callback = std::make_unique>(std::move(promise), recv_wrapped_addHostsIntoZone, channel_); + addHostsIntoZone(rpcOptions, std::move(callback), p_req); + return future; +} + +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_addHostsIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_addHostsIntoZone, channel_); + auto callback = std::move(callbackAndFuture.first); + addHostsIntoZone(rpcOptions, std::move(callback), p_req); + return std::move(callbackAndFuture.second); +} + +folly::Future>> MetaServiceAsyncClient::header_future_addHostsIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + folly::Promise>> promise; + auto future = promise.getFuture(); + auto callback = std::make_unique>(std::move(promise), recv_wrapped_addHostsIntoZone, channel_); + addHostsIntoZone(rpcOptions, std::move(callback), p_req); + return future; +} + +folly::SemiFuture>> MetaServiceAsyncClient::header_semifuture_addHostsIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_addHostsIntoZone, channel_); + auto callback = std::move(callbackAndFuture.first); + addHostsIntoZone(rpcOptions, std::move(callback), p_req); + return std::move(callbackAndFuture.second); +} + +void MetaServiceAsyncClient::addHostsIntoZone(folly::Function callback, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + addHostsIntoZone(std::make_unique(std::move(callback)), p_req); +} + +#if FOLLY_HAS_COROUTINES +#endif // FOLLY_HAS_COROUTINES +folly::exception_wrapper MetaServiceAsyncClient::recv_wrapped_addHostsIntoZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + if (state.isException()) { + return std::move(state.exception()); + } + if (!state.buf()) { + return folly::make_exception_wrapper("recv_ called without result"); + } + + using result = MetaService_addHostsIntoZone_presult; + constexpr auto const fname = "addHostsIntoZone"; + switch (state.protocolId()) { + case apache::thrift::protocol::T_BINARY_PROTOCOL: + { + apache::thrift::BinaryProtocolReader reader; + return apache::thrift::detail::ac::recv_wrapped( + fname, &reader, state, _return); + } + case apache::thrift::protocol::T_COMPACT_PROTOCOL: + { + apache::thrift::CompactProtocolReader reader; + return apache::thrift::detail::ac::recv_wrapped( + fname, &reader, state, _return); + } + default: + { + } + } + return folly::make_exception_wrapper("Could not find Protocol"); +} + +void MetaServiceAsyncClient::recv_addHostsIntoZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + auto ew = recv_wrapped_addHostsIntoZone(_return, state); + if (ew) { + ew.throw_exception(); + } +} + +void MetaServiceAsyncClient::recv_instance_addHostsIntoZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + return recv_addHostsIntoZone(_return, state); +} + +folly::exception_wrapper MetaServiceAsyncClient::recv_instance_wrapped_addHostsIntoZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + return recv_wrapped_addHostsIntoZone(_return, state); +} + +void MetaServiceAsyncClient::dropHosts(std::unique_ptr callback, const ::nebula::meta::cpp2::DropHostsReq& p_req) { + ::apache::thrift::RpcOptions rpcOptions; + dropHosts(rpcOptions, std::move(callback), p_req); +} + +void MetaServiceAsyncClient::dropHosts(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::DropHostsReq& p_req) { + auto ctx = dropHostsCtx(&rpcOptions); + apache::thrift::RequestCallback::Context callbackContext; + callbackContext.protocolId = + apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); + callbackContext.ctx = std::shared_ptr(ctx, &ctx->ctx); + auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); + dropHostsImpl(rpcOptions, std::move(ctx), std::move(wrappedCallback), p_req); +} + +void MetaServiceAsyncClient::dropHostsImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::DropHostsReq& p_req) { + switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { + case apache::thrift::protocol::T_BINARY_PROTOCOL: + { + apache::thrift::BinaryProtocolWriter writer; + dropHostsT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); + break; + } + case apache::thrift::protocol::T_COMPACT_PROTOCOL: + { + apache::thrift::CompactProtocolWriter writer; + dropHostsT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); + break; + } + default: + { + apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); + } + } +} + +std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> MetaServiceAsyncClient::dropHostsCtx(apache::thrift::RpcOptions* rpcOptions) { + return std::make_shared( + channel_->getProtocolId(), + rpcOptions ? rpcOptions->releaseWriteHeaders() : std::map{}, + handlers_, + getServiceName(), + "MetaService.dropHosts"); +} + +void MetaServiceAsyncClient::sync_dropHosts( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::DropHostsReq& p_req) { + ::apache::thrift::RpcOptions rpcOptions; + sync_dropHosts(rpcOptions, _return, p_req); +} + +void MetaServiceAsyncClient::sync_dropHosts(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::DropHostsReq& p_req) { + apache::thrift::ClientReceiveState returnState; + apache::thrift::ClientSyncCallback callback(&returnState); + auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); + auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); + auto ctx = dropHostsCtx(&rpcOptions); + auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); + dropHostsImpl(rpcOptions, ctx, std::move(wrappedCallback), p_req); + callback.waitUntilDone(evb); + + if (returnState.isException()) { + returnState.exception().throw_exception(); + } + returnState.resetProtocolId(protocolId); + returnState.resetCtx(std::shared_ptr(ctx, &ctx->ctx)); + SCOPE_EXIT { + if (returnState.header() && !returnState.header()->getHeaders().empty()) { + rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); + } + }; + return folly::fibers::runInMainContext([&] { + recv_dropHosts(_return, returnState); + }); +} + + +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_dropHosts(const ::nebula::meta::cpp2::DropHostsReq& p_req) { + ::apache::thrift::RpcOptions rpcOptions; + return future_dropHosts(rpcOptions, p_req); +} + +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_dropHosts(const ::nebula::meta::cpp2::DropHostsReq& p_req) { + ::apache::thrift::RpcOptions rpcOptions; + return semifuture_dropHosts(rpcOptions, p_req); +} + +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_dropHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostsReq& p_req) { + folly::Promise< ::nebula::meta::cpp2::ExecResp> promise; + auto future = promise.getFuture(); + auto callback = std::make_unique>(std::move(promise), recv_wrapped_dropHosts, channel_); + dropHosts(rpcOptions, std::move(callback), p_req); + return future; +} + +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_dropHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostsReq& p_req) { + auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_dropHosts, channel_); + auto callback = std::move(callbackAndFuture.first); + dropHosts(rpcOptions, std::move(callback), p_req); + return std::move(callbackAndFuture.second); +} + +folly::Future>> MetaServiceAsyncClient::header_future_dropHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostsReq& p_req) { + folly::Promise>> promise; + auto future = promise.getFuture(); + auto callback = std::make_unique>(std::move(promise), recv_wrapped_dropHosts, channel_); + dropHosts(rpcOptions, std::move(callback), p_req); + return future; +} + +folly::SemiFuture>> MetaServiceAsyncClient::header_semifuture_dropHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostsReq& p_req) { + auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_dropHosts, channel_); + auto callback = std::move(callbackAndFuture.first); + dropHosts(rpcOptions, std::move(callback), p_req); + return std::move(callbackAndFuture.second); +} + +void MetaServiceAsyncClient::dropHosts(folly::Function callback, const ::nebula::meta::cpp2::DropHostsReq& p_req) { + dropHosts(std::make_unique(std::move(callback)), p_req); +} + +#if FOLLY_HAS_COROUTINES +#endif // FOLLY_HAS_COROUTINES +folly::exception_wrapper MetaServiceAsyncClient::recv_wrapped_dropHosts( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + if (state.isException()) { + return std::move(state.exception()); + } + if (!state.buf()) { + return folly::make_exception_wrapper("recv_ called without result"); + } + + using result = MetaService_dropHosts_presult; + constexpr auto const fname = "dropHosts"; + switch (state.protocolId()) { + case apache::thrift::protocol::T_BINARY_PROTOCOL: + { + apache::thrift::BinaryProtocolReader reader; + return apache::thrift::detail::ac::recv_wrapped( + fname, &reader, state, _return); + } + case apache::thrift::protocol::T_COMPACT_PROTOCOL: + { + apache::thrift::CompactProtocolReader reader; + return apache::thrift::detail::ac::recv_wrapped( + fname, &reader, state, _return); + } + default: + { + } + } + return folly::make_exception_wrapper("Could not find Protocol"); +} + +void MetaServiceAsyncClient::recv_dropHosts( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + auto ew = recv_wrapped_dropHosts(_return, state); + if (ew) { + ew.throw_exception(); + } +} + +void MetaServiceAsyncClient::recv_instance_dropHosts( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + return recv_dropHosts(_return, state); +} + +folly::exception_wrapper MetaServiceAsyncClient::recv_instance_wrapped_dropHosts( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + return recv_wrapped_dropHosts(_return, state); +} + void MetaServiceAsyncClient::listHosts(std::unique_ptr callback, const ::nebula::meta::cpp2::ListHostsReq& p_req) { ::apache::thrift::RpcOptions rpcOptions; listHosts(rpcOptions, std::move(callback), p_req); @@ -10261,33 +10807,33 @@ folly::exception_wrapper MetaServiceAsyncClient::recv_instance_wrapped_runAdminJ return recv_wrapped_runAdminJob(_return, state); } -void MetaServiceAsyncClient::addZone(std::unique_ptr callback, const ::nebula::meta::cpp2::AddZoneReq& p_req) { +void MetaServiceAsyncClient::mergeZone(std::unique_ptr callback, const ::nebula::meta::cpp2::MergeZoneReq& p_req) { ::apache::thrift::RpcOptions rpcOptions; - addZone(rpcOptions, std::move(callback), p_req); + mergeZone(rpcOptions, std::move(callback), p_req); } -void MetaServiceAsyncClient::addZone(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::AddZoneReq& p_req) { - auto ctx = addZoneCtx(&rpcOptions); +void MetaServiceAsyncClient::mergeZone(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::MergeZoneReq& p_req) { + auto ctx = mergeZoneCtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); callbackContext.ctx = std::shared_ptr(ctx, &ctx->ctx); auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); - addZoneImpl(rpcOptions, std::move(ctx), std::move(wrappedCallback), p_req); + mergeZoneImpl(rpcOptions, std::move(ctx), std::move(wrappedCallback), p_req); } -void MetaServiceAsyncClient::addZoneImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AddZoneReq& p_req) { +void MetaServiceAsyncClient::mergeZoneImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::MergeZoneReq& p_req) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; - addZoneT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); + mergeZoneT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; - addZoneT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); + mergeZoneT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); break; } default: @@ -10297,28 +10843,28 @@ void MetaServiceAsyncClient::addZoneImpl(const apache::thrift::RpcOptions& rpcOp } } -std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> MetaServiceAsyncClient::addZoneCtx(apache::thrift::RpcOptions* rpcOptions) { +std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> MetaServiceAsyncClient::mergeZoneCtx(apache::thrift::RpcOptions* rpcOptions) { return std::make_shared( channel_->getProtocolId(), rpcOptions ? rpcOptions->releaseWriteHeaders() : std::map{}, handlers_, getServiceName(), - "MetaService.addZone"); + "MetaService.mergeZone"); } -void MetaServiceAsyncClient::sync_addZone( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::AddZoneReq& p_req) { +void MetaServiceAsyncClient::sync_mergeZone( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::MergeZoneReq& p_req) { ::apache::thrift::RpcOptions rpcOptions; - sync_addZone(rpcOptions, _return, p_req); + sync_mergeZone(rpcOptions, _return, p_req); } -void MetaServiceAsyncClient::sync_addZone(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::AddZoneReq& p_req) { +void MetaServiceAsyncClient::sync_mergeZone(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::MergeZoneReq& p_req) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); - auto ctx = addZoneCtx(&rpcOptions); + auto ctx = mergeZoneCtx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); - addZoneImpl(rpcOptions, ctx, std::move(wrappedCallback), p_req); + mergeZoneImpl(rpcOptions, ctx, std::move(wrappedCallback), p_req); callback.waitUntilDone(evb); if (returnState.isException()) { @@ -10332,58 +10878,58 @@ void MetaServiceAsyncClient::sync_addZone(apache::thrift::RpcOptions& rpcOptions } }; return folly::fibers::runInMainContext([&] { - recv_addZone(_return, returnState); + recv_mergeZone(_return, returnState); }); } -folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_addZone(const ::nebula::meta::cpp2::AddZoneReq& p_req) { +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_mergeZone(const ::nebula::meta::cpp2::MergeZoneReq& p_req) { ::apache::thrift::RpcOptions rpcOptions; - return future_addZone(rpcOptions, p_req); + return future_mergeZone(rpcOptions, p_req); } -folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_addZone(const ::nebula::meta::cpp2::AddZoneReq& p_req) { +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_mergeZone(const ::nebula::meta::cpp2::MergeZoneReq& p_req) { ::apache::thrift::RpcOptions rpcOptions; - return semifuture_addZone(rpcOptions, p_req); + return semifuture_mergeZone(rpcOptions, p_req); } -folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_addZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddZoneReq& p_req) { +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_mergeZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::MergeZoneReq& p_req) { folly::Promise< ::nebula::meta::cpp2::ExecResp> promise; auto future = promise.getFuture(); - auto callback = std::make_unique>(std::move(promise), recv_wrapped_addZone, channel_); - addZone(rpcOptions, std::move(callback), p_req); + auto callback = std::make_unique>(std::move(promise), recv_wrapped_mergeZone, channel_); + mergeZone(rpcOptions, std::move(callback), p_req); return future; } -folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_addZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddZoneReq& p_req) { - auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_addZone, channel_); +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_mergeZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::MergeZoneReq& p_req) { + auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_mergeZone, channel_); auto callback = std::move(callbackAndFuture.first); - addZone(rpcOptions, std::move(callback), p_req); + mergeZone(rpcOptions, std::move(callback), p_req); return std::move(callbackAndFuture.second); } -folly::Future>> MetaServiceAsyncClient::header_future_addZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddZoneReq& p_req) { +folly::Future>> MetaServiceAsyncClient::header_future_mergeZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::MergeZoneReq& p_req) { folly::Promise>> promise; auto future = promise.getFuture(); - auto callback = std::make_unique>(std::move(promise), recv_wrapped_addZone, channel_); - addZone(rpcOptions, std::move(callback), p_req); + auto callback = std::make_unique>(std::move(promise), recv_wrapped_mergeZone, channel_); + mergeZone(rpcOptions, std::move(callback), p_req); return future; } -folly::SemiFuture>> MetaServiceAsyncClient::header_semifuture_addZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddZoneReq& p_req) { - auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_addZone, channel_); +folly::SemiFuture>> MetaServiceAsyncClient::header_semifuture_mergeZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::MergeZoneReq& p_req) { + auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_mergeZone, channel_); auto callback = std::move(callbackAndFuture.first); - addZone(rpcOptions, std::move(callback), p_req); + mergeZone(rpcOptions, std::move(callback), p_req); return std::move(callbackAndFuture.second); } -void MetaServiceAsyncClient::addZone(folly::Function callback, const ::nebula::meta::cpp2::AddZoneReq& p_req) { - addZone(std::make_unique(std::move(callback)), p_req); +void MetaServiceAsyncClient::mergeZone(folly::Function callback, const ::nebula::meta::cpp2::MergeZoneReq& p_req) { + mergeZone(std::make_unique(std::move(callback)), p_req); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES -folly::exception_wrapper MetaServiceAsyncClient::recv_wrapped_addZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { +folly::exception_wrapper MetaServiceAsyncClient::recv_wrapped_mergeZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } @@ -10391,8 +10937,8 @@ folly::exception_wrapper MetaServiceAsyncClient::recv_wrapped_addZone( ::nebula: return folly::make_exception_wrapper("recv_ called without result"); } - using result = MetaService_addZone_presult; - constexpr auto const fname = "addZone"; + using result = MetaService_mergeZone_presult; + constexpr auto const fname = "mergeZone"; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { @@ -10413,19 +10959,19 @@ folly::exception_wrapper MetaServiceAsyncClient::recv_wrapped_addZone( ::nebula: return folly::make_exception_wrapper("Could not find Protocol"); } -void MetaServiceAsyncClient::recv_addZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { - auto ew = recv_wrapped_addZone(_return, state); +void MetaServiceAsyncClient::recv_mergeZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + auto ew = recv_wrapped_mergeZone(_return, state); if (ew) { ew.throw_exception(); } } -void MetaServiceAsyncClient::recv_instance_addZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { - return recv_addZone(_return, state); +void MetaServiceAsyncClient::recv_instance_mergeZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + return recv_mergeZone(_return, state); } -folly::exception_wrapper MetaServiceAsyncClient::recv_instance_wrapped_addZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { - return recv_wrapped_addZone(_return, state); +folly::exception_wrapper MetaServiceAsyncClient::recv_instance_wrapped_mergeZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + return recv_wrapped_mergeZone(_return, state); } void MetaServiceAsyncClient::dropZone(std::unique_ptr callback, const ::nebula::meta::cpp2::DropZoneReq& p_req) { @@ -10595,33 +11141,33 @@ folly::exception_wrapper MetaServiceAsyncClient::recv_instance_wrapped_dropZone( return recv_wrapped_dropZone(_return, state); } -void MetaServiceAsyncClient::addHostIntoZone(std::unique_ptr callback, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { +void MetaServiceAsyncClient::splitZone(std::unique_ptr callback, const ::nebula::meta::cpp2::SplitZoneReq& p_req) { ::apache::thrift::RpcOptions rpcOptions; - addHostIntoZone(rpcOptions, std::move(callback), p_req); + splitZone(rpcOptions, std::move(callback), p_req); } -void MetaServiceAsyncClient::addHostIntoZone(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { - auto ctx = addHostIntoZoneCtx(&rpcOptions); +void MetaServiceAsyncClient::splitZone(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::SplitZoneReq& p_req) { + auto ctx = splitZoneCtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); callbackContext.ctx = std::shared_ptr(ctx, &ctx->ctx); auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); - addHostIntoZoneImpl(rpcOptions, std::move(ctx), std::move(wrappedCallback), p_req); + splitZoneImpl(rpcOptions, std::move(ctx), std::move(wrappedCallback), p_req); } -void MetaServiceAsyncClient::addHostIntoZoneImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { +void MetaServiceAsyncClient::splitZoneImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::SplitZoneReq& p_req) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; - addHostIntoZoneT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); + splitZoneT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; - addHostIntoZoneT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); + splitZoneT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); break; } default: @@ -10631,28 +11177,28 @@ void MetaServiceAsyncClient::addHostIntoZoneImpl(const apache::thrift::RpcOption } } -std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> MetaServiceAsyncClient::addHostIntoZoneCtx(apache::thrift::RpcOptions* rpcOptions) { +std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> MetaServiceAsyncClient::splitZoneCtx(apache::thrift::RpcOptions* rpcOptions) { return std::make_shared( channel_->getProtocolId(), rpcOptions ? rpcOptions->releaseWriteHeaders() : std::map{}, handlers_, getServiceName(), - "MetaService.addHostIntoZone"); + "MetaService.splitZone"); } -void MetaServiceAsyncClient::sync_addHostIntoZone( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { +void MetaServiceAsyncClient::sync_splitZone( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::SplitZoneReq& p_req) { ::apache::thrift::RpcOptions rpcOptions; - sync_addHostIntoZone(rpcOptions, _return, p_req); + sync_splitZone(rpcOptions, _return, p_req); } -void MetaServiceAsyncClient::sync_addHostIntoZone(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { +void MetaServiceAsyncClient::sync_splitZone(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::SplitZoneReq& p_req) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); - auto ctx = addHostIntoZoneCtx(&rpcOptions); + auto ctx = splitZoneCtx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); - addHostIntoZoneImpl(rpcOptions, ctx, std::move(wrappedCallback), p_req); + splitZoneImpl(rpcOptions, ctx, std::move(wrappedCallback), p_req); callback.waitUntilDone(evb); if (returnState.isException()) { @@ -10666,58 +11212,58 @@ void MetaServiceAsyncClient::sync_addHostIntoZone(apache::thrift::RpcOptions& rp } }; return folly::fibers::runInMainContext([&] { - recv_addHostIntoZone(_return, returnState); + recv_splitZone(_return, returnState); }); } -folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_addHostIntoZone(const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_splitZone(const ::nebula::meta::cpp2::SplitZoneReq& p_req) { ::apache::thrift::RpcOptions rpcOptions; - return future_addHostIntoZone(rpcOptions, p_req); + return future_splitZone(rpcOptions, p_req); } -folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_addHostIntoZone(const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_splitZone(const ::nebula::meta::cpp2::SplitZoneReq& p_req) { ::apache::thrift::RpcOptions rpcOptions; - return semifuture_addHostIntoZone(rpcOptions, p_req); + return semifuture_splitZone(rpcOptions, p_req); } -folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_addHostIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_splitZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::SplitZoneReq& p_req) { folly::Promise< ::nebula::meta::cpp2::ExecResp> promise; auto future = promise.getFuture(); - auto callback = std::make_unique>(std::move(promise), recv_wrapped_addHostIntoZone, channel_); - addHostIntoZone(rpcOptions, std::move(callback), p_req); + auto callback = std::make_unique>(std::move(promise), recv_wrapped_splitZone, channel_); + splitZone(rpcOptions, std::move(callback), p_req); return future; } -folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_addHostIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { - auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_addHostIntoZone, channel_); +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_splitZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::SplitZoneReq& p_req) { + auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_splitZone, channel_); auto callback = std::move(callbackAndFuture.first); - addHostIntoZone(rpcOptions, std::move(callback), p_req); + splitZone(rpcOptions, std::move(callback), p_req); return std::move(callbackAndFuture.second); } -folly::Future>> MetaServiceAsyncClient::header_future_addHostIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { +folly::Future>> MetaServiceAsyncClient::header_future_splitZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::SplitZoneReq& p_req) { folly::Promise>> promise; auto future = promise.getFuture(); - auto callback = std::make_unique>(std::move(promise), recv_wrapped_addHostIntoZone, channel_); - addHostIntoZone(rpcOptions, std::move(callback), p_req); + auto callback = std::make_unique>(std::move(promise), recv_wrapped_splitZone, channel_); + splitZone(rpcOptions, std::move(callback), p_req); return future; } -folly::SemiFuture>> MetaServiceAsyncClient::header_semifuture_addHostIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { - auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_addHostIntoZone, channel_); +folly::SemiFuture>> MetaServiceAsyncClient::header_semifuture_splitZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::SplitZoneReq& p_req) { + auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_splitZone, channel_); auto callback = std::move(callbackAndFuture.first); - addHostIntoZone(rpcOptions, std::move(callback), p_req); + splitZone(rpcOptions, std::move(callback), p_req); return std::move(callbackAndFuture.second); } -void MetaServiceAsyncClient::addHostIntoZone(folly::Function callback, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { - addHostIntoZone(std::make_unique(std::move(callback)), p_req); +void MetaServiceAsyncClient::splitZone(folly::Function callback, const ::nebula::meta::cpp2::SplitZoneReq& p_req) { + splitZone(std::make_unique(std::move(callback)), p_req); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES -folly::exception_wrapper MetaServiceAsyncClient::recv_wrapped_addHostIntoZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { +folly::exception_wrapper MetaServiceAsyncClient::recv_wrapped_splitZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } @@ -10725,8 +11271,8 @@ folly::exception_wrapper MetaServiceAsyncClient::recv_wrapped_addHostIntoZone( : return folly::make_exception_wrapper("recv_ called without result"); } - using result = MetaService_addHostIntoZone_presult; - constexpr auto const fname = "addHostIntoZone"; + using result = MetaService_splitZone_presult; + constexpr auto const fname = "splitZone"; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { @@ -10747,48 +11293,48 @@ folly::exception_wrapper MetaServiceAsyncClient::recv_wrapped_addHostIntoZone( : return folly::make_exception_wrapper("Could not find Protocol"); } -void MetaServiceAsyncClient::recv_addHostIntoZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { - auto ew = recv_wrapped_addHostIntoZone(_return, state); +void MetaServiceAsyncClient::recv_splitZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + auto ew = recv_wrapped_splitZone(_return, state); if (ew) { ew.throw_exception(); } } -void MetaServiceAsyncClient::recv_instance_addHostIntoZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { - return recv_addHostIntoZone(_return, state); +void MetaServiceAsyncClient::recv_instance_splitZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + return recv_splitZone(_return, state); } -folly::exception_wrapper MetaServiceAsyncClient::recv_instance_wrapped_addHostIntoZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { - return recv_wrapped_addHostIntoZone(_return, state); +folly::exception_wrapper MetaServiceAsyncClient::recv_instance_wrapped_splitZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + return recv_wrapped_splitZone(_return, state); } -void MetaServiceAsyncClient::dropHostFromZone(std::unique_ptr callback, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { +void MetaServiceAsyncClient::renameZone(std::unique_ptr callback, const ::nebula::meta::cpp2::RenameZoneReq& p_req) { ::apache::thrift::RpcOptions rpcOptions; - dropHostFromZone(rpcOptions, std::move(callback), p_req); + renameZone(rpcOptions, std::move(callback), p_req); } -void MetaServiceAsyncClient::dropHostFromZone(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { - auto ctx = dropHostFromZoneCtx(&rpcOptions); +void MetaServiceAsyncClient::renameZone(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::RenameZoneReq& p_req) { + auto ctx = renameZoneCtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); callbackContext.ctx = std::shared_ptr(ctx, &ctx->ctx); auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); - dropHostFromZoneImpl(rpcOptions, std::move(ctx), std::move(wrappedCallback), p_req); + renameZoneImpl(rpcOptions, std::move(ctx), std::move(wrappedCallback), p_req); } -void MetaServiceAsyncClient::dropHostFromZoneImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { +void MetaServiceAsyncClient::renameZoneImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::RenameZoneReq& p_req) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; - dropHostFromZoneT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); + renameZoneT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; - dropHostFromZoneT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); + renameZoneT(&writer, rpcOptions, std::move(ctx), std::move(callback), p_req); break; } default: @@ -10798,28 +11344,28 @@ void MetaServiceAsyncClient::dropHostFromZoneImpl(const apache::thrift::RpcOptio } } -std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> MetaServiceAsyncClient::dropHostFromZoneCtx(apache::thrift::RpcOptions* rpcOptions) { +std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> MetaServiceAsyncClient::renameZoneCtx(apache::thrift::RpcOptions* rpcOptions) { return std::make_shared( channel_->getProtocolId(), rpcOptions ? rpcOptions->releaseWriteHeaders() : std::map{}, handlers_, getServiceName(), - "MetaService.dropHostFromZone"); + "MetaService.renameZone"); } -void MetaServiceAsyncClient::sync_dropHostFromZone( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { +void MetaServiceAsyncClient::sync_renameZone( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::RenameZoneReq& p_req) { ::apache::thrift::RpcOptions rpcOptions; - sync_dropHostFromZone(rpcOptions, _return, p_req); + sync_renameZone(rpcOptions, _return, p_req); } -void MetaServiceAsyncClient::sync_dropHostFromZone(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { +void MetaServiceAsyncClient::sync_renameZone(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::RenameZoneReq& p_req) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); - auto ctx = dropHostFromZoneCtx(&rpcOptions); + auto ctx = renameZoneCtx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); - dropHostFromZoneImpl(rpcOptions, ctx, std::move(wrappedCallback), p_req); + renameZoneImpl(rpcOptions, ctx, std::move(wrappedCallback), p_req); callback.waitUntilDone(evb); if (returnState.isException()) { @@ -10833,58 +11379,58 @@ void MetaServiceAsyncClient::sync_dropHostFromZone(apache::thrift::RpcOptions& r } }; return folly::fibers::runInMainContext([&] { - recv_dropHostFromZone(_return, returnState); + recv_renameZone(_return, returnState); }); } -folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_dropHostFromZone(const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_renameZone(const ::nebula::meta::cpp2::RenameZoneReq& p_req) { ::apache::thrift::RpcOptions rpcOptions; - return future_dropHostFromZone(rpcOptions, p_req); + return future_renameZone(rpcOptions, p_req); } -folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_dropHostFromZone(const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_renameZone(const ::nebula::meta::cpp2::RenameZoneReq& p_req) { ::apache::thrift::RpcOptions rpcOptions; - return semifuture_dropHostFromZone(rpcOptions, p_req); + return semifuture_renameZone(rpcOptions, p_req); } -folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_dropHostFromZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { +folly::Future< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::future_renameZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::RenameZoneReq& p_req) { folly::Promise< ::nebula::meta::cpp2::ExecResp> promise; auto future = promise.getFuture(); - auto callback = std::make_unique>(std::move(promise), recv_wrapped_dropHostFromZone, channel_); - dropHostFromZone(rpcOptions, std::move(callback), p_req); + auto callback = std::make_unique>(std::move(promise), recv_wrapped_renameZone, channel_); + renameZone(rpcOptions, std::move(callback), p_req); return future; } -folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_dropHostFromZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { - auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_dropHostFromZone, channel_); +folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> MetaServiceAsyncClient::semifuture_renameZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::RenameZoneReq& p_req) { + auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_renameZone, channel_); auto callback = std::move(callbackAndFuture.first); - dropHostFromZone(rpcOptions, std::move(callback), p_req); + renameZone(rpcOptions, std::move(callback), p_req); return std::move(callbackAndFuture.second); } -folly::Future>> MetaServiceAsyncClient::header_future_dropHostFromZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { +folly::Future>> MetaServiceAsyncClient::header_future_renameZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::RenameZoneReq& p_req) { folly::Promise>> promise; auto future = promise.getFuture(); - auto callback = std::make_unique>(std::move(promise), recv_wrapped_dropHostFromZone, channel_); - dropHostFromZone(rpcOptions, std::move(callback), p_req); + auto callback = std::make_unique>(std::move(promise), recv_wrapped_renameZone, channel_); + renameZone(rpcOptions, std::move(callback), p_req); return future; } -folly::SemiFuture>> MetaServiceAsyncClient::header_semifuture_dropHostFromZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { - auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_dropHostFromZone, channel_); +folly::SemiFuture>> MetaServiceAsyncClient::header_semifuture_renameZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::RenameZoneReq& p_req) { + auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_renameZone, channel_); auto callback = std::move(callbackAndFuture.first); - dropHostFromZone(rpcOptions, std::move(callback), p_req); + renameZone(rpcOptions, std::move(callback), p_req); return std::move(callbackAndFuture.second); } -void MetaServiceAsyncClient::dropHostFromZone(folly::Function callback, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { - dropHostFromZone(std::make_unique(std::move(callback)), p_req); +void MetaServiceAsyncClient::renameZone(folly::Function callback, const ::nebula::meta::cpp2::RenameZoneReq& p_req) { + renameZone(std::make_unique(std::move(callback)), p_req); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES -folly::exception_wrapper MetaServiceAsyncClient::recv_wrapped_dropHostFromZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { +folly::exception_wrapper MetaServiceAsyncClient::recv_wrapped_renameZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } @@ -10892,8 +11438,8 @@ folly::exception_wrapper MetaServiceAsyncClient::recv_wrapped_dropHostFromZone( return folly::make_exception_wrapper("recv_ called without result"); } - using result = MetaService_dropHostFromZone_presult; - constexpr auto const fname = "dropHostFromZone"; + using result = MetaService_renameZone_presult; + constexpr auto const fname = "renameZone"; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { @@ -10914,19 +11460,19 @@ folly::exception_wrapper MetaServiceAsyncClient::recv_wrapped_dropHostFromZone( return folly::make_exception_wrapper("Could not find Protocol"); } -void MetaServiceAsyncClient::recv_dropHostFromZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { - auto ew = recv_wrapped_dropHostFromZone(_return, state); +void MetaServiceAsyncClient::recv_renameZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + auto ew = recv_wrapped_renameZone(_return, state); if (ew) { ew.throw_exception(); } } -void MetaServiceAsyncClient::recv_instance_dropHostFromZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { - return recv_dropHostFromZone(_return, state); +void MetaServiceAsyncClient::recv_instance_renameZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + return recv_renameZone(_return, state); } -folly::exception_wrapper MetaServiceAsyncClient::recv_instance_wrapped_dropHostFromZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { - return recv_wrapped_dropHostFromZone(_return, state); +folly::exception_wrapper MetaServiceAsyncClient::recv_instance_wrapped_renameZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state) { + return recv_wrapped_renameZone(_return, state); } void MetaServiceAsyncClient::getZone(std::unique_ptr callback, const ::nebula::meta::cpp2::GetZoneReq& p_req) { diff --git a/src/interface/gen-cpp2/MetaServiceAsyncClient.h b/src/interface/gen-cpp2/MetaServiceAsyncClient.h index 8f506864..051b107e 100644 --- a/src/interface/gen-cpp2/MetaServiceAsyncClient.h +++ b/src/interface/gen-cpp2/MetaServiceAsyncClient.h @@ -1257,6 +1257,252 @@ class MetaServiceAsyncClient : public apache::thrift::GeneratedAsyncClient { template void listEdgesT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::ListEdgesReq& p_req); std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> listEdgesCtx(apache::thrift::RpcOptions* rpcOptions); + public: + virtual void addHosts(std::unique_ptr callback, const ::nebula::meta::cpp2::AddHostsReq& p_req); + virtual void addHosts(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::AddHostsReq& p_req); + protected: + void addHostsImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AddHostsReq& p_req); + public: + + virtual void sync_addHosts( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::AddHostsReq& p_req); + virtual void sync_addHosts(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::AddHostsReq& p_req); + + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_addHosts(const ::nebula::meta::cpp2::AddHostsReq& p_req); + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_addHosts(const ::nebula::meta::cpp2::AddHostsReq& p_req); + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_addHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsReq& p_req); + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_addHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsReq& p_req); + virtual folly::Future>> header_future_addHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsReq& p_req); + virtual folly::SemiFuture>> header_semifuture_addHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsReq& p_req); + +#if FOLLY_HAS_COROUTINES + template + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_addHosts(const ::nebula::meta::cpp2::AddHostsReq& p_req) { + return co_addHosts(nullptr, p_req); + } + template + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_addHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsReq& p_req) { + return co_addHosts(&rpcOptions, p_req); + } + private: + template + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_addHosts(apache::thrift::RpcOptions* rpcOptions, const ::nebula::meta::cpp2::AddHostsReq& p_req) { + const folly::CancellationToken& cancelToken = + co_await folly::coro::co_current_cancellation_token; + const bool cancellable = cancelToken.canBeCancelled(); + apache::thrift::ClientReceiveState returnState; + apache::thrift::ClientSyncCallback callback(&returnState); + auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); + auto ctx = addHostsCtx(rpcOptions); + using CancellableCallback = apache::thrift::CancellableRequestClientCallback; + auto cancellableCallback = cancellable ? CancellableCallback::create(&callback, channel_) : nullptr; + static const apache::thrift::RpcOptions defaultRpcOptions; + auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(cancellableCallback ? (apache::thrift::RequestClientCallback*)cancellableCallback.get() : &callback); + if constexpr (hasRpcOptions) { + addHostsImpl(*rpcOptions, ctx, std::move(wrappedCallback), p_req); + } else { + addHostsImpl(defaultRpcOptions, ctx, std::move(wrappedCallback), p_req); + } + if (cancellable) { + folly::CancellationCallback cb(cancelToken, [&] { CancellableCallback::cancel(std::move(cancellableCallback)); }); + co_await callback.co_waitUntilDone(); + } else { + co_await callback.co_waitUntilDone(); + } + if (returnState.isException()) { + co_yield folly::coro::co_error(std::move(returnState.exception())); + } + returnState.resetProtocolId(protocolId); + returnState.resetCtx(std::shared_ptr(ctx, &ctx->ctx)); + SCOPE_EXIT { + if (hasRpcOptions && returnState.header() && !returnState.header()->getHeaders().empty()) { + rpcOptions->setReadHeaders(returnState.header()->releaseHeaders()); + } + }; + ::nebula::meta::cpp2::ExecResp _return; + if (auto ew = recv_wrapped_addHosts(_return, returnState)) { + co_yield folly::coro::co_error(std::move(ew)); + } + co_return _return; + } + public: +#endif // FOLLY_HAS_COROUTINES + + virtual void addHosts(folly::Function callback, const ::nebula::meta::cpp2::AddHostsReq& p_req); + + + static folly::exception_wrapper recv_wrapped_addHosts( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + static void recv_addHosts( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + // Mock friendly virtual instance method + virtual void recv_instance_addHosts( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + virtual folly::exception_wrapper recv_instance_wrapped_addHosts( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + private: + template + void addHostsT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AddHostsReq& p_req); + std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> addHostsCtx(apache::thrift::RpcOptions* rpcOptions); + public: + virtual void addHostsIntoZone(std::unique_ptr callback, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req); + virtual void addHostsIntoZone(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req); + protected: + void addHostsIntoZoneImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req); + public: + + virtual void sync_addHostsIntoZone( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req); + virtual void sync_addHostsIntoZone(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req); + + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_addHostsIntoZone(const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req); + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_addHostsIntoZone(const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req); + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_addHostsIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req); + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_addHostsIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req); + virtual folly::Future>> header_future_addHostsIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req); + virtual folly::SemiFuture>> header_semifuture_addHostsIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req); + +#if FOLLY_HAS_COROUTINES + template + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_addHostsIntoZone(const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + return co_addHostsIntoZone(nullptr, p_req); + } + template + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_addHostsIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + return co_addHostsIntoZone(&rpcOptions, p_req); + } + private: + template + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_addHostsIntoZone(apache::thrift::RpcOptions* rpcOptions, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req) { + const folly::CancellationToken& cancelToken = + co_await folly::coro::co_current_cancellation_token; + const bool cancellable = cancelToken.canBeCancelled(); + apache::thrift::ClientReceiveState returnState; + apache::thrift::ClientSyncCallback callback(&returnState); + auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); + auto ctx = addHostsIntoZoneCtx(rpcOptions); + using CancellableCallback = apache::thrift::CancellableRequestClientCallback; + auto cancellableCallback = cancellable ? CancellableCallback::create(&callback, channel_) : nullptr; + static const apache::thrift::RpcOptions defaultRpcOptions; + auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(cancellableCallback ? (apache::thrift::RequestClientCallback*)cancellableCallback.get() : &callback); + if constexpr (hasRpcOptions) { + addHostsIntoZoneImpl(*rpcOptions, ctx, std::move(wrappedCallback), p_req); + } else { + addHostsIntoZoneImpl(defaultRpcOptions, ctx, std::move(wrappedCallback), p_req); + } + if (cancellable) { + folly::CancellationCallback cb(cancelToken, [&] { CancellableCallback::cancel(std::move(cancellableCallback)); }); + co_await callback.co_waitUntilDone(); + } else { + co_await callback.co_waitUntilDone(); + } + if (returnState.isException()) { + co_yield folly::coro::co_error(std::move(returnState.exception())); + } + returnState.resetProtocolId(protocolId); + returnState.resetCtx(std::shared_ptr(ctx, &ctx->ctx)); + SCOPE_EXIT { + if (hasRpcOptions && returnState.header() && !returnState.header()->getHeaders().empty()) { + rpcOptions->setReadHeaders(returnState.header()->releaseHeaders()); + } + }; + ::nebula::meta::cpp2::ExecResp _return; + if (auto ew = recv_wrapped_addHostsIntoZone(_return, returnState)) { + co_yield folly::coro::co_error(std::move(ew)); + } + co_return _return; + } + public: +#endif // FOLLY_HAS_COROUTINES + + virtual void addHostsIntoZone(folly::Function callback, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req); + + + static folly::exception_wrapper recv_wrapped_addHostsIntoZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + static void recv_addHostsIntoZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + // Mock friendly virtual instance method + virtual void recv_instance_addHostsIntoZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + virtual folly::exception_wrapper recv_instance_wrapped_addHostsIntoZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + private: + template + void addHostsIntoZoneT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AddHostsIntoZoneReq& p_req); + std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> addHostsIntoZoneCtx(apache::thrift::RpcOptions* rpcOptions); + public: + virtual void dropHosts(std::unique_ptr callback, const ::nebula::meta::cpp2::DropHostsReq& p_req); + virtual void dropHosts(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::DropHostsReq& p_req); + protected: + void dropHostsImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::DropHostsReq& p_req); + public: + + virtual void sync_dropHosts( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::DropHostsReq& p_req); + virtual void sync_dropHosts(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::DropHostsReq& p_req); + + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_dropHosts(const ::nebula::meta::cpp2::DropHostsReq& p_req); + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_dropHosts(const ::nebula::meta::cpp2::DropHostsReq& p_req); + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_dropHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostsReq& p_req); + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_dropHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostsReq& p_req); + virtual folly::Future>> header_future_dropHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostsReq& p_req); + virtual folly::SemiFuture>> header_semifuture_dropHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostsReq& p_req); + +#if FOLLY_HAS_COROUTINES + template + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_dropHosts(const ::nebula::meta::cpp2::DropHostsReq& p_req) { + return co_dropHosts(nullptr, p_req); + } + template + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_dropHosts(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostsReq& p_req) { + return co_dropHosts(&rpcOptions, p_req); + } + private: + template + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_dropHosts(apache::thrift::RpcOptions* rpcOptions, const ::nebula::meta::cpp2::DropHostsReq& p_req) { + const folly::CancellationToken& cancelToken = + co_await folly::coro::co_current_cancellation_token; + const bool cancellable = cancelToken.canBeCancelled(); + apache::thrift::ClientReceiveState returnState; + apache::thrift::ClientSyncCallback callback(&returnState); + auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); + auto ctx = dropHostsCtx(rpcOptions); + using CancellableCallback = apache::thrift::CancellableRequestClientCallback; + auto cancellableCallback = cancellable ? CancellableCallback::create(&callback, channel_) : nullptr; + static const apache::thrift::RpcOptions defaultRpcOptions; + auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(cancellableCallback ? (apache::thrift::RequestClientCallback*)cancellableCallback.get() : &callback); + if constexpr (hasRpcOptions) { + dropHostsImpl(*rpcOptions, ctx, std::move(wrappedCallback), p_req); + } else { + dropHostsImpl(defaultRpcOptions, ctx, std::move(wrappedCallback), p_req); + } + if (cancellable) { + folly::CancellationCallback cb(cancelToken, [&] { CancellableCallback::cancel(std::move(cancellableCallback)); }); + co_await callback.co_waitUntilDone(); + } else { + co_await callback.co_waitUntilDone(); + } + if (returnState.isException()) { + co_yield folly::coro::co_error(std::move(returnState.exception())); + } + returnState.resetProtocolId(protocolId); + returnState.resetCtx(std::shared_ptr(ctx, &ctx->ctx)); + SCOPE_EXIT { + if (hasRpcOptions && returnState.header() && !returnState.header()->getHeaders().empty()) { + rpcOptions->setReadHeaders(returnState.header()->releaseHeaders()); + } + }; + ::nebula::meta::cpp2::ExecResp _return; + if (auto ew = recv_wrapped_dropHosts(_return, returnState)) { + co_yield folly::coro::co_error(std::move(ew)); + } + co_return _return; + } + public: +#endif // FOLLY_HAS_COROUTINES + + virtual void dropHosts(folly::Function callback, const ::nebula::meta::cpp2::DropHostsReq& p_req); + + + static folly::exception_wrapper recv_wrapped_dropHosts( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + static void recv_dropHosts( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + // Mock friendly virtual instance method + virtual void recv_instance_dropHosts( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + virtual folly::exception_wrapper recv_instance_wrapped_dropHosts( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + private: + template + void dropHostsT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::DropHostsReq& p_req); + std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> dropHostsCtx(apache::thrift::RpcOptions* rpcOptions); public: virtual void listHosts(std::unique_ptr callback, const ::nebula::meta::cpp2::ListHostsReq& p_req); virtual void listHosts(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::ListHostsReq& p_req); @@ -4456,49 +4702,49 @@ class MetaServiceAsyncClient : public apache::thrift::GeneratedAsyncClient { void runAdminJobT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AdminJobReq& p_req); std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> runAdminJobCtx(apache::thrift::RpcOptions* rpcOptions); public: - virtual void addZone(std::unique_ptr callback, const ::nebula::meta::cpp2::AddZoneReq& p_req); - virtual void addZone(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::AddZoneReq& p_req); + virtual void mergeZone(std::unique_ptr callback, const ::nebula::meta::cpp2::MergeZoneReq& p_req); + virtual void mergeZone(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::MergeZoneReq& p_req); protected: - void addZoneImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AddZoneReq& p_req); + void mergeZoneImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::MergeZoneReq& p_req); public: - virtual void sync_addZone( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::AddZoneReq& p_req); - virtual void sync_addZone(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::AddZoneReq& p_req); + virtual void sync_mergeZone( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::MergeZoneReq& p_req); + virtual void sync_mergeZone(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::MergeZoneReq& p_req); - virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_addZone(const ::nebula::meta::cpp2::AddZoneReq& p_req); - virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_addZone(const ::nebula::meta::cpp2::AddZoneReq& p_req); - virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_addZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddZoneReq& p_req); - virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_addZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddZoneReq& p_req); - virtual folly::Future>> header_future_addZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddZoneReq& p_req); - virtual folly::SemiFuture>> header_semifuture_addZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddZoneReq& p_req); + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_mergeZone(const ::nebula::meta::cpp2::MergeZoneReq& p_req); + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_mergeZone(const ::nebula::meta::cpp2::MergeZoneReq& p_req); + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_mergeZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::MergeZoneReq& p_req); + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_mergeZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::MergeZoneReq& p_req); + virtual folly::Future>> header_future_mergeZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::MergeZoneReq& p_req); + virtual folly::SemiFuture>> header_semifuture_mergeZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::MergeZoneReq& p_req); #if FOLLY_HAS_COROUTINES template - folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_addZone(const ::nebula::meta::cpp2::AddZoneReq& p_req) { - return co_addZone(nullptr, p_req); + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_mergeZone(const ::nebula::meta::cpp2::MergeZoneReq& p_req) { + return co_mergeZone(nullptr, p_req); } template - folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_addZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddZoneReq& p_req) { - return co_addZone(&rpcOptions, p_req); + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_mergeZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::MergeZoneReq& p_req) { + return co_mergeZone(&rpcOptions, p_req); } private: template - folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_addZone(apache::thrift::RpcOptions* rpcOptions, const ::nebula::meta::cpp2::AddZoneReq& p_req) { + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_mergeZone(apache::thrift::RpcOptions* rpcOptions, const ::nebula::meta::cpp2::MergeZoneReq& p_req) { const folly::CancellationToken& cancelToken = co_await folly::coro::co_current_cancellation_token; const bool cancellable = cancelToken.canBeCancelled(); apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); - auto ctx = addZoneCtx(rpcOptions); + auto ctx = mergeZoneCtx(rpcOptions); using CancellableCallback = apache::thrift::CancellableRequestClientCallback; auto cancellableCallback = cancellable ? CancellableCallback::create(&callback, channel_) : nullptr; static const apache::thrift::RpcOptions defaultRpcOptions; auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(cancellableCallback ? (apache::thrift::RequestClientCallback*)cancellableCallback.get() : &callback); if constexpr (hasRpcOptions) { - addZoneImpl(*rpcOptions, ctx, std::move(wrappedCallback), p_req); + mergeZoneImpl(*rpcOptions, ctx, std::move(wrappedCallback), p_req); } else { - addZoneImpl(defaultRpcOptions, ctx, std::move(wrappedCallback), p_req); + mergeZoneImpl(defaultRpcOptions, ctx, std::move(wrappedCallback), p_req); } if (cancellable) { folly::CancellationCallback cb(cancelToken, [&] { CancellableCallback::cancel(std::move(cancellableCallback)); }); @@ -4517,7 +4763,7 @@ class MetaServiceAsyncClient : public apache::thrift::GeneratedAsyncClient { } }; ::nebula::meta::cpp2::ExecResp _return; - if (auto ew = recv_wrapped_addZone(_return, returnState)) { + if (auto ew = recv_wrapped_mergeZone(_return, returnState)) { co_yield folly::coro::co_error(std::move(ew)); } co_return _return; @@ -4525,18 +4771,18 @@ class MetaServiceAsyncClient : public apache::thrift::GeneratedAsyncClient { public: #endif // FOLLY_HAS_COROUTINES - virtual void addZone(folly::Function callback, const ::nebula::meta::cpp2::AddZoneReq& p_req); + virtual void mergeZone(folly::Function callback, const ::nebula::meta::cpp2::MergeZoneReq& p_req); - static folly::exception_wrapper recv_wrapped_addZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); - static void recv_addZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + static folly::exception_wrapper recv_wrapped_mergeZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + static void recv_mergeZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); // Mock friendly virtual instance method - virtual void recv_instance_addZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); - virtual folly::exception_wrapper recv_instance_wrapped_addZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + virtual void recv_instance_mergeZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + virtual folly::exception_wrapper recv_instance_wrapped_mergeZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); private: template - void addZoneT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AddZoneReq& p_req); - std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> addZoneCtx(apache::thrift::RpcOptions* rpcOptions); + void mergeZoneT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::MergeZoneReq& p_req); + std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> mergeZoneCtx(apache::thrift::RpcOptions* rpcOptions); public: virtual void dropZone(std::unique_ptr callback, const ::nebula::meta::cpp2::DropZoneReq& p_req); virtual void dropZone(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::DropZoneReq& p_req); @@ -4620,49 +4866,49 @@ class MetaServiceAsyncClient : public apache::thrift::GeneratedAsyncClient { void dropZoneT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::DropZoneReq& p_req); std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> dropZoneCtx(apache::thrift::RpcOptions* rpcOptions); public: - virtual void addHostIntoZone(std::unique_ptr callback, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req); - virtual void addHostIntoZone(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req); + virtual void splitZone(std::unique_ptr callback, const ::nebula::meta::cpp2::SplitZoneReq& p_req); + virtual void splitZone(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::SplitZoneReq& p_req); protected: - void addHostIntoZoneImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req); + void splitZoneImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::SplitZoneReq& p_req); public: - virtual void sync_addHostIntoZone( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req); - virtual void sync_addHostIntoZone(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req); + virtual void sync_splitZone( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::SplitZoneReq& p_req); + virtual void sync_splitZone(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::SplitZoneReq& p_req); - virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_addHostIntoZone(const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req); - virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_addHostIntoZone(const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req); - virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_addHostIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req); - virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_addHostIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req); - virtual folly::Future>> header_future_addHostIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req); - virtual folly::SemiFuture>> header_semifuture_addHostIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req); + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_splitZone(const ::nebula::meta::cpp2::SplitZoneReq& p_req); + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_splitZone(const ::nebula::meta::cpp2::SplitZoneReq& p_req); + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_splitZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::SplitZoneReq& p_req); + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_splitZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::SplitZoneReq& p_req); + virtual folly::Future>> header_future_splitZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::SplitZoneReq& p_req); + virtual folly::SemiFuture>> header_semifuture_splitZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::SplitZoneReq& p_req); #if FOLLY_HAS_COROUTINES template - folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_addHostIntoZone(const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { - return co_addHostIntoZone(nullptr, p_req); + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_splitZone(const ::nebula::meta::cpp2::SplitZoneReq& p_req) { + return co_splitZone(nullptr, p_req); } template - folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_addHostIntoZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { - return co_addHostIntoZone(&rpcOptions, p_req); + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_splitZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::SplitZoneReq& p_req) { + return co_splitZone(&rpcOptions, p_req); } private: template - folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_addHostIntoZone(apache::thrift::RpcOptions* rpcOptions, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req) { + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_splitZone(apache::thrift::RpcOptions* rpcOptions, const ::nebula::meta::cpp2::SplitZoneReq& p_req) { const folly::CancellationToken& cancelToken = co_await folly::coro::co_current_cancellation_token; const bool cancellable = cancelToken.canBeCancelled(); apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); - auto ctx = addHostIntoZoneCtx(rpcOptions); + auto ctx = splitZoneCtx(rpcOptions); using CancellableCallback = apache::thrift::CancellableRequestClientCallback; auto cancellableCallback = cancellable ? CancellableCallback::create(&callback, channel_) : nullptr; static const apache::thrift::RpcOptions defaultRpcOptions; auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(cancellableCallback ? (apache::thrift::RequestClientCallback*)cancellableCallback.get() : &callback); if constexpr (hasRpcOptions) { - addHostIntoZoneImpl(*rpcOptions, ctx, std::move(wrappedCallback), p_req); + splitZoneImpl(*rpcOptions, ctx, std::move(wrappedCallback), p_req); } else { - addHostIntoZoneImpl(defaultRpcOptions, ctx, std::move(wrappedCallback), p_req); + splitZoneImpl(defaultRpcOptions, ctx, std::move(wrappedCallback), p_req); } if (cancellable) { folly::CancellationCallback cb(cancelToken, [&] { CancellableCallback::cancel(std::move(cancellableCallback)); }); @@ -4681,7 +4927,7 @@ class MetaServiceAsyncClient : public apache::thrift::GeneratedAsyncClient { } }; ::nebula::meta::cpp2::ExecResp _return; - if (auto ew = recv_wrapped_addHostIntoZone(_return, returnState)) { + if (auto ew = recv_wrapped_splitZone(_return, returnState)) { co_yield folly::coro::co_error(std::move(ew)); } co_return _return; @@ -4689,62 +4935,62 @@ class MetaServiceAsyncClient : public apache::thrift::GeneratedAsyncClient { public: #endif // FOLLY_HAS_COROUTINES - virtual void addHostIntoZone(folly::Function callback, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req); + virtual void splitZone(folly::Function callback, const ::nebula::meta::cpp2::SplitZoneReq& p_req); - static folly::exception_wrapper recv_wrapped_addHostIntoZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); - static void recv_addHostIntoZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + static folly::exception_wrapper recv_wrapped_splitZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + static void recv_splitZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); // Mock friendly virtual instance method - virtual void recv_instance_addHostIntoZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); - virtual folly::exception_wrapper recv_instance_wrapped_addHostIntoZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + virtual void recv_instance_splitZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + virtual folly::exception_wrapper recv_instance_wrapped_splitZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); private: template - void addHostIntoZoneT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::AddHostIntoZoneReq& p_req); - std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> addHostIntoZoneCtx(apache::thrift::RpcOptions* rpcOptions); + void splitZoneT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::SplitZoneReq& p_req); + std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> splitZoneCtx(apache::thrift::RpcOptions* rpcOptions); public: - virtual void dropHostFromZone(std::unique_ptr callback, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req); - virtual void dropHostFromZone(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req); + virtual void renameZone(std::unique_ptr callback, const ::nebula::meta::cpp2::RenameZoneReq& p_req); + virtual void renameZone(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::RenameZoneReq& p_req); protected: - void dropHostFromZoneImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req); + void renameZoneImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::RenameZoneReq& p_req); public: - virtual void sync_dropHostFromZone( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req); - virtual void sync_dropHostFromZone(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req); + virtual void sync_renameZone( ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::RenameZoneReq& p_req); + virtual void sync_renameZone(apache::thrift::RpcOptions& rpcOptions, ::nebula::meta::cpp2::ExecResp& _return, const ::nebula::meta::cpp2::RenameZoneReq& p_req); - virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_dropHostFromZone(const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req); - virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_dropHostFromZone(const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req); - virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_dropHostFromZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req); - virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_dropHostFromZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req); - virtual folly::Future>> header_future_dropHostFromZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req); - virtual folly::SemiFuture>> header_semifuture_dropHostFromZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req); + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_renameZone(const ::nebula::meta::cpp2::RenameZoneReq& p_req); + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_renameZone(const ::nebula::meta::cpp2::RenameZoneReq& p_req); + virtual folly::Future< ::nebula::meta::cpp2::ExecResp> future_renameZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::RenameZoneReq& p_req); + virtual folly::SemiFuture< ::nebula::meta::cpp2::ExecResp> semifuture_renameZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::RenameZoneReq& p_req); + virtual folly::Future>> header_future_renameZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::RenameZoneReq& p_req); + virtual folly::SemiFuture>> header_semifuture_renameZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::RenameZoneReq& p_req); #if FOLLY_HAS_COROUTINES template - folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_dropHostFromZone(const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { - return co_dropHostFromZone(nullptr, p_req); + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_renameZone(const ::nebula::meta::cpp2::RenameZoneReq& p_req) { + return co_renameZone(nullptr, p_req); } template - folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_dropHostFromZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { - return co_dropHostFromZone(&rpcOptions, p_req); + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_renameZone(apache::thrift::RpcOptions& rpcOptions, const ::nebula::meta::cpp2::RenameZoneReq& p_req) { + return co_renameZone(&rpcOptions, p_req); } private: template - folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_dropHostFromZone(apache::thrift::RpcOptions* rpcOptions, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req) { + folly::coro::Task< ::nebula::meta::cpp2::ExecResp> co_renameZone(apache::thrift::RpcOptions* rpcOptions, const ::nebula::meta::cpp2::RenameZoneReq& p_req) { const folly::CancellationToken& cancelToken = co_await folly::coro::co_current_cancellation_token; const bool cancellable = cancelToken.canBeCancelled(); apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); - auto ctx = dropHostFromZoneCtx(rpcOptions); + auto ctx = renameZoneCtx(rpcOptions); using CancellableCallback = apache::thrift::CancellableRequestClientCallback; auto cancellableCallback = cancellable ? CancellableCallback::create(&callback, channel_) : nullptr; static const apache::thrift::RpcOptions defaultRpcOptions; auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(cancellableCallback ? (apache::thrift::RequestClientCallback*)cancellableCallback.get() : &callback); if constexpr (hasRpcOptions) { - dropHostFromZoneImpl(*rpcOptions, ctx, std::move(wrappedCallback), p_req); + renameZoneImpl(*rpcOptions, ctx, std::move(wrappedCallback), p_req); } else { - dropHostFromZoneImpl(defaultRpcOptions, ctx, std::move(wrappedCallback), p_req); + renameZoneImpl(defaultRpcOptions, ctx, std::move(wrappedCallback), p_req); } if (cancellable) { folly::CancellationCallback cb(cancelToken, [&] { CancellableCallback::cancel(std::move(cancellableCallback)); }); @@ -4763,7 +5009,7 @@ class MetaServiceAsyncClient : public apache::thrift::GeneratedAsyncClient { } }; ::nebula::meta::cpp2::ExecResp _return; - if (auto ew = recv_wrapped_dropHostFromZone(_return, returnState)) { + if (auto ew = recv_wrapped_renameZone(_return, returnState)) { co_yield folly::coro::co_error(std::move(ew)); } co_return _return; @@ -4771,18 +5017,18 @@ class MetaServiceAsyncClient : public apache::thrift::GeneratedAsyncClient { public: #endif // FOLLY_HAS_COROUTINES - virtual void dropHostFromZone(folly::Function callback, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req); + virtual void renameZone(folly::Function callback, const ::nebula::meta::cpp2::RenameZoneReq& p_req); - static folly::exception_wrapper recv_wrapped_dropHostFromZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); - static void recv_dropHostFromZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + static folly::exception_wrapper recv_wrapped_renameZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + static void recv_renameZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); // Mock friendly virtual instance method - virtual void recv_instance_dropHostFromZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); - virtual folly::exception_wrapper recv_instance_wrapped_dropHostFromZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + virtual void recv_instance_renameZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); + virtual folly::exception_wrapper recv_instance_wrapped_renameZone( ::nebula::meta::cpp2::ExecResp& _return, ::apache::thrift::ClientReceiveState& state); private: template - void dropHostFromZoneT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::DropHostFromZoneReq& p_req); - std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> dropHostFromZoneCtx(apache::thrift::RpcOptions* rpcOptions); + void renameZoneT(Protocol_* prot, apache::thrift::RpcOptions rpcOptions, std::shared_ptr ctx, apache::thrift::RequestClientCallback::Ptr callback, const ::nebula::meta::cpp2::RenameZoneReq& p_req); + std::shared_ptr<::apache::thrift::detail::ac::ClientRequestContext> renameZoneCtx(apache::thrift::RpcOptions* rpcOptions); public: virtual void getZone(std::unique_ptr callback, const ::nebula::meta::cpp2::GetZoneReq& p_req); virtual void getZone(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, const ::nebula::meta::cpp2::GetZoneReq& p_req); diff --git a/src/interface/gen-cpp2/common_data.cpp b/src/interface/gen-cpp2/common_data.cpp index 1fb2e025..5a7d76b4 100644 --- a/src/interface/gen-cpp2/common_data.cpp +++ b/src/interface/gen-cpp2/common_data.cpp @@ -84,7 +84,7 @@ const std::array<::nebula::cpp2::ErrorCode, 121> TEnumDataStorage<::nebula::cpp2 type::E_TAG_PROP_NOT_FOUND, type::E_ROLE_NOT_FOUND, type::E_CONFIG_NOT_FOUND, - type::E_GROUP_NOT_FOUND, + type::E_MACHINE_NOT_FOUND, type::E_ZONE_NOT_FOUND, type::E_LISTENER_NOT_FOUND, type::E_PART_NOT_FOUND, @@ -207,7 +207,7 @@ const std::array TEnumDataStorage<::nebula::cpp2::Error "E_TAG_PROP_NOT_FOUND", "E_ROLE_NOT_FOUND", "E_CONFIG_NOT_FOUND", - "E_GROUP_NOT_FOUND", + "E_MACHINE_NOT_FOUND", "E_ZONE_NOT_FOUND", "E_LISTENER_NOT_FOUND", "E_PART_NOT_FOUND", diff --git a/src/interface/gen-cpp2/common_types.h b/src/interface/gen-cpp2/common_types.h index 76325497..dd1d5368 100644 --- a/src/interface/gen-cpp2/common_types.h +++ b/src/interface/gen-cpp2/common_types.h @@ -475,7 +475,7 @@ enum class ErrorCode { E_TAG_PROP_NOT_FOUND = -10, E_ROLE_NOT_FOUND = -11, E_CONFIG_NOT_FOUND = -12, - E_GROUP_NOT_FOUND = -13, + E_MACHINE_NOT_FOUND = -13, E_ZONE_NOT_FOUND = -14, E_LISTENER_NOT_FOUND = -15, E_PART_NOT_FOUND = -16, diff --git a/src/interface/gen-cpp2/meta_data.cpp b/src/interface/gen-cpp2/meta_data.cpp index 4822ac15..8c66e8a4 100644 --- a/src/interface/gen-cpp2/meta_data.cpp +++ b/src/interface/gen-cpp2/meta_data.cpp @@ -359,7 +359,7 @@ const std::array TStructDataStorage<::nebula::meta::cpp2: "charset_name", "collate_name", "vid_type", - "group_name", + "zone_names", "isolation_level", "comment", }}; @@ -381,7 +381,7 @@ const std::array TStructDataStorage<::nebula::meta::cpp2::Sp TType::T_STRING, TType::T_STRING, TType::T_STRUCT, - TType::T_STRING, + TType::T_LIST, TType::T_I32, TType::T_STRING, }}; @@ -1017,6 +1017,26 @@ const std::array TStructDataStorage<::nebula::meta::cpp2::Li TType::T_LIST, }}; +const std::array TStructDataStorage<::nebula::meta::cpp2::AddHostsReq>::fields_names = {{ + "hosts", +}}; +const std::array TStructDataStorage<::nebula::meta::cpp2::AddHostsReq>::fields_ids = {{ + 1, +}}; +const std::array TStructDataStorage<::nebula::meta::cpp2::AddHostsReq>::fields_types = {{ + TType::T_LIST, +}}; + +const std::array TStructDataStorage<::nebula::meta::cpp2::DropHostsReq>::fields_names = {{ + "hosts", +}}; +const std::array TStructDataStorage<::nebula::meta::cpp2::DropHostsReq>::fields_ids = {{ + 1, +}}; +const std::array TStructDataStorage<::nebula::meta::cpp2::DropHostsReq>::fields_types = {{ + TType::T_LIST, +}}; + const std::array TStructDataStorage<::nebula::meta::cpp2::ListHostsReq>::fields_names = {{ "type", }}; @@ -1888,17 +1908,17 @@ const std::array TStructDataStorage<::nebula::meta::cpp2::Li TType::T_LIST, }}; -const std::array TStructDataStorage<::nebula::meta::cpp2::AddZoneReq>::fields_names = {{ +const std::array TStructDataStorage<::nebula::meta::cpp2::MergeZoneReq>::fields_names = {{ + "zones", "zone_name", - "nodes", }}; -const std::array TStructDataStorage<::nebula::meta::cpp2::AddZoneReq>::fields_ids = {{ +const std::array TStructDataStorage<::nebula::meta::cpp2::MergeZoneReq>::fields_ids = {{ 1, 2, }}; -const std::array TStructDataStorage<::nebula::meta::cpp2::AddZoneReq>::fields_types = {{ - TType::T_STRING, +const std::array TStructDataStorage<::nebula::meta::cpp2::MergeZoneReq>::fields_types = {{ TType::T_LIST, + TType::T_STRING, }}; const std::array TStructDataStorage<::nebula::meta::cpp2::DropZoneReq>::fields_names = {{ @@ -1911,30 +1931,43 @@ const std::array TStructDataStorage<::nebula::meta::cpp2::Dr TType::T_STRING, }}; -const std::array TStructDataStorage<::nebula::meta::cpp2::AddHostIntoZoneReq>::fields_names = {{ - "node", +const std::array TStructDataStorage<::nebula::meta::cpp2::SplitZoneReq>::fields_names = {{ "zone_name", }}; -const std::array TStructDataStorage<::nebula::meta::cpp2::AddHostIntoZoneReq>::fields_ids = {{ +const std::array TStructDataStorage<::nebula::meta::cpp2::SplitZoneReq>::fields_ids = {{ + 1, +}}; +const std::array TStructDataStorage<::nebula::meta::cpp2::SplitZoneReq>::fields_types = {{ + TType::T_STRING, +}}; + +const std::array TStructDataStorage<::nebula::meta::cpp2::RenameZoneReq>::fields_names = {{ + "original_zone_name", + "zone_name", +}}; +const std::array TStructDataStorage<::nebula::meta::cpp2::RenameZoneReq>::fields_ids = {{ 1, 2, }}; -const std::array TStructDataStorage<::nebula::meta::cpp2::AddHostIntoZoneReq>::fields_types = {{ - TType::T_STRUCT, +const std::array TStructDataStorage<::nebula::meta::cpp2::RenameZoneReq>::fields_types = {{ + TType::T_STRING, TType::T_STRING, }}; -const std::array TStructDataStorage<::nebula::meta::cpp2::DropHostFromZoneReq>::fields_names = {{ - "node", +const std::array TStructDataStorage<::nebula::meta::cpp2::AddHostsIntoZoneReq>::fields_names = {{ + "hosts", "zone_name", + "is_new", }}; -const std::array TStructDataStorage<::nebula::meta::cpp2::DropHostFromZoneReq>::fields_ids = {{ +const std::array TStructDataStorage<::nebula::meta::cpp2::AddHostsIntoZoneReq>::fields_ids = {{ 1, 2, + 3, }}; -const std::array TStructDataStorage<::nebula::meta::cpp2::DropHostFromZoneReq>::fields_types = {{ - TType::T_STRUCT, +const std::array TStructDataStorage<::nebula::meta::cpp2::AddHostsIntoZoneReq>::fields_types = {{ + TType::T_LIST, TType::T_STRING, + TType::T_BOOL, }}; const std::array TStructDataStorage<::nebula::meta::cpp2::GetZoneReq>::fields_names = {{ diff --git a/src/interface/gen-cpp2/meta_data.h b/src/interface/gen-cpp2/meta_data.h index b6d0cd7c..5ffd1ad7 100644 --- a/src/interface/gen-cpp2/meta_data.h +++ b/src/interface/gen-cpp2/meta_data.h @@ -446,6 +446,20 @@ template <> struct TStructDataStorage<::nebula::meta::cpp2::ListEdgesResp> { static const std::array fields_types; }; +template <> struct TStructDataStorage<::nebula::meta::cpp2::AddHostsReq> { + static constexpr const std::size_t fields_size = 1; + static const std::array fields_names; + static const std::array fields_ids; + static const std::array fields_types; +}; + +template <> struct TStructDataStorage<::nebula::meta::cpp2::DropHostsReq> { + static constexpr const std::size_t fields_size = 1; + static const std::array fields_names; + static const std::array fields_ids; + static const std::array fields_types; +}; + template <> struct TStructDataStorage<::nebula::meta::cpp2::ListHostsReq> { static constexpr const std::size_t fields_size = 1; static const std::array fields_names; @@ -873,7 +887,7 @@ template <> struct TStructDataStorage<::nebula::meta::cpp2::ListIndexStatusResp> static const std::array fields_types; }; -template <> struct TStructDataStorage<::nebula::meta::cpp2::AddZoneReq> { +template <> struct TStructDataStorage<::nebula::meta::cpp2::MergeZoneReq> { static constexpr const std::size_t fields_size = 2; static const std::array fields_names; static const std::array fields_ids; @@ -887,20 +901,27 @@ template <> struct TStructDataStorage<::nebula::meta::cpp2::DropZoneReq> { static const std::array fields_types; }; -template <> struct TStructDataStorage<::nebula::meta::cpp2::AddHostIntoZoneReq> { - static constexpr const std::size_t fields_size = 2; +template <> struct TStructDataStorage<::nebula::meta::cpp2::SplitZoneReq> { + static constexpr const std::size_t fields_size = 1; static const std::array fields_names; static const std::array fields_ids; static const std::array fields_types; }; -template <> struct TStructDataStorage<::nebula::meta::cpp2::DropHostFromZoneReq> { +template <> struct TStructDataStorage<::nebula::meta::cpp2::RenameZoneReq> { static constexpr const std::size_t fields_size = 2; static const std::array fields_names; static const std::array fields_ids; static const std::array fields_types; }; +template <> struct TStructDataStorage<::nebula::meta::cpp2::AddHostsIntoZoneReq> { + static constexpr const std::size_t fields_size = 3; + static const std::array fields_names; + static const std::array fields_ids; + static const std::array fields_types; +}; + template <> struct TStructDataStorage<::nebula::meta::cpp2::GetZoneReq> { static constexpr const std::size_t fields_size = 1; static const std::array fields_names; diff --git a/src/interface/gen-cpp2/meta_for_each_field.h b/src/interface/gen-cpp2/meta_for_each_field.h index 6114e7e0..4ec9e512 100644 --- a/src/interface/gen-cpp2/meta_for_each_field.h +++ b/src/interface/gen-cpp2/meta_for_each_field.h @@ -85,7 +85,7 @@ struct ForEachField<::nebula::meta::cpp2::SpaceDesc> { f(3, static_cast(t).charset_name_ref()...); f(4, static_cast(t).collate_name_ref()...); f(5, static_cast(t).vid_type_ref()...); - f(6, static_cast(t).group_name_ref()...); + f(6, static_cast(t).zone_names_ref()...); f(7, static_cast(t).isolation_level_ref()...); f(8, static_cast(t).comment_ref()...); } @@ -474,6 +474,22 @@ struct ForEachField<::nebula::meta::cpp2::ListEdgesResp> { } }; +template <> +struct ForEachField<::nebula::meta::cpp2::AddHostsReq> { + template + void operator()(FOLLY_MAYBE_UNUSED F&& f, FOLLY_MAYBE_UNUSED T&&... t) const { + f(0, static_cast(t).hosts_ref()...); + } +}; + +template <> +struct ForEachField<::nebula::meta::cpp2::DropHostsReq> { + template + void operator()(FOLLY_MAYBE_UNUSED F&& f, FOLLY_MAYBE_UNUSED T&&... t) const { + f(0, static_cast(t).hosts_ref()...); + } +}; + template <> struct ForEachField<::nebula::meta::cpp2::ListHostsReq> { template @@ -1050,11 +1066,11 @@ struct ForEachField<::nebula::meta::cpp2::ListIndexStatusResp> { }; template <> -struct ForEachField<::nebula::meta::cpp2::AddZoneReq> { +struct ForEachField<::nebula::meta::cpp2::MergeZoneReq> { template void operator()(FOLLY_MAYBE_UNUSED F&& f, FOLLY_MAYBE_UNUSED T&&... t) const { - f(0, static_cast(t).zone_name_ref()...); - f(1, static_cast(t).nodes_ref()...); + f(0, static_cast(t).zones_ref()...); + f(1, static_cast(t).zone_name_ref()...); } }; @@ -1067,20 +1083,29 @@ struct ForEachField<::nebula::meta::cpp2::DropZoneReq> { }; template <> -struct ForEachField<::nebula::meta::cpp2::AddHostIntoZoneReq> { +struct ForEachField<::nebula::meta::cpp2::SplitZoneReq> { + template + void operator()(FOLLY_MAYBE_UNUSED F&& f, FOLLY_MAYBE_UNUSED T&&... t) const { + f(0, static_cast(t).zone_name_ref()...); + } +}; + +template <> +struct ForEachField<::nebula::meta::cpp2::RenameZoneReq> { template void operator()(FOLLY_MAYBE_UNUSED F&& f, FOLLY_MAYBE_UNUSED T&&... t) const { - f(0, static_cast(t).node_ref()...); + f(0, static_cast(t).original_zone_name_ref()...); f(1, static_cast(t).zone_name_ref()...); } }; template <> -struct ForEachField<::nebula::meta::cpp2::DropHostFromZoneReq> { +struct ForEachField<::nebula::meta::cpp2::AddHostsIntoZoneReq> { template void operator()(FOLLY_MAYBE_UNUSED F&& f, FOLLY_MAYBE_UNUSED T&&... t) const { - f(0, static_cast(t).node_ref()...); + f(0, static_cast(t).hosts_ref()...); f(1, static_cast(t).zone_name_ref()...); + f(2, static_cast(t).is_new_ref()...); } }; diff --git a/src/interface/gen-cpp2/meta_metadata.cpp b/src/interface/gen-cpp2/meta_metadata.cpp index da4914a9..0dcc1548 100644 --- a/src/interface/gen-cpp2/meta_metadata.cpp +++ b/src/interface/gen-cpp2/meta_metadata.cpp @@ -398,7 +398,7 @@ StructMetadata<::nebula::meta::cpp2::SpaceDesc>::gen(ThriftMetadata& metadata) { std::make_tuple(4, "charset_name", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{}), std::make_tuple(5, "collate_name", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{}), std::make_tuple(6, "vid_type", false, std::make_unique>("meta.ColumnTypeDef"), std::vector{}), - std::make_tuple(7, "group_name", true, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{}), + std::make_tuple(7, "zone_names", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE)), std::vector{}), std::make_tuple(8, "isolation_level", true, std::make_unique>("meta.IsolationLevel"), std::vector{}), std::make_tuple(9, "comment", true, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{}), }; @@ -1377,6 +1377,54 @@ StructMetadata<::nebula::meta::cpp2::ListEdgesResp>::gen(ThriftMetadata& metadat return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& +StructMetadata<::nebula::meta::cpp2::AddHostsReq>::gen(ThriftMetadata& metadata) { + auto res = metadata.structs_ref()->emplace("meta.AddHostsReq", ::apache::thrift::metadata::ThriftStruct{}); + if (!res.second) { + return res.first->second; + } + ::apache::thrift::metadata::ThriftStruct& meta_AddHostsReq = res.first->second; + meta_AddHostsReq.name_ref() = "meta.AddHostsReq"; + meta_AddHostsReq.is_union_ref() = false; + static const EncodedThriftField + meta_AddHostsReq_fields[] = { + std::make_tuple(1, "hosts", false, std::make_unique(std::make_unique>("common.HostAddr")), std::vector{}), + }; + for (const auto& f : meta_AddHostsReq_fields) { + ::apache::thrift::metadata::ThriftField field; + field.id_ref() = std::get<0>(f); + field.name_ref() = std::get<1>(f); + field.is_optional_ref() = std::get<2>(f); + std::get<3>(f)->writeAndGenType(*field.type_ref(), metadata); + field.structured_annotations_ref() = std::get<4>(f); + meta_AddHostsReq.fields_ref()->push_back(std::move(field)); + } + return res.first->second; +} +const ::apache::thrift::metadata::ThriftStruct& +StructMetadata<::nebula::meta::cpp2::DropHostsReq>::gen(ThriftMetadata& metadata) { + auto res = metadata.structs_ref()->emplace("meta.DropHostsReq", ::apache::thrift::metadata::ThriftStruct{}); + if (!res.second) { + return res.first->second; + } + ::apache::thrift::metadata::ThriftStruct& meta_DropHostsReq = res.first->second; + meta_DropHostsReq.name_ref() = "meta.DropHostsReq"; + meta_DropHostsReq.is_union_ref() = false; + static const EncodedThriftField + meta_DropHostsReq_fields[] = { + std::make_tuple(1, "hosts", false, std::make_unique(std::make_unique>("common.HostAddr")), std::vector{}), + }; + for (const auto& f : meta_DropHostsReq_fields) { + ::apache::thrift::metadata::ThriftField field; + field.id_ref() = std::get<0>(f); + field.name_ref() = std::get<1>(f); + field.is_optional_ref() = std::get<2>(f); + std::get<3>(f)->writeAndGenType(*field.type_ref(), metadata); + field.structured_annotations_ref() = std::get<4>(f); + meta_DropHostsReq.fields_ref()->push_back(std::move(field)); + } + return res.first->second; +} +const ::apache::thrift::metadata::ThriftStruct& StructMetadata<::nebula::meta::cpp2::ListHostsReq>::gen(ThriftMetadata& metadata) { auto res = metadata.structs_ref()->emplace("meta.ListHostsReq", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { @@ -2892,27 +2940,27 @@ StructMetadata<::nebula::meta::cpp2::ListIndexStatusResp>::gen(ThriftMetadata& m return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& -StructMetadata<::nebula::meta::cpp2::AddZoneReq>::gen(ThriftMetadata& metadata) { - auto res = metadata.structs_ref()->emplace("meta.AddZoneReq", ::apache::thrift::metadata::ThriftStruct{}); +StructMetadata<::nebula::meta::cpp2::MergeZoneReq>::gen(ThriftMetadata& metadata) { + auto res = metadata.structs_ref()->emplace("meta.MergeZoneReq", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } - ::apache::thrift::metadata::ThriftStruct& meta_AddZoneReq = res.first->second; - meta_AddZoneReq.name_ref() = "meta.AddZoneReq"; - meta_AddZoneReq.is_union_ref() = false; + ::apache::thrift::metadata::ThriftStruct& meta_MergeZoneReq = res.first->second; + meta_MergeZoneReq.name_ref() = "meta.MergeZoneReq"; + meta_MergeZoneReq.is_union_ref() = false; static const EncodedThriftField - meta_AddZoneReq_fields[] = { - std::make_tuple(1, "zone_name", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{}), - std::make_tuple(2, "nodes", false, std::make_unique(std::make_unique>("common.HostAddr")), std::vector{}), + meta_MergeZoneReq_fields[] = { + std::make_tuple(1, "zones", false, std::make_unique(std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE)), std::vector{}), + std::make_tuple(2, "zone_name", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{}), }; - for (const auto& f : meta_AddZoneReq_fields) { + for (const auto& f : meta_MergeZoneReq_fields) { ::apache::thrift::metadata::ThriftField field; field.id_ref() = std::get<0>(f); field.name_ref() = std::get<1>(f); field.is_optional_ref() = std::get<2>(f); std::get<3>(f)->writeAndGenType(*field.type_ref(), metadata); field.structured_annotations_ref() = std::get<4>(f); - meta_AddZoneReq.fields_ref()->push_back(std::move(field)); + meta_MergeZoneReq.fields_ref()->push_back(std::move(field)); } return res.first->second; } @@ -2941,52 +2989,77 @@ StructMetadata<::nebula::meta::cpp2::DropZoneReq>::gen(ThriftMetadata& metadata) return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& -StructMetadata<::nebula::meta::cpp2::AddHostIntoZoneReq>::gen(ThriftMetadata& metadata) { - auto res = metadata.structs_ref()->emplace("meta.AddHostIntoZoneReq", ::apache::thrift::metadata::ThriftStruct{}); +StructMetadata<::nebula::meta::cpp2::SplitZoneReq>::gen(ThriftMetadata& metadata) { + auto res = metadata.structs_ref()->emplace("meta.SplitZoneReq", ::apache::thrift::metadata::ThriftStruct{}); + if (!res.second) { + return res.first->second; + } + ::apache::thrift::metadata::ThriftStruct& meta_SplitZoneReq = res.first->second; + meta_SplitZoneReq.name_ref() = "meta.SplitZoneReq"; + meta_SplitZoneReq.is_union_ref() = false; + static const EncodedThriftField + meta_SplitZoneReq_fields[] = { + std::make_tuple(1, "zone_name", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{}), + }; + for (const auto& f : meta_SplitZoneReq_fields) { + ::apache::thrift::metadata::ThriftField field; + field.id_ref() = std::get<0>(f); + field.name_ref() = std::get<1>(f); + field.is_optional_ref() = std::get<2>(f); + std::get<3>(f)->writeAndGenType(*field.type_ref(), metadata); + field.structured_annotations_ref() = std::get<4>(f); + meta_SplitZoneReq.fields_ref()->push_back(std::move(field)); + } + return res.first->second; +} +const ::apache::thrift::metadata::ThriftStruct& +StructMetadata<::nebula::meta::cpp2::RenameZoneReq>::gen(ThriftMetadata& metadata) { + auto res = metadata.structs_ref()->emplace("meta.RenameZoneReq", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } - ::apache::thrift::metadata::ThriftStruct& meta_AddHostIntoZoneReq = res.first->second; - meta_AddHostIntoZoneReq.name_ref() = "meta.AddHostIntoZoneReq"; - meta_AddHostIntoZoneReq.is_union_ref() = false; + ::apache::thrift::metadata::ThriftStruct& meta_RenameZoneReq = res.first->second; + meta_RenameZoneReq.name_ref() = "meta.RenameZoneReq"; + meta_RenameZoneReq.is_union_ref() = false; static const EncodedThriftField - meta_AddHostIntoZoneReq_fields[] = { - std::make_tuple(1, "node", false, std::make_unique>("common.HostAddr"), std::vector{}), + meta_RenameZoneReq_fields[] = { + std::make_tuple(1, "original_zone_name", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{}), std::make_tuple(2, "zone_name", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{}), }; - for (const auto& f : meta_AddHostIntoZoneReq_fields) { + for (const auto& f : meta_RenameZoneReq_fields) { ::apache::thrift::metadata::ThriftField field; field.id_ref() = std::get<0>(f); field.name_ref() = std::get<1>(f); field.is_optional_ref() = std::get<2>(f); std::get<3>(f)->writeAndGenType(*field.type_ref(), metadata); field.structured_annotations_ref() = std::get<4>(f); - meta_AddHostIntoZoneReq.fields_ref()->push_back(std::move(field)); + meta_RenameZoneReq.fields_ref()->push_back(std::move(field)); } return res.first->second; } const ::apache::thrift::metadata::ThriftStruct& -StructMetadata<::nebula::meta::cpp2::DropHostFromZoneReq>::gen(ThriftMetadata& metadata) { - auto res = metadata.structs_ref()->emplace("meta.DropHostFromZoneReq", ::apache::thrift::metadata::ThriftStruct{}); +StructMetadata<::nebula::meta::cpp2::AddHostsIntoZoneReq>::gen(ThriftMetadata& metadata) { + auto res = metadata.structs_ref()->emplace("meta.AddHostsIntoZoneReq", ::apache::thrift::metadata::ThriftStruct{}); if (!res.second) { return res.first->second; } - ::apache::thrift::metadata::ThriftStruct& meta_DropHostFromZoneReq = res.first->second; - meta_DropHostFromZoneReq.name_ref() = "meta.DropHostFromZoneReq"; - meta_DropHostFromZoneReq.is_union_ref() = false; + ::apache::thrift::metadata::ThriftStruct& meta_AddHostsIntoZoneReq = res.first->second; + meta_AddHostsIntoZoneReq.name_ref() = "meta.AddHostsIntoZoneReq"; + meta_AddHostsIntoZoneReq.is_union_ref() = false; static const EncodedThriftField - meta_DropHostFromZoneReq_fields[] = { - std::make_tuple(1, "node", false, std::make_unique>("common.HostAddr"), std::vector{}), + meta_AddHostsIntoZoneReq_fields[] = { + std::make_tuple(1, "hosts", false, std::make_unique(std::make_unique>("common.HostAddr")), std::vector{}), std::make_tuple(2, "zone_name", false, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{}), + std::make_tuple(3, "is_new", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{}), }; - for (const auto& f : meta_DropHostFromZoneReq_fields) { + for (const auto& f : meta_AddHostsIntoZoneReq_fields) { ::apache::thrift::metadata::ThriftField field; field.id_ref() = std::get<0>(f); field.name_ref() = std::get<1>(f); field.is_optional_ref() = std::get<2>(f); std::get<3>(f)->writeAndGenType(*field.type_ref(), metadata); field.structured_annotations_ref() = std::get<4>(f); - meta_DropHostFromZoneReq.fields_ref()->push_back(std::move(field)); + meta_AddHostsIntoZoneReq.fields_ref()->push_back(std::move(field)); } return res.first->second; } @@ -4363,6 +4436,54 @@ void ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_listEdges(Thrif func.is_oneway_ref() = false; service.functions_ref()->push_back(std::move(func)); } +void ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_addHosts(ThriftMetadata& metadata, ThriftService& service) { + ::apache::thrift::metadata::ThriftFunction func; + (void)metadata; + func.name_ref() = "addHosts"; + auto func_ret_type = std::make_unique>("meta.ExecResp"); + func_ret_type->writeAndGenType(*func.return_type_ref(), metadata); + ::apache::thrift::metadata::ThriftField meta_MetaService_addHosts_req_1; + meta_MetaService_addHosts_req_1.id_ref() = 1; + meta_MetaService_addHosts_req_1.name_ref() = "req"; + meta_MetaService_addHosts_req_1.is_optional_ref() = false; + auto meta_MetaService_addHosts_req_1_type = std::make_unique>("meta.AddHostsReq"); + meta_MetaService_addHosts_req_1_type->writeAndGenType(*meta_MetaService_addHosts_req_1.type_ref(), metadata); + func.arguments_ref()->push_back(std::move(meta_MetaService_addHosts_req_1)); + func.is_oneway_ref() = false; + service.functions_ref()->push_back(std::move(func)); +} +void ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_addHostsIntoZone(ThriftMetadata& metadata, ThriftService& service) { + ::apache::thrift::metadata::ThriftFunction func; + (void)metadata; + func.name_ref() = "addHostsIntoZone"; + auto func_ret_type = std::make_unique>("meta.ExecResp"); + func_ret_type->writeAndGenType(*func.return_type_ref(), metadata); + ::apache::thrift::metadata::ThriftField meta_MetaService_addHostsIntoZone_req_1; + meta_MetaService_addHostsIntoZone_req_1.id_ref() = 1; + meta_MetaService_addHostsIntoZone_req_1.name_ref() = "req"; + meta_MetaService_addHostsIntoZone_req_1.is_optional_ref() = false; + auto meta_MetaService_addHostsIntoZone_req_1_type = std::make_unique>("meta.AddHostsIntoZoneReq"); + meta_MetaService_addHostsIntoZone_req_1_type->writeAndGenType(*meta_MetaService_addHostsIntoZone_req_1.type_ref(), metadata); + func.arguments_ref()->push_back(std::move(meta_MetaService_addHostsIntoZone_req_1)); + func.is_oneway_ref() = false; + service.functions_ref()->push_back(std::move(func)); +} +void ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_dropHosts(ThriftMetadata& metadata, ThriftService& service) { + ::apache::thrift::metadata::ThriftFunction func; + (void)metadata; + func.name_ref() = "dropHosts"; + auto func_ret_type = std::make_unique>("meta.ExecResp"); + func_ret_type->writeAndGenType(*func.return_type_ref(), metadata); + ::apache::thrift::metadata::ThriftField meta_MetaService_dropHosts_req_1; + meta_MetaService_dropHosts_req_1.id_ref() = 1; + meta_MetaService_dropHosts_req_1.name_ref() = "req"; + meta_MetaService_dropHosts_req_1.is_optional_ref() = false; + auto meta_MetaService_dropHosts_req_1_type = std::make_unique>("meta.DropHostsReq"); + meta_MetaService_dropHosts_req_1_type->writeAndGenType(*meta_MetaService_dropHosts_req_1.type_ref(), metadata); + func.arguments_ref()->push_back(std::move(meta_MetaService_dropHosts_req_1)); + func.is_oneway_ref() = false; + service.functions_ref()->push_back(std::move(func)); +} void ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_listHosts(ThriftMetadata& metadata, ThriftService& service) { ::apache::thrift::metadata::ThriftFunction func; (void)metadata; @@ -4987,19 +5108,19 @@ void ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_runAdminJob(Thr func.is_oneway_ref() = false; service.functions_ref()->push_back(std::move(func)); } -void ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_addZone(ThriftMetadata& metadata, ThriftService& service) { +void ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_mergeZone(ThriftMetadata& metadata, ThriftService& service) { ::apache::thrift::metadata::ThriftFunction func; (void)metadata; - func.name_ref() = "addZone"; + func.name_ref() = "mergeZone"; auto func_ret_type = std::make_unique>("meta.ExecResp"); func_ret_type->writeAndGenType(*func.return_type_ref(), metadata); - ::apache::thrift::metadata::ThriftField meta_MetaService_addZone_req_1; - meta_MetaService_addZone_req_1.id_ref() = 1; - meta_MetaService_addZone_req_1.name_ref() = "req"; - meta_MetaService_addZone_req_1.is_optional_ref() = false; - auto meta_MetaService_addZone_req_1_type = std::make_unique>("meta.AddZoneReq"); - meta_MetaService_addZone_req_1_type->writeAndGenType(*meta_MetaService_addZone_req_1.type_ref(), metadata); - func.arguments_ref()->push_back(std::move(meta_MetaService_addZone_req_1)); + ::apache::thrift::metadata::ThriftField meta_MetaService_mergeZone_req_1; + meta_MetaService_mergeZone_req_1.id_ref() = 1; + meta_MetaService_mergeZone_req_1.name_ref() = "req"; + meta_MetaService_mergeZone_req_1.is_optional_ref() = false; + auto meta_MetaService_mergeZone_req_1_type = std::make_unique>("meta.MergeZoneReq"); + meta_MetaService_mergeZone_req_1_type->writeAndGenType(*meta_MetaService_mergeZone_req_1.type_ref(), metadata); + func.arguments_ref()->push_back(std::move(meta_MetaService_mergeZone_req_1)); func.is_oneway_ref() = false; service.functions_ref()->push_back(std::move(func)); } @@ -5019,35 +5140,35 @@ void ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_dropZone(Thrift func.is_oneway_ref() = false; service.functions_ref()->push_back(std::move(func)); } -void ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_addHostIntoZone(ThriftMetadata& metadata, ThriftService& service) { +void ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_splitZone(ThriftMetadata& metadata, ThriftService& service) { ::apache::thrift::metadata::ThriftFunction func; (void)metadata; - func.name_ref() = "addHostIntoZone"; + func.name_ref() = "splitZone"; auto func_ret_type = std::make_unique>("meta.ExecResp"); func_ret_type->writeAndGenType(*func.return_type_ref(), metadata); - ::apache::thrift::metadata::ThriftField meta_MetaService_addHostIntoZone_req_1; - meta_MetaService_addHostIntoZone_req_1.id_ref() = 1; - meta_MetaService_addHostIntoZone_req_1.name_ref() = "req"; - meta_MetaService_addHostIntoZone_req_1.is_optional_ref() = false; - auto meta_MetaService_addHostIntoZone_req_1_type = std::make_unique>("meta.AddHostIntoZoneReq"); - meta_MetaService_addHostIntoZone_req_1_type->writeAndGenType(*meta_MetaService_addHostIntoZone_req_1.type_ref(), metadata); - func.arguments_ref()->push_back(std::move(meta_MetaService_addHostIntoZone_req_1)); + ::apache::thrift::metadata::ThriftField meta_MetaService_splitZone_req_1; + meta_MetaService_splitZone_req_1.id_ref() = 1; + meta_MetaService_splitZone_req_1.name_ref() = "req"; + meta_MetaService_splitZone_req_1.is_optional_ref() = false; + auto meta_MetaService_splitZone_req_1_type = std::make_unique>("meta.SplitZoneReq"); + meta_MetaService_splitZone_req_1_type->writeAndGenType(*meta_MetaService_splitZone_req_1.type_ref(), metadata); + func.arguments_ref()->push_back(std::move(meta_MetaService_splitZone_req_1)); func.is_oneway_ref() = false; service.functions_ref()->push_back(std::move(func)); } -void ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_dropHostFromZone(ThriftMetadata& metadata, ThriftService& service) { +void ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_renameZone(ThriftMetadata& metadata, ThriftService& service) { ::apache::thrift::metadata::ThriftFunction func; (void)metadata; - func.name_ref() = "dropHostFromZone"; + func.name_ref() = "renameZone"; auto func_ret_type = std::make_unique>("meta.ExecResp"); func_ret_type->writeAndGenType(*func.return_type_ref(), metadata); - ::apache::thrift::metadata::ThriftField meta_MetaService_dropHostFromZone_req_1; - meta_MetaService_dropHostFromZone_req_1.id_ref() = 1; - meta_MetaService_dropHostFromZone_req_1.name_ref() = "req"; - meta_MetaService_dropHostFromZone_req_1.is_optional_ref() = false; - auto meta_MetaService_dropHostFromZone_req_1_type = std::make_unique>("meta.DropHostFromZoneReq"); - meta_MetaService_dropHostFromZone_req_1_type->writeAndGenType(*meta_MetaService_dropHostFromZone_req_1.type_ref(), metadata); - func.arguments_ref()->push_back(std::move(meta_MetaService_dropHostFromZone_req_1)); + ::apache::thrift::metadata::ThriftField meta_MetaService_renameZone_req_1; + meta_MetaService_renameZone_req_1.id_ref() = 1; + meta_MetaService_renameZone_req_1.name_ref() = "req"; + meta_MetaService_renameZone_req_1.is_optional_ref() = false; + auto meta_MetaService_renameZone_req_1_type = std::make_unique>("meta.RenameZoneReq"); + meta_MetaService_renameZone_req_1_type->writeAndGenType(*meta_MetaService_renameZone_req_1.type_ref(), metadata); + func.arguments_ref()->push_back(std::move(meta_MetaService_renameZone_req_1)); func.is_oneway_ref() = false; service.functions_ref()->push_back(std::move(func)); } @@ -5456,6 +5577,9 @@ void ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen(ThriftMetadata& ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_dropEdge, ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_getEdge, ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_listEdges, + ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_addHosts, + ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_addHostsIntoZone, + ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_dropHosts, ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_listHosts, ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_getPartsAlloc, ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_listParts, @@ -5495,10 +5619,10 @@ void ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen(ThriftMetadata& ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_dropSnapshot, ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_listSnapshots, ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_runAdminJob, - ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_addZone, + ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_mergeZone, ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_dropZone, - ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_addHostIntoZone, - ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_dropHostFromZone, + ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_splitZone, + ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_renameZone, ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_getZone, ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_listZones, ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf>::gen_createBackup, diff --git a/src/interface/gen-cpp2/meta_metadata.h b/src/interface/gen-cpp2/meta_metadata.h index 021f29b9..e09d5803 100644 --- a/src/interface/gen-cpp2/meta_metadata.h +++ b/src/interface/gen-cpp2/meta_metadata.h @@ -327,6 +327,16 @@ class StructMetadata<::nebula::meta::cpp2::ListEdgesResp> { static const ::apache::thrift::metadata::ThriftStruct& gen(ThriftMetadata& metadata); }; template <> +class StructMetadata<::nebula::meta::cpp2::AddHostsReq> { + public: + static const ::apache::thrift::metadata::ThriftStruct& gen(ThriftMetadata& metadata); +}; +template <> +class StructMetadata<::nebula::meta::cpp2::DropHostsReq> { + public: + static const ::apache::thrift::metadata::ThriftStruct& gen(ThriftMetadata& metadata); +}; +template <> class StructMetadata<::nebula::meta::cpp2::ListHostsReq> { public: static const ::apache::thrift::metadata::ThriftStruct& gen(ThriftMetadata& metadata); @@ -632,7 +642,7 @@ class StructMetadata<::nebula::meta::cpp2::ListIndexStatusResp> { static const ::apache::thrift::metadata::ThriftStruct& gen(ThriftMetadata& metadata); }; template <> -class StructMetadata<::nebula::meta::cpp2::AddZoneReq> { +class StructMetadata<::nebula::meta::cpp2::MergeZoneReq> { public: static const ::apache::thrift::metadata::ThriftStruct& gen(ThriftMetadata& metadata); }; @@ -642,12 +652,17 @@ class StructMetadata<::nebula::meta::cpp2::DropZoneReq> { static const ::apache::thrift::metadata::ThriftStruct& gen(ThriftMetadata& metadata); }; template <> -class StructMetadata<::nebula::meta::cpp2::AddHostIntoZoneReq> { +class StructMetadata<::nebula::meta::cpp2::SplitZoneReq> { + public: + static const ::apache::thrift::metadata::ThriftStruct& gen(ThriftMetadata& metadata); +}; +template <> +class StructMetadata<::nebula::meta::cpp2::RenameZoneReq> { public: static const ::apache::thrift::metadata::ThriftStruct& gen(ThriftMetadata& metadata); }; template <> -class StructMetadata<::nebula::meta::cpp2::DropHostFromZoneReq> { +class StructMetadata<::nebula::meta::cpp2::AddHostsIntoZoneReq> { public: static const ::apache::thrift::metadata::ThriftStruct& gen(ThriftMetadata& metadata); }; @@ -911,6 +926,9 @@ class ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf> { static void gen_dropEdge(ThriftMetadata& metadata, ThriftService& context); static void gen_getEdge(ThriftMetadata& metadata, ThriftService& context); static void gen_listEdges(ThriftMetadata& metadata, ThriftService& context); + static void gen_addHosts(ThriftMetadata& metadata, ThriftService& context); + static void gen_addHostsIntoZone(ThriftMetadata& metadata, ThriftService& context); + static void gen_dropHosts(ThriftMetadata& metadata, ThriftService& context); static void gen_listHosts(ThriftMetadata& metadata, ThriftService& context); static void gen_getPartsAlloc(ThriftMetadata& metadata, ThriftService& context); static void gen_listParts(ThriftMetadata& metadata, ThriftService& context); @@ -950,10 +968,10 @@ class ServiceMetadata<::nebula::meta::cpp2::MetaServiceSvIf> { static void gen_dropSnapshot(ThriftMetadata& metadata, ThriftService& context); static void gen_listSnapshots(ThriftMetadata& metadata, ThriftService& context); static void gen_runAdminJob(ThriftMetadata& metadata, ThriftService& context); - static void gen_addZone(ThriftMetadata& metadata, ThriftService& context); + static void gen_mergeZone(ThriftMetadata& metadata, ThriftService& context); static void gen_dropZone(ThriftMetadata& metadata, ThriftService& context); - static void gen_addHostIntoZone(ThriftMetadata& metadata, ThriftService& context); - static void gen_dropHostFromZone(ThriftMetadata& metadata, ThriftService& context); + static void gen_splitZone(ThriftMetadata& metadata, ThriftService& context); + static void gen_renameZone(ThriftMetadata& metadata, ThriftService& context); static void gen_getZone(ThriftMetadata& metadata, ThriftService& context); static void gen_listZones(ThriftMetadata& metadata, ThriftService& context); static void gen_createBackup(ThriftMetadata& metadata, ThriftService& context); diff --git a/src/interface/gen-cpp2/meta_types.cpp b/src/interface/gen-cpp2/meta_types.cpp index a5cb6ca4..1bff22bc 100644 --- a/src/interface/gen-cpp2/meta_types.cpp +++ b/src/interface/gen-cpp2/meta_types.cpp @@ -1359,14 +1359,14 @@ THRIFT_IGNORE_ISSET_USE_WARNING_END SpaceDesc::~SpaceDesc() {} THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN -SpaceDesc::SpaceDesc(apache::thrift::FragileConstructor, ::std::string space_name__arg, int32_t partition_num__arg, int32_t replica_factor__arg, ::std::string charset_name__arg, ::std::string collate_name__arg, ::nebula::meta::cpp2::ColumnTypeDef vid_type__arg, ::std::string group_name__arg, ::nebula::meta::cpp2::IsolationLevel isolation_level__arg, ::std::string comment__arg) : +SpaceDesc::SpaceDesc(apache::thrift::FragileConstructor, ::std::string space_name__arg, int32_t partition_num__arg, int32_t replica_factor__arg, ::std::string charset_name__arg, ::std::string collate_name__arg, ::nebula::meta::cpp2::ColumnTypeDef vid_type__arg, ::std::vector<::std::string> zone_names__arg, ::nebula::meta::cpp2::IsolationLevel isolation_level__arg, ::std::string comment__arg) : space_name(std::move(space_name__arg)), partition_num(std::move(partition_num__arg)), replica_factor(std::move(replica_factor__arg)), charset_name(std::move(charset_name__arg)), collate_name(std::move(collate_name__arg)), vid_type(std::move(vid_type__arg)), - group_name(std::move(group_name__arg)), + zone_names(std::move(zone_names__arg)), isolation_level(std::move(isolation_level__arg)), comment(std::move(comment__arg)) { __isset.space_name = true; @@ -1375,7 +1375,7 @@ SpaceDesc::SpaceDesc(apache::thrift::FragileConstructor, ::std::string space_nam __isset.charset_name = true; __isset.collate_name = true; __isset.vid_type = true; - __isset.group_name = true; + __isset.zone_names = true; __isset.isolation_level = true; __isset.comment = true; } @@ -1388,7 +1388,7 @@ void SpaceDesc::__clear() { charset_name = apache::thrift::StringTraits< std::string>::fromStringLiteral(""); collate_name = apache::thrift::StringTraits< std::string>::fromStringLiteral(""); vid_type.__clear(); - group_name = apache::thrift::StringTraits< std::string>::fromStringLiteral(""); + zone_names.clear(); isolation_level = ::nebula::meta::cpp2::IsolationLevel::DEFAULT; comment = apache::thrift::StringTraits< std::string>::fromStringLiteral(""); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN @@ -1418,14 +1418,9 @@ bool SpaceDesc::operator==(const SpaceDesc& rhs) const { if (!(lhs.vid_type == rhs.vid_type)) { return false; } - if (lhs.group_name_ref().has_value() != rhs.group_name_ref().has_value()) { + if (!(lhs.zone_names == rhs.zone_names)) { return false; } - if (lhs.group_name_ref().has_value()) { - if (!apache::thrift::StringTraits::isEqual(lhs.group_name, rhs.group_name)) { - return false; - } - } if (lhs.isolation_level_ref() != rhs.isolation_level_ref()) { return false; } @@ -1462,13 +1457,8 @@ bool SpaceDesc::operator<(const SpaceDesc& rhs) const { if (!(lhs.vid_type == rhs.vid_type)) { return lhs.vid_type < rhs.vid_type; } - if (lhs.group_name_ref().has_value() != rhs.group_name_ref().has_value()) { - return lhs.group_name_ref().has_value() < rhs.group_name_ref().has_value(); - } - if (lhs.group_name_ref().has_value()) { - if (!apache::thrift::StringTraits::isEqual(lhs.group_name, rhs.group_name)) { - return apache::thrift::StringTraits::isLess(lhs.group_name, rhs.group_name); - } + if (!(lhs.zone_names == rhs.zone_names)) { + return lhs.zone_names < rhs.zone_names; } if (lhs.isolation_level_ref() != rhs.isolation_level_ref()) { return lhs.isolation_level_ref() < rhs.isolation_level_ref(); @@ -1492,6 +1482,14 @@ const ::nebula::meta::cpp2::ColumnTypeDef& SpaceDesc::get_vid_type() const& { return std::move(vid_type); } +const ::std::vector<::std::string>& SpaceDesc::get_zone_names() const& { + return zone_names; +} + +::std::vector<::std::string> SpaceDesc::get_zone_names() && { + return std::move(zone_names); +} + void swap(SpaceDesc& a, SpaceDesc& b) { using ::std::swap; @@ -1501,7 +1499,7 @@ void swap(SpaceDesc& a, SpaceDesc& b) { swap(a.charset_name_ref().value(), b.charset_name_ref().value()); swap(a.collate_name_ref().value(), b.collate_name_ref().value()); swap(a.vid_type_ref().value(), b.vid_type_ref().value()); - swap(a.group_name_ref().value_unchecked(), b.group_name_ref().value_unchecked()); + swap(a.zone_names_ref().value(), b.zone_names_ref().value()); swap(a.isolation_level_ref().value_unchecked(), b.isolation_level_ref().value_unchecked()); swap(a.comment_ref().value_unchecked(), b.comment_ref().value_unchecked()); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN @@ -6086,6 +6084,204 @@ namespace apache { namespace thrift { namespace detail { +void TccStructTraits<::nebula::meta::cpp2::AddHostsReq>::translateFieldName( + folly::StringPiece _fname, + int16_t& fid, + apache::thrift::protocol::TType& _ftype) noexcept { + using data = apache::thrift::TStructDataStorage<::nebula::meta::cpp2::AddHostsReq>; + static const st::translate_field_name_table table{ + data::fields_size, + data::fields_names.data(), + data::fields_ids.data(), + data::fields_types.data()}; + st::translate_field_name(_fname, fid, _ftype, table); +} + +} // namespace detail +} // namespace thrift +} // namespace apache + +namespace nebula { namespace meta { namespace cpp2 { + +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN +AddHostsReq::AddHostsReq(apache::thrift::FragileConstructor, ::std::vector hosts__arg) : + hosts(std::move(hosts__arg)) { + __isset.hosts = true; +} +THRIFT_IGNORE_ISSET_USE_WARNING_END +void AddHostsReq::__clear() { + // clear all fields + hosts.clear(); +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + __isset = {}; +THRIFT_IGNORE_ISSET_USE_WARNING_END +} + +bool AddHostsReq::operator==(const AddHostsReq& rhs) const { + (void)rhs; + auto& lhs = *this; + (void)lhs; + if (!(lhs.hosts == rhs.hosts)) { + return false; + } + return true; +} + +bool AddHostsReq::operator<(const AddHostsReq& rhs) const { + (void)rhs; + auto& lhs = *this; + (void)lhs; + if (!(lhs.hosts == rhs.hosts)) { + return lhs.hosts < rhs.hosts; + } + return false; +} + +const ::std::vector& AddHostsReq::get_hosts() const& { + return hosts; +} + +::std::vector AddHostsReq::get_hosts() && { + return std::move(hosts); +} + + +void swap(AddHostsReq& a, AddHostsReq& b) { + using ::std::swap; + swap(a.hosts_ref().value(), b.hosts_ref().value()); +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + swap(a.__isset, b.__isset); +THRIFT_IGNORE_ISSET_USE_WARNING_END +} + +template void AddHostsReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); +template uint32_t AddHostsReq::write<>(apache::thrift::BinaryProtocolWriter*) const; +template uint32_t AddHostsReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; +template uint32_t AddHostsReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; +template void AddHostsReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); +template uint32_t AddHostsReq::write<>(apache::thrift::CompactProtocolWriter*) const; +template uint32_t AddHostsReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; +template uint32_t AddHostsReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; + +static_assert( + ::apache::thrift::detail::st::gen_check_json< + AddHostsReq, + ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, + ::std::vector>, + "inconsistent use of json option"); + +static_assert( + ::apache::thrift::detail::st::gen_check_nimble< + AddHostsReq, + ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, + ::std::vector>, + "inconsistent use of nimble option"); + +}}} // nebula::meta::cpp2 + +namespace apache { +namespace thrift { +namespace detail { + +void TccStructTraits<::nebula::meta::cpp2::DropHostsReq>::translateFieldName( + folly::StringPiece _fname, + int16_t& fid, + apache::thrift::protocol::TType& _ftype) noexcept { + using data = apache::thrift::TStructDataStorage<::nebula::meta::cpp2::DropHostsReq>; + static const st::translate_field_name_table table{ + data::fields_size, + data::fields_names.data(), + data::fields_ids.data(), + data::fields_types.data()}; + st::translate_field_name(_fname, fid, _ftype, table); +} + +} // namespace detail +} // namespace thrift +} // namespace apache + +namespace nebula { namespace meta { namespace cpp2 { + +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN +DropHostsReq::DropHostsReq(apache::thrift::FragileConstructor, ::std::vector hosts__arg) : + hosts(std::move(hosts__arg)) { + __isset.hosts = true; +} +THRIFT_IGNORE_ISSET_USE_WARNING_END +void DropHostsReq::__clear() { + // clear all fields + hosts.clear(); +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + __isset = {}; +THRIFT_IGNORE_ISSET_USE_WARNING_END +} + +bool DropHostsReq::operator==(const DropHostsReq& rhs) const { + (void)rhs; + auto& lhs = *this; + (void)lhs; + if (!(lhs.hosts == rhs.hosts)) { + return false; + } + return true; +} + +bool DropHostsReq::operator<(const DropHostsReq& rhs) const { + (void)rhs; + auto& lhs = *this; + (void)lhs; + if (!(lhs.hosts == rhs.hosts)) { + return lhs.hosts < rhs.hosts; + } + return false; +} + +const ::std::vector& DropHostsReq::get_hosts() const& { + return hosts; +} + +::std::vector DropHostsReq::get_hosts() && { + return std::move(hosts); +} + + +void swap(DropHostsReq& a, DropHostsReq& b) { + using ::std::swap; + swap(a.hosts_ref().value(), b.hosts_ref().value()); +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + swap(a.__isset, b.__isset); +THRIFT_IGNORE_ISSET_USE_WARNING_END +} + +template void DropHostsReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); +template uint32_t DropHostsReq::write<>(apache::thrift::BinaryProtocolWriter*) const; +template uint32_t DropHostsReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; +template uint32_t DropHostsReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; +template void DropHostsReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); +template uint32_t DropHostsReq::write<>(apache::thrift::CompactProtocolWriter*) const; +template uint32_t DropHostsReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; +template uint32_t DropHostsReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; + +static_assert( + ::apache::thrift::detail::st::gen_check_json< + DropHostsReq, + ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, + ::std::vector>, + "inconsistent use of json option"); + +static_assert( + ::apache::thrift::detail::st::gen_check_nimble< + DropHostsReq, + ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, + ::std::vector>, + "inconsistent use of nimble option"); + +}}} // nebula::meta::cpp2 + +namespace apache { +namespace thrift { +namespace detail { + void TccStructTraits<::nebula::meta::cpp2::ListHostsReq>::translateFieldName( folly::StringPiece _fname, int16_t& fid, @@ -12592,11 +12788,11 @@ namespace apache { namespace thrift { namespace detail { -void TccStructTraits<::nebula::meta::cpp2::AddZoneReq>::translateFieldName( +void TccStructTraits<::nebula::meta::cpp2::MergeZoneReq>::translateFieldName( folly::StringPiece _fname, int16_t& fid, apache::thrift::protocol::TType& _ftype) noexcept { - using data = apache::thrift::TStructDataStorage<::nebula::meta::cpp2::AddZoneReq>; + using data = apache::thrift::TStructDataStorage<::nebula::meta::cpp2::MergeZoneReq>; static const st::translate_field_name_table table{ data::fields_size, data::fields_names.data(), @@ -12612,88 +12808,76 @@ void TccStructTraits<::nebula::meta::cpp2::AddZoneReq>::translateFieldName( namespace nebula { namespace meta { namespace cpp2 { THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN -AddZoneReq::AddZoneReq(apache::thrift::FragileConstructor, ::std::string zone_name__arg, ::std::vector nodes__arg) : - zone_name(std::move(zone_name__arg)), - nodes(std::move(nodes__arg)) { +MergeZoneReq::MergeZoneReq(apache::thrift::FragileConstructor, ::std::vector<::std::string> zones__arg, ::std::string zone_name__arg) : + zones(std::move(zones__arg)), + zone_name(std::move(zone_name__arg)) { + __isset.zones = true; __isset.zone_name = true; - __isset.nodes = true; } THRIFT_IGNORE_ISSET_USE_WARNING_END -void AddZoneReq::__clear() { +void MergeZoneReq::__clear() { // clear all fields + zones.clear(); zone_name = apache::thrift::StringTraits< std::string>::fromStringLiteral(""); - nodes.clear(); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN __isset = {}; THRIFT_IGNORE_ISSET_USE_WARNING_END } -bool AddZoneReq::operator==(const AddZoneReq& rhs) const { +bool MergeZoneReq::operator==(const MergeZoneReq& rhs) const { (void)rhs; auto& lhs = *this; (void)lhs; - if (!apache::thrift::StringTraits::isEqual(lhs.zone_name, rhs.zone_name)) { + if (!(lhs.zones == rhs.zones)) { return false; } - if (!(lhs.nodes == rhs.nodes)) { + if (!apache::thrift::StringTraits::isEqual(lhs.zone_name, rhs.zone_name)) { return false; } return true; } -bool AddZoneReq::operator<(const AddZoneReq& rhs) const { +bool MergeZoneReq::operator<(const MergeZoneReq& rhs) const { (void)rhs; auto& lhs = *this; (void)lhs; + if (!(lhs.zones == rhs.zones)) { + return lhs.zones < rhs.zones; + } if (!apache::thrift::StringTraits::isEqual(lhs.zone_name, rhs.zone_name)) { return apache::thrift::StringTraits::isLess(lhs.zone_name, rhs.zone_name); } - if (!(lhs.nodes == rhs.nodes)) { - return lhs.nodes < rhs.nodes; - } return false; } -const ::std::vector& AddZoneReq::get_nodes() const& { - return nodes; +const ::std::vector<::std::string>& MergeZoneReq::get_zones() const& { + return zones; } -::std::vector AddZoneReq::get_nodes() && { - return std::move(nodes); +::std::vector<::std::string> MergeZoneReq::get_zones() && { + return std::move(zones); } -void swap(AddZoneReq& a, AddZoneReq& b) { +void swap(MergeZoneReq& a, MergeZoneReq& b) { using ::std::swap; + swap(a.zones_ref().value(), b.zones_ref().value()); swap(a.zone_name_ref().value(), b.zone_name_ref().value()); - swap(a.nodes_ref().value(), b.nodes_ref().value()); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN swap(a.__isset, b.__isset); THRIFT_IGNORE_ISSET_USE_WARNING_END } -template void AddZoneReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); -template uint32_t AddZoneReq::write<>(apache::thrift::BinaryProtocolWriter*) const; -template uint32_t AddZoneReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; -template uint32_t AddZoneReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; -template void AddZoneReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); -template uint32_t AddZoneReq::write<>(apache::thrift::CompactProtocolWriter*) const; -template uint32_t AddZoneReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; -template uint32_t AddZoneReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; +template void MergeZoneReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); +template uint32_t MergeZoneReq::write<>(apache::thrift::BinaryProtocolWriter*) const; +template uint32_t MergeZoneReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; +template uint32_t MergeZoneReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; +template void MergeZoneReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); +template uint32_t MergeZoneReq::write<>(apache::thrift::CompactProtocolWriter*) const; +template uint32_t MergeZoneReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; +template uint32_t MergeZoneReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; -static_assert( - ::apache::thrift::detail::st::gen_check_json< - AddZoneReq, - ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, - ::std::vector>, - "inconsistent use of json option"); -static_assert( - ::apache::thrift::detail::st::gen_check_nimble< - AddZoneReq, - ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, - ::std::vector>, - "inconsistent use of nimble option"); }}} // nebula::meta::cpp2 @@ -12780,11 +12964,11 @@ namespace apache { namespace thrift { namespace detail { -void TccStructTraits<::nebula::meta::cpp2::AddHostIntoZoneReq>::translateFieldName( +void TccStructTraits<::nebula::meta::cpp2::SplitZoneReq>::translateFieldName( folly::StringPiece _fname, int16_t& fid, apache::thrift::protocol::TType& _ftype) noexcept { - using data = apache::thrift::TStructDataStorage<::nebula::meta::cpp2::AddHostIntoZoneReq>; + using data = apache::thrift::TStructDataStorage<::nebula::meta::cpp2::SplitZoneReq>; static const st::translate_field_name_table table{ data::fields_size, data::fields_names.data(), @@ -12800,88 +12984,147 @@ void TccStructTraits<::nebula::meta::cpp2::AddHostIntoZoneReq>::translateFieldNa namespace nebula { namespace meta { namespace cpp2 { THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN -AddHostIntoZoneReq::AddHostIntoZoneReq(apache::thrift::FragileConstructor, nebula::HostAddr node__arg, ::std::string zone_name__arg) : - node(std::move(node__arg)), +SplitZoneReq::SplitZoneReq(apache::thrift::FragileConstructor, ::std::string zone_name__arg) : zone_name(std::move(zone_name__arg)) { - __isset.node = true; __isset.zone_name = true; } THRIFT_IGNORE_ISSET_USE_WARNING_END -void AddHostIntoZoneReq::__clear() { +void SplitZoneReq::__clear() { // clear all fields - node.__clear(); zone_name = apache::thrift::StringTraits< std::string>::fromStringLiteral(""); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN __isset = {}; THRIFT_IGNORE_ISSET_USE_WARNING_END } -bool AddHostIntoZoneReq::operator==(const AddHostIntoZoneReq& rhs) const { +bool SplitZoneReq::operator==(const SplitZoneReq& rhs) const { (void)rhs; auto& lhs = *this; (void)lhs; - if (!(lhs.node == rhs.node)) { - return false; - } if (!apache::thrift::StringTraits::isEqual(lhs.zone_name, rhs.zone_name)) { return false; } return true; } -bool AddHostIntoZoneReq::operator<(const AddHostIntoZoneReq& rhs) const { +bool SplitZoneReq::operator<(const SplitZoneReq& rhs) const { (void)rhs; auto& lhs = *this; (void)lhs; - if (!(lhs.node == rhs.node)) { - return lhs.node < rhs.node; - } if (!apache::thrift::StringTraits::isEqual(lhs.zone_name, rhs.zone_name)) { return apache::thrift::StringTraits::isLess(lhs.zone_name, rhs.zone_name); } return false; } -const nebula::HostAddr& AddHostIntoZoneReq::get_node() const& { - return node; + +void swap(SplitZoneReq& a, SplitZoneReq& b) { + using ::std::swap; + swap(a.zone_name_ref().value(), b.zone_name_ref().value()); +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + swap(a.__isset, b.__isset); +THRIFT_IGNORE_ISSET_USE_WARNING_END } -nebula::HostAddr AddHostIntoZoneReq::get_node() && { - return std::move(node); +template void SplitZoneReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); +template uint32_t SplitZoneReq::write<>(apache::thrift::BinaryProtocolWriter*) const; +template uint32_t SplitZoneReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; +template uint32_t SplitZoneReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; +template void SplitZoneReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); +template uint32_t SplitZoneReq::write<>(apache::thrift::CompactProtocolWriter*) const; +template uint32_t SplitZoneReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; +template uint32_t SplitZoneReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; + + + +}}} // nebula::meta::cpp2 + +namespace apache { +namespace thrift { +namespace detail { + +void TccStructTraits<::nebula::meta::cpp2::RenameZoneReq>::translateFieldName( + folly::StringPiece _fname, + int16_t& fid, + apache::thrift::protocol::TType& _ftype) noexcept { + using data = apache::thrift::TStructDataStorage<::nebula::meta::cpp2::RenameZoneReq>; + static const st::translate_field_name_table table{ + data::fields_size, + data::fields_names.data(), + data::fields_ids.data(), + data::fields_types.data()}; + st::translate_field_name(_fname, fid, _ftype, table); +} + +} // namespace detail +} // namespace thrift +} // namespace apache + +namespace nebula { namespace meta { namespace cpp2 { + +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN +RenameZoneReq::RenameZoneReq(apache::thrift::FragileConstructor, ::std::string original_zone_name__arg, ::std::string zone_name__arg) : + original_zone_name(std::move(original_zone_name__arg)), + zone_name(std::move(zone_name__arg)) { + __isset.original_zone_name = true; + __isset.zone_name = true; +} +THRIFT_IGNORE_ISSET_USE_WARNING_END +void RenameZoneReq::__clear() { + // clear all fields + original_zone_name = apache::thrift::StringTraits< std::string>::fromStringLiteral(""); + zone_name = apache::thrift::StringTraits< std::string>::fromStringLiteral(""); +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + __isset = {}; +THRIFT_IGNORE_ISSET_USE_WARNING_END +} + +bool RenameZoneReq::operator==(const RenameZoneReq& rhs) const { + (void)rhs; + auto& lhs = *this; + (void)lhs; + if (!apache::thrift::StringTraits::isEqual(lhs.original_zone_name, rhs.original_zone_name)) { + return false; + } + if (!apache::thrift::StringTraits::isEqual(lhs.zone_name, rhs.zone_name)) { + return false; + } + return true; +} + +bool RenameZoneReq::operator<(const RenameZoneReq& rhs) const { + (void)rhs; + auto& lhs = *this; + (void)lhs; + if (!apache::thrift::StringTraits::isEqual(lhs.original_zone_name, rhs.original_zone_name)) { + return apache::thrift::StringTraits::isLess(lhs.original_zone_name, rhs.original_zone_name); + } + if (!apache::thrift::StringTraits::isEqual(lhs.zone_name, rhs.zone_name)) { + return apache::thrift::StringTraits::isLess(lhs.zone_name, rhs.zone_name); + } + return false; } -void swap(AddHostIntoZoneReq& a, AddHostIntoZoneReq& b) { +void swap(RenameZoneReq& a, RenameZoneReq& b) { using ::std::swap; - swap(a.node_ref().value(), b.node_ref().value()); + swap(a.original_zone_name_ref().value(), b.original_zone_name_ref().value()); swap(a.zone_name_ref().value(), b.zone_name_ref().value()); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN swap(a.__isset, b.__isset); THRIFT_IGNORE_ISSET_USE_WARNING_END } -template void AddHostIntoZoneReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); -template uint32_t AddHostIntoZoneReq::write<>(apache::thrift::BinaryProtocolWriter*) const; -template uint32_t AddHostIntoZoneReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; -template uint32_t AddHostIntoZoneReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; -template void AddHostIntoZoneReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); -template uint32_t AddHostIntoZoneReq::write<>(apache::thrift::CompactProtocolWriter*) const; -template uint32_t AddHostIntoZoneReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; -template uint32_t AddHostIntoZoneReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; +template void RenameZoneReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); +template uint32_t RenameZoneReq::write<>(apache::thrift::BinaryProtocolWriter*) const; +template uint32_t RenameZoneReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; +template uint32_t RenameZoneReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; +template void RenameZoneReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); +template uint32_t RenameZoneReq::write<>(apache::thrift::CompactProtocolWriter*) const; +template uint32_t RenameZoneReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; +template uint32_t RenameZoneReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; -static_assert( - ::apache::thrift::detail::st::gen_check_json< - AddHostIntoZoneReq, - ::apache::thrift::type_class::structure, - nebula::HostAddr>, - "inconsistent use of json option"); -static_assert( - ::apache::thrift::detail::st::gen_check_nimble< - AddHostIntoZoneReq, - ::apache::thrift::type_class::structure, - nebula::HostAddr>, - "inconsistent use of nimble option"); }}} // nebula::meta::cpp2 @@ -12889,11 +13132,11 @@ namespace apache { namespace thrift { namespace detail { -void TccStructTraits<::nebula::meta::cpp2::DropHostFromZoneReq>::translateFieldName( +void TccStructTraits<::nebula::meta::cpp2::AddHostsIntoZoneReq>::translateFieldName( folly::StringPiece _fname, int16_t& fid, apache::thrift::protocol::TType& _ftype) noexcept { - using data = apache::thrift::TStructDataStorage<::nebula::meta::cpp2::DropHostFromZoneReq>; + using data = apache::thrift::TStructDataStorage<::nebula::meta::cpp2::AddHostsIntoZoneReq>; static const st::translate_field_name_table table{ data::fields_size, data::fields_names.data(), @@ -12909,87 +13152,97 @@ void TccStructTraits<::nebula::meta::cpp2::DropHostFromZoneReq>::translateFieldN namespace nebula { namespace meta { namespace cpp2 { THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN -DropHostFromZoneReq::DropHostFromZoneReq(apache::thrift::FragileConstructor, nebula::HostAddr node__arg, ::std::string zone_name__arg) : - node(std::move(node__arg)), - zone_name(std::move(zone_name__arg)) { - __isset.node = true; +AddHostsIntoZoneReq::AddHostsIntoZoneReq(apache::thrift::FragileConstructor, ::std::vector hosts__arg, ::std::string zone_name__arg, bool is_new__arg) : + hosts(std::move(hosts__arg)), + zone_name(std::move(zone_name__arg)), + is_new(std::move(is_new__arg)) { + __isset.hosts = true; __isset.zone_name = true; + __isset.is_new = true; } THRIFT_IGNORE_ISSET_USE_WARNING_END -void DropHostFromZoneReq::__clear() { +void AddHostsIntoZoneReq::__clear() { // clear all fields - node.__clear(); + hosts.clear(); zone_name = apache::thrift::StringTraits< std::string>::fromStringLiteral(""); + is_new = 0; THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN __isset = {}; THRIFT_IGNORE_ISSET_USE_WARNING_END } -bool DropHostFromZoneReq::operator==(const DropHostFromZoneReq& rhs) const { +bool AddHostsIntoZoneReq::operator==(const AddHostsIntoZoneReq& rhs) const { (void)rhs; auto& lhs = *this; (void)lhs; - if (!(lhs.node == rhs.node)) { + if (!(lhs.hosts == rhs.hosts)) { return false; } if (!apache::thrift::StringTraits::isEqual(lhs.zone_name, rhs.zone_name)) { return false; } + if (!(lhs.is_new == rhs.is_new)) { + return false; + } return true; } -bool DropHostFromZoneReq::operator<(const DropHostFromZoneReq& rhs) const { +bool AddHostsIntoZoneReq::operator<(const AddHostsIntoZoneReq& rhs) const { (void)rhs; auto& lhs = *this; (void)lhs; - if (!(lhs.node == rhs.node)) { - return lhs.node < rhs.node; + if (!(lhs.hosts == rhs.hosts)) { + return lhs.hosts < rhs.hosts; } if (!apache::thrift::StringTraits::isEqual(lhs.zone_name, rhs.zone_name)) { return apache::thrift::StringTraits::isLess(lhs.zone_name, rhs.zone_name); } + if (!(lhs.is_new == rhs.is_new)) { + return lhs.is_new < rhs.is_new; + } return false; } -const nebula::HostAddr& DropHostFromZoneReq::get_node() const& { - return node; +const ::std::vector& AddHostsIntoZoneReq::get_hosts() const& { + return hosts; } -nebula::HostAddr DropHostFromZoneReq::get_node() && { - return std::move(node); +::std::vector AddHostsIntoZoneReq::get_hosts() && { + return std::move(hosts); } -void swap(DropHostFromZoneReq& a, DropHostFromZoneReq& b) { +void swap(AddHostsIntoZoneReq& a, AddHostsIntoZoneReq& b) { using ::std::swap; - swap(a.node_ref().value(), b.node_ref().value()); + swap(a.hosts_ref().value(), b.hosts_ref().value()); swap(a.zone_name_ref().value(), b.zone_name_ref().value()); + swap(a.is_new_ref().value(), b.is_new_ref().value()); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN swap(a.__isset, b.__isset); THRIFT_IGNORE_ISSET_USE_WARNING_END } -template void DropHostFromZoneReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); -template uint32_t DropHostFromZoneReq::write<>(apache::thrift::BinaryProtocolWriter*) const; -template uint32_t DropHostFromZoneReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; -template uint32_t DropHostFromZoneReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; -template void DropHostFromZoneReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); -template uint32_t DropHostFromZoneReq::write<>(apache::thrift::CompactProtocolWriter*) const; -template uint32_t DropHostFromZoneReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; -template uint32_t DropHostFromZoneReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; +template void AddHostsIntoZoneReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); +template uint32_t AddHostsIntoZoneReq::write<>(apache::thrift::BinaryProtocolWriter*) const; +template uint32_t AddHostsIntoZoneReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; +template uint32_t AddHostsIntoZoneReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; +template void AddHostsIntoZoneReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); +template uint32_t AddHostsIntoZoneReq::write<>(apache::thrift::CompactProtocolWriter*) const; +template uint32_t AddHostsIntoZoneReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; +template uint32_t AddHostsIntoZoneReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; static_assert( ::apache::thrift::detail::st::gen_check_json< - DropHostFromZoneReq, - ::apache::thrift::type_class::structure, - nebula::HostAddr>, + AddHostsIntoZoneReq, + ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, + ::std::vector>, "inconsistent use of json option"); static_assert( ::apache::thrift::detail::st::gen_check_nimble< - DropHostFromZoneReq, - ::apache::thrift::type_class::structure, - nebula::HostAddr>, + AddHostsIntoZoneReq, + ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, + ::std::vector>, "inconsistent use of nimble option"); }}} // nebula::meta::cpp2 diff --git a/src/interface/gen-cpp2/meta_types.h b/src/interface/gen-cpp2/meta_types.h index 1090d4fc..5559021f 100644 --- a/src/interface/gen-cpp2/meta_types.h +++ b/src/interface/gen-cpp2/meta_types.h @@ -40,7 +40,7 @@ struct replica_factor; struct charset_name; struct collate_name; struct vid_type; -struct group_name; +struct zone_names; struct isolation_level; struct comment; struct space_id; @@ -167,6 +167,8 @@ struct space_id; struct code; struct leader; struct edges; +struct hosts; +struct hosts; struct type; struct code; struct leader; @@ -315,13 +317,15 @@ struct status; struct code; struct leader; struct statuses; +struct zones; struct zone_name; -struct nodes; struct zone_name; -struct node; struct zone_name; -struct node; +struct original_zone_name; struct zone_name; +struct hosts; +struct zone_name; +struct is_new; struct zone_name; struct code; struct leader; @@ -540,9 +544,9 @@ APACHE_THRIFT_DEFINE_ACCESSOR(collate_name); #define APACHE_THRIFT_ACCESSOR_vid_type APACHE_THRIFT_DEFINE_ACCESSOR(vid_type); #endif -#ifndef APACHE_THRIFT_ACCESSOR_group_name -#define APACHE_THRIFT_ACCESSOR_group_name -APACHE_THRIFT_DEFINE_ACCESSOR(group_name); +#ifndef APACHE_THRIFT_ACCESSOR_zone_names +#define APACHE_THRIFT_ACCESSOR_zone_names +APACHE_THRIFT_DEFINE_ACCESSOR(zone_names); #endif #ifndef APACHE_THRIFT_ACCESSOR_isolation_level #define APACHE_THRIFT_ACCESSOR_isolation_level @@ -1048,6 +1052,14 @@ APACHE_THRIFT_DEFINE_ACCESSOR(leader); #define APACHE_THRIFT_ACCESSOR_edges APACHE_THRIFT_DEFINE_ACCESSOR(edges); #endif +#ifndef APACHE_THRIFT_ACCESSOR_hosts +#define APACHE_THRIFT_ACCESSOR_hosts +APACHE_THRIFT_DEFINE_ACCESSOR(hosts); +#endif +#ifndef APACHE_THRIFT_ACCESSOR_hosts +#define APACHE_THRIFT_ACCESSOR_hosts +APACHE_THRIFT_DEFINE_ACCESSOR(hosts); +#endif #ifndef APACHE_THRIFT_ACCESSOR_type #define APACHE_THRIFT_ACCESSOR_type APACHE_THRIFT_DEFINE_ACCESSOR(type); @@ -1640,34 +1652,42 @@ APACHE_THRIFT_DEFINE_ACCESSOR(leader); #define APACHE_THRIFT_ACCESSOR_statuses APACHE_THRIFT_DEFINE_ACCESSOR(statuses); #endif +#ifndef APACHE_THRIFT_ACCESSOR_zones +#define APACHE_THRIFT_ACCESSOR_zones +APACHE_THRIFT_DEFINE_ACCESSOR(zones); +#endif #ifndef APACHE_THRIFT_ACCESSOR_zone_name #define APACHE_THRIFT_ACCESSOR_zone_name APACHE_THRIFT_DEFINE_ACCESSOR(zone_name); #endif -#ifndef APACHE_THRIFT_ACCESSOR_nodes -#define APACHE_THRIFT_ACCESSOR_nodes -APACHE_THRIFT_DEFINE_ACCESSOR(nodes); +#ifndef APACHE_THRIFT_ACCESSOR_zone_name +#define APACHE_THRIFT_ACCESSOR_zone_name +APACHE_THRIFT_DEFINE_ACCESSOR(zone_name); #endif #ifndef APACHE_THRIFT_ACCESSOR_zone_name #define APACHE_THRIFT_ACCESSOR_zone_name APACHE_THRIFT_DEFINE_ACCESSOR(zone_name); #endif -#ifndef APACHE_THRIFT_ACCESSOR_node -#define APACHE_THRIFT_ACCESSOR_node -APACHE_THRIFT_DEFINE_ACCESSOR(node); +#ifndef APACHE_THRIFT_ACCESSOR_original_zone_name +#define APACHE_THRIFT_ACCESSOR_original_zone_name +APACHE_THRIFT_DEFINE_ACCESSOR(original_zone_name); #endif #ifndef APACHE_THRIFT_ACCESSOR_zone_name #define APACHE_THRIFT_ACCESSOR_zone_name APACHE_THRIFT_DEFINE_ACCESSOR(zone_name); #endif -#ifndef APACHE_THRIFT_ACCESSOR_node -#define APACHE_THRIFT_ACCESSOR_node -APACHE_THRIFT_DEFINE_ACCESSOR(node); +#ifndef APACHE_THRIFT_ACCESSOR_hosts +#define APACHE_THRIFT_ACCESSOR_hosts +APACHE_THRIFT_DEFINE_ACCESSOR(hosts); #endif #ifndef APACHE_THRIFT_ACCESSOR_zone_name #define APACHE_THRIFT_ACCESSOR_zone_name APACHE_THRIFT_DEFINE_ACCESSOR(zone_name); #endif +#ifndef APACHE_THRIFT_ACCESSOR_is_new +#define APACHE_THRIFT_ACCESSOR_is_new +APACHE_THRIFT_DEFINE_ACCESSOR(is_new); +#endif #ifndef APACHE_THRIFT_ACCESSOR_zone_name #define APACHE_THRIFT_ACCESSOR_zone_name APACHE_THRIFT_DEFINE_ACCESSOR(zone_name); @@ -2815,6 +2835,8 @@ class GetEdgeResp; class DropEdgeReq; class ListEdgesReq; class ListEdgesResp; +class AddHostsReq; +class DropHostsReq; class ListHostsReq; class ListHostsResp; class PartItem; @@ -2876,10 +2898,11 @@ class ListSnapshotsResp; class ListIndexStatusReq; class IndexStatus; class ListIndexStatusResp; -class AddZoneReq; +class MergeZoneReq; class DropZoneReq; -class AddHostIntoZoneReq; -class DropHostFromZoneReq; +class SplitZoneReq; +class RenameZoneReq; +class AddHostsIntoZoneReq; class GetZoneReq; class GetZoneResp; class ListZonesReq; @@ -4427,7 +4450,7 @@ THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN // FragileConstructor for use in initialization lists only. [[deprecated("This constructor is deprecated")]] - SpaceDesc(apache::thrift::FragileConstructor, ::std::string space_name__arg, int32_t partition_num__arg, int32_t replica_factor__arg, ::std::string charset_name__arg, ::std::string collate_name__arg, ::nebula::meta::cpp2::ColumnTypeDef vid_type__arg, ::std::string group_name__arg, ::nebula::meta::cpp2::IsolationLevel isolation_level__arg, ::std::string comment__arg); + SpaceDesc(apache::thrift::FragileConstructor, ::std::string space_name__arg, int32_t partition_num__arg, int32_t replica_factor__arg, ::std::string charset_name__arg, ::std::string collate_name__arg, ::nebula::meta::cpp2::ColumnTypeDef vid_type__arg, ::std::vector<::std::string> zone_names__arg, ::nebula::meta::cpp2::IsolationLevel isolation_level__arg, ::std::string comment__arg); SpaceDesc(SpaceDesc&&) = default; @@ -4455,7 +4478,7 @@ THRIFT_IGNORE_ISSET_USE_WARNING_END private: ::nebula::meta::cpp2::ColumnTypeDef vid_type; private: - ::std::string group_name; + ::std::vector<::std::string> zone_names; private: ::nebula::meta::cpp2::IsolationLevel isolation_level; private: @@ -4470,7 +4493,7 @@ THRIFT_IGNORE_ISSET_USE_WARNING_END bool charset_name; bool collate_name; bool vid_type; - bool group_name; + bool zone_names; bool isolation_level; bool comment; } __isset = {}; @@ -4626,24 +4649,24 @@ THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN THRIFT_IGNORE_ISSET_USE_WARNING_END THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - template - FOLLY_ERASE ::apache::thrift::optional_field_ref group_name_ref() const& { - return {this->group_name, __isset.group_name}; + template > + FOLLY_ERASE ::apache::thrift::field_ref zone_names_ref() const& { + return {this->zone_names, __isset.zone_names}; } - template - FOLLY_ERASE ::apache::thrift::optional_field_ref group_name_ref() const&& { - return {std::move(this->group_name), __isset.group_name}; + template > + FOLLY_ERASE ::apache::thrift::field_ref zone_names_ref() const&& { + return {std::move(this->zone_names), __isset.zone_names}; } - template - FOLLY_ERASE ::apache::thrift::optional_field_ref group_name_ref() & { - return {this->group_name, __isset.group_name}; + template > + FOLLY_ERASE ::apache::thrift::field_ref zone_names_ref() & { + return {this->zone_names, __isset.zone_names}; } - template - FOLLY_ERASE ::apache::thrift::optional_field_ref group_name_ref() && { - return {std::move(this->group_name), __isset.group_name}; + template > + FOLLY_ERASE ::apache::thrift::field_ref zone_names_ref() && { + return {std::move(this->zone_names), __isset.zone_names}; } THRIFT_IGNORE_ISSET_USE_WARNING_END @@ -4776,23 +4799,16 @@ THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN THRIFT_IGNORE_ISSET_USE_WARNING_END return vid_type; } + const ::std::vector<::std::string>& get_zone_names() const&; + ::std::vector<::std::string> get_zone_names() &&; - const ::std::string* get_group_name() const& { - return group_name_ref() ? std::addressof(group_name) : nullptr; - } - - ::std::string* get_group_name() & { - return group_name_ref() ? std::addressof(group_name) : nullptr; - } - ::std::string* get_group_name() && = delete; - - template - ::std::string& set_group_name(T_SpaceDesc_group_name_struct_setter&& group_name_) { - group_name = std::forward(group_name_); + template > + ::std::vector<::std::string>& set_zone_names(T_SpaceDesc_zone_names_struct_setter&& zone_names_) { + zone_names = std::forward(zone_names_); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - __isset.group_name = true; + __isset.zone_names = true; THRIFT_IGNORE_ISSET_USE_WARNING_END - return group_name; + return zone_names; } const ::nebula::meta::cpp2::IsolationLevel* get_isolation_level() const& { @@ -12657,6 +12673,244 @@ uint32_t ListEdgesResp::read(Protocol_* iprot) { return iprot->getCursorPosition() - _xferStart; } +}}} // nebula::meta::cpp2 +namespace nebula { namespace meta { namespace cpp2 { +class AddHostsReq final { + private: + friend struct ::apache::thrift::detail::st::struct_private_access; + + // used by a static_assert in the corresponding source + static constexpr bool __fbthrift_cpp2_gen_json = false; + static constexpr bool __fbthrift_cpp2_gen_nimble = false; + static constexpr bool __fbthrift_cpp2_gen_has_thrift_uri = false; + + public: + using __fbthrift_cpp2_type = AddHostsReq; + static constexpr bool __fbthrift_cpp2_is_union = + false; + + + public: + +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + AddHostsReq() {} + // FragileConstructor for use in initialization lists only. + [[deprecated("This constructor is deprecated")]] + AddHostsReq(apache::thrift::FragileConstructor, ::std::vector hosts__arg); + + AddHostsReq(AddHostsReq&&) = default; + + AddHostsReq(const AddHostsReq&) = default; + + + AddHostsReq& operator=(AddHostsReq&&) = default; + + AddHostsReq& operator=(const AddHostsReq&) = default; +THRIFT_IGNORE_ISSET_USE_WARNING_END + void __clear(); + private: + ::std::vector hosts; + + public: + [[deprecated("__isset field is deprecated in Thrift struct. Use _ref() accessors instead.")]] + struct __isset { + bool hosts; + } __isset = {}; + bool operator==(const AddHostsReq& rhs) const; +#ifndef SWIG + friend bool operator!=(const AddHostsReq& __x, const AddHostsReq& __y) { + return !(__x == __y); + } +#endif + bool operator<(const AddHostsReq& rhs) const; +#ifndef SWIG + friend bool operator>(const AddHostsReq& __x, const AddHostsReq& __y) { + return __y < __x; + } + friend bool operator<=(const AddHostsReq& __x, const AddHostsReq& __y) { + return !(__y < __x); + } + friend bool operator>=(const AddHostsReq& __x, const AddHostsReq& __y) { + return !(__x < __y); + } +#endif + +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + template > + FOLLY_ERASE ::apache::thrift::field_ref hosts_ref() const& { + return {this->hosts, __isset.hosts}; + } + + template > + FOLLY_ERASE ::apache::thrift::field_ref hosts_ref() const&& { + return {std::move(this->hosts), __isset.hosts}; + } + + template > + FOLLY_ERASE ::apache::thrift::field_ref hosts_ref() & { + return {this->hosts, __isset.hosts}; + } + + template > + FOLLY_ERASE ::apache::thrift::field_ref hosts_ref() && { + return {std::move(this->hosts), __isset.hosts}; + } +THRIFT_IGNORE_ISSET_USE_WARNING_END + const ::std::vector& get_hosts() const&; + ::std::vector get_hosts() &&; + + template > + ::std::vector& set_hosts(T_AddHostsReq_hosts_struct_setter&& hosts_) { + hosts = std::forward(hosts_); +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + __isset.hosts = true; +THRIFT_IGNORE_ISSET_USE_WARNING_END + return hosts; + } + + template + uint32_t read(Protocol_* iprot); + template + uint32_t serializedSize(Protocol_ const* prot_) const; + template + uint32_t serializedSizeZC(Protocol_ const* prot_) const; + template + uint32_t write(Protocol_* prot_) const; + + private: + template + void readNoXfer(Protocol_* iprot); + + friend class ::apache::thrift::Cpp2Ops< AddHostsReq >; + friend void swap(AddHostsReq& a, AddHostsReq& b); +}; + +template +uint32_t AddHostsReq::read(Protocol_* iprot) { + auto _xferStart = iprot->getCursorPosition(); + readNoXfer(iprot); + return iprot->getCursorPosition() - _xferStart; +} + +}}} // nebula::meta::cpp2 +namespace nebula { namespace meta { namespace cpp2 { +class DropHostsReq final { + private: + friend struct ::apache::thrift::detail::st::struct_private_access; + + // used by a static_assert in the corresponding source + static constexpr bool __fbthrift_cpp2_gen_json = false; + static constexpr bool __fbthrift_cpp2_gen_nimble = false; + static constexpr bool __fbthrift_cpp2_gen_has_thrift_uri = false; + + public: + using __fbthrift_cpp2_type = DropHostsReq; + static constexpr bool __fbthrift_cpp2_is_union = + false; + + + public: + +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + DropHostsReq() {} + // FragileConstructor for use in initialization lists only. + [[deprecated("This constructor is deprecated")]] + DropHostsReq(apache::thrift::FragileConstructor, ::std::vector hosts__arg); + + DropHostsReq(DropHostsReq&&) = default; + + DropHostsReq(const DropHostsReq&) = default; + + + DropHostsReq& operator=(DropHostsReq&&) = default; + + DropHostsReq& operator=(const DropHostsReq&) = default; +THRIFT_IGNORE_ISSET_USE_WARNING_END + void __clear(); + private: + ::std::vector hosts; + + public: + [[deprecated("__isset field is deprecated in Thrift struct. Use _ref() accessors instead.")]] + struct __isset { + bool hosts; + } __isset = {}; + bool operator==(const DropHostsReq& rhs) const; +#ifndef SWIG + friend bool operator!=(const DropHostsReq& __x, const DropHostsReq& __y) { + return !(__x == __y); + } +#endif + bool operator<(const DropHostsReq& rhs) const; +#ifndef SWIG + friend bool operator>(const DropHostsReq& __x, const DropHostsReq& __y) { + return __y < __x; + } + friend bool operator<=(const DropHostsReq& __x, const DropHostsReq& __y) { + return !(__y < __x); + } + friend bool operator>=(const DropHostsReq& __x, const DropHostsReq& __y) { + return !(__x < __y); + } +#endif + +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + template > + FOLLY_ERASE ::apache::thrift::field_ref hosts_ref() const& { + return {this->hosts, __isset.hosts}; + } + + template > + FOLLY_ERASE ::apache::thrift::field_ref hosts_ref() const&& { + return {std::move(this->hosts), __isset.hosts}; + } + + template > + FOLLY_ERASE ::apache::thrift::field_ref hosts_ref() & { + return {this->hosts, __isset.hosts}; + } + + template > + FOLLY_ERASE ::apache::thrift::field_ref hosts_ref() && { + return {std::move(this->hosts), __isset.hosts}; + } +THRIFT_IGNORE_ISSET_USE_WARNING_END + const ::std::vector& get_hosts() const&; + ::std::vector get_hosts() &&; + + template > + ::std::vector& set_hosts(T_DropHostsReq_hosts_struct_setter&& hosts_) { + hosts = std::forward(hosts_); +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + __isset.hosts = true; +THRIFT_IGNORE_ISSET_USE_WARNING_END + return hosts; + } + + template + uint32_t read(Protocol_* iprot); + template + uint32_t serializedSize(Protocol_ const* prot_) const; + template + uint32_t serializedSizeZC(Protocol_ const* prot_) const; + template + uint32_t write(Protocol_* prot_) const; + + private: + template + void readNoXfer(Protocol_* iprot); + + friend class ::apache::thrift::Cpp2Ops< DropHostsReq >; + friend void swap(DropHostsReq& a, DropHostsReq& b); +}; + +template +uint32_t DropHostsReq::read(Protocol_* iprot) { + auto _xferStart = iprot->getCursorPosition(); + readNoXfer(iprot); + return iprot->getCursorPosition() - _xferStart; +} + }}} // nebula::meta::cpp2 namespace nebula { namespace meta { namespace cpp2 { class ListHostsReq final { @@ -23395,7 +23649,7 @@ uint32_t ListIndexStatusResp::read(Protocol_* iprot) { }}} // nebula::meta::cpp2 namespace nebula { namespace meta { namespace cpp2 { -class AddZoneReq final { +class MergeZoneReq final { private: friend struct ::apache::thrift::detail::st::struct_private_access; @@ -23405,7 +23659,7 @@ class AddZoneReq final { static constexpr bool __fbthrift_cpp2_gen_has_thrift_uri = false; public: - using __fbthrift_cpp2_type = AddZoneReq; + using __fbthrift_cpp2_type = MergeZoneReq; static constexpr bool __fbthrift_cpp2_is_union = false; @@ -23413,51 +23667,73 @@ class AddZoneReq final { public: THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - AddZoneReq() {} + MergeZoneReq() {} // FragileConstructor for use in initialization lists only. [[deprecated("This constructor is deprecated")]] - AddZoneReq(apache::thrift::FragileConstructor, ::std::string zone_name__arg, ::std::vector nodes__arg); + MergeZoneReq(apache::thrift::FragileConstructor, ::std::vector<::std::string> zones__arg, ::std::string zone_name__arg); - AddZoneReq(AddZoneReq&&) = default; + MergeZoneReq(MergeZoneReq&&) = default; - AddZoneReq(const AddZoneReq&) = default; + MergeZoneReq(const MergeZoneReq&) = default; - AddZoneReq& operator=(AddZoneReq&&) = default; + MergeZoneReq& operator=(MergeZoneReq&&) = default; - AddZoneReq& operator=(const AddZoneReq&) = default; + MergeZoneReq& operator=(const MergeZoneReq&) = default; THRIFT_IGNORE_ISSET_USE_WARNING_END void __clear(); private: - ::std::string zone_name; + ::std::vector<::std::string> zones; private: - ::std::vector nodes; + ::std::string zone_name; public: [[deprecated("__isset field is deprecated in Thrift struct. Use _ref() accessors instead.")]] struct __isset { + bool zones; bool zone_name; - bool nodes; } __isset = {}; - bool operator==(const AddZoneReq& rhs) const; + bool operator==(const MergeZoneReq& rhs) const; #ifndef SWIG - friend bool operator!=(const AddZoneReq& __x, const AddZoneReq& __y) { + friend bool operator!=(const MergeZoneReq& __x, const MergeZoneReq& __y) { return !(__x == __y); } #endif - bool operator<(const AddZoneReq& rhs) const; + bool operator<(const MergeZoneReq& rhs) const; #ifndef SWIG - friend bool operator>(const AddZoneReq& __x, const AddZoneReq& __y) { + friend bool operator>(const MergeZoneReq& __x, const MergeZoneReq& __y) { return __y < __x; } - friend bool operator<=(const AddZoneReq& __x, const AddZoneReq& __y) { + friend bool operator<=(const MergeZoneReq& __x, const MergeZoneReq& __y) { return !(__y < __x); } - friend bool operator>=(const AddZoneReq& __x, const AddZoneReq& __y) { + friend bool operator>=(const MergeZoneReq& __x, const MergeZoneReq& __y) { return !(__x < __y); } #endif +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + template > + FOLLY_ERASE ::apache::thrift::field_ref zones_ref() const& { + return {this->zones, __isset.zones}; + } + + template > + FOLLY_ERASE ::apache::thrift::field_ref zones_ref() const&& { + return {std::move(this->zones), __isset.zones}; + } + + template > + FOLLY_ERASE ::apache::thrift::field_ref zones_ref() & { + return {this->zones, __isset.zones}; + } + + template > + FOLLY_ERASE ::apache::thrift::field_ref zones_ref() && { + return {std::move(this->zones), __isset.zones}; + } +THRIFT_IGNORE_ISSET_USE_WARNING_END + THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN template FOLLY_ERASE ::apache::thrift::field_ref zone_name_ref() const& { @@ -23479,28 +23755,17 @@ THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN return {std::move(this->zone_name), __isset.zone_name}; } THRIFT_IGNORE_ISSET_USE_WARNING_END + const ::std::vector<::std::string>& get_zones() const&; + ::std::vector<::std::string> get_zones() &&; + template > + ::std::vector<::std::string>& set_zones(T_MergeZoneReq_zones_struct_setter&& zones_) { + zones = std::forward(zones_); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - template > - FOLLY_ERASE ::apache::thrift::field_ref nodes_ref() const& { - return {this->nodes, __isset.nodes}; - } - - template > - FOLLY_ERASE ::apache::thrift::field_ref nodes_ref() const&& { - return {std::move(this->nodes), __isset.nodes}; - } - - template > - FOLLY_ERASE ::apache::thrift::field_ref nodes_ref() & { - return {this->nodes, __isset.nodes}; - } - - template > - FOLLY_ERASE ::apache::thrift::field_ref nodes_ref() && { - return {std::move(this->nodes), __isset.nodes}; - } + __isset.zones = true; THRIFT_IGNORE_ISSET_USE_WARNING_END + return zones; + } const ::std::string& get_zone_name() const& { return zone_name; @@ -23510,25 +23775,14 @@ THRIFT_IGNORE_ISSET_USE_WARNING_END return std::move(zone_name); } - template - ::std::string& set_zone_name(T_AddZoneReq_zone_name_struct_setter&& zone_name_) { - zone_name = std::forward(zone_name_); + template + ::std::string& set_zone_name(T_MergeZoneReq_zone_name_struct_setter&& zone_name_) { + zone_name = std::forward(zone_name_); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN __isset.zone_name = true; THRIFT_IGNORE_ISSET_USE_WARNING_END return zone_name; } - const ::std::vector& get_nodes() const&; - ::std::vector get_nodes() &&; - - template > - ::std::vector& set_nodes(T_AddZoneReq_nodes_struct_setter&& nodes_) { - nodes = std::forward(nodes_); -THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - __isset.nodes = true; -THRIFT_IGNORE_ISSET_USE_WARNING_END - return nodes; - } template uint32_t read(Protocol_* iprot); @@ -23543,12 +23797,12 @@ THRIFT_IGNORE_ISSET_USE_WARNING_END template void readNoXfer(Protocol_* iprot); - friend class ::apache::thrift::Cpp2Ops< AddZoneReq >; - friend void swap(AddZoneReq& a, AddZoneReq& b); + friend class ::apache::thrift::Cpp2Ops< MergeZoneReq >; + friend void swap(MergeZoneReq& a, MergeZoneReq& b); }; template -uint32_t AddZoneReq::read(Protocol_* iprot) { +uint32_t MergeZoneReq::read(Protocol_* iprot) { auto _xferStart = iprot->getCursorPosition(); readNoXfer(iprot); return iprot->getCursorPosition() - _xferStart; @@ -23681,7 +23935,7 @@ uint32_t DropZoneReq::read(Protocol_* iprot) { }}} // nebula::meta::cpp2 namespace nebula { namespace meta { namespace cpp2 { -class AddHostIntoZoneReq final { +class SplitZoneReq final { private: friend struct ::apache::thrift::detail::st::struct_private_access; @@ -23691,7 +23945,7 @@ class AddHostIntoZoneReq final { static constexpr bool __fbthrift_cpp2_gen_has_thrift_uri = false; public: - using __fbthrift_cpp2_type = AddHostIntoZoneReq; + using __fbthrift_cpp2_type = SplitZoneReq; static constexpr bool __fbthrift_cpp2_is_union = false; @@ -23699,70 +23953,195 @@ class AddHostIntoZoneReq final { public: THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - AddHostIntoZoneReq() {} + SplitZoneReq() {} // FragileConstructor for use in initialization lists only. [[deprecated("This constructor is deprecated")]] - AddHostIntoZoneReq(apache::thrift::FragileConstructor, nebula::HostAddr node__arg, ::std::string zone_name__arg); + SplitZoneReq(apache::thrift::FragileConstructor, ::std::string zone_name__arg); - AddHostIntoZoneReq(AddHostIntoZoneReq&&) = default; + SplitZoneReq(SplitZoneReq&&) = default; - AddHostIntoZoneReq(const AddHostIntoZoneReq&) = default; + SplitZoneReq(const SplitZoneReq&) = default; - AddHostIntoZoneReq& operator=(AddHostIntoZoneReq&&) = default; + SplitZoneReq& operator=(SplitZoneReq&&) = default; - AddHostIntoZoneReq& operator=(const AddHostIntoZoneReq&) = default; + SplitZoneReq& operator=(const SplitZoneReq&) = default; THRIFT_IGNORE_ISSET_USE_WARNING_END void __clear(); private: - nebula::HostAddr node; + ::std::string zone_name; + + public: + [[deprecated("__isset field is deprecated in Thrift struct. Use _ref() accessors instead.")]] + struct __isset { + bool zone_name; + } __isset = {}; + bool operator==(const SplitZoneReq& rhs) const; +#ifndef SWIG + friend bool operator!=(const SplitZoneReq& __x, const SplitZoneReq& __y) { + return !(__x == __y); + } +#endif + bool operator<(const SplitZoneReq& rhs) const; +#ifndef SWIG + friend bool operator>(const SplitZoneReq& __x, const SplitZoneReq& __y) { + return __y < __x; + } + friend bool operator<=(const SplitZoneReq& __x, const SplitZoneReq& __y) { + return !(__y < __x); + } + friend bool operator>=(const SplitZoneReq& __x, const SplitZoneReq& __y) { + return !(__x < __y); + } +#endif + +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + template + FOLLY_ERASE ::apache::thrift::field_ref zone_name_ref() const& { + return {this->zone_name, __isset.zone_name}; + } + + template + FOLLY_ERASE ::apache::thrift::field_ref zone_name_ref() const&& { + return {std::move(this->zone_name), __isset.zone_name}; + } + + template + FOLLY_ERASE ::apache::thrift::field_ref zone_name_ref() & { + return {this->zone_name, __isset.zone_name}; + } + + template + FOLLY_ERASE ::apache::thrift::field_ref zone_name_ref() && { + return {std::move(this->zone_name), __isset.zone_name}; + } +THRIFT_IGNORE_ISSET_USE_WARNING_END + + const ::std::string& get_zone_name() const& { + return zone_name; + } + + ::std::string get_zone_name() && { + return std::move(zone_name); + } + + template + ::std::string& set_zone_name(T_SplitZoneReq_zone_name_struct_setter&& zone_name_) { + zone_name = std::forward(zone_name_); +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + __isset.zone_name = true; +THRIFT_IGNORE_ISSET_USE_WARNING_END + return zone_name; + } + + template + uint32_t read(Protocol_* iprot); + template + uint32_t serializedSize(Protocol_ const* prot_) const; + template + uint32_t serializedSizeZC(Protocol_ const* prot_) const; + template + uint32_t write(Protocol_* prot_) const; + + private: + template + void readNoXfer(Protocol_* iprot); + + friend class ::apache::thrift::Cpp2Ops< SplitZoneReq >; + friend void swap(SplitZoneReq& a, SplitZoneReq& b); +}; + +template +uint32_t SplitZoneReq::read(Protocol_* iprot) { + auto _xferStart = iprot->getCursorPosition(); + readNoXfer(iprot); + return iprot->getCursorPosition() - _xferStart; +} + +}}} // nebula::meta::cpp2 +namespace nebula { namespace meta { namespace cpp2 { +class RenameZoneReq final { + private: + friend struct ::apache::thrift::detail::st::struct_private_access; + + // used by a static_assert in the corresponding source + static constexpr bool __fbthrift_cpp2_gen_json = false; + static constexpr bool __fbthrift_cpp2_gen_nimble = false; + static constexpr bool __fbthrift_cpp2_gen_has_thrift_uri = false; + + public: + using __fbthrift_cpp2_type = RenameZoneReq; + static constexpr bool __fbthrift_cpp2_is_union = + false; + + + public: + +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + RenameZoneReq() {} + // FragileConstructor for use in initialization lists only. + [[deprecated("This constructor is deprecated")]] + RenameZoneReq(apache::thrift::FragileConstructor, ::std::string original_zone_name__arg, ::std::string zone_name__arg); + + RenameZoneReq(RenameZoneReq&&) = default; + + RenameZoneReq(const RenameZoneReq&) = default; + + + RenameZoneReq& operator=(RenameZoneReq&&) = default; + + RenameZoneReq& operator=(const RenameZoneReq&) = default; +THRIFT_IGNORE_ISSET_USE_WARNING_END + void __clear(); + private: + ::std::string original_zone_name; private: ::std::string zone_name; public: [[deprecated("__isset field is deprecated in Thrift struct. Use _ref() accessors instead.")]] struct __isset { - bool node; + bool original_zone_name; bool zone_name; } __isset = {}; - bool operator==(const AddHostIntoZoneReq& rhs) const; + bool operator==(const RenameZoneReq& rhs) const; #ifndef SWIG - friend bool operator!=(const AddHostIntoZoneReq& __x, const AddHostIntoZoneReq& __y) { + friend bool operator!=(const RenameZoneReq& __x, const RenameZoneReq& __y) { return !(__x == __y); } #endif - bool operator<(const AddHostIntoZoneReq& rhs) const; + bool operator<(const RenameZoneReq& rhs) const; #ifndef SWIG - friend bool operator>(const AddHostIntoZoneReq& __x, const AddHostIntoZoneReq& __y) { + friend bool operator>(const RenameZoneReq& __x, const RenameZoneReq& __y) { return __y < __x; } - friend bool operator<=(const AddHostIntoZoneReq& __x, const AddHostIntoZoneReq& __y) { + friend bool operator<=(const RenameZoneReq& __x, const RenameZoneReq& __y) { return !(__y < __x); } - friend bool operator>=(const AddHostIntoZoneReq& __x, const AddHostIntoZoneReq& __y) { + friend bool operator>=(const RenameZoneReq& __x, const RenameZoneReq& __y) { return !(__x < __y); } #endif THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - template - FOLLY_ERASE ::apache::thrift::field_ref node_ref() const& { - return {this->node, __isset.node}; + template + FOLLY_ERASE ::apache::thrift::field_ref original_zone_name_ref() const& { + return {this->original_zone_name, __isset.original_zone_name}; } - template - FOLLY_ERASE ::apache::thrift::field_ref node_ref() const&& { - return {std::move(this->node), __isset.node}; + template + FOLLY_ERASE ::apache::thrift::field_ref original_zone_name_ref() const&& { + return {std::move(this->original_zone_name), __isset.original_zone_name}; } - template - FOLLY_ERASE ::apache::thrift::field_ref node_ref() & { - return {this->node, __isset.node}; + template + FOLLY_ERASE ::apache::thrift::field_ref original_zone_name_ref() & { + return {this->original_zone_name, __isset.original_zone_name}; } - template - FOLLY_ERASE ::apache::thrift::field_ref node_ref() && { - return {std::move(this->node), __isset.node}; + template + FOLLY_ERASE ::apache::thrift::field_ref original_zone_name_ref() && { + return {std::move(this->original_zone_name), __isset.original_zone_name}; } THRIFT_IGNORE_ISSET_USE_WARNING_END @@ -23787,16 +24166,22 @@ THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN return {std::move(this->zone_name), __isset.zone_name}; } THRIFT_IGNORE_ISSET_USE_WARNING_END - const nebula::HostAddr& get_node() const&; - nebula::HostAddr get_node() &&; - template - nebula::HostAddr& set_node(T_AddHostIntoZoneReq_node_struct_setter&& node_) { - node = std::forward(node_); + const ::std::string& get_original_zone_name() const& { + return original_zone_name; + } + + ::std::string get_original_zone_name() && { + return std::move(original_zone_name); + } + + template + ::std::string& set_original_zone_name(T_RenameZoneReq_original_zone_name_struct_setter&& original_zone_name_) { + original_zone_name = std::forward(original_zone_name_); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - __isset.node = true; + __isset.original_zone_name = true; THRIFT_IGNORE_ISSET_USE_WARNING_END - return node; + return original_zone_name; } const ::std::string& get_zone_name() const& { @@ -23807,9 +24192,9 @@ THRIFT_IGNORE_ISSET_USE_WARNING_END return std::move(zone_name); } - template - ::std::string& set_zone_name(T_AddHostIntoZoneReq_zone_name_struct_setter&& zone_name_) { - zone_name = std::forward(zone_name_); + template + ::std::string& set_zone_name(T_RenameZoneReq_zone_name_struct_setter&& zone_name_) { + zone_name = std::forward(zone_name_); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN __isset.zone_name = true; THRIFT_IGNORE_ISSET_USE_WARNING_END @@ -23829,12 +24214,12 @@ THRIFT_IGNORE_ISSET_USE_WARNING_END template void readNoXfer(Protocol_* iprot); - friend class ::apache::thrift::Cpp2Ops< AddHostIntoZoneReq >; - friend void swap(AddHostIntoZoneReq& a, AddHostIntoZoneReq& b); + friend class ::apache::thrift::Cpp2Ops< RenameZoneReq >; + friend void swap(RenameZoneReq& a, RenameZoneReq& b); }; template -uint32_t AddHostIntoZoneReq::read(Protocol_* iprot) { +uint32_t RenameZoneReq::read(Protocol_* iprot) { auto _xferStart = iprot->getCursorPosition(); readNoXfer(iprot); return iprot->getCursorPosition() - _xferStart; @@ -23842,7 +24227,7 @@ uint32_t AddHostIntoZoneReq::read(Protocol_* iprot) { }}} // nebula::meta::cpp2 namespace nebula { namespace meta { namespace cpp2 { -class DropHostFromZoneReq final { +class AddHostsIntoZoneReq final { private: friend struct ::apache::thrift::detail::st::struct_private_access; @@ -23852,7 +24237,7 @@ class DropHostFromZoneReq final { static constexpr bool __fbthrift_cpp2_gen_has_thrift_uri = false; public: - using __fbthrift_cpp2_type = DropHostFromZoneReq; + using __fbthrift_cpp2_type = AddHostsIntoZoneReq; static constexpr bool __fbthrift_cpp2_is_union = false; @@ -23860,70 +24245,74 @@ class DropHostFromZoneReq final { public: THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - DropHostFromZoneReq() {} + AddHostsIntoZoneReq() : + is_new(0) {} // FragileConstructor for use in initialization lists only. [[deprecated("This constructor is deprecated")]] - DropHostFromZoneReq(apache::thrift::FragileConstructor, nebula::HostAddr node__arg, ::std::string zone_name__arg); + AddHostsIntoZoneReq(apache::thrift::FragileConstructor, ::std::vector hosts__arg, ::std::string zone_name__arg, bool is_new__arg); - DropHostFromZoneReq(DropHostFromZoneReq&&) = default; + AddHostsIntoZoneReq(AddHostsIntoZoneReq&&) = default; - DropHostFromZoneReq(const DropHostFromZoneReq&) = default; + AddHostsIntoZoneReq(const AddHostsIntoZoneReq&) = default; - DropHostFromZoneReq& operator=(DropHostFromZoneReq&&) = default; + AddHostsIntoZoneReq& operator=(AddHostsIntoZoneReq&&) = default; - DropHostFromZoneReq& operator=(const DropHostFromZoneReq&) = default; + AddHostsIntoZoneReq& operator=(const AddHostsIntoZoneReq&) = default; THRIFT_IGNORE_ISSET_USE_WARNING_END void __clear(); private: - nebula::HostAddr node; + ::std::vector hosts; private: ::std::string zone_name; + private: + bool is_new; public: [[deprecated("__isset field is deprecated in Thrift struct. Use _ref() accessors instead.")]] struct __isset { - bool node; + bool hosts; bool zone_name; + bool is_new; } __isset = {}; - bool operator==(const DropHostFromZoneReq& rhs) const; + bool operator==(const AddHostsIntoZoneReq& rhs) const; #ifndef SWIG - friend bool operator!=(const DropHostFromZoneReq& __x, const DropHostFromZoneReq& __y) { + friend bool operator!=(const AddHostsIntoZoneReq& __x, const AddHostsIntoZoneReq& __y) { return !(__x == __y); } #endif - bool operator<(const DropHostFromZoneReq& rhs) const; + bool operator<(const AddHostsIntoZoneReq& rhs) const; #ifndef SWIG - friend bool operator>(const DropHostFromZoneReq& __x, const DropHostFromZoneReq& __y) { + friend bool operator>(const AddHostsIntoZoneReq& __x, const AddHostsIntoZoneReq& __y) { return __y < __x; } - friend bool operator<=(const DropHostFromZoneReq& __x, const DropHostFromZoneReq& __y) { + friend bool operator<=(const AddHostsIntoZoneReq& __x, const AddHostsIntoZoneReq& __y) { return !(__y < __x); } - friend bool operator>=(const DropHostFromZoneReq& __x, const DropHostFromZoneReq& __y) { + friend bool operator>=(const AddHostsIntoZoneReq& __x, const AddHostsIntoZoneReq& __y) { return !(__x < __y); } #endif THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - template - FOLLY_ERASE ::apache::thrift::field_ref node_ref() const& { - return {this->node, __isset.node}; + template > + FOLLY_ERASE ::apache::thrift::field_ref hosts_ref() const& { + return {this->hosts, __isset.hosts}; } - template - FOLLY_ERASE ::apache::thrift::field_ref node_ref() const&& { - return {std::move(this->node), __isset.node}; + template > + FOLLY_ERASE ::apache::thrift::field_ref hosts_ref() const&& { + return {std::move(this->hosts), __isset.hosts}; } - template - FOLLY_ERASE ::apache::thrift::field_ref node_ref() & { - return {this->node, __isset.node}; + template > + FOLLY_ERASE ::apache::thrift::field_ref hosts_ref() & { + return {this->hosts, __isset.hosts}; } - template - FOLLY_ERASE ::apache::thrift::field_ref node_ref() && { - return {std::move(this->node), __isset.node}; + template > + FOLLY_ERASE ::apache::thrift::field_ref hosts_ref() && { + return {std::move(this->hosts), __isset.hosts}; } THRIFT_IGNORE_ISSET_USE_WARNING_END @@ -23948,16 +24337,38 @@ THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN return {std::move(this->zone_name), __isset.zone_name}; } THRIFT_IGNORE_ISSET_USE_WARNING_END - const nebula::HostAddr& get_node() const&; - nebula::HostAddr get_node() &&; - template - nebula::HostAddr& set_node(T_DropHostFromZoneReq_node_struct_setter&& node_) { - node = std::forward(node_); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - __isset.node = true; + template + FOLLY_ERASE ::apache::thrift::field_ref is_new_ref() const& { + return {this->is_new, __isset.is_new}; + } + + template + FOLLY_ERASE ::apache::thrift::field_ref is_new_ref() const&& { + return {std::move(this->is_new), __isset.is_new}; + } + + template + FOLLY_ERASE ::apache::thrift::field_ref is_new_ref() & { + return {this->is_new, __isset.is_new}; + } + + template + FOLLY_ERASE ::apache::thrift::field_ref is_new_ref() && { + return {std::move(this->is_new), __isset.is_new}; + } +THRIFT_IGNORE_ISSET_USE_WARNING_END + const ::std::vector& get_hosts() const&; + ::std::vector get_hosts() &&; + + template > + ::std::vector& set_hosts(T_AddHostsIntoZoneReq_hosts_struct_setter&& hosts_) { + hosts = std::forward(hosts_); +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + __isset.hosts = true; THRIFT_IGNORE_ISSET_USE_WARNING_END - return node; + return hosts; } const ::std::string& get_zone_name() const& { @@ -23968,15 +24379,27 @@ THRIFT_IGNORE_ISSET_USE_WARNING_END return std::move(zone_name); } - template - ::std::string& set_zone_name(T_DropHostFromZoneReq_zone_name_struct_setter&& zone_name_) { - zone_name = std::forward(zone_name_); + template + ::std::string& set_zone_name(T_AddHostsIntoZoneReq_zone_name_struct_setter&& zone_name_) { + zone_name = std::forward(zone_name_); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN __isset.zone_name = true; THRIFT_IGNORE_ISSET_USE_WARNING_END return zone_name; } + bool get_is_new() const { + return is_new; + } + + bool& set_is_new(bool is_new_) { + is_new = is_new_; +THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + __isset.is_new = true; +THRIFT_IGNORE_ISSET_USE_WARNING_END + return is_new; + } + template uint32_t read(Protocol_* iprot); template @@ -23990,12 +24413,12 @@ THRIFT_IGNORE_ISSET_USE_WARNING_END template void readNoXfer(Protocol_* iprot); - friend class ::apache::thrift::Cpp2Ops< DropHostFromZoneReq >; - friend void swap(DropHostFromZoneReq& a, DropHostFromZoneReq& b); + friend class ::apache::thrift::Cpp2Ops< AddHostsIntoZoneReq >; + friend void swap(AddHostsIntoZoneReq& a, AddHostsIntoZoneReq& b); }; template -uint32_t DropHostFromZoneReq::read(Protocol_* iprot) { +uint32_t AddHostsIntoZoneReq::read(Protocol_* iprot) { auto _xferStart = iprot->getCursorPosition(); readNoXfer(iprot); return iprot->getCursorPosition() - _xferStart; diff --git a/src/interface/gen-cpp2/meta_types.tcc b/src/interface/gen-cpp2/meta_types.tcc index fc7cb4c1..0dd4d90a 100644 --- a/src/interface/gen-cpp2/meta_types.tcc +++ b/src/interface/gen-cpp2/meta_types.tcc @@ -443,6 +443,20 @@ struct TccStructTraits<::nebula::meta::cpp2::ListEdgesResp> { apache::thrift::protocol::TType& _ftype) noexcept; }; template <> +struct TccStructTraits<::nebula::meta::cpp2::AddHostsReq> { + static void translateFieldName( + folly::StringPiece _fname, + int16_t& fid, + apache::thrift::protocol::TType& _ftype) noexcept; +}; +template <> +struct TccStructTraits<::nebula::meta::cpp2::DropHostsReq> { + static void translateFieldName( + folly::StringPiece _fname, + int16_t& fid, + apache::thrift::protocol::TType& _ftype) noexcept; +}; +template <> struct TccStructTraits<::nebula::meta::cpp2::ListHostsReq> { static void translateFieldName( folly::StringPiece _fname, @@ -870,7 +884,7 @@ struct TccStructTraits<::nebula::meta::cpp2::ListIndexStatusResp> { apache::thrift::protocol::TType& _ftype) noexcept; }; template <> -struct TccStructTraits<::nebula::meta::cpp2::AddZoneReq> { +struct TccStructTraits<::nebula::meta::cpp2::MergeZoneReq> { static void translateFieldName( folly::StringPiece _fname, int16_t& fid, @@ -884,14 +898,21 @@ struct TccStructTraits<::nebula::meta::cpp2::DropZoneReq> { apache::thrift::protocol::TType& _ftype) noexcept; }; template <> -struct TccStructTraits<::nebula::meta::cpp2::AddHostIntoZoneReq> { +struct TccStructTraits<::nebula::meta::cpp2::SplitZoneReq> { static void translateFieldName( folly::StringPiece _fname, int16_t& fid, apache::thrift::protocol::TType& _ftype) noexcept; }; template <> -struct TccStructTraits<::nebula::meta::cpp2::DropHostFromZoneReq> { +struct TccStructTraits<::nebula::meta::cpp2::RenameZoneReq> { + static void translateFieldName( + folly::StringPiece _fname, + int16_t& fid, + apache::thrift::protocol::TType& _ftype) noexcept; +}; +template <> +struct TccStructTraits<::nebula::meta::cpp2::AddHostsIntoZoneReq> { static void translateFieldName( folly::StringPiece _fname, int16_t& fid, @@ -2464,15 +2485,18 @@ _readField_vid_type: iprot, 6, 7, - apache::thrift::protocol::T_STRING))) { + apache::thrift::protocol::T_LIST))) { goto _loop; } -_readField_group_name: +_readField_zone_names: { - ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::readWithContext(*iprot, this->group_name, _readState); + _readState.beforeSubobject(iprot); + this->zone_names = ::std::vector<::std::string>(); + ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::binary>, ::std::vector<::std::string>>::readWithContext(*iprot, this->zone_names, _readState); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - this->__isset.group_name = true; + this->__isset.zone_names = true; THRIFT_IGNORE_ISSET_USE_WARNING_END + _readState.afterSubobject(iprot); } if (UNLIKELY(!_readState.advanceToNextField( @@ -2578,8 +2602,8 @@ _loop: } case 7: { - if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING))) { - goto _readField_group_name; + if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) { + goto _readField_zone_names; } else { goto _skip; } @@ -2627,10 +2651,8 @@ uint32_t SpaceDesc::serializedSize(Protocol_ const* prot_) const { xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::serializedSize(*prot_, this->collate_name); xfer += prot_->serializedFieldSize("vid_type", apache::thrift::protocol::T_STRUCT, 6); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::structure, ::nebula::meta::cpp2::ColumnTypeDef>::serializedSize(*prot_, this->vid_type); - if (this->group_name_ref().has_value()) { - xfer += prot_->serializedFieldSize("group_name", apache::thrift::protocol::T_STRING, 7); - xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::serializedSize(*prot_, this->group_name); - } + xfer += prot_->serializedFieldSize("zone_names", apache::thrift::protocol::T_LIST, 7); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::binary>, ::std::vector<::std::string>>::serializedSize(*prot_, this->zone_names); if (this->isolation_level_ref().has_value()) { xfer += prot_->serializedFieldSize("isolation_level", apache::thrift::protocol::T_I32, 8); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::enumeration, ::nebula::meta::cpp2::IsolationLevel>::serializedSize(*prot_, this->isolation_level); @@ -2659,10 +2681,8 @@ uint32_t SpaceDesc::serializedSizeZC(Protocol_ const* prot_) const { xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::serializedSize(*prot_, this->collate_name); xfer += prot_->serializedFieldSize("vid_type", apache::thrift::protocol::T_STRUCT, 6); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::structure, ::nebula::meta::cpp2::ColumnTypeDef>::serializedSize(*prot_, this->vid_type); - if (this->group_name_ref().has_value()) { - xfer += prot_->serializedFieldSize("group_name", apache::thrift::protocol::T_STRING, 7); - xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::serializedSize(*prot_, this->group_name); - } + xfer += prot_->serializedFieldSize("zone_names", apache::thrift::protocol::T_LIST, 7); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::binary>, ::std::vector<::std::string>>::serializedSize(*prot_, this->zone_names); if (this->isolation_level_ref().has_value()) { xfer += prot_->serializedFieldSize("isolation_level", apache::thrift::protocol::T_I32, 8); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::enumeration, ::nebula::meta::cpp2::IsolationLevel>::serializedSize(*prot_, this->isolation_level); @@ -2697,11 +2717,9 @@ uint32_t SpaceDesc::write(Protocol_* prot_) const { xfer += prot_->writeFieldBegin("vid_type", apache::thrift::protocol::T_STRUCT, 6); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::structure, ::nebula::meta::cpp2::ColumnTypeDef>::write(*prot_, this->vid_type); xfer += prot_->writeFieldEnd(); - if (this->group_name_ref().has_value()) { - xfer += prot_->writeFieldBegin("group_name", apache::thrift::protocol::T_STRING, 7); - xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::write(*prot_, this->group_name); - xfer += prot_->writeFieldEnd(); - } + xfer += prot_->writeFieldBegin("zone_names", apache::thrift::protocol::T_LIST, 7); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::binary>, ::std::vector<::std::string>>::write(*prot_, this->zone_names); + xfer += prot_->writeFieldEnd(); if (this->isolation_level_ref().has_value()) { xfer += prot_->writeFieldBegin("isolation_level", apache::thrift::protocol::T_I32, 8); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::enumeration, ::nebula::meta::cpp2::IsolationLevel>::write(*prot_, this->isolation_level); @@ -9548,6 +9566,232 @@ extern template uint32_t ListEdgesResp::serializedSizeZC<>(apache::thrift::Compa }}} // nebula::meta::cpp2 namespace nebula { namespace meta { namespace cpp2 { +template +void AddHostsReq::readNoXfer(Protocol_* iprot) { + apache::thrift::detail::ProtocolReaderStructReadState _readState; + + _readState.readStructBegin(iprot); + + using apache::thrift::TProtocolException; + + + if (UNLIKELY(!_readState.advanceToNextField( + iprot, + 0, + 1, + apache::thrift::protocol::T_LIST))) { + goto _loop; + } +_readField_hosts: + { + _readState.beforeSubobject(iprot); + this->hosts = ::std::vector(); + ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector>::readWithContext(*iprot, this->hosts, _readState); + THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + this->__isset.hosts = true; + THRIFT_IGNORE_ISSET_USE_WARNING_END + _readState.afterSubobject(iprot); + } + + if (UNLIKELY(!_readState.advanceToNextField( + iprot, + 1, + 0, + apache::thrift::protocol::T_STOP))) { + goto _loop; + } + +_end: + _readState.readStructEnd(iprot); + + return; + +_loop: + _readState.afterAdvanceFailure(iprot); + if (_readState.atStop()) { + goto _end; + } + if (iprot->kUsesFieldNames()) { + _readState.template fillFieldTraitsFromName>(); + } + + switch (_readState.fieldId) { + case 1: + { + if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) { + goto _readField_hosts; + } else { + goto _skip; + } + } + default: + { +_skip: + _readState.skip(iprot); + _readState.readFieldEnd(iprot); + _readState.readFieldBeginNoInline(iprot); + goto _loop; + } + } +} + +template +uint32_t AddHostsReq::serializedSize(Protocol_ const* prot_) const { + uint32_t xfer = 0; + xfer += prot_->serializedStructSize("AddHostsReq"); + xfer += prot_->serializedFieldSize("hosts", apache::thrift::protocol::T_LIST, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector>::serializedSize(*prot_, this->hosts); + xfer += prot_->serializedSizeStop(); + return xfer; +} + +template +uint32_t AddHostsReq::serializedSizeZC(Protocol_ const* prot_) const { + uint32_t xfer = 0; + xfer += prot_->serializedStructSize("AddHostsReq"); + xfer += prot_->serializedFieldSize("hosts", apache::thrift::protocol::T_LIST, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector>::serializedSize(*prot_, this->hosts); + xfer += prot_->serializedSizeStop(); + return xfer; +} + +template +uint32_t AddHostsReq::write(Protocol_* prot_) const { + uint32_t xfer = 0; + xfer += prot_->writeStructBegin("AddHostsReq"); + xfer += prot_->writeFieldBegin("hosts", apache::thrift::protocol::T_LIST, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector>::write(*prot_, this->hosts); + xfer += prot_->writeFieldEnd(); + xfer += prot_->writeFieldStop(); + xfer += prot_->writeStructEnd(); + return xfer; +} + +extern template void AddHostsReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); +extern template uint32_t AddHostsReq::write<>(apache::thrift::BinaryProtocolWriter*) const; +extern template uint32_t AddHostsReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; +extern template uint32_t AddHostsReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; +extern template void AddHostsReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); +extern template uint32_t AddHostsReq::write<>(apache::thrift::CompactProtocolWriter*) const; +extern template uint32_t AddHostsReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; +extern template uint32_t AddHostsReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; + +}}} // nebula::meta::cpp2 +namespace nebula { namespace meta { namespace cpp2 { + +template +void DropHostsReq::readNoXfer(Protocol_* iprot) { + apache::thrift::detail::ProtocolReaderStructReadState _readState; + + _readState.readStructBegin(iprot); + + using apache::thrift::TProtocolException; + + + if (UNLIKELY(!_readState.advanceToNextField( + iprot, + 0, + 1, + apache::thrift::protocol::T_LIST))) { + goto _loop; + } +_readField_hosts: + { + _readState.beforeSubobject(iprot); + this->hosts = ::std::vector(); + ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector>::readWithContext(*iprot, this->hosts, _readState); + THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + this->__isset.hosts = true; + THRIFT_IGNORE_ISSET_USE_WARNING_END + _readState.afterSubobject(iprot); + } + + if (UNLIKELY(!_readState.advanceToNextField( + iprot, + 1, + 0, + apache::thrift::protocol::T_STOP))) { + goto _loop; + } + +_end: + _readState.readStructEnd(iprot); + + return; + +_loop: + _readState.afterAdvanceFailure(iprot); + if (_readState.atStop()) { + goto _end; + } + if (iprot->kUsesFieldNames()) { + _readState.template fillFieldTraitsFromName>(); + } + + switch (_readState.fieldId) { + case 1: + { + if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) { + goto _readField_hosts; + } else { + goto _skip; + } + } + default: + { +_skip: + _readState.skip(iprot); + _readState.readFieldEnd(iprot); + _readState.readFieldBeginNoInline(iprot); + goto _loop; + } + } +} + +template +uint32_t DropHostsReq::serializedSize(Protocol_ const* prot_) const { + uint32_t xfer = 0; + xfer += prot_->serializedStructSize("DropHostsReq"); + xfer += prot_->serializedFieldSize("hosts", apache::thrift::protocol::T_LIST, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector>::serializedSize(*prot_, this->hosts); + xfer += prot_->serializedSizeStop(); + return xfer; +} + +template +uint32_t DropHostsReq::serializedSizeZC(Protocol_ const* prot_) const { + uint32_t xfer = 0; + xfer += prot_->serializedStructSize("DropHostsReq"); + xfer += prot_->serializedFieldSize("hosts", apache::thrift::protocol::T_LIST, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector>::serializedSize(*prot_, this->hosts); + xfer += prot_->serializedSizeStop(); + return xfer; +} + +template +uint32_t DropHostsReq::write(Protocol_* prot_) const { + uint32_t xfer = 0; + xfer += prot_->writeStructBegin("DropHostsReq"); + xfer += prot_->writeFieldBegin("hosts", apache::thrift::protocol::T_LIST, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector>::write(*prot_, this->hosts); + xfer += prot_->writeFieldEnd(); + xfer += prot_->writeFieldStop(); + xfer += prot_->writeStructEnd(); + return xfer; +} + +extern template void DropHostsReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); +extern template uint32_t DropHostsReq::write<>(apache::thrift::BinaryProtocolWriter*) const; +extern template uint32_t DropHostsReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; +extern template uint32_t DropHostsReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; +extern template void DropHostsReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); +extern template uint32_t DropHostsReq::write<>(apache::thrift::CompactProtocolWriter*) const; +extern template uint32_t DropHostsReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; +extern template uint32_t DropHostsReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; + +}}} // nebula::meta::cpp2 +namespace nebula { namespace meta { namespace cpp2 { + template void ListHostsReq::readNoXfer(Protocol_* iprot) { apache::thrift::detail::ProtocolReaderStructReadState _readState; @@ -19023,7 +19267,7 @@ extern template uint32_t ListIndexStatusResp::serializedSizeZC<>(apache::thrift: namespace nebula { namespace meta { namespace cpp2 { template -void AddZoneReq::readNoXfer(Protocol_* iprot) { +void MergeZoneReq::readNoXfer(Protocol_* iprot) { apache::thrift::detail::ProtocolReaderStructReadState _readState; _readState.readStructBegin(iprot); @@ -19035,33 +19279,33 @@ void AddZoneReq::readNoXfer(Protocol_* iprot) { iprot, 0, 1, - apache::thrift::protocol::T_STRING))) { + apache::thrift::protocol::T_LIST))) { goto _loop; } -_readField_zone_name: +_readField_zones: { - ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::readWithContext(*iprot, this->zone_name, _readState); + _readState.beforeSubobject(iprot); + this->zones = ::std::vector<::std::string>(); + ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::binary>, ::std::vector<::std::string>>::readWithContext(*iprot, this->zones, _readState); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - this->__isset.zone_name = true; + this->__isset.zones = true; THRIFT_IGNORE_ISSET_USE_WARNING_END + _readState.afterSubobject(iprot); } if (UNLIKELY(!_readState.advanceToNextField( iprot, 1, 2, - apache::thrift::protocol::T_LIST))) { + apache::thrift::protocol::T_STRING))) { goto _loop; } -_readField_nodes: +_readField_zone_name: { - _readState.beforeSubobject(iprot); - this->nodes = ::std::vector(); - ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector>::readWithContext(*iprot, this->nodes, _readState); + ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::readWithContext(*iprot, this->zone_name, _readState); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - this->__isset.nodes = true; + this->__isset.zone_name = true; THRIFT_IGNORE_ISSET_USE_WARNING_END - _readState.afterSubobject(iprot); } if (UNLIKELY(!_readState.advanceToNextField( @@ -19083,22 +19327,22 @@ _loop: goto _end; } if (iprot->kUsesFieldNames()) { - _readState.template fillFieldTraitsFromName>(); + _readState.template fillFieldTraitsFromName>(); } switch (_readState.fieldId) { case 1: { - if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING))) { - goto _readField_zone_name; + if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) { + goto _readField_zones; } else { goto _skip; } } case 2: { - if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) { - goto _readField_nodes; + if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING))) { + goto _readField_zone_name; } else { goto _skip; } @@ -19115,52 +19359,52 @@ _skip: } template -uint32_t AddZoneReq::serializedSize(Protocol_ const* prot_) const { +uint32_t MergeZoneReq::serializedSize(Protocol_ const* prot_) const { uint32_t xfer = 0; - xfer += prot_->serializedStructSize("AddZoneReq"); - xfer += prot_->serializedFieldSize("zone_name", apache::thrift::protocol::T_STRING, 1); + xfer += prot_->serializedStructSize("MergeZoneReq"); + xfer += prot_->serializedFieldSize("zones", apache::thrift::protocol::T_LIST, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::binary>, ::std::vector<::std::string>>::serializedSize(*prot_, this->zones); + xfer += prot_->serializedFieldSize("zone_name", apache::thrift::protocol::T_STRING, 2); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::serializedSize(*prot_, this->zone_name); - xfer += prot_->serializedFieldSize("nodes", apache::thrift::protocol::T_LIST, 2); - xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector>::serializedSize(*prot_, this->nodes); xfer += prot_->serializedSizeStop(); return xfer; } template -uint32_t AddZoneReq::serializedSizeZC(Protocol_ const* prot_) const { +uint32_t MergeZoneReq::serializedSizeZC(Protocol_ const* prot_) const { uint32_t xfer = 0; - xfer += prot_->serializedStructSize("AddZoneReq"); - xfer += prot_->serializedFieldSize("zone_name", apache::thrift::protocol::T_STRING, 1); + xfer += prot_->serializedStructSize("MergeZoneReq"); + xfer += prot_->serializedFieldSize("zones", apache::thrift::protocol::T_LIST, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::binary>, ::std::vector<::std::string>>::serializedSize(*prot_, this->zones); + xfer += prot_->serializedFieldSize("zone_name", apache::thrift::protocol::T_STRING, 2); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::serializedSize(*prot_, this->zone_name); - xfer += prot_->serializedFieldSize("nodes", apache::thrift::protocol::T_LIST, 2); - xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector>::serializedSize(*prot_, this->nodes); xfer += prot_->serializedSizeStop(); return xfer; } template -uint32_t AddZoneReq::write(Protocol_* prot_) const { +uint32_t MergeZoneReq::write(Protocol_* prot_) const { uint32_t xfer = 0; - xfer += prot_->writeStructBegin("AddZoneReq"); - xfer += prot_->writeFieldBegin("zone_name", apache::thrift::protocol::T_STRING, 1); - xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::write(*prot_, this->zone_name); + xfer += prot_->writeStructBegin("MergeZoneReq"); + xfer += prot_->writeFieldBegin("zones", apache::thrift::protocol::T_LIST, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::binary>, ::std::vector<::std::string>>::write(*prot_, this->zones); xfer += prot_->writeFieldEnd(); - xfer += prot_->writeFieldBegin("nodes", apache::thrift::protocol::T_LIST, 2); - xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector>::write(*prot_, this->nodes); + xfer += prot_->writeFieldBegin("zone_name", apache::thrift::protocol::T_STRING, 2); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::write(*prot_, this->zone_name); xfer += prot_->writeFieldEnd(); xfer += prot_->writeFieldStop(); xfer += prot_->writeStructEnd(); return xfer; } -extern template void AddZoneReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); -extern template uint32_t AddZoneReq::write<>(apache::thrift::BinaryProtocolWriter*) const; -extern template uint32_t AddZoneReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; -extern template uint32_t AddZoneReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; -extern template void AddZoneReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); -extern template uint32_t AddZoneReq::write<>(apache::thrift::CompactProtocolWriter*) const; -extern template uint32_t AddZoneReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; -extern template uint32_t AddZoneReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; +extern template void MergeZoneReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); +extern template uint32_t MergeZoneReq::write<>(apache::thrift::BinaryProtocolWriter*) const; +extern template uint32_t MergeZoneReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; +extern template uint32_t MergeZoneReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; +extern template void MergeZoneReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); +extern template uint32_t MergeZoneReq::write<>(apache::thrift::CompactProtocolWriter*) const; +extern template uint32_t MergeZoneReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; +extern template uint32_t MergeZoneReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; }}} // nebula::meta::cpp2 namespace nebula { namespace meta { namespace cpp2 { @@ -19276,7 +19520,7 @@ extern template uint32_t DropZoneReq::serializedSizeZC<>(apache::thrift::Compact namespace nebula { namespace meta { namespace cpp2 { template -void AddHostIntoZoneReq::readNoXfer(Protocol_* iprot) { +void SplitZoneReq::readNoXfer(Protocol_* iprot) { apache::thrift::detail::ProtocolReaderStructReadState _readState; _readState.readStructBegin(iprot); @@ -19288,17 +19532,125 @@ void AddHostIntoZoneReq::readNoXfer(Protocol_* iprot) { iprot, 0, 1, - apache::thrift::protocol::T_STRUCT))) { + apache::thrift::protocol::T_STRING))) { goto _loop; } -_readField_node: +_readField_zone_name: { - _readState.beforeSubobject(iprot); - ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::structure, nebula::HostAddr>::readWithContext(*iprot, this->node, _readState); + ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::readWithContext(*iprot, this->zone_name, _readState); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - this->__isset.node = true; + this->__isset.zone_name = true; + THRIFT_IGNORE_ISSET_USE_WARNING_END + } + + if (UNLIKELY(!_readState.advanceToNextField( + iprot, + 1, + 0, + apache::thrift::protocol::T_STOP))) { + goto _loop; + } + +_end: + _readState.readStructEnd(iprot); + + return; + +_loop: + _readState.afterAdvanceFailure(iprot); + if (_readState.atStop()) { + goto _end; + } + if (iprot->kUsesFieldNames()) { + _readState.template fillFieldTraitsFromName>(); + } + + switch (_readState.fieldId) { + case 1: + { + if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING))) { + goto _readField_zone_name; + } else { + goto _skip; + } + } + default: + { +_skip: + _readState.skip(iprot); + _readState.readFieldEnd(iprot); + _readState.readFieldBeginNoInline(iprot); + goto _loop; + } + } +} + +template +uint32_t SplitZoneReq::serializedSize(Protocol_ const* prot_) const { + uint32_t xfer = 0; + xfer += prot_->serializedStructSize("SplitZoneReq"); + xfer += prot_->serializedFieldSize("zone_name", apache::thrift::protocol::T_STRING, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::serializedSize(*prot_, this->zone_name); + xfer += prot_->serializedSizeStop(); + return xfer; +} + +template +uint32_t SplitZoneReq::serializedSizeZC(Protocol_ const* prot_) const { + uint32_t xfer = 0; + xfer += prot_->serializedStructSize("SplitZoneReq"); + xfer += prot_->serializedFieldSize("zone_name", apache::thrift::protocol::T_STRING, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::serializedSize(*prot_, this->zone_name); + xfer += prot_->serializedSizeStop(); + return xfer; +} + +template +uint32_t SplitZoneReq::write(Protocol_* prot_) const { + uint32_t xfer = 0; + xfer += prot_->writeStructBegin("SplitZoneReq"); + xfer += prot_->writeFieldBegin("zone_name", apache::thrift::protocol::T_STRING, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::write(*prot_, this->zone_name); + xfer += prot_->writeFieldEnd(); + xfer += prot_->writeFieldStop(); + xfer += prot_->writeStructEnd(); + return xfer; +} + +extern template void SplitZoneReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); +extern template uint32_t SplitZoneReq::write<>(apache::thrift::BinaryProtocolWriter*) const; +extern template uint32_t SplitZoneReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; +extern template uint32_t SplitZoneReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; +extern template void SplitZoneReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); +extern template uint32_t SplitZoneReq::write<>(apache::thrift::CompactProtocolWriter*) const; +extern template uint32_t SplitZoneReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; +extern template uint32_t SplitZoneReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; + +}}} // nebula::meta::cpp2 +namespace nebula { namespace meta { namespace cpp2 { + +template +void RenameZoneReq::readNoXfer(Protocol_* iprot) { + apache::thrift::detail::ProtocolReaderStructReadState _readState; + + _readState.readStructBegin(iprot); + + using apache::thrift::TProtocolException; + + + if (UNLIKELY(!_readState.advanceToNextField( + iprot, + 0, + 1, + apache::thrift::protocol::T_STRING))) { + goto _loop; + } +_readField_original_zone_name: + { + ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::readWithContext(*iprot, this->original_zone_name, _readState); + THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + this->__isset.original_zone_name = true; THRIFT_IGNORE_ISSET_USE_WARNING_END - _readState.afterSubobject(iprot); } if (UNLIKELY(!_readState.advanceToNextField( @@ -19335,14 +19687,14 @@ _loop: goto _end; } if (iprot->kUsesFieldNames()) { - _readState.template fillFieldTraitsFromName>(); + _readState.template fillFieldTraitsFromName>(); } switch (_readState.fieldId) { case 1: { - if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) { - goto _readField_node; + if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING))) { + goto _readField_original_zone_name; } else { goto _skip; } @@ -19367,11 +19719,11 @@ _skip: } template -uint32_t AddHostIntoZoneReq::serializedSize(Protocol_ const* prot_) const { +uint32_t RenameZoneReq::serializedSize(Protocol_ const* prot_) const { uint32_t xfer = 0; - xfer += prot_->serializedStructSize("AddHostIntoZoneReq"); - xfer += prot_->serializedFieldSize("node", apache::thrift::protocol::T_STRUCT, 1); - xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::structure, nebula::HostAddr>::serializedSize(*prot_, this->node); + xfer += prot_->serializedStructSize("RenameZoneReq"); + xfer += prot_->serializedFieldSize("original_zone_name", apache::thrift::protocol::T_STRING, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::serializedSize(*prot_, this->original_zone_name); xfer += prot_->serializedFieldSize("zone_name", apache::thrift::protocol::T_STRING, 2); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::serializedSize(*prot_, this->zone_name); xfer += prot_->serializedSizeStop(); @@ -19379,11 +19731,11 @@ uint32_t AddHostIntoZoneReq::serializedSize(Protocol_ const* prot_) const { } template -uint32_t AddHostIntoZoneReq::serializedSizeZC(Protocol_ const* prot_) const { +uint32_t RenameZoneReq::serializedSizeZC(Protocol_ const* prot_) const { uint32_t xfer = 0; - xfer += prot_->serializedStructSize("AddHostIntoZoneReq"); - xfer += prot_->serializedFieldSize("node", apache::thrift::protocol::T_STRUCT, 1); - xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::structure, nebula::HostAddr>::serializedSize(*prot_, this->node); + xfer += prot_->serializedStructSize("RenameZoneReq"); + xfer += prot_->serializedFieldSize("original_zone_name", apache::thrift::protocol::T_STRING, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::serializedSize(*prot_, this->original_zone_name); xfer += prot_->serializedFieldSize("zone_name", apache::thrift::protocol::T_STRING, 2); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::serializedSize(*prot_, this->zone_name); xfer += prot_->serializedSizeStop(); @@ -19391,11 +19743,11 @@ uint32_t AddHostIntoZoneReq::serializedSizeZC(Protocol_ const* prot_) const { } template -uint32_t AddHostIntoZoneReq::write(Protocol_* prot_) const { +uint32_t RenameZoneReq::write(Protocol_* prot_) const { uint32_t xfer = 0; - xfer += prot_->writeStructBegin("AddHostIntoZoneReq"); - xfer += prot_->writeFieldBegin("node", apache::thrift::protocol::T_STRUCT, 1); - xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::structure, nebula::HostAddr>::write(*prot_, this->node); + xfer += prot_->writeStructBegin("RenameZoneReq"); + xfer += prot_->writeFieldBegin("original_zone_name", apache::thrift::protocol::T_STRING, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::write(*prot_, this->original_zone_name); xfer += prot_->writeFieldEnd(); xfer += prot_->writeFieldBegin("zone_name", apache::thrift::protocol::T_STRING, 2); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::write(*prot_, this->zone_name); @@ -19405,20 +19757,20 @@ uint32_t AddHostIntoZoneReq::write(Protocol_* prot_) const { return xfer; } -extern template void AddHostIntoZoneReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); -extern template uint32_t AddHostIntoZoneReq::write<>(apache::thrift::BinaryProtocolWriter*) const; -extern template uint32_t AddHostIntoZoneReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; -extern template uint32_t AddHostIntoZoneReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; -extern template void AddHostIntoZoneReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); -extern template uint32_t AddHostIntoZoneReq::write<>(apache::thrift::CompactProtocolWriter*) const; -extern template uint32_t AddHostIntoZoneReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; -extern template uint32_t AddHostIntoZoneReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; +extern template void RenameZoneReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); +extern template uint32_t RenameZoneReq::write<>(apache::thrift::BinaryProtocolWriter*) const; +extern template uint32_t RenameZoneReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; +extern template uint32_t RenameZoneReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; +extern template void RenameZoneReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); +extern template uint32_t RenameZoneReq::write<>(apache::thrift::CompactProtocolWriter*) const; +extern template uint32_t RenameZoneReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; +extern template uint32_t RenameZoneReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; }}} // nebula::meta::cpp2 namespace nebula { namespace meta { namespace cpp2 { template -void DropHostFromZoneReq::readNoXfer(Protocol_* iprot) { +void AddHostsIntoZoneReq::readNoXfer(Protocol_* iprot) { apache::thrift::detail::ProtocolReaderStructReadState _readState; _readState.readStructBegin(iprot); @@ -19430,15 +19782,16 @@ void DropHostFromZoneReq::readNoXfer(Protocol_* iprot) { iprot, 0, 1, - apache::thrift::protocol::T_STRUCT))) { + apache::thrift::protocol::T_LIST))) { goto _loop; } -_readField_node: +_readField_hosts: { _readState.beforeSubobject(iprot); - ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::structure, nebula::HostAddr>::readWithContext(*iprot, this->node, _readState); + this->hosts = ::std::vector(); + ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector>::readWithContext(*iprot, this->hosts, _readState); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - this->__isset.node = true; + this->__isset.hosts = true; THRIFT_IGNORE_ISSET_USE_WARNING_END _readState.afterSubobject(iprot); } @@ -19461,6 +19814,21 @@ _readField_zone_name: if (UNLIKELY(!_readState.advanceToNextField( iprot, 2, + 3, + apache::thrift::protocol::T_BOOL))) { + goto _loop; + } +_readField_is_new: + { + ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::integral, bool>::readWithContext(*iprot, this->is_new, _readState); + THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN + this->__isset.is_new = true; + THRIFT_IGNORE_ISSET_USE_WARNING_END + } + + if (UNLIKELY(!_readState.advanceToNextField( + iprot, + 3, 0, apache::thrift::protocol::T_STOP))) { goto _loop; @@ -19477,14 +19845,14 @@ _loop: goto _end; } if (iprot->kUsesFieldNames()) { - _readState.template fillFieldTraitsFromName>(); + _readState.template fillFieldTraitsFromName>(); } switch (_readState.fieldId) { case 1: { - if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT))) { - goto _readField_node; + if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_LIST))) { + goto _readField_hosts; } else { goto _skip; } @@ -19497,6 +19865,14 @@ _loop: goto _skip; } } + case 3: + { + if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_BOOL))) { + goto _readField_is_new; + } else { + goto _skip; + } + } default: { _skip: @@ -19509,52 +19885,59 @@ _skip: } template -uint32_t DropHostFromZoneReq::serializedSize(Protocol_ const* prot_) const { +uint32_t AddHostsIntoZoneReq::serializedSize(Protocol_ const* prot_) const { uint32_t xfer = 0; - xfer += prot_->serializedStructSize("DropHostFromZoneReq"); - xfer += prot_->serializedFieldSize("node", apache::thrift::protocol::T_STRUCT, 1); - xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::structure, nebula::HostAddr>::serializedSize(*prot_, this->node); + xfer += prot_->serializedStructSize("AddHostsIntoZoneReq"); + xfer += prot_->serializedFieldSize("hosts", apache::thrift::protocol::T_LIST, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector>::serializedSize(*prot_, this->hosts); xfer += prot_->serializedFieldSize("zone_name", apache::thrift::protocol::T_STRING, 2); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::serializedSize(*prot_, this->zone_name); + xfer += prot_->serializedFieldSize("is_new", apache::thrift::protocol::T_BOOL, 3); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::integral, bool>::serializedSize(*prot_, this->is_new); xfer += prot_->serializedSizeStop(); return xfer; } template -uint32_t DropHostFromZoneReq::serializedSizeZC(Protocol_ const* prot_) const { +uint32_t AddHostsIntoZoneReq::serializedSizeZC(Protocol_ const* prot_) const { uint32_t xfer = 0; - xfer += prot_->serializedStructSize("DropHostFromZoneReq"); - xfer += prot_->serializedFieldSize("node", apache::thrift::protocol::T_STRUCT, 1); - xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::structure, nebula::HostAddr>::serializedSize(*prot_, this->node); + xfer += prot_->serializedStructSize("AddHostsIntoZoneReq"); + xfer += prot_->serializedFieldSize("hosts", apache::thrift::protocol::T_LIST, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector>::serializedSize(*prot_, this->hosts); xfer += prot_->serializedFieldSize("zone_name", apache::thrift::protocol::T_STRING, 2); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::serializedSize(*prot_, this->zone_name); + xfer += prot_->serializedFieldSize("is_new", apache::thrift::protocol::T_BOOL, 3); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::integral, bool>::serializedSize(*prot_, this->is_new); xfer += prot_->serializedSizeStop(); return xfer; } template -uint32_t DropHostFromZoneReq::write(Protocol_* prot_) const { +uint32_t AddHostsIntoZoneReq::write(Protocol_* prot_) const { uint32_t xfer = 0; - xfer += prot_->writeStructBegin("DropHostFromZoneReq"); - xfer += prot_->writeFieldBegin("node", apache::thrift::protocol::T_STRUCT, 1); - xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::structure, nebula::HostAddr>::write(*prot_, this->node); + xfer += prot_->writeStructBegin("AddHostsIntoZoneReq"); + xfer += prot_->writeFieldBegin("hosts", apache::thrift::protocol::T_LIST, 1); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector>::write(*prot_, this->hosts); xfer += prot_->writeFieldEnd(); xfer += prot_->writeFieldBegin("zone_name", apache::thrift::protocol::T_STRING, 2); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::write(*prot_, this->zone_name); xfer += prot_->writeFieldEnd(); + xfer += prot_->writeFieldBegin("is_new", apache::thrift::protocol::T_BOOL, 3); + xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::integral, bool>::write(*prot_, this->is_new); + xfer += prot_->writeFieldEnd(); xfer += prot_->writeFieldStop(); xfer += prot_->writeStructEnd(); return xfer; } -extern template void DropHostFromZoneReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); -extern template uint32_t DropHostFromZoneReq::write<>(apache::thrift::BinaryProtocolWriter*) const; -extern template uint32_t DropHostFromZoneReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; -extern template uint32_t DropHostFromZoneReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; -extern template void DropHostFromZoneReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); -extern template uint32_t DropHostFromZoneReq::write<>(apache::thrift::CompactProtocolWriter*) const; -extern template uint32_t DropHostFromZoneReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; -extern template uint32_t DropHostFromZoneReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; +extern template void AddHostsIntoZoneReq::readNoXfer<>(apache::thrift::BinaryProtocolReader*); +extern template uint32_t AddHostsIntoZoneReq::write<>(apache::thrift::BinaryProtocolWriter*) const; +extern template uint32_t AddHostsIntoZoneReq::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; +extern template uint32_t AddHostsIntoZoneReq::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; +extern template void AddHostsIntoZoneReq::readNoXfer<>(apache::thrift::CompactProtocolReader*); +extern template uint32_t AddHostsIntoZoneReq::write<>(apache::thrift::CompactProtocolWriter*) const; +extern template uint32_t AddHostsIntoZoneReq::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; +extern template uint32_t AddHostsIntoZoneReq::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; }}} // nebula::meta::cpp2 namespace nebula { namespace meta { namespace cpp2 { diff --git a/src/interface/gen-cpp2/meta_visit_by_thrift_field_metadata.h b/src/interface/gen-cpp2/meta_visit_by_thrift_field_metadata.h index c879eeb2..a2705854 100644 --- a/src/interface/gen-cpp2/meta_visit_by_thrift_field_metadata.h +++ b/src/interface/gen-cpp2/meta_visit_by_thrift_field_metadata.h @@ -137,7 +137,7 @@ struct VisitByThriftId<::nebula::meta::cpp2::SpaceDesc> { case 6: return f(5, static_cast(t).vid_type_ref()); case 7: - return f(6, static_cast(t).group_name_ref()); + return f(6, static_cast(t).zone_names_ref()); case 8: return f(7, static_cast(t).isolation_level_ref()); case 9: @@ -803,6 +803,32 @@ struct VisitByThriftId<::nebula::meta::cpp2::ListEdgesResp> { } }; +template <> +struct VisitByThriftId<::nebula::meta::cpp2::AddHostsReq> { + template + void operator()(FOLLY_MAYBE_UNUSED F&& f, size_t id, FOLLY_MAYBE_UNUSED T&& t) const { + switch (id) { + case 1: + return f(0, static_cast(t).hosts_ref()); + default: + throwInvalidThriftId(id, "::nebula::meta::cpp2::AddHostsReq"); + } + } +}; + +template <> +struct VisitByThriftId<::nebula::meta::cpp2::DropHostsReq> { + template + void operator()(FOLLY_MAYBE_UNUSED F&& f, size_t id, FOLLY_MAYBE_UNUSED T&& t) const { + switch (id) { + case 1: + return f(0, static_cast(t).hosts_ref()); + default: + throwInvalidThriftId(id, "::nebula::meta::cpp2::DropHostsReq"); + } + } +}; + template <> struct VisitByThriftId<::nebula::meta::cpp2::ListHostsReq> { template @@ -1771,16 +1797,16 @@ struct VisitByThriftId<::nebula::meta::cpp2::ListIndexStatusResp> { }; template <> -struct VisitByThriftId<::nebula::meta::cpp2::AddZoneReq> { +struct VisitByThriftId<::nebula::meta::cpp2::MergeZoneReq> { template void operator()(FOLLY_MAYBE_UNUSED F&& f, size_t id, FOLLY_MAYBE_UNUSED T&& t) const { switch (id) { case 1: - return f(0, static_cast(t).zone_name_ref()); + return f(0, static_cast(t).zones_ref()); case 2: - return f(1, static_cast(t).nodes_ref()); + return f(1, static_cast(t).zone_name_ref()); default: - throwInvalidThriftId(id, "::nebula::meta::cpp2::AddZoneReq"); + throwInvalidThriftId(id, "::nebula::meta::cpp2::MergeZoneReq"); } } }; @@ -1799,31 +1825,46 @@ struct VisitByThriftId<::nebula::meta::cpp2::DropZoneReq> { }; template <> -struct VisitByThriftId<::nebula::meta::cpp2::AddHostIntoZoneReq> { +struct VisitByThriftId<::nebula::meta::cpp2::SplitZoneReq> { template void operator()(FOLLY_MAYBE_UNUSED F&& f, size_t id, FOLLY_MAYBE_UNUSED T&& t) const { switch (id) { case 1: - return f(0, static_cast(t).node_ref()); + return f(0, static_cast(t).zone_name_ref()); + default: + throwInvalidThriftId(id, "::nebula::meta::cpp2::SplitZoneReq"); + } + } +}; + +template <> +struct VisitByThriftId<::nebula::meta::cpp2::RenameZoneReq> { + template + void operator()(FOLLY_MAYBE_UNUSED F&& f, size_t id, FOLLY_MAYBE_UNUSED T&& t) const { + switch (id) { + case 1: + return f(0, static_cast(t).original_zone_name_ref()); case 2: return f(1, static_cast(t).zone_name_ref()); default: - throwInvalidThriftId(id, "::nebula::meta::cpp2::AddHostIntoZoneReq"); + throwInvalidThriftId(id, "::nebula::meta::cpp2::RenameZoneReq"); } } }; template <> -struct VisitByThriftId<::nebula::meta::cpp2::DropHostFromZoneReq> { +struct VisitByThriftId<::nebula::meta::cpp2::AddHostsIntoZoneReq> { template void operator()(FOLLY_MAYBE_UNUSED F&& f, size_t id, FOLLY_MAYBE_UNUSED T&& t) const { switch (id) { case 1: - return f(0, static_cast(t).node_ref()); + return f(0, static_cast(t).hosts_ref()); case 2: return f(1, static_cast(t).zone_name_ref()); + case 3: + return f(2, static_cast(t).is_new_ref()); default: - throwInvalidThriftId(id, "::nebula::meta::cpp2::DropHostFromZoneReq"); + throwInvalidThriftId(id, "::nebula::meta::cpp2::AddHostsIntoZoneReq"); } } }; diff --git a/src/interface/gen-cpp2/storage_data.cpp b/src/interface/gen-cpp2/storage_data.cpp index fb73104e..38e1db67 100644 --- a/src/interface/gen-cpp2/storage_data.cpp +++ b/src/interface/gen-cpp2/storage_data.cpp @@ -716,16 +716,13 @@ const std::array TStructDataStorage<::nebula::storage::cpp2: TType::T_STRUCT, }}; -const std::array TStructDataStorage<::nebula::storage::cpp2::ScanCursor>::fields_names = {{ - "has_next", +const std::array TStructDataStorage<::nebula::storage::cpp2::ScanCursor>::fields_names = {{ "next_cursor", }}; -const std::array TStructDataStorage<::nebula::storage::cpp2::ScanCursor>::fields_ids = {{ - 3, - 4, +const std::array TStructDataStorage<::nebula::storage::cpp2::ScanCursor>::fields_ids = {{ + 1, }}; -const std::array TStructDataStorage<::nebula::storage::cpp2::ScanCursor>::fields_types = {{ - TType::T_BOOL, +const std::array TStructDataStorage<::nebula::storage::cpp2::ScanCursor>::fields_types = {{ TType::T_STRING, }}; diff --git a/src/interface/gen-cpp2/storage_data.h b/src/interface/gen-cpp2/storage_data.h index 04fc8a3e..3c19167e 100644 --- a/src/interface/gen-cpp2/storage_data.h +++ b/src/interface/gen-cpp2/storage_data.h @@ -300,7 +300,7 @@ template <> struct TStructDataStorage<::nebula::storage::cpp2::LookupAndTraverse }; template <> struct TStructDataStorage<::nebula::storage::cpp2::ScanCursor> { - static constexpr const std::size_t fields_size = 2; + static constexpr const std::size_t fields_size = 1; static const std::array fields_names; static const std::array fields_ids; static const std::array fields_types; diff --git a/src/interface/gen-cpp2/storage_for_each_field.h b/src/interface/gen-cpp2/storage_for_each_field.h index 0a95af28..50480b5f 100644 --- a/src/interface/gen-cpp2/storage_for_each_field.h +++ b/src/interface/gen-cpp2/storage_for_each_field.h @@ -402,8 +402,7 @@ template <> struct ForEachField<::nebula::storage::cpp2::ScanCursor> { template void operator()(FOLLY_MAYBE_UNUSED F&& f, FOLLY_MAYBE_UNUSED T&&... t) const { - f(0, static_cast(t).has_next_ref()...); - f(1, static_cast(t).next_cursor_ref()...); + f(0, static_cast(t).next_cursor_ref()...); } }; diff --git a/src/interface/gen-cpp2/storage_metadata.cpp b/src/interface/gen-cpp2/storage_metadata.cpp index 0f394adc..5bea95cf 100644 --- a/src/interface/gen-cpp2/storage_metadata.cpp +++ b/src/interface/gen-cpp2/storage_metadata.cpp @@ -1051,8 +1051,7 @@ StructMetadata<::nebula::storage::cpp2::ScanCursor>::gen(ThriftMetadata& metadat storage_ScanCursor.is_union_ref() = false; static const EncodedThriftField storage_ScanCursor_fields[] = { - std::make_tuple(3, "has_next", false, std::make_unique(ThriftPrimitiveType::THRIFT_BOOL_TYPE), std::vector{}), - std::make_tuple(4, "next_cursor", true, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{}), + std::make_tuple(1, "next_cursor", true, std::make_unique(ThriftPrimitiveType::THRIFT_BINARY_TYPE), std::vector{}), }; for (const auto& f : storage_ScanCursor_fields) { ::apache::thrift::metadata::ThriftField field; diff --git a/src/interface/gen-cpp2/storage_types.cpp b/src/interface/gen-cpp2/storage_types.cpp index ff644593..5ec76ade 100644 --- a/src/interface/gen-cpp2/storage_types.cpp +++ b/src/interface/gen-cpp2/storage_types.cpp @@ -4995,16 +4995,13 @@ void TccStructTraits<::nebula::storage::cpp2::ScanCursor>::translateFieldName( namespace nebula { namespace storage { namespace cpp2 { THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN -ScanCursor::ScanCursor(apache::thrift::FragileConstructor, bool has_next__arg, ::std::string next_cursor__arg) : - has_next(std::move(has_next__arg)), +ScanCursor::ScanCursor(apache::thrift::FragileConstructor, ::std::string next_cursor__arg) : next_cursor(std::move(next_cursor__arg)) { - __isset.has_next = true; __isset.next_cursor = true; } THRIFT_IGNORE_ISSET_USE_WARNING_END void ScanCursor::__clear() { // clear all fields - has_next = 0; next_cursor = apache::thrift::StringTraits< std::string>::fromStringLiteral(""); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN __isset = {}; @@ -5015,9 +5012,6 @@ bool ScanCursor::operator==(const ScanCursor& rhs) const { (void)rhs; auto& lhs = *this; (void)lhs; - if (!(lhs.has_next == rhs.has_next)) { - return false; - } if (lhs.next_cursor_ref().has_value() != rhs.next_cursor_ref().has_value()) { return false; } @@ -5033,9 +5027,6 @@ bool ScanCursor::operator<(const ScanCursor& rhs) const { (void)rhs; auto& lhs = *this; (void)lhs; - if (!(lhs.has_next == rhs.has_next)) { - return lhs.has_next < rhs.has_next; - } if (lhs.next_cursor_ref().has_value() != rhs.next_cursor_ref().has_value()) { return lhs.next_cursor_ref().has_value() < rhs.next_cursor_ref().has_value(); } @@ -5050,7 +5041,6 @@ bool ScanCursor::operator<(const ScanCursor& rhs) const { void swap(ScanCursor& a, ScanCursor& b) { using ::std::swap; - swap(a.has_next_ref().value(), b.has_next_ref().value()); swap(a.next_cursor_ref().value_unchecked(), b.next_cursor_ref().value_unchecked()); THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN swap(a.__isset, b.__isset); diff --git a/src/interface/gen-cpp2/storage_types.h b/src/interface/gen-cpp2/storage_types.h index aef45952..f78b770f 100644 --- a/src/interface/gen-cpp2/storage_types.h +++ b/src/interface/gen-cpp2/storage_types.h @@ -148,7 +148,6 @@ struct parts; struct indices; struct traverse_spec; struct common; -struct has_next; struct next_cursor; struct space_id; struct parts; @@ -781,10 +780,6 @@ APACHE_THRIFT_DEFINE_ACCESSOR(traverse_spec); #define APACHE_THRIFT_ACCESSOR_common APACHE_THRIFT_DEFINE_ACCESSOR(common); #endif -#ifndef APACHE_THRIFT_ACCESSOR_has_next -#define APACHE_THRIFT_ACCESSOR_has_next -APACHE_THRIFT_DEFINE_ACCESSOR(has_next); -#endif #ifndef APACHE_THRIFT_ACCESSOR_next_cursor #define APACHE_THRIFT_ACCESSOR_next_cursor APACHE_THRIFT_DEFINE_ACCESSOR(next_cursor); @@ -9391,11 +9386,10 @@ class ScanCursor final { public: THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - ScanCursor() : - has_next(0) {} + ScanCursor() {} // FragileConstructor for use in initialization lists only. [[deprecated("This constructor is deprecated")]] - ScanCursor(apache::thrift::FragileConstructor, bool has_next__arg, ::std::string next_cursor__arg); + ScanCursor(apache::thrift::FragileConstructor, ::std::string next_cursor__arg); ScanCursor(ScanCursor&&) = default; @@ -9407,15 +9401,12 @@ THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN ScanCursor& operator=(const ScanCursor&) = default; THRIFT_IGNORE_ISSET_USE_WARNING_END void __clear(); - private: - bool has_next; private: ::std::string next_cursor; public: [[deprecated("__isset field is deprecated in Thrift struct. Use _ref() accessors instead.")]] struct __isset { - bool has_next; bool next_cursor; } __isset = {}; bool operator==(const ScanCursor& rhs) const; @@ -9437,28 +9428,6 @@ THRIFT_IGNORE_ISSET_USE_WARNING_END } #endif -THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - template - FOLLY_ERASE ::apache::thrift::field_ref has_next_ref() const& { - return {this->has_next, __isset.has_next}; - } - - template - FOLLY_ERASE ::apache::thrift::field_ref has_next_ref() const&& { - return {std::move(this->has_next), __isset.has_next}; - } - - template - FOLLY_ERASE ::apache::thrift::field_ref has_next_ref() & { - return {this->has_next, __isset.has_next}; - } - - template - FOLLY_ERASE ::apache::thrift::field_ref has_next_ref() && { - return {std::move(this->has_next), __isset.has_next}; - } -THRIFT_IGNORE_ISSET_USE_WARNING_END - THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN template FOLLY_ERASE ::apache::thrift::optional_field_ref next_cursor_ref() const& { @@ -9481,18 +9450,6 @@ THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN } THRIFT_IGNORE_ISSET_USE_WARNING_END - bool get_has_next() const { - return has_next; - } - - bool& set_has_next(bool has_next_) { - has_next = has_next_; -THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - __isset.has_next = true; -THRIFT_IGNORE_ISSET_USE_WARNING_END - return has_next; - } - const ::std::string* get_next_cursor() const& { return next_cursor_ref() ? std::addressof(next_cursor) : nullptr; } diff --git a/src/interface/gen-cpp2/storage_types.tcc b/src/interface/gen-cpp2/storage_types.tcc index 3d951d4a..436efe98 100644 --- a/src/interface/gen-cpp2/storage_types.tcc +++ b/src/interface/gen-cpp2/storage_types.tcc @@ -7802,22 +7802,7 @@ void ScanCursor::readNoXfer(Protocol_* iprot) { if (UNLIKELY(!_readState.advanceToNextField( iprot, 0, - 3, - apache::thrift::protocol::T_BOOL))) { - goto _loop; - } -_readField_has_next: - { - ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::integral, bool>::readWithContext(*iprot, this->has_next, _readState); - THRIFT_IGNORE_ISSET_USE_WARNING_BEGIN - this->__isset.has_next = true; - THRIFT_IGNORE_ISSET_USE_WARNING_END - } - - if (UNLIKELY(!_readState.advanceToNextField( - iprot, - 3, - 4, + 1, apache::thrift::protocol::T_STRING))) { goto _loop; } @@ -7831,7 +7816,7 @@ _readField_next_cursor: if (UNLIKELY(!_readState.advanceToNextField( iprot, - 4, + 1, 0, apache::thrift::protocol::T_STOP))) { goto _loop; @@ -7852,15 +7837,7 @@ _loop: } switch (_readState.fieldId) { - case 3: - { - if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_BOOL))) { - goto _readField_has_next; - } else { - goto _skip; - } - } - case 4: + case 1: { if (LIKELY(_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING))) { goto _readField_next_cursor; @@ -7883,10 +7860,8 @@ template uint32_t ScanCursor::serializedSize(Protocol_ const* prot_) const { uint32_t xfer = 0; xfer += prot_->serializedStructSize("ScanCursor"); - xfer += prot_->serializedFieldSize("has_next", apache::thrift::protocol::T_BOOL, 3); - xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::integral, bool>::serializedSize(*prot_, this->has_next); if (this->next_cursor_ref().has_value()) { - xfer += prot_->serializedFieldSize("next_cursor", apache::thrift::protocol::T_STRING, 4); + xfer += prot_->serializedFieldSize("next_cursor", apache::thrift::protocol::T_STRING, 1); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::serializedSize(*prot_, this->next_cursor); } xfer += prot_->serializedSizeStop(); @@ -7897,10 +7872,8 @@ template uint32_t ScanCursor::serializedSizeZC(Protocol_ const* prot_) const { uint32_t xfer = 0; xfer += prot_->serializedStructSize("ScanCursor"); - xfer += prot_->serializedFieldSize("has_next", apache::thrift::protocol::T_BOOL, 3); - xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::integral, bool>::serializedSize(*prot_, this->has_next); if (this->next_cursor_ref().has_value()) { - xfer += prot_->serializedFieldSize("next_cursor", apache::thrift::protocol::T_STRING, 4); + xfer += prot_->serializedFieldSize("next_cursor", apache::thrift::protocol::T_STRING, 1); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::serializedSize(*prot_, this->next_cursor); } xfer += prot_->serializedSizeStop(); @@ -7911,11 +7884,8 @@ template uint32_t ScanCursor::write(Protocol_* prot_) const { uint32_t xfer = 0; xfer += prot_->writeStructBegin("ScanCursor"); - xfer += prot_->writeFieldBegin("has_next", apache::thrift::protocol::T_BOOL, 3); - xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::integral, bool>::write(*prot_, this->has_next); - xfer += prot_->writeFieldEnd(); if (this->next_cursor_ref().has_value()) { - xfer += prot_->writeFieldBegin("next_cursor", apache::thrift::protocol::T_STRING, 4); + xfer += prot_->writeFieldBegin("next_cursor", apache::thrift::protocol::T_STRING, 1); xfer += ::apache::thrift::detail::pm::protocol_methods< ::apache::thrift::type_class::binary, ::std::string>::write(*prot_, this->next_cursor); xfer += prot_->writeFieldEnd(); } diff --git a/src/interface/gen-cpp2/storage_visit_by_thrift_field_metadata.h b/src/interface/gen-cpp2/storage_visit_by_thrift_field_metadata.h index 0dd8002a..0704b573 100644 --- a/src/interface/gen-cpp2/storage_visit_by_thrift_field_metadata.h +++ b/src/interface/gen-cpp2/storage_visit_by_thrift_field_metadata.h @@ -680,10 +680,8 @@ struct VisitByThriftId<::nebula::storage::cpp2::ScanCursor> { template void operator()(FOLLY_MAYBE_UNUSED F&& f, size_t id, FOLLY_MAYBE_UNUSED T&& t) const { switch (id) { - case 3: - return f(0, static_cast(t).has_next_ref()); - case 4: - return f(1, static_cast(t).next_cursor_ref()); + case 1: + return f(0, static_cast(t).next_cursor_ref()); default: throwInvalidThriftId(id, "::nebula::storage::cpp2::ScanCursor"); } diff --git a/src/interface/meta.thrift b/src/interface/meta.thrift index f9bd4e1f..6b3fe96a 100644 --- a/src/interface/meta.thrift +++ b/src/interface/meta.thrift @@ -112,7 +112,7 @@ struct SpaceDesc { 4: binary charset_name, 5: binary collate_name, 6: ColumnTypeDef vid_type = {"type": common.PropertyType.FIXED_STRING, "type_length": 8}, - 7: optional binary group_name, + 7: list zone_names, 8: optional IsolationLevel isolation_level, 9: optional binary comment, } @@ -432,6 +432,14 @@ struct ListEdgesResp { 3: list edges, } +struct AddHostsReq { + 1: list hosts, +} + +struct DropHostsReq { + 1: list hosts, +} + enum ListHostType { // nebula 1.0 show hosts, show leader, partition info ALLOC = 0x00, @@ -815,23 +823,28 @@ struct ListIndexStatusResp { } // Zone related interface -struct AddZoneReq { - 1: binary zone_name, - 2: list nodes, +struct MergeZoneReq { + 1: list zones, + 2: binary zone_name, } struct DropZoneReq { 1: binary zone_name, } -struct AddHostIntoZoneReq { - 1: common.HostAddr node, - 2: binary zone_name, +struct SplitZoneReq { + 1: binary zone_name, +} + +struct RenameZoneReq { + 1: binary original_zone_name, + 2: binary zone_name, } -struct DropHostFromZoneReq { - 1: common.HostAddr node, - 2: binary zone_name, +struct AddHostsIntoZoneReq { + 1: list hosts, + 2: binary zone_name, + 3: bool is_new, } struct GetZoneReq { @@ -1134,7 +1147,10 @@ service MetaService { GetEdgeResp getEdge(1: GetEdgeReq req); ListEdgesResp listEdges(1: ListEdgesReq req); - ListHostsResp listHosts(1: ListHostsReq req); + ExecResp addHosts(1: AddHostsReq req); + ExecResp addHostsIntoZone(1: AddHostsIntoZoneReq req); + ExecResp dropHosts(1: DropHostsReq req); + ListHostsResp listHosts(1: ListHostsReq req); GetPartsAllocResp getPartsAlloc(1: GetPartsAllocReq req); ListPartsResp listParts(1: ListPartsReq req); @@ -1182,17 +1198,17 @@ service MetaService { AdminJobResp runAdminJob(1: AdminJobReq req); - ExecResp addZone(1: AddZoneReq req); + ExecResp mergeZone(1: MergeZoneReq req); ExecResp dropZone(1: DropZoneReq req); - ExecResp addHostIntoZone(1: AddHostIntoZoneReq req); - ExecResp dropHostFromZone(1: DropHostFromZoneReq req); + ExecResp splitZone(1: SplitZoneReq req); + ExecResp renameZone(1: RenameZoneReq req); GetZoneResp getZone(1: GetZoneReq req); ListZonesResp listZones(1: ListZonesReq req); CreateBackupResp createBackup(1: CreateBackupReq req); - ExecResp restoreMeta(1: RestoreMetaReq req); - ExecResp addListener(1: AddListenerReq req); - ExecResp removeListener(1: RemoveListenerReq req); + ExecResp restoreMeta(1: RestoreMetaReq req); + ExecResp addListener(1: AddListenerReq req); + ExecResp removeListener(1: RemoveListenerReq req); ListListenerResp listListener(1: ListListenerReq req); GetStatsResp getStats(1: GetStatsReq req); diff --git a/src/interface/storage.thrift b/src/interface/storage.thrift index 07c56e2b..405114af 100644 --- a/src/interface/storage.thrift +++ b/src/interface/storage.thrift @@ -561,9 +561,8 @@ struct LookupAndTraverseRequest { */ struct ScanCursor { - 3: bool has_next, // next start key of scan, only valid when has_next is true - 4: optional binary next_cursor, + 1: optional binary next_cursor, } struct ScanVertexRequest { diff --git a/src/mclient/tests/CMakeLists.txt b/src/mclient/tests/CMakeLists.txt index b2525fcc..7bf2ddb5 100644 --- a/src/mclient/tests/CMakeLists.txt +++ b/src/mclient/tests/CMakeLists.txt @@ -17,3 +17,19 @@ nebula_add_test( gtest ${NEBULA_THIRD_PARTY_LIBRARIES} ) + +nebula_add_test( + NAME + meta_client_ssl_test + SOURCES + MetaClientSSLTest.cpp + OBJECTS + ${NEBULA_MCLIENT_OBJS} + $ + $ + $ + $ + LIBRARIES + gtest + ${NEBULA_THIRD_PARTY_LIBRARIES} +) diff --git a/src/mclient/tests/MetaClientSSLTest.cpp b/src/mclient/tests/MetaClientSSLTest.cpp new file mode 100644 index 00000000..9a9b4102 --- /dev/null +++ b/src/mclient/tests/MetaClientSSLTest.cpp @@ -0,0 +1,88 @@ +/* Copyright (c) 2020 vesoft inc. All rights reserved. + * + * This source code is licensed under Apache 2.0 License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "./MClientTest.h" +#include "common/datatypes/HostAddr.h" +#include "common/thrift/ThriftTypes.h" + +// Require a nebula server could access + +#define kServerHost "127.0.0.1" + +class MetaClientTest : public MClientTest { + protected: + static void prepare() { + nebula::ConnectionPool pool; + pool.init({kServerHost ":9669"}, nebula::Config{0, 0, 10, 0, "", true}); + auto session = pool.getSession("root", "nebula"); + ASSERT_TRUE(session.valid()); + EXPECT_TRUE(session.ping()); + auto result = session.execute( + "CREATE SPACE IF NOT EXISTS meta_client_test(vid_type=FIXED_STRING(8)," + "partition_num=3);USE meta_client_test"); + ASSERT_EQ(result.errorCode, nebula::ErrorCode::SUCCEEDED); + + auto result2 = session.execute("CREATE EDGE IF NOT EXISTS like(likeness int)"); + ASSERT_EQ(result2.errorCode, nebula::ErrorCode::SUCCEEDED); + + ::sleep(30); + + auto result3 = session.execute( + "INSERT EDGE like(likeness) VALUES '101'->'102':(78), '102'->'103':(99), " + "'103'->'201':(43), '201'->'202':(56), '202'->'203':(-13), '203'->'301':(431), " + "'301'->'302':(457)"); + ASSERT_EQ(result3.errorCode, nebula::ErrorCode::SUCCEEDED); + } + + static void runOnce(nebula::MetaClient &c) { + auto ret = c.getSpaceIdByNameFromCache("meta_client_test"); + ASSERT_TRUE(ret.first); + nebula::GraphSpaceID spaceId = ret.second; + LOG(INFO) << "spaceId of nba: " << spaceId; + EXPECT_GT(spaceId, 0); + + auto ret2 = c.getEdgeTypeByNameFromCache(spaceId, "like"); + ASSERT_TRUE(ret2.first); + nebula::EdgeType edgeType = ret2.second; + LOG(INFO) << "edgeType of like: " << edgeType; + EXPECT_GT(edgeType, 0); + + auto ret3 = c.getPartsFromCache(spaceId); + ASSERT_TRUE(ret3.first); + auto parts = ret3.second; + EXPECT_EQ(parts, (std::vector{1, 2, 3})); + + auto ret4 = c.getPartLeaderFromCache(spaceId, 1); + ASSERT_TRUE(ret4.first); + EXPECT_EQ(ret4.second, nebula::HostAddr(kServerHost, 9779)); + } +}; + +TEST_F(MetaClientTest, SSL) { + LOG(INFO) << "Prepare data."; + prepare(); + + LOG(INFO) << "Run once."; + nebula::MConfig mConfig{1000, 60 * 1000, true, ""}; + nebula::MetaClient c({kServerHost ":9559"}, mConfig); + runOnce(c); +} + +int main(int argc, char **argv) { + testing::InitGoogleTest(&argc, argv); + nebula::init(&argc, &argv); + google::SetStderrLogging(google::INFO); + + return RUN_ALL_TESTS(); +} diff --git a/src/mclient/tests/MetaClientTest.cpp b/src/mclient/tests/MetaClientTest.cpp index 093ffe2f..b640f081 100644 --- a/src/mclient/tests/MetaClientTest.cpp +++ b/src/mclient/tests/MetaClientTest.cpp @@ -78,16 +78,6 @@ TEST_F(MetaClientTest, Basic) { runOnce(c); } -TEST_F(MetaClientTest, SSL) { - LOG(INFO) << "Prepare data."; - prepare(); - - LOG(INFO) << "Run once."; - nebula::MConfig mConfig{1000, 60 * 1000, true, ""}; - nebula::MetaClient c({kServerHost ":9559"}, mConfig); - runOnce(c); -} - int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); nebula::init(&argc, &argv); diff --git a/src/sclient/ScanEdgeIter.cpp b/src/sclient/ScanEdgeIter.cpp index b002dcab..48560beb 100644 --- a/src/sclient/ScanEdgeIter.cpp +++ b/src/sclient/ScanEdgeIter.cpp @@ -25,7 +25,6 @@ DataSet ScanEdgeIter::next() { DCHECK(!!req_); auto partCursorMapReq = req_->get_parts(); DCHECK_EQ(partCursorMapReq.size(), 1); - partCursorMapReq.begin()->second.set_has_next(true); partCursorMapReq.begin()->second.set_next_cursor(nextCursor_); req_->set_parts(partCursorMapReq); auto r = client_->doScanEdge(*req_); @@ -44,9 +43,9 @@ DataSet ScanEdgeIter::next() { auto partCursorMapResp = scanResponse.get_cursors(); DCHECK_EQ(partCursorMapResp.size(), 1); auto scanCursor = partCursorMapResp.begin()->second; - hasNext_ = scanCursor.get_has_next(); + hasNext_ = scanCursor.next_cursor_ref().has_value(); if (hasNext_) { - nextCursor_ = *scanCursor.get_next_cursor(); + nextCursor_ = scanCursor.next_cursor_ref().value(); } return *scanResponse.get_props(); diff --git a/src/sclient/StorageClient.cpp b/src/sclient/StorageClient.cpp index 06cfadcf..fb0113a6 100644 --- a/src/sclient/StorageClient.cpp +++ b/src/sclient/StorageClient.cpp @@ -73,7 +73,6 @@ ScanEdgeIter StorageClient::scanEdgeWithPart(std::string spaceName, // req->set_cursor(""); // new interface storage::cpp2::ScanCursor scanCursor; - scanCursor.set_has_next(false); req->set_parts(std::unordered_map{{partId, scanCursor}}); req->set_return_columns({returnCols}); req->set_limit(limit); diff --git a/src/sclient/tests/CMakeLists.txt b/src/sclient/tests/CMakeLists.txt index 1e431d5a..fb0cf943 100644 --- a/src/sclient/tests/CMakeLists.txt +++ b/src/sclient/tests/CMakeLists.txt @@ -17,3 +17,19 @@ nebula_add_test( gtest ${NEBULA_THIRD_PARTY_LIBRARIES} ) + +nebula_add_test( + NAME + storage_client_ssl_test + SOURCES + StorageClientSSLTest.cpp + OBJECTS + ${NEBULA_SCLIENT_OBJS} + $ + $ + $ + $ + LIBRARIES + gtest + ${NEBULA_THIRD_PARTY_LIBRARIES} +) diff --git a/src/sclient/tests/StorageClientSSLTest.cpp b/src/sclient/tests/StorageClientSSLTest.cpp new file mode 100644 index 00000000..a73705c4 --- /dev/null +++ b/src/sclient/tests/StorageClientSSLTest.cpp @@ -0,0 +1,154 @@ +/* Copyright (c) 2020 vesoft inc. All rights reserved. + * + * This source code is licensed under Apache 2.0 License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "./SClientTest.h" + +// Require a nebula server could access + +#define kServerHost "127.0.0.1" + +class StorageClientTest : public SClientTest { + protected: + static void prepare() { + nebula::ConnectionPool pool; + pool.init({kServerHost ":9669"}, nebula::Config{0, 0, 10, 0, "", true}); + auto session = pool.getSession("root", "nebula"); + ASSERT_TRUE(session.valid()); + EXPECT_TRUE(session.ping()); + auto result = session.execute( + "CREATE SPACE IF NOT EXISTS storage_client_test(vid_type=FIXED_STRING(8)," + "partition_num=1);USE storage_client_test"); + ASSERT_EQ(result.errorCode, nebula::ErrorCode::SUCCEEDED); + + auto result2 = session.execute("CREATE EDGE IF NOT EXISTS like(likeness int)"); + ASSERT_EQ(result2.errorCode, nebula::ErrorCode::SUCCEEDED); + + ::sleep(30); + + auto result3 = session.execute( + "INSERT EDGE like(likeness) VALUES '101'->'102':(78), '102'->'103':(99), " + "'103'->'201':(43), '201'->'202':(56), '202'->'203':(-13), '203'->'301':(431), " + "'301'->'302':(457)"); + ASSERT_EQ(result3.errorCode, nebula::ErrorCode::SUCCEEDED) + << (result3.errorMsg ? *result3.errorMsg : ""); + } + + static void runOnce(nebula::MetaClient &c) { + auto ret = c.getSpaceIdByNameFromCache("storage_client_test"); + ASSERT_TRUE(ret.first); + nebula::GraphSpaceID spaceId = ret.second; + LOG(INFO) << "spaceId of nba: " << spaceId; + EXPECT_GT(spaceId, 0); + + auto ret2 = c.getEdgeTypeByNameFromCache(spaceId, "like"); + ASSERT_TRUE(ret2.first); + nebula::EdgeType edgeType = ret2.second; + LOG(INFO) << "edgeType of like: " << edgeType; + EXPECT_GT(edgeType, 0); + + auto ret3 = c.getPartsFromCache(spaceId); + ASSERT_TRUE(ret3.first); + auto parts = ret3.second; + EXPECT_EQ(parts, (std::vector{1})); + + auto ret4 = c.getPartLeaderFromCache(spaceId, 1); + ASSERT_TRUE(ret4.first); + EXPECT_EQ(ret4.second, nebula::HostAddr(kServerHost, 9779)); + } + + static void runGetParts(nebula::StorageClient &c) { + auto parts = c.getParts("storage_client_test"); + EXPECT_EQ(parts, (std::vector{1})); + } + + static void runScanEdgeWithPart(nebula::StorageClient &c) { + LOG(INFO) << "run with goodScanIter"; + { + auto goodScanIter = c.scanEdgeWithPart("storage_client_test", + 1, + "like", + std::vector{"likeness"}, + 3, + 0, + std::numeric_limits::max(), + "", + true, + true); + nebula::DataSet expected({"like.likeness"}); + expected.emplace_back(nebula::List({78})); + expected.emplace_back(nebula::List({99})); + expected.emplace_back(nebula::List({43})); + expected.emplace_back(nebula::List({56})); + expected.emplace_back(nebula::List({-13})); + expected.emplace_back(nebula::List({431})); + expected.emplace_back(nebula::List({457})); + + nebula::DataSet got; + int scanNum = 0; + while (goodScanIter.hasNext()) { + nebula::DataSet ds = goodScanIter.next(); + got.append(std::move(ds)); + ++scanNum; + } + EXPECT_EQ(scanNum, 3); + EXPECT_TRUE(verifyResultWithoutOrder(got, expected)); + } + LOG(INFO) << "run with badScanIter"; + { + auto badScanIter = c.scanEdgeWithPart("storage_client_test", + 999, // non-existent partId + "like", + std::vector(), + 10, + 0, + std::numeric_limits::max(), + "", + true, + true); + { + EXPECT_EQ(badScanIter.hasNext(), true); + nebula::DataSet ds = badScanIter.next(); + EXPECT_EQ(ds, nebula::DataSet()); + EXPECT_EQ(badScanIter.hasNext_, false); + EXPECT_EQ(badScanIter.nextCursor_, ""); + } + } + } +}; + +TEST_F(StorageClientTest, SSL) { + LOG(INFO) << "Prepare data."; + prepare(); + nebula::MConfig mConfig{1000, 60 * 1000, true, ""}; + nebula::SConfig sConfig{1000, 60 * 1000, true, ""}; + nebula::StorageClient c({kServerHost ":9559"}, mConfig, sConfig); + auto *m = c.getMetaClient(); + LOG(INFO) << "Testing run once of meta client"; + runOnce(*m); + LOG(INFO) << "Testing run get parts."; + runGetParts(c); + LOG(INFO) << "Testing run scan edge with part."; + runScanEdgeWithPart(c); +} + +int main(int argc, char **argv) { + testing::InitGoogleTest(&argc, argv); + nebula::init(&argc, &argv); + google::SetStderrLogging(google::INFO); + + return RUN_ALL_TESTS(); +} diff --git a/src/sclient/tests/StorageClientTest.cpp b/src/sclient/tests/StorageClientTest.cpp index acd03542..d4f0a7f3 100644 --- a/src/sclient/tests/StorageClientTest.cpp +++ b/src/sclient/tests/StorageClientTest.cpp @@ -143,21 +143,6 @@ TEST_F(StorageClientTest, Basic) { runScanEdgeWithPart(c); } -TEST_F(StorageClientTest, SSL) { - LOG(INFO) << "Prepare data."; - prepare(); - nebula::MConfig mConfig{1000, 60 * 1000, true, ""}; - nebula::SConfig sConfig{1000, 60 * 1000, true, ""}; - nebula::StorageClient c({kServerHost ":9559"}, mConfig, sConfig); - auto *m = c.getMetaClient(); - LOG(INFO) << "Testing run once of meta client"; - runOnce(*m); - LOG(INFO) << "Testing run get parts."; - runGetParts(c); - LOG(INFO) << "Testing run scan edge with part."; - runScanEdgeWithPart(c); -} - int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); nebula::init(&argc, &argv);