public abstract class AbstractRemoteSegmentArchiveWriter extends Object implements org.apache.jackrabbit.oak.segment.spi.persistence.SegmentArchiveWriter
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
created |
protected int |
entries |
protected Map<UUID,RemoteSegmentArchiveEntry> |
index |
protected org.apache.jackrabbit.oak.segment.spi.monitor.IOMonitor |
ioMonitor |
protected org.apache.jackrabbit.oak.segment.spi.monitor.FileStoreMonitor |
monitor |
protected Optional<SegmentWriteQueue> |
queue |
protected long |
totalLength |
| Constructor and Description |
|---|
AbstractRemoteSegmentArchiveWriter(org.apache.jackrabbit.oak.segment.spi.monitor.IOMonitor ioMonitor,
org.apache.jackrabbit.oak.segment.spi.monitor.FileStoreMonitor monitor) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
afterQueueClosed()
Hook for executing additional actions after the segment write queue is closed.
|
protected abstract void |
afterQueueFlushed()
Hook for executing additional actions after the segment write queue is flushed.
|
void |
close() |
boolean |
containsSegment(long msb,
long lsb) |
protected abstract org.apache.jackrabbit.oak.commons.Buffer |
doReadArchiveEntry(RemoteSegmentArchiveEntry indexEntry)
Reads a segment from remote storage into a buffer.
|
protected abstract void |
doWriteArchiveEntry(RemoteSegmentArchiveEntry indexEntry,
byte[] data,
int offset,
int size)
Writes a segment to the remote storage.
|
protected abstract void |
doWriteDataFile(byte[] data,
String extension)
Writes a data file inside the archive.
|
void |
flush() |
int |
getEntryCount() |
long |
getLength() |
boolean |
isCreated() |
org.apache.jackrabbit.oak.commons.Buffer |
readSegment(long msb,
long lsb) |
void |
writeBinaryReferences(@NotNull byte[] data) |
void |
writeDataFile(byte[] data,
String extension) |
void |
writeGraph(@NotNull byte[] data) |
void |
writeSegment(long msb,
long lsb,
@NotNull byte[] data,
int offset,
int size,
int generation,
int fullGeneration,
boolean compacted) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNameprotected final org.apache.jackrabbit.oak.segment.spi.monitor.IOMonitor ioMonitor
protected final org.apache.jackrabbit.oak.segment.spi.monitor.FileStoreMonitor monitor
protected final Optional<SegmentWriteQueue> queue
protected Map<UUID,RemoteSegmentArchiveEntry> index
protected int entries
protected long totalLength
protected volatile boolean created
public AbstractRemoteSegmentArchiveWriter(org.apache.jackrabbit.oak.segment.spi.monitor.IOMonitor ioMonitor, org.apache.jackrabbit.oak.segment.spi.monitor.FileStoreMonitor monitor)
public void writeSegment(long msb,
long lsb,
@NotNull
@NotNull byte[] data,
int offset,
int size,
int generation,
int fullGeneration,
boolean compacted)
throws IOException
writeSegment in interface org.apache.jackrabbit.oak.segment.spi.persistence.SegmentArchiveWriterIOExceptionpublic org.apache.jackrabbit.oak.commons.Buffer readSegment(long msb, long lsb) throws IOException
readSegment in interface org.apache.jackrabbit.oak.segment.spi.persistence.SegmentArchiveWriterIOExceptionpublic boolean containsSegment(long msb,
long lsb)
containsSegment in interface org.apache.jackrabbit.oak.segment.spi.persistence.SegmentArchiveWriterpublic void writeGraph(@NotNull
@NotNull byte[] data)
throws IOException
writeGraph in interface org.apache.jackrabbit.oak.segment.spi.persistence.SegmentArchiveWriterIOExceptionpublic void writeBinaryReferences(@NotNull
@NotNull byte[] data)
throws IOException
writeBinaryReferences in interface org.apache.jackrabbit.oak.segment.spi.persistence.SegmentArchiveWriterIOExceptionpublic void writeDataFile(byte[] data,
String extension)
throws IOException
IOExceptionpublic long getLength()
getLength in interface org.apache.jackrabbit.oak.segment.spi.persistence.SegmentArchiveWriterpublic int getEntryCount()
getEntryCount in interface org.apache.jackrabbit.oak.segment.spi.persistence.SegmentArchiveWriterpublic void close()
throws IOException
close in interface org.apache.jackrabbit.oak.segment.spi.persistence.SegmentArchiveWriterIOExceptionpublic boolean isCreated()
isCreated in interface org.apache.jackrabbit.oak.segment.spi.persistence.SegmentArchiveWriterpublic void flush()
throws IOException
flush in interface org.apache.jackrabbit.oak.segment.spi.persistence.SegmentArchiveWriterIOExceptionprotected abstract void doWriteArchiveEntry(RemoteSegmentArchiveEntry indexEntry, byte[] data, int offset, int size) throws IOException
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.IOExceptionprotected abstract org.apache.jackrabbit.oak.commons.Buffer doReadArchiveEntry(RemoteSegmentArchiveEntry indexEntry) throws IOException
indexEntry, - the archive index entry to readIOExceptionprotected abstract void doWriteDataFile(byte[] data,
String extension)
throws IOException
data, - bytes to writeextension, - the extension of the data fileIOExceptionprotected abstract void afterQueueClosed()
throws IOException
IOExceptionprotected abstract void afterQueueFlushed()
throws IOException
IOExceptionCopyright © 2012–2021 The Apache Software Foundation. All rights reserved.