-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix_unwind_crash
- Loading branch information
Showing
58 changed files
with
1,808 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* Copyright (c) 2021 vesoft inc. All rights reserved. | ||
* | ||
* This source code is licensed under Apache 2.0 License. | ||
*/ | ||
|
||
#include "graph/executor/query/ScanEdgesExecutor.h" | ||
|
||
#include "common/time/ScopedTimer.h" | ||
#include "graph/context/QueryContext.h" | ||
#include "graph/planner/plan/Query.h" | ||
#include "graph/util/SchemaUtil.h" | ||
|
||
using nebula::storage::StorageClient; | ||
using nebula::storage::StorageRpcResponse; | ||
using nebula::storage::cpp2::ScanResponse; | ||
|
||
namespace nebula { | ||
namespace graph { | ||
|
||
folly::Future<Status> ScanEdgesExecutor::execute() { return scanEdges(); } | ||
|
||
folly::Future<Status> ScanEdgesExecutor::scanEdges() { | ||
SCOPED_TIMER(&execTime_); | ||
StorageClient *client = qctx()->getStorageClient(); | ||
auto *se = asNode<ScanEdges>(node()); | ||
if (se->limit() < 0) { | ||
return Status::Error("Scan edges must specify limit number."); | ||
} | ||
|
||
time::Duration scanEdgesTime; | ||
StorageClient::CommonRequestParam param(se->space(), | ||
qctx()->rctx()->session()->id(), | ||
qctx()->plan()->id(), | ||
qctx()->plan()->isProfileEnabled()); | ||
return DCHECK_NOTNULL(client) | ||
->scanEdge(param, *DCHECK_NOTNULL(se->props()), se->limit(), se->filter()) | ||
.via(runner()) | ||
.ensure([this, scanEdgesTime]() { | ||
SCOPED_TIMER(&execTime_); | ||
otherStats_.emplace("total_rpc", folly::sformat("{}(us)", scanEdgesTime.elapsedInUSec())); | ||
}) | ||
.thenValue([this, se](StorageRpcResponse<ScanResponse> &&rpcResp) { | ||
SCOPED_TIMER(&execTime_); | ||
addStats(rpcResp, otherStats_); | ||
return handleResp(std::move(rpcResp), se->colNames()); | ||
}); | ||
} | ||
|
||
} // namespace graph | ||
} // namespace nebula |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* Copyright (c) 2021 vesoft inc. All rights reserved. | ||
* | ||
* This source code is licensed under Apache 2.0 License. | ||
*/ | ||
|
||
#include "graph/executor/query/GetPropExecutor.h" | ||
|
||
namespace nebula { | ||
namespace graph { | ||
class ScanEdgesExecutor final : public GetPropExecutor { | ||
public: | ||
ScanEdgesExecutor(const PlanNode *node, QueryContext *qctx) | ||
: GetPropExecutor("ScanEdgesExecutor", node, qctx) {} | ||
|
||
folly::Future<Status> execute() override; | ||
|
||
private: | ||
folly::Future<Status> scanEdges(); | ||
}; | ||
|
||
} // namespace graph | ||
} // namespace nebula |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* Copyright (c) 2021 vesoft inc. All rights reserved. | ||
* | ||
* This source code is licensed under Apache 2.0 License. | ||
*/ | ||
|
||
#include "graph/executor/query/ScanVerticesExecutor.h" | ||
|
||
#include "common/time/ScopedTimer.h" | ||
#include "graph/context/QueryContext.h" | ||
#include "graph/util/SchemaUtil.h" | ||
|
||
using nebula::storage::StorageClient; | ||
using nebula::storage::StorageRpcResponse; | ||
using nebula::storage::cpp2::ScanResponse; | ||
|
||
namespace nebula { | ||
namespace graph { | ||
|
||
folly::Future<Status> ScanVerticesExecutor::execute() { return scanVertices(); } | ||
|
||
folly::Future<Status> ScanVerticesExecutor::scanVertices() { | ||
SCOPED_TIMER(&execTime_); | ||
|
||
auto *sv = asNode<ScanVertices>(node()); | ||
if (sv->limit() < 0) { | ||
return Status::Error("Scan vertices must specify limit number."); | ||
} | ||
StorageClient *storageClient = qctx()->getStorageClient(); | ||
|
||
time::Duration scanVertexTime; | ||
StorageClient::CommonRequestParam param(sv->space(), | ||
qctx()->rctx()->session()->id(), | ||
qctx()->plan()->id(), | ||
qctx()->plan()->isProfileEnabled()); | ||
return DCHECK_NOTNULL(storageClient) | ||
->scanVertex(param, *DCHECK_NOTNULL(sv->props()), sv->limit(), sv->filter()) | ||
.via(runner()) | ||
.ensure([this, scanVertexTime]() { | ||
SCOPED_TIMER(&execTime_); | ||
otherStats_.emplace("total_rpc", folly::sformat("{}(us)", scanVertexTime.elapsedInUSec())); | ||
}) | ||
.thenValue([this, sv](StorageRpcResponse<ScanResponse> &&rpcResp) { | ||
SCOPED_TIMER(&execTime_); | ||
addStats(rpcResp, otherStats_); | ||
return handleResp(std::move(rpcResp), sv->colNames()); | ||
}); | ||
} | ||
|
||
} // namespace graph | ||
} // namespace nebula |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* Copyright (c) 2021 vesoft inc. All rights reserved. | ||
* | ||
* This source code is licensed under Apache 2.0 License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "graph/executor/query/GetPropExecutor.h" | ||
#include "graph/planner/plan/Query.h" | ||
|
||
namespace nebula { | ||
namespace graph { | ||
|
||
class ScanVerticesExecutor final : public GetPropExecutor { | ||
public: | ||
ScanVerticesExecutor(const PlanNode *node, QueryContext *qctx) | ||
: GetPropExecutor("ScanVerticesExecutor", node, qctx) {} | ||
|
||
folly::Future<Status> execute() override; | ||
|
||
private: | ||
folly::Future<Status> scanVertices(); | ||
}; | ||
|
||
} // namespace graph | ||
} // namespace nebula |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.