Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into fix_path_error
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 authored Apr 1, 2021
2 parents 0c41444 + d6544b2 commit 32b4909
Show file tree
Hide file tree
Showing 92 changed files with 1,209 additions and 1,087 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:
service:
- metad
- storaged
- tools
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/tagname-action
Expand Down
34 changes: 17 additions & 17 deletions package/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,27 @@ do
done

# version is null, get from tag name
[[ -z $version ]] && version=`git describe --exact-match --abbrev=0 --tags | sed 's/^v//'`
[[ -z $version ]] && version=$(git describe --exact-match --abbrev=0 --tags | sed 's/^v//')
# version is null, use UTC date as version
[[ -z $version ]] && version=$(date -u +%Y.%m.%d)-nightly

if [[ -z $version ]]; then
echo "version is null, exit"
echo ${usage}
exit -1
exit 1
fi


if [[ $strip_enable != TRUE ]] && [[ $strip_enable != FALSE ]]; then
echo "strip enable is wrong, exit"
echo ${usage}
exit -1
exit 1
fi

echo "current version is [ $version ], strip enable is [$strip_enable], enablesanitizer is [$enablesanitizer], static_sanitizer is [$static_sanitizer]"

function _build_storage {
if [ ! -d ${storage_dir} && ! -L ${storage_dir} ]; then
if [[ ! -d ${storage_dir} && ! -L ${storage_dir} ]]; then
git clone --single-branch --branch ${branch} https://github.com/vesoft-inc/nebula-storage.git ${storage_dir}
fi

Expand All @@ -101,9 +101,9 @@ function _build_storage {
-S ${storage_dir} \
-B ${storage_build_dir}

if !( cmake --build ${storage_build_dir} -j ${jobs} ); then
if ! ( cmake --build ${storage_build_dir} -j ${jobs} ); then
echo ">>> build nebula storage failed <<<"
exit -1
exit 1
fi
echo ">>> build nebula storage successfully <<<"
}
Expand All @@ -123,9 +123,9 @@ function _build_graph {
-S ${project_dir} \
-B ${build_dir}

if !( cmake --build ${build_dir} -j ${jobs} ); then
if ! ( cmake --build ${build_dir} -j ${jobs} ); then
echo ">>> build nebula graph failed <<<"
exit -1
exit 1
fi
echo ">>> build nebula graph successfully <<<"
}
Expand All @@ -152,7 +152,7 @@ function package {
# The package CMakeLists.txt in ${project_dir}/package/build
package_dir=${build_dir}/package/
if [[ -d $package_dir ]]; then
rm -rf ${package_dir}/*
rm -rf ${package_dir:?}/*
else
mkdir ${package_dir}
fi
Expand All @@ -174,30 +174,30 @@ function package {
sys_ver=""
pType="RPM"
if [[ -f "/etc/redhat-release" ]]; then
sys_name=`cat /etc/redhat-release | cut -d ' ' -f1`
sys_name=$(< /etc/redhat-release cut -d ' ' -f1)
if [[ ${sys_name} == "CentOS" ]]; then
sys_ver=`cat /etc/redhat-release | tr -dc '0-9.' | cut -d \. -f1`
sys_ver=$(< /etc/redhat-release tr -dc '0-9.' | cut -d \. -f1)
sys_ver=.el${sys_ver}.x86_64
elif [[ ${sys_name} == "Fedora" ]]; then
sys_ver=`cat /etc/redhat-release | cut -d ' ' -f3`
sys_ver=$(< /etc/redhat-release cut -d ' ' -f3)
sys_ver=.fc${sys_ver}.x86_64
fi
pType="RPM"
elif [[ -f "/etc/lsb-release" ]]; then
sys_ver=`cat /etc/lsb-release | grep DISTRIB_RELEASE | cut -d "=" -f 2 | sed 's/\.//'`
sys_ver=$(< /etc/lsb-release grep DISTRIB_RELEASE | cut -d "=" -f 2 | sed 's/\.//')
sys_ver=.ubuntu${sys_ver}.amd64
pType="DEB"
fi

if !( cpack -G ${pType} --verbose $args ); then
if ! ( cpack -G ${pType} --verbose $args ); then
echo ">>> package nebula failed <<<"
exit -1
exit 1
else
# rename package file
pkg_names=`ls | grep nebula | grep ${version}`
pkg_names=$(ls ./*nebula*-${version}*)
outputDir=$build_dir/cpack_output
mkdir -p ${outputDir}
for pkg_name in ${pkg_names[@]};
for pkg_name in "${pkg_names[@]}";
do
new_pkg_name=${pkg_name/\-Linux/${sys_ver}}
mv ${pkg_name} ${outputDir}/${new_pkg_name}
Expand Down
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 @@ -62,8 +62,7 @@ nebula_add_executable(
$<TARGET_OBJECTS:common_ft_es_graph_adapter_obj>
$<TARGET_OBJECTS:common_version_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
Loading

0 comments on commit 32b4909

Please sign in to comment.