Skip to content

Commit

Permalink
Merge branch 'master' into PushFilterDownInnerJoin
Browse files Browse the repository at this point in the history
  • Loading branch information
czpmango authored Sep 5, 2022
2 parents 5284d8f + 3157fad commit f06219d
Show file tree
Hide file tree
Showing 21 changed files with 85 additions and 35 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
See [How to contribute](https://github.com/vesoft-inc/nebula-community/blob/master/Contributors/how-to-contribute.md) for details about how to contribute to **Nebula Graph**.
See [How to contribute](https://github.com/vesoft-inc/nebula-community/blob/master/Contributors/how-to-contribute.md) for details about how to contribute to **NebulaGraph**.
2 changes: 1 addition & 1 deletion conf/tuned/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Summary

These are tuned profile to configure the system to optimize for the Nebula Graph service.
These are tuned profile to configure the system to optimize for the NebulaGraph service.

Follow below steps to utilize:
* Install the tuned service if absent, and enable it with `systemctl`.
Expand Down
2 changes: 1 addition & 1 deletion conf/tuned/nebula/tuned.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[main]
summary=Optimize for Nebula Graph DBMS
summary=Optimize for NebulaGraph DBMS
include=latency-performance


Expand Down
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Docker Files for Nebula Graph Services
# Docker Files for NebulaGraph Services

Following docker images will be ready in production.

Expand Down
6 changes: 3 additions & 3 deletions package/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ function _build_graph {
${project_dir}

if ! ( make -j ${jobs} ); then
echo ">>> build nebula graph failed <<<"
echo ">>> build NebulaGraph failed <<<"
exit 1
fi
popd
echo ">>> build nebula graph successfully <<<"
echo ">>> build NebulaGraph successfully <<<"
}

# args: <version>
Expand All @@ -179,7 +179,7 @@ function package {
[[ $strip_enable == TRUE ]] && args="-D CPACK_STRIP_FILES=TRUE -D CPACK_RPM_SPEC_MORE_DEFINE="

if ! ( cpack --verbose $args ); then
echo ">>> package nebula failed <<<"
echo ">>> package NebulaGraph failed <<<"
exit 1
else
# rename package file
Expand Down
2 changes: 1 addition & 1 deletion resources/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Overview

This directory holds docs and resources shipped with the **Nebula Graph** package.
This directory holds docs and resources shipped with the **NebulaGraph** package.
2 changes: 1 addition & 1 deletion scripts/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Overview

This document handles **Nebula Graph** installation, and all the operations are done on single hosts.
This document handles **NebulaGraph** installation, and all the operations are done on single hosts.

Firstly, you need to create the config files for the three daemons in the `conf` directory based on their `*.default` counterparts.

Expand Down
2 changes: 1 addition & 1 deletion src/daemons/MetaDaemonInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ std::unique_ptr<nebula::kvstore::KVStore> initKV(std::vector<nebula::HostAddr> p

auto engineRet = kvstore->part(nebula::kDefaultSpaceId, nebula::kDefaultPartId);
if (!nebula::ok(engineRet)) {
LOG(ERROR) << "Get nebula store engine failed";
LOG(ERROR) << "Get Nebula store engine failed";
return nullptr;
}

Expand Down
2 changes: 1 addition & 1 deletion src/daemons/StorageDaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ DEFINE_string(data_path,
"For rocksdb engine, one path one instance.");
DEFINE_string(wal_path,
"",
"Nebula wal path. By default, wal will be stored as a sibling of "
"NebulaGraph wal path. By default, wal will be stored as a sibling of "
"rocksdb data.");
DEFINE_string(listener_path,
"",
Expand Down
4 changes: 2 additions & 2 deletions src/graph/service/GraphFlags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

#include "version/Version.h"

DEFINE_int32(port, 3699, "Nebula Graph daemon's listen port");
DEFINE_int32(port, 3699, "Graph service daemon's listen port");
DEFINE_int32(client_idle_timeout_secs,
28800,
"The number of seconds Nebula service waits before closing the idle connections");
"The number of seconds NebulaGraph service waits before closing the idle connections");
DEFINE_int32(session_idle_timeout_secs, 28800, "The number of seconds before idle sessions expire");
DEFINE_int32(session_reclaim_interval_secs, 10, "Period we try to reclaim expired sessions");
DEFINE_int32(num_netio_threads,
Expand Down
2 changes: 1 addition & 1 deletion src/parser/test/fuzzing/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nebula Graph Database fuzz testing
# NebulaGraph Database fuzz testing

Nebula-graph uses [libfuzzer](http://llvm.org/docs/LibFuzzer.html) for fuzz test.
If you want to use fuzz test, then you need to use the [Clang](https://clang.llvm.org/) to compile Nebula.
Expand Down
14 changes: 12 additions & 2 deletions src/storage/exec/GetPropNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,13 @@ class GetTagPropNode : public QueryNode<VertexID> {
return ret;
}
}
if (filter_ == nullptr || (QueryUtils::vTrue(filter_->eval(*expCtx_)))) {
if (filter_ == nullptr) {
resultDataSet_->rows.emplace_back(std::move(row));
} else {
auto result = QueryUtils::vTrue(filter_->eval(*expCtx_));
if (result.ok() && result.value()) {
resultDataSet_->rows.emplace_back(std::move(row));
}
}
if (expCtx_ != nullptr) {
expCtx_->clear();
Expand Down Expand Up @@ -172,8 +177,13 @@ class GetEdgePropNode : public QueryNode<cpp2::EdgeKey> {
return ret;
}
}
if (filter_ == nullptr || (QueryUtils::vTrue(filter_->eval(*expCtx_)))) {
if (filter_ == nullptr) {
resultDataSet_->rows.emplace_back(std::move(row));
} else {
auto result = QueryUtils::vTrue(filter_->eval(*expCtx_));
if (result.ok() && result.value()) {
resultDataSet_->rows.emplace_back(std::move(row));
}
}
if (expCtx_ != nullptr) {
expCtx_->clear();
Expand Down
12 changes: 10 additions & 2 deletions src/storage/exec/QueryUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,16 @@ namespace storage {

class QueryUtils final {
public:
static inline bool vTrue(const Value& v) {
return v.isBool() && v.getBool();
// The behavior keep same with filter executor
static inline StatusOr<bool> vTrue(const Value& val) {
if (val.isBadNull() || (!val.empty() && !val.isBool() && !val.isNull())) {
return Status::Error("Wrong type result, the type should be NULL, EMPTY or BOOL");
}
if (val.empty() || val.isNull() || !val.getBool()) {
return false;
} else {
return true;
}
}

enum class ReturnColType : uint16_t {
Expand Down
24 changes: 18 additions & 6 deletions src/storage/exec/ScanNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,15 @@ class ScanVertexPropNode : public QueryNode<Cursor> {
break;
}
}
if (ret == nebula::cpp2::ErrorCode::SUCCEEDED &&
(filter_ == nullptr || QueryUtils::vTrue(filter_->eval(*expCtx_)))) {
resultDataSet_->rows.emplace_back(std::move(row));
if (ret == nebula::cpp2::ErrorCode::SUCCEEDED) {
if (filter_ == nullptr) {
resultDataSet_->rows.emplace_back(std::move(row));
} else {
auto result = QueryUtils::vTrue(filter_->eval(*expCtx_));
if (result.ok() && result.value()) {
resultDataSet_->rows.emplace_back(std::move(row));
}
}
}
expCtx_->clear();
for (auto& tagNode : tagNodes_) {
Expand Down Expand Up @@ -323,9 +329,15 @@ class ScanEdgePropNode : public QueryNode<Cursor> {
break;
}
}
if (ret == nebula::cpp2::ErrorCode::SUCCEEDED &&
(filter_ == nullptr || QueryUtils::vTrue(filter_->eval(*expCtx_)))) {
resultDataSet_->rows.emplace_back(std::move(row));
if (ret == nebula::cpp2::ErrorCode::SUCCEEDED) {
if (filter_ == nullptr) {
resultDataSet_->rows.emplace_back(std::move(row));
} else {
auto result = QueryUtils::vTrue(filter_->eval(*expCtx_));
if (result.ok() && result.value()) {
resultDataSet_->rows.emplace_back(std::move(row));
}
}
}
expCtx_->clear();
for (auto& edgeNode : edgeNodes_) {
Expand Down
5 changes: 5 additions & 0 deletions src/storage/query/GetNeighborsProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,13 @@ void GetNeighborsProcessor::runInMultipleThread(const cpp2::GetNeighborsRequest&
folly::collectAll(futures).via(executor_).thenTry([this](auto&& t) mutable {
CHECK(!t.hasException());
const auto& tries = t.value();
size_t sum = 0;
for (size_t j = 0; j < tries.size(); j++) {
CHECK(!tries[j].hasException());
sum += results_[j].size();
}
resultDataSet_.rows.reserve(sum);
for (size_t j = 0; j < tries.size(); j++) {
const auto& [code, partId] = tries[j].value();
if (code != nebula::cpp2::ErrorCode::SUCCEEDED) {
handleErrorCode(code, spaceId_, partId);
Expand Down
5 changes: 5 additions & 0 deletions src/storage/query/GetPropProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,13 @@ void GetPropProcessor::runInMultipleThread(const cpp2::GetPropRequest& req) {
folly::collectAll(futures).via(executor_).thenTry([this](auto&& t) mutable {
CHECK(!t.hasException());
const auto& tries = t.value();
size_t sum = 0;
for (size_t j = 0; j < tries.size(); j++) {
CHECK(!tries[j].hasException());
sum += results_[j].size();
}
resultDataSet_.rows.reserve(sum);
for (size_t j = 0; j < tries.size(); j++) {
const auto& [code, partId] = tries[j].value();
if (code != nebula::cpp2::ErrorCode::SUCCEEDED) {
handleErrorCode(code, spaceId_, partId);
Expand Down
5 changes: 5 additions & 0 deletions src/storage/query/ScanEdgeProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,13 @@ void ScanEdgeProcessor::runInMultipleThread(const cpp2::ScanEdgeRequest& req) {
folly::collectAll(futures).via(executor_).thenTry([this](auto&& t) mutable {
CHECK(!t.hasException());
const auto& tries = t.value();
size_t sum = 0;
for (size_t j = 0; j < tries.size(); j++) {
CHECK(!tries[j].hasException());
sum += results_[j].size();
}
resultDataSet_.rows.reserve(sum);
for (size_t j = 0; j < tries.size(); j++) {
const auto& [code, partId] = tries[j].value();
if (code != nebula::cpp2::ErrorCode::SUCCEEDED) {
handleErrorCode(code, spaceId_, partId);
Expand Down
5 changes: 5 additions & 0 deletions src/storage/query/ScanVertexProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,13 @@ void ScanVertexProcessor::runInMultipleThread(const cpp2::ScanVertexRequest& req
folly::collectAll(futures).via(executor_).thenTry([this](auto&& t) mutable {
CHECK(!t.hasException());
const auto& tries = t.value();
size_t sum = 0;
for (size_t j = 0; j < tries.size(); j++) {
CHECK(!tries[j].hasException());
sum += results_[j].size();
}
resultDataSet_.rows.reserve(sum);
for (size_t j = 0; j < tries.size(); j++) {
const auto& [code, partId] = tries[j].value();
if (code != nebula::cpp2::ErrorCode::SUCCEEDED) {
handleErrorCode(code, spaceId_, partId);
Expand Down
4 changes: 2 additions & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nebula Graph Test Manual
# NebulaGraph Test Manual

## Usage

Expand Down Expand Up @@ -35,7 +35,7 @@ $ make BUILD_DIR=/path/to/nebula/build/directory up

### Run all test cases

There are two classes of nebula graph test cases, one is built on pytest and another is built on TCK. We split them into different execution methods:
There are two classes of NebulaGraph test cases, one is built on pytest and another is built on TCK. We split them into different execution methods:

```shell
$ make test # run pytest cases
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ def pytest_addoption(parser):
parser.addoption("--build_dir",
dest="build_dir",
default=BUILD_DIR,
help="Nebula Graph CMake build directory")
help="NebulaGraph CMake build directory")
parser.addoption("--src_dir",
dest="src_dir",
default=NEBULA_HOME,
help="Nebula Graph workspace")
help="NebulaGraph workspace")


def pytest_bdd_step_error(request, feature, scenario, step, step_func, step_func_args):
Expand Down
14 changes: 7 additions & 7 deletions tests/nebula-test-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def init_parser():
'--build_dir',
dest='build_dir',
default=BUILD_DIR,
help='Build directory of nebula graph',
help='Build directory of NebulaGraph',
)
opt_parser.add_option(
'--rm_dir',
Expand All @@ -39,10 +39,10 @@ def init_parser():
help='Whether to remove the test folder',
)
opt_parser.add_option(
'--user', dest='user', default='root', help='nebula graph user'
'--user', dest='user', default='root', help='NebulaGraph user'
)
opt_parser.add_option(
'--password', dest='password', default='nebula', help='nebula graph password'
'--password', dest='password', default='nebula', help='NebulaGraph password'
)
opt_parser.add_option('--cmd', dest='cmd', default='', help='start or stop command')
opt_parser.add_option(
Expand Down Expand Up @@ -114,7 +114,7 @@ def opt_is(val, expect):

def start_nebula(nb, configs):
if configs.address is not None and configs.address != "":
print('test remote nebula graph, address is {}'.format(configs.address))
print('test remote NebulaGraph, address is {}'.format(configs.address))
if len(configs.address.split(':')) != 2:
raise Exception('Invalid address, address is {}'.format(configs.address))
address, port = configs.address.split(':')
Expand Down Expand Up @@ -161,7 +161,7 @@ def start_nebula(nb, configs):

def start_standalone(nb, configs):
if configs.address is not None and configs.address != "":
print('test remote nebula graph, address is {}'.format(configs.address))
print('test remote NebulaGraph, address is {}'.format(configs.address))
if len(configs.address.split(':')) != 2:
raise Exception('Invalid address, address is {}'.format(configs.address))
address, port = configs.address.split(':')
Expand Down Expand Up @@ -209,7 +209,7 @@ def start_standalone(nb, configs):

def stop_nebula(nb, configs=None):
if configs.address is not None and configs.address != "":
print('test remote nebula graph, no need to stop nebula.')
print('test remote NebulaGraph, no need to stop nebula.')
return

with open(NB_TMP_PATH, "r") as f:
Expand All @@ -235,7 +235,7 @@ def stop_nebula(nb, configs=None):
graphd_inst = 2
is_standalone = False

# Setup nebula graph service
# Setup NebulaGraph service
nebula_svc = NebulaService(
configs.build_dir,
NEBULA_HOME,
Expand Down

0 comments on commit f06219d

Please sign in to comment.