public class SegmentTarReader extends java.lang.Object implements SegmentArchiveReader
Constructor and Description |
---|
SegmentTarReader(java.io.File file,
org.apache.jackrabbit.oak.segment.file.tar.FileAccess access,
Index index,
IOMonitor ioMonitor) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the archive.
|
boolean |
containsSegment(long msb,
long lsb)
Check if the segment exists.
|
Buffer |
getBinaryReferences()
Load binary references.
|
int |
getEntrySize(int size)
Transforms the segment size in bytes into the effective size on disk for
the given entry (eg.
|
Buffer |
getGraph()
Load the segment graph.
|
java.lang.String |
getName()
Get the name of the archive.
|
boolean |
hasGraph()
Check if the segment graph has been persisted for this archive.
|
long |
length()
Get the current length of the archive.
|
java.util.List<SegmentArchiveEntry> |
listSegments()
List all the segments, in the order as they have been written to the archive.
|
static Index |
loadAndValidateIndex(java.io.RandomAccessFile file,
java.lang.String name) |
Buffer |
readSegment(long msb,
long lsb)
Read the segment.
|
public SegmentTarReader(java.io.File file, org.apache.jackrabbit.oak.segment.file.tar.FileAccess access, Index index, IOMonitor ioMonitor)
public Buffer readSegment(long msb, long lsb) throws java.io.IOException
SegmentArchiveReader
readSegment
in interface SegmentArchiveReader
msb
- the most significant bits of the identifier of the segmentlsb
- the least significant bits of the identifier of the segmentjava.io.IOException
public boolean containsSegment(long msb, long lsb)
SegmentArchiveReader
containsSegment
in interface SegmentArchiveReader
msb
- the most significant bits of the identifier of the segmentlsb
- the least significant bits of the identifier of the segmenttrue
if the segment existspublic java.util.List<SegmentArchiveEntry> listSegments()
SegmentArchiveReader
listSegments
in interface SegmentArchiveReader
public static Index loadAndValidateIndex(java.io.RandomAccessFile file, java.lang.String name) throws java.io.IOException
java.io.IOException
public Buffer getGraph() throws java.io.IOException
SegmentArchiveReader
getGraph
in interface SegmentArchiveReader
java.io.IOException
public boolean hasGraph()
SegmentArchiveReader
hasGraph
in interface SegmentArchiveReader
true
if the graph exists, false otherwisepublic Buffer getBinaryReferences() throws java.io.IOException
SegmentArchiveReader
getBinaryReferences
in interface SegmentArchiveReader
java.io.IOException
public long length()
SegmentArchiveReader
length
in interface SegmentArchiveReader
public java.lang.String getName()
SegmentArchiveReader
getName
in interface SegmentArchiveReader
public void close() throws java.io.IOException
SegmentArchiveReader
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface SegmentArchiveReader
java.io.IOException
public int getEntrySize(int size)
SegmentArchiveReader
getEntrySize
in interface SegmentArchiveReader
size
- the segment size in bytesCopyright © 2012–2022 The Apache Software Foundation. All rights reserved.