Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove group relevant component #3330

Merged
merged 3 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 0 additions & 96 deletions src/clients/meta/MetaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3116,102 +3116,6 @@ folly::Future<StatusOr<std::vector<cpp2::Zone>>> MetaClient::listZones() {
return future;
}

folly::Future<StatusOr<bool>> MetaClient::addGroup(std::string groupName,
std::vector<std::string> zoneNames) {
cpp2::AddGroupReq req;
req.set_group_name(std::move(groupName));
req.set_zone_names(std::move(zoneNames));

folly::Promise<StatusOr<bool>> promise;
auto future = promise.getFuture();
getResponse(
std::move(req),
[](auto client, auto request) { return client->future_addGroup(request); },
[](cpp2::ExecResp&& resp) -> bool {
return resp.get_code() == nebula::cpp2::ErrorCode::SUCCEEDED;
},
std::move(promise));
return future;
}

folly::Future<StatusOr<bool>> MetaClient::dropGroup(std::string groupName) {
cpp2::DropGroupReq req;
req.set_group_name(std::move(groupName));

folly::Promise<StatusOr<bool>> promise;
auto future = promise.getFuture();
getResponse(
std::move(req),
[](auto client, auto request) { return client->future_dropGroup(request); },
[](cpp2::ExecResp&& resp) -> bool {
return resp.get_code() == nebula::cpp2::ErrorCode::SUCCEEDED;
},
std::move(promise));
return future;
}

folly::Future<StatusOr<bool>> MetaClient::addZoneIntoGroup(std::string zoneName,
std::string groupName) {
cpp2::AddZoneIntoGroupReq req;
req.set_zone_name(zoneName);
req.set_group_name(groupName);

folly::Promise<StatusOr<bool>> promise;
auto future = promise.getFuture();
getResponse(
std::move(req),
[](auto client, auto request) { return client->future_addZoneIntoGroup(request); },
[](cpp2::ExecResp&& resp) -> bool {
return resp.get_code() == nebula::cpp2::ErrorCode::SUCCEEDED;
},
std::move(promise));
return future;
}

folly::Future<StatusOr<bool>> MetaClient::dropZoneFromGroup(std::string zoneName,
std::string groupName) {
cpp2::DropZoneFromGroupReq req;
req.set_zone_name(zoneName);
req.set_group_name(groupName);

folly::Promise<StatusOr<bool>> promise;
auto future = promise.getFuture();
getResponse(
std::move(req),
[](auto client, auto request) { return client->future_dropZoneFromGroup(request); },
[](cpp2::ExecResp&& resp) -> bool {
return resp.get_code() == nebula::cpp2::ErrorCode::SUCCEEDED;
},
std::move(promise));
return future;
}

folly::Future<StatusOr<std::vector<std::string>>> MetaClient::getGroup(std::string groupName) {
cpp2::GetGroupReq req;
req.set_group_name(std::move(groupName));

folly::Promise<StatusOr<std::vector<std::string>>> promise;
auto future = promise.getFuture();
getResponse(
std::move(req),
[](auto client, auto request) { return client->future_getGroup(request); },
[](cpp2::GetGroupResp&& resp) -> decltype(auto) { return resp.get_zone_names(); },
std::move(promise));
return future;
}

folly::Future<StatusOr<std::vector<cpp2::Group>>> MetaClient::listGroups() {
cpp2::ListGroupsReq req;
folly::Promise<StatusOr<std::vector<cpp2::Group>>> promise;
auto future = promise.getFuture();
getResponse(
std::move(req),
[](auto client, auto request) { return client->future_listGroups(request); },
[](cpp2::ListGroupsResp&& resp) -> decltype(auto) { return resp.get_groups(); },
std::move(promise));
return future;
}

folly::Future<StatusOr<cpp2::StatsItem>> MetaClient::getStats(GraphSpaceID spaceId) {
cpp2::GetStatsReq req;
req.set_space_id(spaceId);
Expand Down
12 changes: 0 additions & 12 deletions src/clients/meta/MetaClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -607,18 +607,6 @@ class MetaClient {

folly::Future<StatusOr<std::vector<cpp2::Zone>>> listZones();

folly::Future<StatusOr<bool>> addGroup(std::string groupName, std::vector<std::string> zoneNames);

folly::Future<StatusOr<bool>> dropGroup(std::string groupName);

folly::Future<StatusOr<bool>> addZoneIntoGroup(std::string zoneName, std::string groupName);

folly::Future<StatusOr<bool>> dropZoneFromGroup(std::string zoneName, std::string groupName);

folly::Future<StatusOr<std::vector<std::string>>> getGroup(std::string groupName);

folly::Future<StatusOr<std::vector<cpp2::Group>>> listGroups();

Status refreshCache();

folly::Future<StatusOr<cpp2::StatsItem>> getStats(GraphSpaceID spaceId);
Expand Down
1 change: 0 additions & 1 deletion src/graph/executor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ nebula_add_library(
admin/DownloadExecutor.cpp
admin/IngestExecutor.cpp
admin/ConfigExecutor.cpp
admin/GroupExecutor.cpp
admin/ZoneExecutor.cpp
admin/ShowTSClientsExecutor.cpp
admin/SignInTSServiceExecutor.cpp
Expand Down
19 changes: 0 additions & 19 deletions src/graph/executor/Executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "graph/executor/admin/DownloadExecutor.h"
#include "graph/executor/admin/DropUserExecutor.h"
#include "graph/executor/admin/GrantRoleExecutor.h"
#include "graph/executor/admin/GroupExecutor.h"
#include "graph/executor/admin/IngestExecutor.h"
#include "graph/executor/admin/KillQueryExecutor.h"
#include "graph/executor/admin/ListRolesExecutor.h"
Expand Down Expand Up @@ -431,24 +430,6 @@ Executor *Executor::makeExecutor(QueryContext *qctx, const PlanNode *node) {
case PlanNode::Kind::kSubgraph: {
return pool->add(new SubgraphExecutor(node, qctx));
}
case PlanNode::Kind::kAddGroup: {
return pool->add(new AddGroupExecutor(node, qctx));
}
case PlanNode::Kind::kDropGroup: {
return pool->add(new DropGroupExecutor(node, qctx));
}
case PlanNode::Kind::kDescribeGroup: {
return pool->add(new DescribeGroupExecutor(node, qctx));
}
case PlanNode::Kind::kAddZoneIntoGroup: {
return pool->add(new AddZoneIntoGroupExecutor(node, qctx));
}
case PlanNode::Kind::kDropZoneFromGroup: {
return pool->add(new DropZoneFromGroupExecutor(node, qctx));
}
case PlanNode::Kind::kShowGroups: {
return pool->add(new ListGroupsExecutor(node, qctx));
}
case PlanNode::Kind::kAddZone: {
return pool->add(new AddZoneExecutor(node, qctx));
}
Expand Down
129 changes: 0 additions & 129 deletions src/graph/executor/admin/GroupExecutor.cpp

This file was deleted.

65 changes: 0 additions & 65 deletions src/graph/executor/admin/GroupExecutor.h

This file was deleted.

Loading