protected class AbstractPersistenceManager.AbstractPersistentStore.BatchTask extends AbstractPersistenceManager.Task implements KeyAssociation
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractPersistenceManager.AbstractPersistentStore.BatchTask.EraseOperation
An erase() Operation.
|
protected class |
AbstractPersistenceManager.AbstractPersistentStore.BatchTask.Operation
Base class for Runnable implementations that encapsulate a persistent store operation.
|
protected class |
AbstractPersistenceManager.AbstractPersistentStore.BatchTask.StoreOperation
A store() Operation.
|
Base.LoggingWriter, Base.StackFrame| Modifier and Type | Field and Description |
|---|---|
protected Collector<Object> |
f_collector
An optional Collector to add notifications to.
|
protected List<AbstractPersistenceManager.AbstractPersistentStore.BatchTask.Operation> |
f_listOps
The sequence of operations to commit atomically.
|
protected Object |
f_oReceipt
The receipt to add to the Collector after the unit is committed.
|
protected Object |
f_oToken
A token representing the atomic unit that will be committed asynchronously.
|
f_canceled| Constructor and Description |
|---|
BatchTask(Object oToken, Collector<Object> collector, Object oReceipt)
Create a new BatchTask.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort(Throwable eCause)
Abort all changes that have been made to the persistent store by this BatchTask.
|
void |
commit()
Commit all changes that have been made to the persistent store by this BatchTask.
|
void |
erase(long lExtentId, ReadBuffer bufKey)
Queue an erase operation.
|
void |
execute()
Execute all queued operations and commit changes.
|
Object |
getAssociatedKey()
Determine the host key (or base) object to which this object is associated.
|
void |
notifyCanceled(Throwable eCause)
Notify the task that it has been canceled.
|
protected void |
notifyCollector(Object oItem, boolean fFlush)
Add the given object to the configured collector (if any).
|
void |
store(long lExtentId, ReadBuffer bufKey, ReadBuffer bufValue)
Queue a store operation.
|
cancel, runazzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, waitprotected final Object f_oToken
protected final Collector<Object> f_collector
protected final Object f_oReceipt
protected final List<AbstractPersistenceManager.AbstractPersistentStore.BatchTask.Operation> f_listOps
public BatchTask(Object oToken, Collector<Object> collector, Object oReceipt)
oToken - a token that represents the atomic unit to commitcollector - an optional Collector to notifyoReceipt - the receipt to add to the Collector after the unit is committed
public void store(long lExtentId,
ReadBuffer bufKey,
ReadBuffer bufValue)
lExtentId - the extent identifier for the keybufKey - key to store the value underbufValue - value to be stored
public void erase(long lExtentId,
ReadBuffer bufKey)
lExtentId - the extent identifier for the keybufKey - key whose mapping is to be removedpublic void commit()
public void abort(Throwable eCause)
eCause - optional cause for the abortpublic void execute()
execute in class AbstractPersistenceManager.Taskpublic void notifyCanceled(Throwable eCause)
notifyCanceled in class AbstractPersistenceManager.TaskeCause - the optional cause of the cancellationpublic Object getAssociatedKey()
Note: It's expected that the returned object is suitable to be used as an immutable identity (e.g. a key in a Map).
Note 2: Circular associations are not permitted.
getAssociatedKey in interface Associatedprotected void notifyCollector(Object oItem, boolean fFlush)
oItem - the item to addfFlush - if true, the collector will be flushed after adding the item