-
Notifications
You must be signed in to change notification settings - Fork 50
refactor index key utils #12
refactor index key utils #12
Conversation
src/common/IndexKeyUtils.h
Outdated
} | ||
return std::move(v); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return v directly.
Addressed dangleptr's comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done. LGTM
CHECK_GE(rawKey.size(), kVertexIndexLen); | ||
auto offset = rawKey.size() - sizeof(VertexIntID); | ||
return *reinterpret_cast<const VertexIntID*>(rawKey.data() + offset); | ||
static VertexIDSlice getIndexVertexID(size_t vIdLen, const folly::StringPiece& rawKey) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so seems we don't need VertexIntID
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so seems we don't need
VertexIntID
?
Yes, we don't need VertexIntID , the vIdLen should be 8 if this is nebula1.0 data.
.append(reinterpret_cast<const char*>(&indexId), sizeof(IndexID)); | ||
indexRaw(values, key); | ||
key.append(srcId.data(), srcId.size()) | ||
.append(vIdLen - srcId.size(), '\0') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The zero filling will arise at here ? I mean for example: when we define the vertex size is 6 and current vertex ID is ABCD
the graph service will send ABCD\0\0
or ABCD
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The zero filling will arise at here ? I mean for example: when we define the vertex size is 6 and current vertex ID is
ABCD
the graph service will sendABCD\0\0
orABCD
?
The graph service should send ABCD
, then storage service will convert it to fixed length vid ABCD\0\0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM
Please rebase on the master |
rebased done. |
case Value::Type::INT : | ||
return encodeInt64(v.getInt()); | ||
case Value::Type::FLOAT : | ||
return encodeDouble(v.getFloat()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
encodeDouble
is too good,👍
refactor index key utils. using Value instead of VariantType.