Skip to content

Commit

Permalink
Merge branch 'master' into keep
Browse files Browse the repository at this point in the history
  • Loading branch information
yixinglu authored Nov 25, 2021
2 parents b18c889 + c6d1046 commit 5bf95f4
Show file tree
Hide file tree
Showing 59 changed files with 482 additions and 2,599 deletions.
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 @@ -65,7 +65,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 @@ -24,7 +24,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 @@ -435,24 +434,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.

1 change: 1 addition & 0 deletions src/graph/optimizer/rule/TopNRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include "graph/optimizer/rule/TopNRule.h"

#include "graph/optimizer/OptContext.h"
#include "graph/optimizer/OptGroup.h"
#include "graph/planner/plan/PlanNode.h"
Expand Down
Loading

0 comments on commit 5bf95f4

Please sign in to comment.