use of org.apache.jackrabbit.oak.segment.Segment.RecordConsumer in project jackrabbit-oak by apache.
the class AbstractFileStore method readBinaryReferences.
static Set<String> readBinaryReferences(final Segment segment) {
final Set<String> binaryReferences = new HashSet<>();
segment.forEachRecord(new RecordConsumer() {
@Override
public void consume(int number, RecordType type, int offset) {
if (type == RecordType.BLOB_ID) {
binaryReferences.add(SegmentBlob.readBlobId(segment, number));
}
}
});
return binaryReferences;
}
use of org.apache.jackrabbit.oak.segment.Segment.RecordConsumer in project jackrabbit-oak by apache.
the class DebugStore method analyseSegment.
private static void analyseSegment(final Segment segment, final RecordUsageAnalyser analyser) {
final List<RecordId> ids = newArrayList();
segment.forEachRecord(new RecordConsumer() {
@Override
public void consume(int number, RecordType type, int offset) {
if (type == NODE) {
ids.add(new RecordId(segment.getSegmentId(), number));
}
}
});
for (RecordId id : ids) {
try {
analyser.analyseNode(id);
} catch (Exception e) {
System.err.format("Error while processing node at %s", id);
e.printStackTrace();
}
}
}
use of org.apache.jackrabbit.oak.segment.Segment.RecordConsumer in project jackrabbit-oak by apache.
the class AbstractFileStore method populateTarBinaryReferences.
static void populateTarBinaryReferences(final Segment segment, final TarWriter w) {
final int generation = segment.getGcGeneration();
final UUID id = segment.getSegmentId().asUUID();
segment.forEachRecord(new RecordConsumer() {
@Override
public void consume(int number, RecordType type, int offset) {
if (type == RecordType.BLOB_ID) {
w.addBinaryReference(generation, id, SegmentBlob.readBlobId(segment, number));
}
}
});
}
Aggregations