public class CompressedSequentialWriter extends SequentialWriter
Modifier and Type | Class and Description |
---|---|
protected static class |
CompressedSequentialWriter.CompressedFileWriterMark
Class to hold a mark to the position of the file
|
protected class |
CompressedSequentialWriter.TransactionalProxy |
SequentialWriter.BufferedFileWriterMark
Transactional.AbstractTransactional
bufferOffset, fchannel, lastFlushOffset, runPostFlush
buffer, strictFlushing
channel
Constructor and Description |
---|
CompressedSequentialWriter(java.io.File file,
java.lang.String offsetsPath,
java.io.File digestFile,
SequentialWriterOption option,
CompressionParams parameters,
MetadataCollector sstableMetadataCollector)
Create CompressedSequentialWriter without digest file.
|
Modifier and Type | Method and Description |
---|---|
void |
flush() |
protected void |
flushData()
Override this method instead of overriding flush()
|
long |
getEstimatedOnDiskBytesWritten()
Get a quick estimation on how many bytes have been written to disk
It should for the most part be exactly the same as getOnDiskFilePointer()
|
long |
getOnDiskFilePointer()
Returns the current file pointer of the underlying on-disk file.
|
DataPosition |
mark() |
CompressionMetadata |
open(long overrideLength) |
void |
resetAndTruncate(DataPosition mark)
Drops all buffered data that's past the limits of our new file mark + buffer capacity, or syncs and truncates
the underlying file to the marked position
|
protected SequentialWriter.TransactionalProxy |
txnProxy() |
abort, close, commit, current, doFlush, finish, getLastFlushOffset, getPath, hasPosition, isOpen, length, position, prepareToCommit, resetBuffer, setPostFlushListener, skipBytes, sync, syncDataOnlyInternal, syncInternal, truncate
applyToChannel, order, write, write, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUnsignedVInt, writeUTF, writeVInt
newDefaultChannel, retrieveTemporaryBuffer
public CompressedSequentialWriter(java.io.File file, java.lang.String offsetsPath, java.io.File digestFile, SequentialWriterOption option, CompressionParams parameters, MetadataCollector sstableMetadataCollector)
file
- File to writeoffsetsPath
- File name to write compression metadatadigestFile
- File to write digestoption
- Write option (buffer size and type will be set the same as compression params)parameters
- Compression mparameterssstableMetadataCollector
- Metadata collectorpublic long getOnDiskFilePointer()
SequentialWriter
getOnDiskFilePointer
in class SequentialWriter
public long getEstimatedOnDiskBytesWritten()
getEstimatedOnDiskBytesWritten
in class SequentialWriter
public void flush()
flush
in interface java.io.Flushable
flush
in class BufferedDataOutputStreamPlus
protected void flushData()
SequentialWriter
flushData
in class SequentialWriter
public CompressionMetadata open(long overrideLength)
public DataPosition mark()
mark
in class SequentialWriter
public void resetAndTruncate(DataPosition mark)
SequentialWriter
resetAndTruncate
in class SequentialWriter
protected SequentialWriter.TransactionalProxy txnProxy()
txnProxy
in class SequentialWriter
Copyright © 2009- The Apache Software Foundation