Skip to content

Commit

Permalink
clean codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
xtcyclist committed Nov 29, 2022
1 parent 7059e95 commit 82a74a5
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 18 deletions.
2 changes: 1 addition & 1 deletion conf/nebula-graphd.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
# The number of networking IO threads, 0 for # of CPU cores
--num_netio_threads=0
# The number of threads to execute user queries, 0 for # of CPU cores
--num_worker_threads=1
--num_worker_threads=0
# HTTP service ip
--ws_ip=0.0.0.0
# HTTP service port
Expand Down
2 changes: 0 additions & 2 deletions src/common/utils/NebulaKeyUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ std::string NebulaKeyUtils::tagKey(
.append(vId.data(), vId.size())
.append(vIdLen - vId.size(), pad)
.append(reinterpret_cast<const char*>(&tagId), sizeof(TagID));
VLOG(1) << "tagKey return value: " << key;
return key;
}

Expand All @@ -71,7 +70,6 @@ std::string NebulaKeyUtils::edgeKey(size_t vIdLen,
.append(dstId.data(), dstId.size())
.append(vIdLen - dstId.size(), '\0')
.append(1, ev);
VLOG(1) << "edgeKey return value: " << key;
return key;
}

Expand Down
8 changes: 0 additions & 8 deletions src/graph/executor/query/TraverseExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,9 @@ Status TraverseExecutor::buildInterimPath(GetNeighborsIter* iter) {
return Status::Error("Can't find prev paths.");
}
const auto& paths = pathToSrcFound->second;
// debug
VLOG(1) << "visited src:\t" << srcV.toString() << "\tedge:\t" << e.toString();
VLOG(1) << "prevPath size:\t" << paths.size();
for (auto& prevPath : paths) {
if (hasSameEdge(prevPath, e.getEdge())) {
VLOG(1) << "\t\tsame edge:\t" << prevPath.toString() << "\t\tto edge\t" << e.toString();
continue;
} else {
VLOG(1) << "\t\tdiff edge:\t" << prevPath.toString() << "\t\tto edge\t" << e.toString();
}
vids_.emplace(dst);

Expand All @@ -263,15 +257,13 @@ Status TraverseExecutor::buildInterimPath(GetNeighborsIter* iter) {
List neighbors;
neighbors.values.emplace_back(e);
path.values.emplace_back(std::move(neighbors));
VLOG(1) << "\t\t\tadded path:" << path.toString();
buildPath(current, dst, std::move(path));
++count;
} else {
auto path = prevPath;
auto& eList = path.values.back().mutableList().values;
eList.emplace_back(srcV);
eList.emplace_back(e);
VLOG(1) << "\t\t\tadded path:" << path.toString();
buildPath(current, dst, std::move(path));
++count;
}
Expand Down
2 changes: 0 additions & 2 deletions src/storage/exec/GetNeighborsNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class GetNeighborsNode : public QueryNode<VertexID> {
if (context_->isIntId()) {
row.emplace_back(*reinterpret_cast<const int64_t*>(vId.data()));
} else {
VLOG(1) << "vId to iterate: " << vId;
row.emplace_back(vId);
}
// second column is reserved for stat
Expand Down Expand Up @@ -120,7 +119,6 @@ class GetNeighborsNode : public QueryNode<VertexID> {
auto reader = upstream_->reader();
auto props = context_->props_;
auto columnIdx = context_->columnIdx_;
VLOG(1) << "Key to iterate: " << key.toString();
list.reserve(props->size());
// collect props need to return
if (!QueryUtils::collectEdgeProps(
Expand Down
5 changes: 0 additions & 5 deletions src/storage/exec/HashJoinNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,29 +156,24 @@ class HashJoinNode : public IterateNode<VertexID> {
/* This section is implemented to filter out duplicated self-reflective edges. */
private:
bool isDuplicatedSelfReflectiveEdge(SingleEdgeNode* edgeNode) {
// get destination id
if (!edgeNode->valid()) {
return false;
}
auto rawKey = edgeNode->key();
std::string srcID = NebulaKeyUtils::getSrcId(context_->vIdLen(), rawKey).str();
std::string dstID = NebulaKeyUtils::getDstId(context_->vIdLen(), rawKey).str();
VLOG(1) << "Tried to detect SR Edge with: " << srcID << "\t" << dstID;
if (srcID.compare(dstID) == 0) {
// self-reflective edge
std::string rank = std::to_string(NebulaKeyUtils::getRank(context_->vIdLen(), rawKey));
auto edgeType = NebulaKeyUtils::getEdgeType(context_->vIdLen(), rawKey);
edgeType = edgeType > 0 ? edgeType : -edgeType;
std::string type = std::to_string(edgeType);
// std::string key = srcID + std::to_string(edgeType) + std::to_string(rank);
std::string key;
key.reserve(srcID.size() + type.size() + rank.size());
key = type + rank + srcID;
if (!visitedSelfReflectiveEdges_.insert(key).second) {
return true;
}
for (auto& elem : visitedSelfReflectiveEdges_) {
}
}
return false;
}
Expand Down

0 comments on commit 82a74a5

Please sign in to comment.