public abstract class CompactionAwareWriter extends Transactional.AbstractTransactional implements Transactional
Transactional.AbstractTransactional.State
Transactional.AbstractTransactional
Modifier and Type | Field and Description |
---|---|
protected ColumnFamilyStore |
cfs |
protected Directories |
directories |
protected long |
estimatedTotalKeys |
protected long |
maxAge |
protected long |
minRepairedAt |
protected java.util.Set<SSTableReader> |
nonExpiredSSTables |
protected SSTableRewriter |
sstableWriter |
protected LifecycleTransaction |
txn |
Constructor and Description |
---|
CompactionAwareWriter(ColumnFamilyStore cfs,
Directories directories,
LifecycleTransaction txn,
java.util.Set<SSTableReader> nonExpiredSSTables,
boolean offline,
boolean keepOriginals) |
Modifier and Type | Method and Description |
---|---|
boolean |
append(UnfilteredRowIterator partition) |
protected java.lang.Throwable |
doAbort(java.lang.Throwable accumulate) |
protected java.lang.Throwable |
doCommit(java.lang.Throwable accumulate) |
protected void |
doPrepare()
Do any preparatory work prior to commit.
|
long |
estimatedKeys()
estimated number of keys we should write
|
java.util.Collection<SSTableReader> |
finish()
we are done, return the finished sstables so that the caller can mark the old ones as compacted
|
Directories |
getDirectories()
The directories we can write to
|
Directories.DataDirectory |
getWriteDirectory(long expectedWriteSize)
Return a directory where we can expect expectedWriteSize to fit.
|
protected void |
maybeSwitchWriter(DecoratedKey key)
Guaranteed to be called before the first call to realAppend.
|
protected abstract boolean |
realAppend(UnfilteredRowIterator partition) |
protected abstract void |
switchCompactionLocation(Directories.DataDirectory directory)
Implementations of this method should finish the current sstable writer and start writing to this directory.
|
abort, abort, close, commit, commit, doPostCleanup, doPreCleanup, permitRedundantTransitions, prepareToCommit, state
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
abort, commit, prepareToCommit
protected final ColumnFamilyStore cfs
protected final Directories directories
protected final java.util.Set<SSTableReader> nonExpiredSSTables
protected final long estimatedTotalKeys
protected final long maxAge
protected final long minRepairedAt
protected final LifecycleTransaction txn
protected final SSTableRewriter sstableWriter
public CompactionAwareWriter(ColumnFamilyStore cfs, Directories directories, LifecycleTransaction txn, java.util.Set<SSTableReader> nonExpiredSSTables, boolean offline, boolean keepOriginals)
protected java.lang.Throwable doAbort(java.lang.Throwable accumulate)
doAbort
in class Transactional.AbstractTransactional
protected java.lang.Throwable doCommit(java.lang.Throwable accumulate)
doCommit
in class Transactional.AbstractTransactional
protected void doPrepare()
Transactional.AbstractTransactional
doPrepare
in class Transactional.AbstractTransactional
public java.util.Collection<SSTableReader> finish()
finish
in class Transactional.AbstractTransactional
public long estimatedKeys()
public final boolean append(UnfilteredRowIterator partition)
protected abstract boolean realAppend(UnfilteredRowIterator partition)
protected void maybeSwitchWriter(DecoratedKey key)
key
- protected abstract void switchCompactionLocation(Directories.DataDirectory directory)
directory
- public Directories getDirectories()
public Directories.DataDirectory getWriteDirectory(long expectedWriteSize)
Copyright © 2015 The Apache Software Foundation