Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite fetch prop on vertex: 1. support input/variable/multi-vertex-id/multi-tags. 2. keep order of input. #2222

Merged
merged 3 commits into from
Jul 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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