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 void
afterQueueClosed()
Hook for executing additional actions after the segment write queue is closed.protected void
afterQueueFlushed()
Hook for executing additional actions after the segment write queue is flushed.protected Buffer
doReadArchiveEntry(RemoteSegmentArchiveEntry indexEntry)
Reads a segment from remote storage into a buffer.protected void
doWriteArchiveEntry(RemoteSegmentArchiveEntry indexEntry, byte[] data, int offset, int size)
Writes a segment to the remote storage.protected void
doWriteDataFile(byte[] data, String extension)
Writes a data file inside the archive.String
getName()
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:SegmentArchiveWriter
Get 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:AbstractRemoteSegmentArchiveWriter
Writes a segment to the remote storage.- Specified by:
doWriteArchiveEntry
in 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:AbstractRemoteSegmentArchiveWriter
Reads a segment from remote storage into a buffer.- Specified by:
doReadArchiveEntry
in 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 IOException
Description copied from class:AbstractRemoteSegmentArchiveWriter
Writes a data file inside the archive. This entry is not a segment. Its full name is given by archive name + extension.- Specified by:
doWriteDataFile
in classAbstractRemoteSegmentArchiveWriter
- Parameters:
data
- , bytes to writeextension
- , the extension of the data file- Throws:
IOException
-
afterQueueClosed
protected void afterQueueClosed() throws IOException
Description copied from class:AbstractRemoteSegmentArchiveWriter
Hook for executing additional actions after the segment write queue is closed.- Specified by:
afterQueueClosed
in classAbstractRemoteSegmentArchiveWriter
- Throws:
IOException
-
afterQueueFlushed
protected void afterQueueFlushed() throws IOException
Description copied from class:AbstractRemoteSegmentArchiveWriter
Hook for executing additional actions after the segment write queue is flushed.- Specified by:
afterQueueFlushed
in classAbstractRemoteSegmentArchiveWriter
- Throws:
IOException
-
-