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

replace kVertex with kTag #3286

Merged
merged 8 commits into from
Nov 17, 2021
2 changes: 1 addition & 1 deletion src/common/utils/IndexKeyUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ class IndexKeyUtils final {
}

static VertexIDSlice getIndexVertexID(size_t vIdLen, const folly::StringPiece& rawKey) {
CHECK_GE(rawKey.size(), kVertexIndexLen + vIdLen);
CHECK_GE(rawKey.size(), kTagIndexLen + vIdLen);
auto offset = rawKey.size() - vIdLen;
return rawKey.subpiece(offset, vIdLen);
}
Expand Down
26 changes: 13 additions & 13 deletions src/common/utils/NebulaKeyUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ std::string NebulaKeyUtils::lastKey(const std::string& prefix, size_t count) {
}

// static
std::string NebulaKeyUtils::vertexKey(
std::string NebulaKeyUtils::tagKey(
size_t vIdLen, PartitionID partId, const VertexID& vId, TagID tagId, char pad) {
CHECK_GE(vIdLen, vId.size());
int32_t item = (partId << kPartitionOffset) | static_cast<uint32_t>(NebulaKeyType::kVertex);
int32_t item = (partId << kPartitionOffset) | static_cast<uint32_t>(NebulaKeyType::kTag_);

std::string key;
key.reserve(kVertexLen + vIdLen);
key.reserve(kTagLen + vIdLen);
key.append(reinterpret_cast<const char*>(&item), sizeof(int32_t))
.append(vId.data(), vId.size())
.append(vIdLen - vId.size(), pad)
Expand Down Expand Up @@ -106,12 +106,12 @@ std::string NebulaKeyUtils::kvKey(PartitionID partId, const folly::StringPiece&
}

// static
std::string NebulaKeyUtils::vertexPrefix(size_t vIdLen,
PartitionID partId,
const VertexID& vId,
TagID tagId) {
std::string NebulaKeyUtils::tagPrefix(size_t vIdLen,
PartitionID partId,
const VertexID& vId,
TagID tagId) {
CHECK_GE(vIdLen, vId.size());
PartitionID item = (partId << kPartitionOffset) | static_cast<uint32_t>(NebulaKeyType::kVertex);
PartitionID item = (partId << kPartitionOffset) | static_cast<uint32_t>(NebulaKeyType::kTag_);

std::string key;
key.reserve(sizeof(PartitionID) + vIdLen + sizeof(TagID));
Expand All @@ -123,9 +123,9 @@ std::string NebulaKeyUtils::vertexPrefix(size_t vIdLen,
}

// static
std::string NebulaKeyUtils::vertexPrefix(size_t vIdLen, PartitionID partId, const VertexID& vId) {
std::string NebulaKeyUtils::tagPrefix(size_t vIdLen, PartitionID partId, const VertexID& vId) {
CHECK_GE(vIdLen, vId.size());
PartitionID item = (partId << kPartitionOffset) | static_cast<uint32_t>(NebulaKeyType::kVertex);
PartitionID item = (partId << kPartitionOffset) | static_cast<uint32_t>(NebulaKeyType::kTag_);
std::string key;
key.reserve(sizeof(PartitionID) + vIdLen);
key.append(reinterpret_cast<const char*>(&item), sizeof(PartitionID))
Expand All @@ -135,8 +135,8 @@ std::string NebulaKeyUtils::vertexPrefix(size_t vIdLen, PartitionID partId, cons
}

// static
std::string NebulaKeyUtils::vertexPrefix(PartitionID partId) {
PartitionID item = (partId << kPartitionOffset) | static_cast<uint32_t>(NebulaKeyType::kVertex);
std::string NebulaKeyUtils::tagPrefix(PartitionID partId) {
PartitionID item = (partId << kPartitionOffset) | static_cast<uint32_t>(NebulaKeyType::kTag_);
std::string key;
key.reserve(sizeof(PartitionID));
key.append(reinterpret_cast<const char*>(&item), sizeof(PartitionID));
Expand Down Expand Up @@ -210,7 +210,7 @@ std::vector<std::string> NebulaKeyUtils::snapshotPrefix(PartitionID partId) {
if (partId == 0) {
result.emplace_back("");
} else {
result.emplace_back(vertexPrefix(partId));
result.emplace_back(tagPrefix(partId));
result.emplace_back(edgePrefix(partId));
result.emplace_back(IndexKeyUtils::indexPrefix(partId));
// kSystem will be written when balance data
Expand Down
27 changes: 12 additions & 15 deletions src/common/utils/NebulaKeyUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace nebula {

/**
* VertexKeyUtils:
* TagKeyUtils:
* type(1) + partId(3) + vertexId(*) + tagId(4)
*
* EdgeKeyUtils:
Expand Down Expand Up @@ -55,7 +55,7 @@ class NebulaKeyUtils final {
/**
* Generate vertex key for kv store
* */
static std::string vertexKey(
static std::string tagKey(
size_t vIdLen, PartitionID partId, const VertexID& vId, TagID tagId, char pad = '\0');

static std::string edgeKey(size_t vIdLen,
Expand All @@ -75,14 +75,11 @@ class NebulaKeyUtils final {
/**
* Prefix for vertex
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the comment, other places may also need modify

* */
static std::string vertexPrefix(size_t vIdLen,
PartitionID partId,
const VertexID& vId,
TagID tagId);
static std::string tagPrefix(size_t vIdLen, PartitionID partId, const VertexID& vId, TagID tagId);

static std::string vertexPrefix(size_t vIdLen, PartitionID partId, const VertexID& vId);
static std::string tagPrefix(size_t vIdLen, PartitionID partId, const VertexID& vId);

static std::string vertexPrefix(PartitionID partId);
static std::string tagPrefix(PartitionID partId);

/**
* Prefix for edge
Expand Down Expand Up @@ -111,26 +108,26 @@ class NebulaKeyUtils final {
return readInt<PartitionID>(rawKey.data(), sizeof(PartitionID)) >> 8;
}

static bool isVertex(size_t vIdLen, const folly::StringPiece& rawKey) {
if (rawKey.size() != kVertexLen + vIdLen) {
static bool isTag(size_t vIdLen, const folly::StringPiece& rawKey) {
if (rawKey.size() != kTagLen + vIdLen) {
return false;
}
constexpr int32_t len = static_cast<int32_t>(sizeof(NebulaKeyType));
auto type = readInt<uint32_t>(rawKey.data(), len) & kTypeMask;
return static_cast<NebulaKeyType>(type) == NebulaKeyType::kVertex;
return static_cast<NebulaKeyType>(type) == NebulaKeyType::kTag_;
}

static VertexIDSlice getVertexId(size_t vIdLen, const folly::StringPiece& rawKey) {
if (rawKey.size() != kVertexLen + vIdLen) {
dumpBadKey(rawKey, kVertexLen + vIdLen, vIdLen);
if (rawKey.size() != kTagLen + vIdLen) {
dumpBadKey(rawKey, kTagLen + vIdLen, vIdLen);
}
auto offset = sizeof(PartitionID);
return rawKey.subpiece(offset, vIdLen);
}

static TagID getTagId(size_t vIdLen, const folly::StringPiece& rawKey) {
if (rawKey.size() != kVertexLen + vIdLen) {
dumpBadKey(rawKey, kVertexLen + vIdLen, vIdLen);
if (rawKey.size() != kTagLen + vIdLen) {
dumpBadKey(rawKey, kTagLen + vIdLen, vIdLen);
}
auto offset = sizeof(PartitionID) + vIdLen;
return readInt<TagID>(rawKey.data() + offset, sizeof(TagID));
Expand Down
7 changes: 4 additions & 3 deletions src/common/utils/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
namespace nebula {

enum class NebulaKeyType : uint32_t {
kVertex = 0x00000001,
kTag_ = 0x00000001,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kTag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kTag is defined in Base.h constexpr char kTag[] = "_tag";.And compiler will report a warning if a local variable overwrite global variables.

kEdge = 0x00000002,
kIndex = 0x00000003,
kSystem = 0x00000004,
kOperation = 0x00000005,
kKeyValue = 0x00000006,
// kVertex = 0x00000007,
};

enum class NebulaSystemKeyType : uint32_t {
Expand All @@ -41,7 +42,7 @@ static typename std::enable_if<std::is_integral<T>::value, T>::type readInt(cons
}

// size of vertex key except vertexId
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tag key

static constexpr int32_t kVertexLen = sizeof(PartitionID) + sizeof(TagID);
static constexpr int32_t kTagLen = sizeof(PartitionID) + sizeof(TagID);

// size of vertex key except srcId and dstId
static constexpr int32_t kEdgeLen =
Expand All @@ -56,7 +57,7 @@ static constexpr uint8_t kPartitionOffset = 8;
// See KeyType enum
static constexpr uint32_t kTypeMask = 0x000000FF;

static constexpr int32_t kVertexIndexLen = sizeof(PartitionID) + sizeof(IndexID);
static constexpr int32_t kTagIndexLen = sizeof(PartitionID) + sizeof(IndexID);

static constexpr int32_t kEdgeIndexLen =
sizeof(PartitionID) + sizeof(IndexID) + sizeof(EdgeRanking);
Expand Down
38 changes: 19 additions & 19 deletions src/common/utils/test/NebulaKeyUtilsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ class KeyUtilsTestBase : public ::testing::Test {

~KeyUtilsTestBase() = default;

void verifyVertex(PartitionID partId, VertexID vId, TagID tagId, size_t actualSize) {
auto vertexKey = NebulaKeyUtils::vertexKey(vIdLen_, partId, vId, tagId);
ASSERT_EQ(vertexKey.size(), kVertexLen + vIdLen_);
ASSERT_EQ(vertexKey.substr(0, sizeof(PartitionID) + vIdLen_ + sizeof(TagID)),
NebulaKeyUtils::vertexPrefix(vIdLen_, partId, vId, tagId));
ASSERT_EQ(vertexKey.substr(0, sizeof(PartitionID) + vIdLen_),
NebulaKeyUtils::vertexPrefix(vIdLen_, partId, vId));
ASSERT_TRUE(NebulaKeyUtils::isVertex(vIdLen_, vertexKey));
ASSERT_FALSE(NebulaKeyUtils::isEdge(vIdLen_, vertexKey));
ASSERT_EQ(partId, NebulaKeyUtils::getPart(vertexKey));
ASSERT_EQ(tagId, NebulaKeyUtils::getTagId(vIdLen_, vertexKey));
ASSERT_EQ(vId, NebulaKeyUtils::getVertexId(vIdLen_, vertexKey).subpiece(0, actualSize));
void verifyTag(PartitionID partId, VertexID vId, TagID tagId, size_t actualSize) {
auto tagKey = NebulaKeyUtils::tagKey(vIdLen_, partId, vId, tagId);
ASSERT_EQ(tagKey.size(), kTagLen + vIdLen_);
ASSERT_EQ(tagKey.substr(0, sizeof(PartitionID) + vIdLen_ + sizeof(TagID)),
NebulaKeyUtils::tagPrefix(vIdLen_, partId, vId, tagId));
ASSERT_EQ(tagKey.substr(0, sizeof(PartitionID) + vIdLen_),
NebulaKeyUtils::tagPrefix(vIdLen_, partId, vId));
ASSERT_TRUE(NebulaKeyUtils::isTag(vIdLen_, tagKey));
ASSERT_FALSE(NebulaKeyUtils::isEdge(vIdLen_, tagKey));
ASSERT_EQ(partId, NebulaKeyUtils::getPart(tagKey));
ASSERT_EQ(tagId, NebulaKeyUtils::getTagId(vIdLen_, tagKey));
ASSERT_EQ(vId, NebulaKeyUtils::getVertexId(vIdLen_, tagKey).subpiece(0, actualSize));
}

void verifyEdge(PartitionID partId,
Expand All @@ -47,7 +47,7 @@ class KeyUtilsTestBase : public ::testing::Test {
0, sizeof(PartitionID) + (vIdLen_ << 1) + sizeof(EdgeType) + sizeof(EdgeRanking)),
NebulaKeyUtils::edgePrefix(vIdLen_, partId, srcId, type, rank, dstId));
ASSERT_TRUE(NebulaKeyUtils::isEdge(vIdLen_, edgeKey));
ASSERT_FALSE(NebulaKeyUtils::isVertex(vIdLen_, edgeKey));
ASSERT_FALSE(NebulaKeyUtils::isTag(vIdLen_, edgeKey));
ASSERT_EQ(partId, NebulaKeyUtils::getPart(edgeKey));
ASSERT_EQ(srcId, NebulaKeyUtils::getSrcId(vIdLen_, edgeKey).subpiece(0, actualSize));
ASSERT_EQ(dstId, NebulaKeyUtils::getDstId(vIdLen_, edgeKey).subpiece(0, actualSize));
Expand Down Expand Up @@ -85,7 +85,7 @@ TEST_F(V1Test, SimpleTest) {
VertexID vId = getStringId(1001L);
TagID tagId = 2020;
TagVersion tagVersion = folly::Random::rand64();
verifyVertex(partId, vId, tagId, tagVersion);
verifyTag(partId, vId, tagId, tagVersion);

VertexID srcId = getStringId(1001L), dstId = getStringId(2001L);
EdgeType type = 1010;
Expand All @@ -98,7 +98,7 @@ TEST_F(V1Test, NegativeEdgeTypeTest) {
PartitionID partId = 123;
VertexID vId = getStringId(1001L);
TagID tagId = 2020;
verifyVertex(partId, vId, tagId, sizeof(int64_t));
verifyTag(partId, vId, tagId, sizeof(int64_t));

VertexID srcId = getStringId(1001L), dstId = getStringId(2001L);
EdgeType type = -1010;
Expand All @@ -111,7 +111,7 @@ TEST_F(V2ShortTest, SimpleTest) {
PartitionID partId = 123;
VertexID vId = "0123456789";
TagID tagId = 2020;
verifyVertex(partId, vId, tagId, 10);
verifyTag(partId, vId, tagId, 10);

VertexID srcId = "0123456789", dstId = "9876543210";
EdgeType type = 1010;
Expand All @@ -124,7 +124,7 @@ TEST_F(V2ShortTest, NegativeEdgeTypeTest) {
PartitionID partId = 123;
VertexID vId = "0123456789";
TagID tagId = 2020;
verifyVertex(partId, vId, tagId, 10);
verifyTag(partId, vId, tagId, 10);

VertexID srcId = "0123456789", dstId = "9876543210";
EdgeType type = -1010;
Expand All @@ -137,7 +137,7 @@ TEST_F(V2LongTest, SimpleTest) {
PartitionID partId = 123;
VertexID vId = "0123456789";
TagID tagId = 2020;
verifyVertex(partId, vId, tagId, 10);
verifyTag(partId, vId, tagId, 10);

VertexID srcId = "0123456789", dstId = "9876543210";
EdgeType type = 1010;
Expand All @@ -150,7 +150,7 @@ TEST_F(V2LongTest, NegativeEdgeTypeTest) {
PartitionID partId = 123;
VertexID vId = "0123456789";
TagID tagId = 2020;
verifyVertex(partId, vId, tagId, 10);
verifyTag(partId, vId, tagId, 10);

VertexID srcId = "0123456789", dstId = "9876543210";
EdgeType type = -1010;
Expand Down
2 changes: 1 addition & 1 deletion src/kvstore/Part.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ bool Part::preProcessLog(LogID logId, TermID termId, ClusterID clusterId, const
void Part::cleanup() {
LOG(INFO) << idStr_ << "Clean rocksdb part data";
// Remove the vertex, edge, index, systemCommitKey, operation data under the part
const auto& vertexPre = NebulaKeyUtils::vertexPrefix(partId_);
const auto& vertexPre = NebulaKeyUtils::tagPrefix(partId_);
auto ret = engine_->removeRange(NebulaKeyUtils::firstKey(vertexPre, vIdLen_),
NebulaKeyUtils::lastKey(vertexPre, vIdLen_));
if (ret != nebula::cpp2::ErrorCode::SUCCEEDED) {
Expand Down
2 changes: 1 addition & 1 deletion src/kvstore/plugins/elasticsearch/ESListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void ESListener::init() {
bool ESListener::apply(const std::vector<KV>& data) {
std::vector<nebula::plugin::DocItem> docItems;
for (const auto& kv : data) {
if (!nebula::NebulaKeyUtils::isVertex(vIdLen_, kv.first) &&
if (!nebula::NebulaKeyUtils::isTag(vIdLen_, kv.first) &&
!nebula::NebulaKeyUtils::isEdge(vIdLen_, kv.first)) {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion src/kvstore/plugins/hbase/HBaseStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ std::shared_ptr<const meta::SchemaProviderIf> HBaseStore::getSchema(GraphSpaceID
SchemaVer version) {
std::shared_ptr<const meta::SchemaProviderIf> schema;
folly::StringPiece rawKey = key;
if (NebulaKeyUtils::isVertex(key)) {
if (NebulaKeyUtils::isTag(key)) {
TagID tagId = NebulaKeyUtils::getTagId(rawKey);
if (version == -1) {
version = schemaMan_->getLatestTagSchemaVersion(spaceId, tagId).value();
Expand Down
2 changes: 1 addition & 1 deletion src/kvstore/plugins/hbase/test/HBaseStoreTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ TEST(HBaseStoreTest, SimpleTest) {
}
EXPECT_EQ(expectedTotal, num);
};
std::string prefix1 = NebulaKeyUtils::vertexPrefix(partId, srcId);
std::string prefix1 = NebulaKeyUtils::tagPrefix(partId, srcId);
checkPrefix(prefix1, 0, 20);
std::string prefix2 = NebulaKeyUtils::edgePrefix(partId, srcId, edgeType);
checkPrefix(prefix2, 0, 10);
Expand Down
4 changes: 2 additions & 2 deletions src/kvstore/test/NebulaListenerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ TEST_P(ListenerAdvanceTest, ListenerResetBySnapshotTest) {
for (int32_t i = 0; i < 10; i++) {
std::vector<KV> data;
for (int32_t j = 0; j < 1000; j++) {
auto vKey = NebulaKeyUtils::vertexKey(8, partId, folly::to<std::string>(i * 1000 + j), 5);
auto vKey = NebulaKeyUtils::tagKey(8, partId, folly::to<std::string>(i * 1000 + j), 5);
data.emplace_back(std::move(vKey), folly::stringPrintf("val_%d_%d", partId, i * 1000 + j));
}
auto leader = findLeader(partId);
Expand Down Expand Up @@ -584,7 +584,7 @@ TEST_P(ListenerSnapshotTest, SnapshotRateLimitTest) {
for (int32_t i = 0; i < 10; i++) {
std::vector<KV> data;
for (int32_t j = 0; j < 1000; j++) {
auto vKey = NebulaKeyUtils::vertexKey(8, partId, folly::to<std::string>(i * 1000 + j), 5);
auto vKey = NebulaKeyUtils::tagKey(8, partId, folly::to<std::string>(i * 1000 + j), 5);
data.emplace_back(std::move(vKey), std::string(24, 'X'));
}
auto leader = findLeader(partId);
Expand Down
4 changes: 2 additions & 2 deletions src/kvstore/test/NebulaStoreTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ TEST(NebulaStoreTest, BackupRestoreTest) {
if (insertData) {
std::vector<KV> data;
for (auto tagId = 0; tagId < 10; tagId++) {
data.emplace_back(NebulaKeyUtils::vertexKey(vIdLen, partId, "vertex", tagId),
data.emplace_back(NebulaKeyUtils::tagKey(vIdLen, partId, "vertex", tagId),
folly::stringPrintf("val_%d", tagId));
}
folly::Baton<true, std::atomic> baton;
Expand All @@ -962,7 +962,7 @@ TEST(NebulaStoreTest, BackupRestoreTest) {
}

{
std::string prefix = NebulaKeyUtils::vertexPrefix(vIdLen, partId, "vertex");
std::string prefix = NebulaKeyUtils::tagPrefix(vIdLen, partId, "vertex");
std::unique_ptr<KVIterator> iter;
auto code = store->prefix(spaceId, partId, prefix, &iter);
EXPECT_EQ(nebula::cpp2::ErrorCode::SUCCEEDED, code);
Expand Down
16 changes: 8 additions & 8 deletions src/kvstore/test/PartTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void checkVertexData(RocksEngine* engine,
PartitionID partId,
int expectNum,
bool checkVal = false) {
std::string vertexPrefix = NebulaKeyUtils::vertexPrefix(partId);
std::string vertexPrefix = NebulaKeyUtils::tagPrefix(partId);
std::unique_ptr<KVIterator> iter;
auto code = engine->prefix(vertexPrefix, &iter);
ASSERT_EQ(nebula::cpp2::ErrorCode::SUCCEEDED, code);
Expand Down Expand Up @@ -105,16 +105,16 @@ TEST(PartTest, KeyOrderTest) {

// build vertex data in part 1, 2
while (partId < 3) {
auto key1 = NebulaKeyUtils::vertexKey(kDefaultVIdLen, partId, "", 0);
auto key1 = NebulaKeyUtils::tagKey(kDefaultVIdLen, partId, "", 0);
data.emplace_back(key1, folly::stringPrintf("val%d", 1));

auto key2 = NebulaKeyUtils::vertexKey(kDefaultVIdLen, partId, "", INT_MAX);
auto key2 = NebulaKeyUtils::tagKey(kDefaultVIdLen, partId, "", INT_MAX);
data.emplace_back(key2, folly::stringPrintf("val%d", 2));

auto key3 = NebulaKeyUtils::vertexKey(kDefaultVIdLen, partId, "ffffff", INT_MAX, '\377');
auto key3 = NebulaKeyUtils::tagKey(kDefaultVIdLen, partId, "ffffff", INT_MAX, '\377');
data.emplace_back(key3, folly::stringPrintf("val%d", 3));

auto key4 = NebulaKeyUtils::vertexKey(kDefaultVIdLen, partId, "", INT_MAX, '\377');
auto key4 = NebulaKeyUtils::tagKey(kDefaultVIdLen, partId, "", INT_MAX, '\377');
data.emplace_back(key4, folly::stringPrintf("val%d", 4));

ASSERT_EQ(nebula::cpp2::ErrorCode::SUCCEEDED, engine->multiPut(data));
Expand All @@ -141,12 +141,12 @@ TEST(PartTest, PartCleanTest) {
while (partId < 3) {
TagID tagId = 1;
for (int i = 0; i < 10; i++) {
auto key = NebulaKeyUtils::vertexKey(kDefaultVIdLen, partId, std::to_string(i), tagId);
auto key = NebulaKeyUtils::tagKey(kDefaultVIdLen, partId, std::to_string(i), tagId);
data.emplace_back(key, folly::stringPrintf("val%d", i));
}
tagId = 2;
for (int i = 0; i < 10; i++) {
auto key = NebulaKeyUtils::vertexKey(kDefaultVIdLen, partId, std::to_string(i), tagId);
auto key = NebulaKeyUtils::tagKey(kDefaultVIdLen, partId, std::to_string(i), tagId);
data.emplace_back(key, folly::stringPrintf("val%d", i));
}

Expand Down Expand Up @@ -196,7 +196,7 @@ TEST(PartTest, PartCleanTest) {
// remove range part::clean data
partId = 1;

const auto& vertexPre = NebulaKeyUtils::vertexPrefix(partId);
const auto& vertexPre = NebulaKeyUtils::tagPrefix(partId);
auto ret = engine->removeRange(NebulaKeyUtils::firstKey(vertexPre, kDefaultVIdLen),
NebulaKeyUtils::lastKey(vertexPre, kDefaultVIdLen));
ASSERT_EQ(nebula::cpp2::ErrorCode::SUCCEEDED, ret);
Expand Down
Loading