Class AwsSegmentArchiveWriter
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.remote.AbstractRemoteSegmentArchiveWriter
-
- org.apache.jackrabbit.oak.segment.aws.AwsSegmentArchiveWriter
-
- All Implemented Interfaces:
SegmentArchiveWriter
public class AwsSegmentArchiveWriter extends AbstractRemoteSegmentArchiveWriter
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.oak.segment.remote.AbstractRemoteSegmentArchiveWriter
created, entries, index, ioMonitor, monitor, queue, totalLength, writeAccessController
-
-
Constructor Summary
Constructors Constructor Description AwsSegmentArchiveWriter(S3Directory directory, String archiveName, IOMonitor ioMonitor, FileStoreMonitor monitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterQueueClosed()Hook for executing additional actions after the segment write queue is closed.protected voidafterQueueFlushed()Hook for executing additional actions after the segment write queue is flushed.protected BufferdoReadArchiveEntry(RemoteSegmentArchiveEntry indexEntry)Reads a segment from remote storage into a buffer.protected voiddoWriteArchiveEntry(RemoteSegmentArchiveEntry indexEntry, byte[] data, int offset, int size)Writes a segment to the remote storage.protected voiddoWriteDataFile(byte[] data, String extension)Writes a data file inside the archive.StringgetName()Get the name of the archive.-
Methods inherited from class org.apache.jackrabbit.oak.segment.remote.AbstractRemoteSegmentArchiveWriter
close, containsSegment, flush, getEntryCount, getLength, getMaxEntryCount, isCreated, isRemote, readSegment, writeBinaryReferences, writeDataFile, writeGraph, writeSegment
-
-
-
-
Constructor Detail
-
AwsSegmentArchiveWriter
public AwsSegmentArchiveWriter(S3Directory directory, String archiveName, IOMonitor ioMonitor, FileStoreMonitor monitor)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:SegmentArchiveWriterGet the name of the archive.- Returns:
- archive name
-
doWriteArchiveEntry
protected void doWriteArchiveEntry(RemoteSegmentArchiveEntry indexEntry, byte[] data, int offset, int size) throws IOException
Description copied from class:AbstractRemoteSegmentArchiveWriterWrites a segment to the remote storage.- Specified by:
doWriteArchiveEntryin classAbstractRemoteSegmentArchiveWriter- Parameters:
indexEntry- , the archive index entry to writedata- , the actual bytes in the entryoffset- , the start offset in the data.size- , the number of bytes to write.- Throws:
IOException
-
doReadArchiveEntry
protected Buffer doReadArchiveEntry(RemoteSegmentArchiveEntry indexEntry) throws IOException
Description copied from class:AbstractRemoteSegmentArchiveWriterReads a segment from remote storage into a buffer.- Specified by:
doReadArchiveEntryin classAbstractRemoteSegmentArchiveWriter- Parameters:
indexEntry- , the archive index entry to read- Returns:
- th buffer containing the segment bytes
- Throws:
IOException
-
doWriteDataFile
protected void doWriteDataFile(byte[] data, String extension) throws IOExceptionDescription copied from class:AbstractRemoteSegmentArchiveWriterWrites a data file inside the archive. This entry is not a segment. Its full name is given by archive name + extension.- Specified by:
doWriteDataFilein classAbstractRemoteSegmentArchiveWriter- Parameters:
data- , bytes to writeextension- , the extension of the data file- Throws:
IOException
-
afterQueueClosed
protected void afterQueueClosed() throws IOExceptionDescription copied from class:AbstractRemoteSegmentArchiveWriterHook for executing additional actions after the segment write queue is closed.- Specified by:
afterQueueClosedin classAbstractRemoteSegmentArchiveWriter- Throws:
IOException
-
afterQueueFlushed
protected void afterQueueFlushed() throws IOExceptionDescription copied from class:AbstractRemoteSegmentArchiveWriterHook for executing additional actions after the segment write queue is flushed.- Specified by:
afterQueueFlushedin classAbstractRemoteSegmentArchiveWriter- Throws:
IOException
-
-