ibessonov commented on code in PR #7112:
URL: https://github.com/apache/ignite-3/pull/7112#discussion_r2576489669
##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/RowVersion.java:
##########
@@ -193,7 +229,7 @@ public void writeFragmentData(ByteBuffer pageBuf, int
rowOff, int payloadSize) {
assert headerSize <= payloadSize : "Header must entirely fit in
the first fragment, but header size is "
+ headerSize + " and payload size is " + payloadSize;
- pageBuf.put(DATA_TYPE);
+ pageBuf.put(dataType());
Review Comment:
The entire part between lines 232 and 240 could have been its own method
that is overriden in a subclass. This way you would avoid hard-coding the
sub-header of the header, and avoid using words like "extraFirstFragment". What
do you think?
##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/mv/ReadRowVersion.java:
##########
@@ -91,24 +81,21 @@ public void finish() {
return;
}
+ assert reader != null;
+
readRowVersionValue.finish();
byte[] valueBytes = readRowVersionValue.result();
- BinaryRow row = valueBytes.length == 0
+ BinaryRow value = valueBytes.length == 0
? null
- : new BinaryRowImpl(schemaVersion,
ByteBuffer.wrap(valueBytes).order(BinaryTuple.ORDER));
+ : new BinaryRowImpl(reader.schemaVersion(),
ByteBuffer.wrap(valueBytes).order(BinaryTuple.ORDER));
+ int valueSize = value == null ? 0 : value.tupleSliceLength();
- result = new RowVersion(partitionIdFromLink(firstFragmentLink),
firstFragmentLink, timestamp, nextLink, row);
+ result = reader.createRowVersion(valueSize, value);
}
RowVersion result() {
return result;
}
-
- void reset() {
- result = null;
- readingFirstSlot = true;
- readRowVersionValue.reset();
- }
Review Comment:
Could you please shortly explain the reason?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]