mreutegg commented on code in PR #1700:
URL: https://github.com/apache/jackrabbit-oak/pull/1700#discussion_r1757128224
##########
oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/Segment.java:
##########
@@ -217,6 +217,21 @@ public String toString() {
}
}
+ public Segment(
+ @NotNull SegmentReader reader,
+ @NotNull SegmentId id,
+ @NotNull SegmentData data,
+ @NotNull RecordNumbers recordNumbers,
+ @NotNull SegmentReferences segmentReferences
+ ) {
+ this.reader = requireNonNull(reader);
+ this.id = requireNonNull(id);
+ this.data = requireNonNull(data);
+ this.recordNumbers = requireNonNull(recordNumbers);
+ this.segmentReferences = requireNonNull(segmentReferences);
+ this.version = LATEST_VERSION;
Review Comment:
I think the version should be read from SegmentData.
```suggestion
this.version = SegmentVersion.fromByte(data.getVersion());
```
Or is there a specific reason why LATEST_VERSION must be used here? Can you
also please add a test for this constructor. E.g. verifying the version is as
expected.
--
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]