Skip to content

Commit

Permalink
concurrent build path
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Mar 19, 2023
1 parent 6bf3490 commit ae8d23a
Show file tree
Hide file tree
Showing 15 changed files with 204 additions and 334 deletions.
1 change: 1 addition & 0 deletions src/common/memory/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ nebula_add_library(
memory_obj OBJECT
MemoryUtils.cpp
MemoryTracker.cpp
NewDelete.cpp
)

nebula_add_subdirectory(test)
1 change: 1 addition & 0 deletions src/graph/executor/Executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class Executor : private boost::noncopyable, private cpp::NonMovable {
folly::Future<Status> error(Status status) const;

static Status memoryExceededStatus() {
DLOG(ERROR) << "test ";
return Status::GraphMemoryExceeded(
"(%d)", static_cast<int32_t>(nebula::cpp2::ErrorCode::E_GRAPH_MEMORY_EXCEEDED));
}
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/PathBaseExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ folly::Future<std::vector<Value>> PathBaseExecutor::getProps(

time::Duration getPropsTime;
StorageClient* storageClient = qctx_->getStorageClient();
StorageClient::CommonRequestParam param(qctx_->spaceId(),
StorageClient::CommonRequestParam param(qctx_->rctx()->session()->space().id,
qctx_->rctx()->session()->id(),
qctx_->plan()->id(),
qctx_->plan()->isProfileEnabled());
Expand Down
42 changes: 0 additions & 42 deletions src/graph/executor/PathBaseExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,48 +58,6 @@ class PathBaseExecutor : public Executor {
return Result::State::kSuccess;
}

struct VertexHash {
std::size_t operator()(const Value& v) const {
switch (v.type()) {
case Value::Type::VERTEX: {
auto& vid = v.getVertex().vid;
if (vid.type() == Value::Type::STRING) {
return std::hash<std::string>()(vid.getStr());
} else {
return vid.getInt();
}
}
case Value::Type::STRING: {
return std::hash<std::string>()(v.getStr());
}
case Value::Type::INT: {
return v.getInt();
}
default: {
return v.hash();
}
}
}
};

struct VertexEqual {
bool operator()(const Value& lhs, const Value& rhs) const {
if (lhs.type() == rhs.type()) {
if (lhs.isVertex()) {
return lhs.getVertex().vid == rhs.getVertex().vid;
}
return lhs == rhs;
}
if (lhs.type() == Value::Type::VERTEX) {
return lhs.getVertex().vid == rhs;
}
if (rhs.type() == Value::Type::VERTEX) {
return lhs == rhs.getVertex().vid;
}
return lhs == rhs;
}
};

protected:
folly::SpinLock statsLock_;
};
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/StorageAccessExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class StorageAccessExecutor : public Executor {
return Status::Error("Storage Error: Atomic operation failed.");
// E_GRAPH_MEMORY_EXCEEDED may happen during rpc response deserialize.
case nebula::cpp2::ErrorCode::E_GRAPH_MEMORY_EXCEEDED:
DLOG(ERROR) << "test ";
return Status::GraphMemoryExceeded("(%d)", static_cast<int32_t>(code));
case nebula::cpp2::ErrorCode::E_STORAGE_MEMORY_EXCEEDED:
return Status::StorageMemoryExceeded("(%d)", static_cast<int32_t>(code));
Expand Down
Loading

0 comments on commit ae8d23a

Please sign in to comment.