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 static org.slf4j.Logger |
logger |
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 keepOriginals) |
CompactionAwareWriter(ColumnFamilyStore cfs,
Directories directories,
LifecycleTransaction txn,
java.util.Set<SSTableReader> nonExpiredSSTables,
boolean offline,
boolean keepOriginals)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
append(UnfilteredRowIterator partition)
Writes a partition in an implementation specific way
|
protected java.lang.Throwable |
doAbort(java.lang.Throwable accumulate) |
protected java.lang.Throwable |
doCommit(java.lang.Throwable accumulate) |
protected java.lang.Throwable |
doPostCleanup(java.lang.Throwable accumulate)
perform an exception-safe post-abort cleanup
|
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(java.lang.Iterable<SSTableReader> sstables,
long estimatedWriteSize)
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) |
CompactionAwareWriter |
setRepairedAt(long repairedAt) |
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, doPreCleanup, permitRedundantTransitions, prepareToCommit, state
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
abort, close, commit, prepareToCommit
protected static final org.slf4j.Logger logger
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 SSTableRewriter sstableWriter
protected final LifecycleTransaction txn
@Deprecated public CompactionAwareWriter(ColumnFamilyStore cfs, Directories directories, LifecycleTransaction txn, java.util.Set<SSTableReader> nonExpiredSSTables, boolean offline, boolean keepOriginals)
public CompactionAwareWriter(ColumnFamilyStore cfs, Directories directories, LifecycleTransaction txn, java.util.Set<SSTableReader> nonExpiredSSTables, 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)
partition
- the partition to appendprotected java.lang.Throwable doPostCleanup(java.lang.Throwable accumulate)
Transactional.AbstractTransactional
doPostCleanup
in class Transactional.AbstractTransactional
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(java.lang.Iterable<SSTableReader> sstables, long estimatedWriteSize)
sstables
- the sstables to compactpublic CompactionAwareWriter setRepairedAt(long repairedAt)
Copyright © 2018 The Apache Software Foundation