Package org.apache.cassandra.io.compress
Class CompressionMetadata.Writer
java.lang.Object
org.apache.cassandra.utils.concurrent.Transactional.AbstractTransactional
org.apache.cassandra.io.compress.CompressionMetadata.Writer
- All Implemented Interfaces:
AutoCloseable,Transactional
- Enclosing class:
- CompressionMetadata
public static class CompressionMetadata.Writer
extends Transactional.AbstractTransactional
implements Transactional
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.cassandra.utils.concurrent.Transactional.AbstractTransactional
Transactional.AbstractTransactional.StateNested classes/interfaces inherited from interface org.apache.cassandra.utils.concurrent.Transactional
Transactional.AbstractTransactional -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOffset(long offset) longchunkOffsetBy(int chunkIndex) Get a chunk offset by it's index.protected Throwableprotected Throwableprotected ThrowabledoPostCleanup(Throwable failed) perform an exception-safe post-abort cleanupvoidDo any preparatory work prior to commit.finalizeLength(long dataLength, int chunkCount) open(long dataLength, long compressedLength) static CompressionMetadata.Writeropen(CompressionParams parameters, File file) voidresetAndTruncate(int chunkIndex) Reset the writer so that the next chunk offset written will be the one ofchunkIndex.Methods inherited from class org.apache.cassandra.utils.concurrent.Transactional.AbstractTransactional
abort, abort, close, commit, commit, doPreCleanup, finish, prepareToCommit, stateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cassandra.utils.concurrent.Transactional
abort, close, commit, prepareToCommit
-
Method Details
-
open
-
addOffset
public void addOffset(long offset) -
finalizeLength
-
doPrepare
public void doPrepare()Description copied from class:Transactional.AbstractTransactionalDo any preparatory work prior to commit. This method should throw any exceptions that can be encountered during the finalization of the behaviour.- Specified by:
doPreparein classTransactional.AbstractTransactional
-
open
-
chunkOffsetBy
public long chunkOffsetBy(int chunkIndex) Get a chunk offset by it's index.- Parameters:
chunkIndex- Index of the chunk.- Returns:
- offset of the chunk in the compressed file.
-
resetAndTruncate
public void resetAndTruncate(int chunkIndex) Reset the writer so that the next chunk offset written will be the one ofchunkIndex.- Parameters:
chunkIndex- the next index to write
-
doPostCleanup
Description copied from class:Transactional.AbstractTransactionalperform an exception-safe post-abort cleanup- Overrides:
doPostCleanupin classTransactional.AbstractTransactional
-
doCommit
- Specified by:
doCommitin classTransactional.AbstractTransactional
-
doAbort
- Specified by:
doAbortin classTransactional.AbstractTransactional
-