Class AwsSegmentArchiveReader
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.remote.AbstractRemoteSegmentArchiveReader
-
- org.apache.jackrabbit.oak.segment.aws.AwsSegmentArchiveReader
-
- All Implemented Interfaces:
Closeable,AutoCloseable,SegmentArchiveReader
public class AwsSegmentArchiveReader extends AbstractRemoteSegmentArchiveReader
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.oak.segment.remote.AbstractRemoteSegmentArchiveReader
index, ioMonitor
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FilearchivePathAsFile()Returns the decoded file component of this archive.protected longcomputeArchiveIndexAndLength()Populates the archive index, summing up each entry's length.protected BufferdoReadDataFile(String extension)Reads a data file inside the archive.protected voiddoReadSegmentToBuffer(String segmentFileName, Buffer buffer)Reads the segment from the remote storage.StringgetName()Get the name of the archive.longlength()Get the current length of the archive.-
Methods inherited from class org.apache.jackrabbit.oak.segment.remote.AbstractRemoteSegmentArchiveReader
close, containsSegment, getBinaryReferences, getEntrySize, getGraph, isRemote, listSegments, readSegment
-
-
-
-
Method Detail
-
length
public long length()
Description copied from interface:SegmentArchiveReaderGet the current length of the archive.- Returns:
- length of the archive, in bytes
-
getName
public String getName()
Description copied from interface:SegmentArchiveReaderGet the name of the archive.- Returns:
- archive name
-
computeArchiveIndexAndLength
protected long computeArchiveIndexAndLength() throws IOExceptionDescription copied from class:AbstractRemoteSegmentArchiveReaderPopulates the archive index, summing up each entry's length.- Specified by:
computeArchiveIndexAndLengthin classAbstractRemoteSegmentArchiveReader- Returns:
- length, the total length of the archive
- Throws:
IOException
-
doReadSegmentToBuffer
protected void doReadSegmentToBuffer(String segmentFileName, Buffer buffer) throws IOException
Description copied from class:AbstractRemoteSegmentArchiveReaderReads the segment from the remote storage.- Specified by:
doReadSegmentToBufferin classAbstractRemoteSegmentArchiveReader- Parameters:
segmentFileName- , the name of the segment (msb + lsb) prefixed by its position in the archivebuffer- , the buffer to which to read- Throws:
IOException
-
doReadDataFile
protected Buffer doReadDataFile(String extension) throws IOException
Description copied from class:AbstractRemoteSegmentArchiveReaderReads a data file inside the archive. This entry is not a segment. Its full name is given by archive name + extension.- Specified by:
doReadDataFilein classAbstractRemoteSegmentArchiveReader- Parameters:
extension- , extension of the file- Returns:
- the buffer containing the data file bytes
- Throws:
IOException
-
archivePathAsFile
protected File archivePathAsFile()
Description copied from class:AbstractRemoteSegmentArchiveReaderReturns the decoded file component of this archive.- Specified by:
archivePathAsFilein classAbstractRemoteSegmentArchiveReader- Returns:
- the decoded file component of this archive.
-
-