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

add executor comment #4033

Merged
merged 10 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from 7 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
9 changes: 3 additions & 6 deletions src/graph/executor/ExecutionError.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#ifndef GRAPH_EXECUTOR_EXECUTIONERROR_H_
#define GRAPH_EXECUTOR_EXECUTIONERROR_H_

#include <stdexcept>

#include "common/base/Status.h"

namespace nebula {
Expand Down
9 changes: 3 additions & 6 deletions src/graph/executor/Executor.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/Executor.h"

Expand All @@ -13,9 +12,7 @@
#include "common/base/ObjectPool.h"
#include "common/memory/MemoryUtils.h"
#include "common/stats/StatsManager.h"
#include "common/time/ScopedTimer.h"
#include "graph/context/ExecutionContext.h"
#include "graph/context/QueryContext.h"
#include "graph/executor/ExecutionError.h"
#include "graph/executor/admin/AddHostsExecutor.h"
#include "graph/executor/admin/ChangePasswordExecutor.h"
Expand Down
18 changes: 4 additions & 14 deletions src/graph/executor/Executor.h
Original file line number Diff line number Diff line change
@@ -1,31 +1,21 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/

// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.
#ifndef GRAPH_EXECUTOR_EXECUTOR_H_
#define GRAPH_EXECUTOR_EXECUTOR_H_

#include <folly/futures/Future.h>

#include <boost/core/noncopyable.hpp>
#include <set>
#include <string>
#include <vector>

#include "common/base/Status.h"
#include "common/cpp/helpers.h"
#include "common/datatypes/Value.h"
#include "common/time/Duration.h"
#include "common/time/ScopedTimer.h"
#include "graph/context/ExecutionContext.h"

#include "graph/context/QueryContext.h"
namespace nebula {
namespace graph {

class PlanNode;
class QueryContext;

class Executor : private boost::noncopyable, private cpp::NonMovable {
public:
// Create executor according to plan node
Expand Down
8 changes: 3 additions & 5 deletions src/graph/executor/StorageAccessExecutor.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/* Copyright (c) 2021 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/StorageAccessExecutor.h"

#include <folly/Format.h>

#include "graph/context/Iterator.h"
#include "graph/context/QueryExpressionContext.h"
#include "graph/util/SchemaUtil.h"
Expand Down
8 changes: 3 additions & 5 deletions src/graph/executor/StorageAccessExecutor.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#ifndef GRAPH_EXECUTOR_STORAGEACCESSEXECUTOR_H_
#define GRAPH_EXECUTOR_STORAGEACCESSEXECUTOR_H_

#include <thrift/lib/cpp/util/EnumUtils.h>

#include "clients/storage/StorageClientBase.h"
#include "graph/context/QueryContext.h"
#include "graph/executor/Executor.h"

namespace nebula {
Expand Down
7 changes: 3 additions & 4 deletions src/graph/executor/admin/AddHostsExecutor.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* Copyright (c) 2021 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/admin/AddHostsExecutor.h"

Expand Down
10 changes: 6 additions & 4 deletions src/graph/executor/admin/AddHostsExecutor.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
/* Copyright (c) 2021 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#ifndef GRAPH_EXECUTOR_ADMIN_ADD_HOST_EXECUTOR_H_
#define GRAPH_EXECUTOR_ADMIN_ADD_HOST_EXECUTOR_H_

#include "graph/executor/Executor.h"

// setting Storage hosts in the configuration files only registers the hosts on the Meta side,
// but does not add them into the cluster. You must run the ADD HOSTS statement to add
// the Storage hosts.
namespace nebula {
namespace graph {

Expand Down
9 changes: 3 additions & 6 deletions src/graph/executor/admin/ChangePasswordExecutor.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/admin/ChangePasswordExecutor.h"

#include <proxygen/lib/utils/CryptUtil.h>

#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Admin.h"

namespace nebula {
Expand Down
7 changes: 3 additions & 4 deletions src/graph/executor/admin/ChangePasswordExecutor.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#ifndef GRAPH_EXECUTOR_ADMIN_CHANGEPASSWORDEXECUTOR_H_
#define GRAPH_EXECUTOR_ADMIN_CHANGEPASSWORDEXECUTOR_H_
Expand Down
10 changes: 3 additions & 7 deletions src/graph/executor/admin/CharsetExecutor.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/admin/CharsetExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"

namespace nebula {
namespace graph {
folly::Future<Status> ShowCharsetExecutor::execute() {
Expand Down
7 changes: 3 additions & 4 deletions src/graph/executor/admin/CharsetExecutor.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#ifndef GRAPH_EXECUTOR_ADMIN_CHARSETEXECUTOR_H_
#define GRAPH_EXECUTOR_ADMIN_CHARSETEXECUTOR_H_
Expand Down
16 changes: 6 additions & 10 deletions src/graph/executor/admin/ConfigExecutor.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/admin/ConfigExecutor.h"

#include <thrift/lib/cpp/util/EnumUtils.h>

#include "common/conf/Configuration.h"
#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Admin.h"
#include "graph/util/SchemaUtil.h"

Expand Down Expand Up @@ -49,7 +45,7 @@ folly::Future<Status> ShowConfigsExecutor::execute() {
.thenValue([this, scNode](StatusOr<std::vector<meta::cpp2::ConfigItem>> resp) {
if (!resp.ok()) {
auto module = apache::thrift::util::enumNameSafe(scNode->getModule());
LOG(ERROR) << "Show configs `" << module << "' failed: " << resp.status();
LOG(WARNING) << "Show configs `" << module << "' failed: " << resp.status();
return Status::Error(
"Show config `%s' failed: %s", module.c_str(), resp.status().toString().c_str());
}
Expand Down Expand Up @@ -90,7 +86,7 @@ folly::Future<Status> SetConfigExecutor::execute() {
.via(runner())
.thenValue([scNode](StatusOr<bool> resp) {
if (!resp.ok()) {
LOG(ERROR) << "Set config `" << scNode->getName() << "' failed: " << resp.status();
LOG(WARNING) << "Set config `" << scNode->getName() << "' failed: " << resp.status();
return Status::Error("Set config `%s' failed: %s",
scNode->getName().c_str(),
resp.status().toString().c_str());
Expand All @@ -109,7 +105,7 @@ folly::Future<Status> GetConfigExecutor::execute() {
.via(runner())
.thenValue([this, gcNode](StatusOr<std::vector<meta::cpp2::ConfigItem>> resp) {
if (!resp.ok()) {
LOG(ERROR) << "Get config `" << gcNode->getName() << "' failed: " << resp.status();
LOG(WARNING) << "Get config `" << gcNode->getName() << "' failed: " << resp.status();
return Status::Error("Get config `%s' failed: %s",
gcNode->getName().c_str(),
resp.status().toString().c_str());
Expand Down
7 changes: 3 additions & 4 deletions src/graph/executor/admin/ConfigExecutor.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#ifndef GRAPH_EXECUTOR_ADMIN_CONFIGEXECUTOR_H_
#define GRAPH_EXECUTOR_ADMIN_CONFIGEXECUTOR_H_
Expand Down
9 changes: 3 additions & 6 deletions src/graph/executor/admin/CreateUserExecutor.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/admin/CreateUserExecutor.h"

#include <proxygen/lib/utils/CryptUtil.h>

#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Admin.h"

namespace nebula {
Expand Down
7 changes: 3 additions & 4 deletions src/graph/executor/admin/CreateUserExecutor.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#ifndef GRAPH_EXECUTOR_ADMIN_CREATEUSEREXECUTOR_H_
#define GRAPH_EXECUTOR_ADMIN_CREATEUSEREXECUTOR_H_
Expand Down
12 changes: 5 additions & 7 deletions src/graph/executor/admin/DescribeUserExecutor.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/admin/DescribeUserExecutor.h"

#include <thrift/lib/cpp/util/EnumUtils.h>

#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Admin.h"
#include "interface/gen-cpp2/meta_types.h"

Expand Down Expand Up @@ -43,7 +40,8 @@ folly::Future<Status> DescribeUserExecutor::describeUser() {
v.emplace_back(nebula::Row({apache::thrift::util::enumNameSafe(item.get_role_type()),
spaceNameResult.value()}));
} else {
LOG(ERROR) << " Space name of " << item.get_space_id() << " no found";
LOG(WARNING) << " Space name of " << item.get_space_id()
<< " no found: " << spaceNameResult.status();
return Status::Error("Space not found");
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/graph/executor/admin/DescribeUserExecutor.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#ifndef GRAPH_EXECUTOR_ADMIN_DESCRIBEUSEREXECUTOR_H_
#define GRAPH_EXECUTOR_ADMIN_DESCRIBEUSEREXECUTOR_H_
Expand Down
7 changes: 3 additions & 4 deletions src/graph/executor/admin/DropHostsExecutor.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* Copyright (c) 2021 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/admin/DropHostsExecutor.h"

Expand Down
7 changes: 3 additions & 4 deletions src/graph/executor/admin/DropHostsExecutor.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* Copyright (c) 2021 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#ifndef GRAPH_EXECUTOR_ADMIN_DROP_HOST_EXECUTOR_H_
#define GRAPH_EXECUTOR_ADMIN_DROP_HOST_EXECUTOR_H_
Expand Down
9 changes: 3 additions & 6 deletions src/graph/executor/admin/DropUserExecutor.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/admin/DropUserExecutor.h"

#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Admin.h"

namespace nebula {
Expand Down
7 changes: 3 additions & 4 deletions src/graph/executor/admin/DropUserExecutor.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#ifndef GRAPH_EXECUTOR_ADMIN_DROPUSEREXECUTOR_H_
#define GRAPH_EXECUTOR_ADMIN_DROPUSEREXECUTOR_H_
Expand Down
8 changes: 3 additions & 5 deletions src/graph/executor/admin/GrantRoleExecutor.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/* Copyright (c) 2020 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
// Copyright (c) 2020 vesoft inc. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/admin/GrantRoleExecutor.h"

#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Admin.h"
#include "graph/service/PermissionManager.h"
#include "interface/gen-cpp2/meta_types.h"
Expand Down
Loading