use of org.apache.jackrabbit.oak.segment.file.tar.TarFiles in project jackrabbit-oak by apache.
the class UpgradeIT method checkSegmentVersion.
private void checkSegmentVersion(@Nonnull SegmentVersion version) throws IOException {
try (TarFiles tarFiles = TarFiles.builder().withDirectory(fileStoreHome.getRoot()).withTarRecovery((_1, _2, _3) -> fail("Unexpected recovery")).withIOMonitor(new IOMonitorAdapter()).withReadOnly().build()) {
for (SegmentData segmentData : getSegments(tarFiles)) {
SegmentVersion actualVersion = SegmentVersion.fromByte(segmentData.getVersion());
assertEquals(format("Segment version mismatch. Expected %s, found %s", version, actualVersion), version, actualVersion);
}
}
}
Aggregations