Skip to content

Commit

Permalink
rewrite fetch prop on vertex: 1. support input/variable/multi-vertex-…
Browse files Browse the repository at this point in the history
…id/multi-tags. 2. keep order of input. (vesoft-inc#2222)

Co-authored-by: trippli <[email protected]>
Co-authored-by: dangleptr <[email protected]>
  • Loading branch information
3 people authored Jul 22, 2020
1 parent 1ce34f4 commit 6c697d3
Show file tree
Hide file tree
Showing 19 changed files with 850 additions and 376 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ pids/
cmake-build-debug/
cmake-build-release/
.vscode/
cmake-build-debug*
cmake-build-release*

3 changes: 1 addition & 2 deletions src/graph/CloudAuthenticator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ bool CloudAuthenticator::auth(const std::string& user, const std::string& passwo
}

// Second, use user + password authentication methods
StatusOr<std::string> result;
std::string userAndPasswd = user + ":" + password;
std::string base64Str = encryption::Base64::encode(userAndPasswd);

std::string header = "-H \"Content-Type: application/json\" -H \"Authorization:Nebula ";
header = header + base64Str + "\"";
result = http::HttpClient::post(FLAGS_cloud_http_url, header);
auto result = http::HttpClient::post(FLAGS_cloud_http_url, header);

if (!result.ok()) {
LOG(ERROR) << result.status();
Expand Down
11 changes: 8 additions & 3 deletions src/graph/FetchEdgesExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ Status FetchEdgesExecutor::prepareClauses() {
expCtx_->setStorageClient(ectx()->getStorageClient());
spaceId_ = ectx()->rctx()->session()->space();
yieldClause_ = DCHECK_NOTNULL(sentence_)->yieldClause();
labelName_ = sentence_->edge();
auto edgeLabelNames = sentence_->edges()->labels();
if (edgeLabelNames.size() != 1) {
status = Status::Error("fetch prop on edge support only one edge label now.");
break;
}
labelName_ = edgeLabelNames[0];
auto result = ectx()->schemaManager()->toEdgeType(spaceId_, *labelName_);
if (!result.ok()) {
status = result.status();
Expand Down Expand Up @@ -308,7 +313,7 @@ void FetchEdgesExecutor::fetchEdges() {
auto cb = [this] (RpcResponse &&result) mutable {
auto completeness = result.completeness();
if (completeness == 0) {
doError(Status::Error("Get edge `%s' props failed", sentence_->edge()->c_str()));
doError(Status::Error("Get edge `%s' props failed", labelName_->c_str()));
return;
} else if (completeness != 100) {
LOG(INFO) << "Get edges partially failed: " << completeness << "%";
Expand All @@ -322,7 +327,7 @@ void FetchEdgesExecutor::fetchEdges() {
};
auto error = [this] (auto &&e) {
auto msg = folly::stringPrintf("Get edge `%s' props faield: %s.",
sentence_->edge()->c_str(), e.what().c_str());
labelName_->c_str(), e.what().c_str());
LOG(ERROR) << msg;
doError(Status::Error(std::move(msg)));
};
Expand Down
Loading

0 comments on commit 6c697d3

Please sign in to comment.