Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7149ba2

Browse files
xuguruogudangleptr
andauthored
remove lru partid as hint. (vesoft-inc#2253)
Co-authored-by: trippli <[email protected]> Co-authored-by: dangleptr <[email protected]>
1 parent c95e85e commit 7149ba2

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

src/storage/index/IndexExecutor.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ kvstore::ResultCode IndexExecutor<RESP>::getVertexRow(PartitionID partId,
182182
return kvstore::ResultCode::SUCCEEDED;
183183
}
184184
if (FLAGS_enable_vertex_cache && vertexCache_ != nullptr) {
185-
auto result = vertexCache_->get(std::make_pair(vId, tagOrEdge_), partId);
185+
auto result = vertexCache_->get(std::make_pair(vId, tagOrEdge_));
186186
if (result.ok()) {
187187
auto v = std::move(result).value();
188188
auto reader = RowReader::getTagPropReader(schemaMan_, v, spaceId_, tagOrEdge_);
@@ -216,7 +216,7 @@ kvstore::ResultCode IndexExecutor<RESP>::getVertexRow(PartitionID partId,
216216
data->set_props(std::move(row));
217217
if (FLAGS_enable_vertex_cache && vertexCache_ != nullptr) {
218218
vertexCache_->insert(std::make_pair(vId, tagOrEdge_),
219-
iter->val().str(), partId);
219+
iter->val().str());
220220
VLOG(3) << "Insert cache for vId " << vId << ", tagId " << tagOrEdge_;
221221
}
222222
} else {

src/storage/mutate/AddVerticesProcessor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void AddVerticesProcessor::process(const cpp2::AddVerticesRequest& req) {
4444
tag.get_tag_id(), version);
4545
data.emplace_back(std::move(key), std::move(tag.get_props()));
4646
if (FLAGS_enable_vertex_cache && vertexCache_ != nullptr) {
47-
vertexCache_->evict(std::make_pair(v.get_id(), tag.get_tag_id()), partId);
47+
vertexCache_->evict(std::make_pair(v.get_id(), tag.get_tag_id()));
4848
VLOG(3) << "Evict cache for vId " << v.get_id()
4949
<< ", tagId " << tag.get_tag_id();
5050
}
@@ -95,7 +95,7 @@ std::string AddVerticesProcessor::addVertices(int64_t version, PartitionID partI
9595
auto key = NebulaKeyUtils::vertexKey(partId, vId, tagId, version);
9696
newVertices[key] = std::move(prop);
9797
if (FLAGS_enable_vertex_cache && this->vertexCache_ != nullptr) {
98-
this->vertexCache_->evict(std::make_pair(vId, tagId), partId);
98+
this->vertexCache_->evict(std::make_pair(vId, tagId));
9999
VLOG(3) << "Evict cache for vId " << vId << ", tagId " << tagId;
100100
}
101101
});

src/storage/mutate/DeleteVerticesProcessor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void DeleteVerticesProcessor::process(const cpp2::DeleteVerticesRequest& req) {
4949
// Evict vertices from cache
5050
if (FLAGS_enable_vertex_cache && vertexCache_ != nullptr) {
5151
VLOG(3) << "Evict vertex cache for VID " << *v << ", TagID " << tag;
52-
vertexCache_->evict(std::make_pair(*v, tag), part);
52+
vertexCache_->evict(std::make_pair(*v, tag));
5353
}
5454
keys.emplace_back(key.str());
5555
}
@@ -99,7 +99,7 @@ DeleteVerticesProcessor::deleteVertices(GraphSpaceID spaceId,
9999
if (FLAGS_enable_vertex_cache && vertexCache_ != nullptr) {
100100
if (NebulaKeyUtils::isVertex(key)) {
101101
VLOG(3) << "Evict vertex cache for vertex ID " << vertex << ", tagId " << tagId;
102-
vertexCache_->evict(std::make_pair(vertex, tagId), partId);
102+
vertexCache_->evict(std::make_pair(vertex, tagId));
103103
}
104104
}
105105

src/storage/mutate/UpdateVertexProcessor.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,6 @@ cpp2::ErrorCode UpdateVertexProcessor::checkAndBuildContexts(
492492
}
493493
}
494494
auto vId = req.get_vertex_id();
495-
auto partId = req.get_part_id();
496495
// build context of the update items
497496
for (auto& item : req.get_update_items()) {
498497
const auto &name = item.get_name();
@@ -511,7 +510,7 @@ cpp2::ErrorCode UpdateVertexProcessor::checkAndBuildContexts(
511510
auto tagId = tagRet.value();
512511
if (FLAGS_enable_vertex_cache && vertexCache_ != nullptr) {
513512
VLOG(3) << "Evict cache for vId " << vId << ", tagId " << tagId;
514-
vertexCache_->evict(std::make_pair(req.get_vertex_id(), tagId), partId);
513+
vertexCache_->evict(std::make_pair(req.get_vertex_id(), tagId));
515514
}
516515
updateTagIds_.emplace(tagId);
517516
auto exp = Expression::decode(item.get_value());

src/storage/query/QueryBaseProcessor.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ kvstore::ResultCode QueryBaseProcessor<REQ, RESP>::collectVertexProps(
408408
Collector* collector) {
409409
auto schema = this->schemaMan_->getTagSchema(spaceId_, tagId);
410410
if (FLAGS_enable_vertex_cache && vertexCache_ != nullptr) {
411-
auto result = vertexCache_->get(std::make_pair(vId, tagId), partId);
411+
auto result = vertexCache_->get(std::make_pair(vId, tagId));
412412
if (result.ok()) {
413413
auto v = std::move(result).value();
414414
auto reader = RowReader::getTagPropReader(this->schemaMan_, v, spaceId_, tagId);
@@ -465,7 +465,7 @@ kvstore::ResultCode QueryBaseProcessor<REQ, RESP>::collectVertexProps(
465465
this->collectProps(reader.get(), iter->key(), props, fcontext, collector);
466466
if (FLAGS_enable_vertex_cache && vertexCache_ != nullptr) {
467467
vertexCache_->insert(std::make_pair(vId, tagId),
468-
iter->val().str(), partId);
468+
iter->val().str());
469469
VLOG(3) << "Insert cache for vId " << vId << ", tagId " << tagId;
470470
}
471471
} else {

src/storage/query/QueryVertexPropsProcessor.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ kvstore::ResultCode QueryVertexPropsProcessor::collectVertexProps(
150150
}
151151
auto valStr = val.str();
152152
if (FLAGS_enable_vertex_cache && vertexCache_ != nullptr) {
153-
vertexCache_->insert(std::make_pair(vId, tagId),
154-
valStr, partId);
153+
vertexCache_->insert(std::make_pair(vId, tagId), valStr);
155154
VLOG(3) << "Insert cache for vId " << vId << ", tagId " << tagId;
156155
}
157156
cpp2::TagData td;

0 commit comments

Comments
 (0)