|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread proai.cache.Committer
public class Committer
A thread for committing a series of QueueItem
updates to the
database.
Items are added to a "commit queue" by Worker
threads via the
synchronized handoff() method. This can occur before the thread is actually
started. Once the thread is started, the items are removed asynchronously,
then committed, until all workers have finished and ( the queue is empty
or processing has been aborted ).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
Committer(Updater updater,
RCDatabase db,
int maxCommitQueueSize,
int maxRecordsPerTransaction)
Construct a new committer with the given configuration. |
Method Summary | |
---|---|
protected int |
getProcessedCount()
|
protected long |
getTotalCommitTime()
|
protected int |
getTransactionCount()
|
protected boolean |
handoff(java.util.List<QueueItem> queueItems)
Attempt to add the list of QueueItems to the commit queue
and return immediately. |
void |
run()
Run the thread. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Committer(Updater updater, RCDatabase db, int maxCommitQueueSize, int maxRecordsPerTransaction) throws ServerException
ServerException
Method Detail |
---|
protected boolean handoff(java.util.List<QueueItem> queueItems)
QueueItems
to the commit queue
and return immediately.
This method will block until adding the list would not cause the queue
to exceed its capacity or the thread is finished running.
Committer
thread has been stopped.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
protected int getTransactionCount()
protected int getProcessedCount()
protected long getTotalCommitTime()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |