Skip to content

Commit

Permalink
Pump up third party (vesoft-inc#864)
Browse files Browse the repository at this point in the history
* Pump up third party

* fix build

* fix insert edge

* fix rebase
  • Loading branch information
dutor authored Mar 31, 2021
1 parent 612d511 commit 8c0c1e3
Show file tree
Hide file tree
Showing 81 changed files with 508 additions and 479 deletions.
6 changes: 2 additions & 4 deletions src/context/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ nebula_add_test(
${THRIFT_LIBRARIES}
gtest
wangle
proxygenhttpserver
proxygenlib
${PROXYGEN_LIBRARIES}
)

nebula_add_executable(
Expand All @@ -69,6 +68,5 @@ nebula_add_executable(
boost_regex
${THRIFT_LIBRARIES}
wangle
proxygenhttpserver
proxygenlib
${PROXYGEN_LIBRARIES}
)
3 changes: 1 addition & 2 deletions src/daemons/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ nebula_add_executable(
$<TARGET_OBJECTS:common_graph_obj>
$<TARGET_OBJECTS:common_ft_es_graph_adapter_obj>
LIBRARIES
proxygenhttpserver
proxygenlib
${PROXYGEN_LIBRARIES}
${THRIFT_LIBRARIES}
wangle
)
Expand Down
1 change: 0 additions & 1 deletion src/daemons/GraphDaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ int main(int argc, char *argv[]) {
gServer->setIdleTimeout(std::chrono::seconds(FLAGS_client_idle_timeout_secs));
gServer->setNumAcceptThreads(FLAGS_num_accept_threads);
gServer->setListenBacklog(FLAGS_listen_backlog);
gServer->setThreadStackSizeMB(5);
setupThreadManager();

// Setup the signal handlers
Expand Down
4 changes: 2 additions & 2 deletions src/executor/StorageAccessExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ DataSet buildRequestDataSet(const SpaceInfo &space,
std::unordered_set<VidType> uniqueSet;
uniqueSet.reserve(iter->size());

const auto &vidType = space.spaceDesc.vid_type;
const auto &vidType = *(space.spaceDesc.vid_type_ref());

for (; iter->valid(); iter->next()) {
auto vid = expr->eval(exprCtx(iter));
Expand All @@ -66,7 +66,7 @@ DataSet buildRequestDataSet(const SpaceInfo &space,
} // namespace internal

bool StorageAccessExecutor::isIntVidType(const SpaceInfo &space) const {
return space.spaceDesc.vid_type.type == meta::cpp2::PropertyType::INT64;
return (*space.spaceDesc.vid_type_ref()).type == meta::cpp2::PropertyType::INT64;
}

DataSet StorageAccessExecutor::buildRequestDataSetByVidType(Iterator *iter,
Expand Down
5 changes: 3 additions & 2 deletions src/executor/StorageAccessExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#ifndef EXECUTOR_STORAGEACCESSEXECUTOR_H_
#define EXECUTOR_STORAGEACCESSEXECUTOR_H_

#include <thrift/lib/cpp/util/EnumUtils.h>
#include "common/clients/storage/StorageClientBase.h"
#include "context/QueryContext.h"
#include "executor/Executor.h"
Expand Down Expand Up @@ -40,7 +41,7 @@ class StorageAccessExecutor : public Executor {
const auto &failedCodes = rpcResp.failedParts();
for (auto it = failedCodes.begin(); it != failedCodes.end(); it++) {
LOG(ERROR) << name_ << " failed, error "
<< storage::cpp2::_ErrorCode_VALUES_TO_NAMES.at(it->second) << ", part "
<< apache::thrift::util::enumNameSafe(it->second) << ", part "
<< it->first;
}
// cannot execute at all, or partial success is not accepted
Expand Down Expand Up @@ -114,7 +115,7 @@ class StorageAccessExecutor : public Executor {
default:
auto status = Status::Error("Storage Error: part: %d, error: %s(%d).",
partId,
storage::cpp2::_ErrorCode_VALUES_TO_NAMES.at(code),
apache::thrift::util::enumNameSafe(code).c_str(),
static_cast<int32_t>(code));
LOG(ERROR) << status;
return status;
Expand Down
2 changes: 1 addition & 1 deletion src/executor/admin/BalanceExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ folly::Future<Status> BalanceExecutor::balance() {
auto *bNode = asNode<Balance>(node());
return qctx()->getMetaClient()->balance(bNode->deleteHosts(), false, false)
.via(runner())
.then([this](StatusOr<int64_t> resp) {
.thenValue([this](StatusOr<int64_t> resp) {
SCOPED_TIMER(&execTime_);
if (!resp.ok()) {
LOG(ERROR) << resp.status();
Expand Down
2 changes: 1 addition & 1 deletion src/executor/admin/BalanceLeadersExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ folly::Future<Status> BalanceLeadersExecutor::execute() {
folly::Future<Status> BalanceLeadersExecutor::balanceLeaders() {
return qctx()->getMetaClient()->balanceLeader()
.via(runner())
.then([this](StatusOr<bool> resp) {
.thenValue([this](StatusOr<bool> resp) {
SCOPED_TIMER(&execTime_);
if (!resp.ok()) {
LOG(ERROR) << resp.status();
Expand Down
2 changes: 1 addition & 1 deletion src/executor/admin/ChangePasswordExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ folly::Future<Status> ChangePasswordExecutor::changePassword() {
encryption::MD5Utils::md5Encode(*cpNode->newPassword()),
encryption::MD5Utils::md5Encode(*cpNode->password()))
.via(runner())
.then([this](StatusOr<bool> &&resp) {
.thenValue([this](StatusOr<bool> &&resp) {
SCOPED_TIMER(&execTime_);
NG_RETURN_IF_ERROR(resp);
if (!resp.value()) {
Expand Down
16 changes: 9 additions & 7 deletions src/executor/admin/ConfigExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/

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

#include "common/conf/Configuration.h"
#include "executor/admin/ConfigExecutor.h"
#include "planner/Admin.h"
Expand All @@ -18,10 +20,10 @@ std::vector<Value> ConfigBaseExecutor::generateColumns(const meta::cpp2::ConfigI
std::vector<Value> columns;
columns.resize(5);
auto value = item.get_value();
columns[0].setStr(meta::cpp2::_ConfigModule_VALUES_TO_NAMES.at(item.get_module()));
columns[0].setStr(apache::thrift::util::enumNameSafe(item.get_module()));
columns[1].setStr(item.get_name());
columns[2].setStr(value.typeName());
columns[3].setStr(meta::cpp2::_ConfigMode_VALUES_TO_NAMES.at(item.get_mode()));
columns[3].setStr(apache::thrift::util::enumNameSafe(item.get_mode()));
columns[4] = std::move(value);
return columns;
}
Expand All @@ -42,13 +44,13 @@ folly::Future<Status> ShowConfigsExecutor::execute() {
auto *scNode = asNode<ShowConfigs>(node());
return qctx()->getMetaClient()->listConfigs(scNode->getModule())
.via(runner())
.then([this, scNode](StatusOr<std::vector<meta::cpp2::ConfigItem>> resp) {
.thenValue([this, scNode](StatusOr<std::vector<meta::cpp2::ConfigItem>> resp) {
if (!resp.ok()) {
auto module = meta::cpp2::_ConfigModule_VALUES_TO_NAMES.at(scNode->getModule());
auto module = apache::thrift::util::enumNameSafe(scNode->getModule());
LOG(ERROR) << "Show configs `" << module
<< "' failed: " << resp.status();
return Status::Error("Show config `%s' failed: %s",
module,
module.c_str(),
resp.status().toString().c_str());
}

Expand All @@ -65,7 +67,7 @@ folly::Future<Status> SetConfigExecutor::execute() {
scNode->getName(),
scNode->getValue())
.via(runner())
.then([scNode](StatusOr<bool> resp) {
.thenValue([scNode](StatusOr<bool> resp) {
if (!resp.ok()) {
LOG(ERROR) << "Set config `" << scNode->getName()
<< "' failed: " << resp.status();
Expand All @@ -84,7 +86,7 @@ folly::Future<Status> GetConfigExecutor::execute() {
return qctx()->getMetaClient()->getConfig(gcNode->getModule(),
gcNode->getName())
.via(runner())
.then([this, gcNode](StatusOr<std::vector<meta::cpp2::ConfigItem>> resp) {
.thenValue([this, gcNode](StatusOr<std::vector<meta::cpp2::ConfigItem>> resp) {
if (!resp.ok()) {
LOG(ERROR) << "Get config `" << gcNode->getName()
<< "' failed: " << resp.status();
Expand Down
2 changes: 1 addition & 1 deletion src/executor/admin/CreateUserExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ folly::Future<Status> CreateUserExecutor::createUser() {
encryption::MD5Utils::md5Encode(*cuNode->password()),
cuNode->ifNotExist())
.via(runner())
.then([this](StatusOr<bool> resp) {
.thenValue([this](StatusOr<bool> resp) {
SCOPED_TIMER(&execTime_);
NG_RETURN_IF_ERROR(resp);
if (!resp.value()) {
Expand Down
2 changes: 1 addition & 1 deletion src/executor/admin/DownloadExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ folly::Future<Status> DownloadExecutor::execute() {
dNode->getHdfsPath(),
spaceId)
.via(runner())
.then([this](StatusOr<bool> resp) {
.thenValue([this](StatusOr<bool> resp) {
SCOPED_TIMER(&execTime_);
NG_RETURN_IF_ERROR(resp);
if (!resp.value()) {
Expand Down
2 changes: 1 addition & 1 deletion src/executor/admin/DropUserExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ folly::Future<Status> DropUserExecutor::dropUser() {
auto *duNode = asNode<DropUser>(node());
return qctx()->getMetaClient()->dropUser(*duNode->username(), duNode->ifExist())
.via(runner())
.then([this](StatusOr<bool> resp) {
.thenValue([this](StatusOr<bool> resp) {
SCOPED_TIMER(&execTime_);
NG_RETURN_IF_ERROR(resp);
if (!resp.value()) {
Expand Down
2 changes: 1 addition & 1 deletion src/executor/admin/GrantRoleExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ folly::Future<Status> GrantRoleExecutor::grantRole() {
->getMetaClient()
->grantToUser(std::move(item))
.via(runner())
.then([this](StatusOr<bool> resp) {
.thenValue([this](StatusOr<bool> resp) {
SCOPED_TIMER(&execTime_);
NG_RETURN_IF_ERROR(resp);
if (!resp.value()) {
Expand Down
14 changes: 7 additions & 7 deletions src/executor/admin/GroupExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ folly::Future<Status> AddGroupExecutor::execute() {
auto *agNode = asNode<AddGroup>(node());
return qctx()->getMetaClient()->addGroup(agNode->groupName(), agNode->zoneNames())
.via(runner())
.then([](StatusOr<bool> resp) {
.thenValue([](StatusOr<bool> resp) {
if (!resp.ok()) {
LOG(ERROR) << "Add Group Failed: " << resp.status();
return resp.status();
Expand All @@ -30,7 +30,7 @@ folly::Future<Status> DropGroupExecutor::execute() {
auto *dgNode = asNode<DropGroup>(node());
return qctx()->getMetaClient()->dropGroup(dgNode->groupName())
.via(runner())
.then([](StatusOr<bool> resp) {
.thenValue([](StatusOr<bool> resp) {
if (!resp.ok()) {
LOG(ERROR) << "Drop Group Failed: " << resp.status();
return resp.status();
Expand All @@ -44,7 +44,7 @@ folly::Future<Status> DescribeGroupExecutor::execute() {
auto *dgNode = asNode<DescribeGroup>(node());
return qctx()->getMetaClient()->getGroup(dgNode->groupName())
.via(runner())
.then([this](StatusOr<std::vector<std::string>> resp) {
.thenValue([this](StatusOr<std::vector<std::string>> resp) {
if (!resp.ok()) {
LOG(ERROR) << "Describe Group Failed: " << resp.status();
return resp.status();
Expand All @@ -68,7 +68,7 @@ folly::Future<Status> AddZoneIntoGroupExecutor::execute() {
auto *azNode = asNode<AddZoneIntoGroup>(node());
return qctx()->getMetaClient()->addZoneIntoGroup(azNode->zoneName(), azNode->groupName())
.via(runner())
.then([](StatusOr<bool> resp) {
.thenValue([](StatusOr<bool> resp) {
if (!resp.ok()) {
LOG(ERROR) << "Add Zone Into Group Failed: " << resp.status();
return resp.status();
Expand All @@ -82,7 +82,7 @@ folly::Future<Status> DropZoneFromGroupExecutor::execute() {
auto *dzNode = asNode<DropZoneFromGroup>(node());
return qctx()->getMetaClient()->dropZoneFromGroup(dzNode->zoneName(), dzNode->groupName())
.via(runner())
.then([](StatusOr<bool> resp) {
.thenValue([](StatusOr<bool> resp) {
if (!resp.ok()) {
LOG(ERROR) << "Drop Zone From Group Failed: " << resp.status();
return resp.status();
Expand All @@ -95,7 +95,7 @@ folly::Future<Status> ListGroupsExecutor::execute() {
SCOPED_TIMER(&execTime_);
return qctx()->getMetaClient()->listGroups()
.via(runner())
.then([this](StatusOr<std::vector<meta::cpp2::Group>> resp) {
.thenValue([this](StatusOr<std::vector<meta::cpp2::Group>> resp) {
if (!resp.ok()) {
LOG(ERROR) << "List Groups Failed: " << resp.status();
return resp.status();
Expand All @@ -105,7 +105,7 @@ folly::Future<Status> ListGroupsExecutor::execute() {
DataSet dataSet({"Name", "Zone"});
for (auto &group : groups) {
for (auto &zone : group.get_zone_names()) {
Row row({group.group_name, zone});
Row row({*group.group_name_ref(), zone});
dataSet.rows.emplace_back(std::move(row));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/executor/admin/IngestExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ folly::Future<Status> IngestExecutor::execute() {
auto spaceId = qctx()->rctx()->session()->space().id;
return qctx()->getMetaClient()->ingest(spaceId)
.via(runner())
.then([this](StatusOr<bool> resp) {
.thenValue([this](StatusOr<bool> resp) {
SCOPED_TIMER(&execTime_);
NG_RETURN_IF_ERROR(resp);
if (!resp.value()) {
Expand Down
8 changes: 5 additions & 3 deletions src/executor/admin/ListRolesExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/

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

#include "executor/admin/ListRolesExecutor.h"
#include "context/QueryContext.h"
#include "planner/Admin.h"
Expand All @@ -23,7 +25,7 @@ folly::Future<Status> ListRolesExecutor::listRoles() {
->getMetaClient()
->listRoles(lrNode->space())
.via(runner())
.then([this](StatusOr<std::vector<meta::cpp2::RoleItem>> &&resp) {
.thenValue([this](StatusOr<std::vector<meta::cpp2::RoleItem>> &&resp) {
SCOPED_TIMER(&execTime_);
if (!resp.ok()) {
return std::move(resp).status();
Expand All @@ -39,12 +41,12 @@ folly::Future<Status> ListRolesExecutor::listRoles() {
foundItem->get_role_type() != meta::cpp2::RoleType::ADMIN) {
v.emplace_back(
Row({foundItem->get_user_id(),
meta::cpp2::_RoleType_VALUES_TO_NAMES.at(foundItem->get_role_type())}));
apache::thrift::util::enumNameSafe(foundItem->get_role_type())}));
} else {
for (const auto &item : items) {
v.emplace_back(nebula::Row(
{item.get_user_id(),
meta::cpp2::_RoleType_VALUES_TO_NAMES.at(item.get_role_type())}));
apache::thrift::util::enumNameSafe(item.get_role_type())}));
}
}
return finish(std::move(v));
Expand Down
6 changes: 4 additions & 2 deletions src/executor/admin/ListUserRolesExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/

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

#include "executor/admin/ListUserRolesExecutor.h"
#include "planner/Admin.h"
#include "context/QueryContext.h"
Expand All @@ -20,7 +22,7 @@ folly::Future<Status> ListUserRolesExecutor::listUserRoles() {
auto *lurNode = asNode<ListUserRoles>(node());
return qctx()->getMetaClient()->getUserRoles(*lurNode->username())
.via(runner())
.then([this](StatusOr<std::vector<meta::cpp2::RoleItem>> &&resp) {
.thenValue([this](StatusOr<std::vector<meta::cpp2::RoleItem>> &&resp) {
SCOPED_TIMER(&execTime_);
if (!resp.ok()) {
return std::move(resp).status();
Expand All @@ -31,7 +33,7 @@ folly::Future<Status> ListUserRolesExecutor::listUserRoles() {
v.emplace_back(nebula::Row(
{
item.get_user_id(),
meta::cpp2::_RoleType_VALUES_TO_NAMES.at(item.get_role_type())
apache::thrift::util::enumNameSafe(item.get_role_type())
}));
}
return finish(std::move(v));
Expand Down
2 changes: 1 addition & 1 deletion src/executor/admin/ListUsersExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ folly::Future<Status> ListUsersExecutor::execute() {
folly::Future<Status> ListUsersExecutor::listUsers() {
return qctx()->getMetaClient()->listUsers()
.via(runner())
.then([this](StatusOr<std::unordered_map<std::string, std::string>> &&resp) {
.thenValue([this](StatusOr<std::unordered_map<std::string, std::string>> &&resp) {
SCOPED_TIMER(&execTime_);
if (!resp.ok()) {
return std::move(resp).status();
Expand Down
Loading

0 comments on commit 8c0c1e3

Please sign in to comment.