-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b7c6901
commit b3735fd
Showing
63 changed files
with
2,804 additions
and
2,096 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* Copyright (c) 2021 vesoft inc. All rights reserved. | ||
* | ||
* This source code is licensed under Apache 2.0 License, | ||
* attached with Common Clause Condition 1.0, found in the LICENSES directory. | ||
*/ | ||
|
||
#include "graph/executor/admin/AddHostsExecutor.h" | ||
|
||
#include "graph/planner/plan/Admin.h" | ||
|
||
namespace nebula { | ||
namespace graph { | ||
|
||
folly::Future<Status> AddHostsExecutor::execute() { | ||
SCOPED_TIMER(&execTime_); | ||
auto *ahNode = asNode<AddHosts>(node()); | ||
return qctx() | ||
->getMetaClient() | ||
->addHosts(ahNode->getHosts()) | ||
.via(runner()) | ||
.thenValue([this](StatusOr<bool> resp) { | ||
SCOPED_TIMER(&execTime_); | ||
NG_RETURN_IF_ERROR(resp); | ||
if (!resp.value()) { | ||
return Status::Error("Add Hosts failed!"); | ||
} | ||
return Status::OK(); | ||
}); | ||
} | ||
|
||
} // namespace graph | ||
} // namespace nebula |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* Copyright (c) 2021 vesoft inc. All rights reserved. | ||
* | ||
* This source code is licensed under Apache 2.0 License, | ||
* attached with Common Clause Condition 1.0, found in the LICENSES directory. | ||
*/ | ||
|
||
#ifndef GRAPH_EXECUTOR_ADMIN_ADD_HOST_EXECUTOR_H_ | ||
#define GRAPH_EXECUTOR_ADMIN_ADD_HOST_EXECUTOR_H_ | ||
|
||
#include "graph/executor/Executor.h" | ||
|
||
namespace nebula { | ||
namespace graph { | ||
|
||
class AddHostsExecutor final : public Executor { | ||
public: | ||
AddHostsExecutor(const PlanNode *node, QueryContext *qctx) | ||
: Executor("AddHostsExecutor", node, qctx) {} | ||
|
||
folly::Future<Status> execute() override; | ||
}; | ||
|
||
} // namespace graph | ||
} // namespace nebula | ||
|
||
#endif // GRAPH_EXECUTOR_ADMIN_ADD_HOST_EXECUTOR_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* Copyright (c) 2021 vesoft inc. All rights reserved. | ||
* | ||
* This source code is licensed under Apache 2.0 License, | ||
* attached with Common Clause Condition 1.0, found in the LICENSES directory. | ||
*/ | ||
|
||
#include "graph/executor/admin/DropHostsExecutor.h" | ||
|
||
#include "graph/planner/plan/Admin.h" | ||
|
||
namespace nebula { | ||
namespace graph { | ||
|
||
folly::Future<Status> DropHostsExecutor::execute() { | ||
auto *dhNode = asNode<DropHosts>(node()); | ||
return qctx() | ||
->getMetaClient() | ||
->dropHosts(dhNode->getHosts()) | ||
.via(runner()) | ||
.thenValue([this](StatusOr<bool> resp) { | ||
SCOPED_TIMER(&execTime_); | ||
NG_RETURN_IF_ERROR(resp); | ||
if (!resp.value()) { | ||
return Status::Error("Drop Hosts failed!"); | ||
} | ||
return Status::OK(); | ||
}); | ||
} | ||
|
||
} // namespace graph | ||
} // namespace nebula |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* Copyright (c) 2021 vesoft inc. All rights reserved. | ||
* | ||
* This source code is licensed under Apache 2.0 License, | ||
* attached with Common Clause Condition 1.0, found in the LICENSES directory. | ||
*/ | ||
|
||
#ifndef GRAPH_EXECUTOR_ADMIN_DROP_HOST_EXECUTOR_H_ | ||
#define GRAPH_EXECUTOR_ADMIN_DROP_HOST_EXECUTOR_H_ | ||
|
||
#include "graph/executor/Executor.h" | ||
|
||
namespace nebula { | ||
namespace graph { | ||
|
||
class DropHostsExecutor final : public Executor { | ||
public: | ||
DropHostsExecutor(const PlanNode *node, QueryContext *qctx) | ||
: Executor("DropHostsExecutor", node, qctx) {} | ||
|
||
folly::Future<Status> execute() override; | ||
}; | ||
|
||
} // namespace graph | ||
} // namespace nebula | ||
|
||
#endif // GRAPH_EXECUTOR_ADMIN_DROP_HOST_EXECUTOR_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.