|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
org.objectweb.cjdbc.controller.recoverylog.RecoverThread
This class defines a RecoverThread that is in charge of replaying the recovery log on a given backend to re-synchronize it with the other nodes of the cluster.
| Field Summary | |
private DatabaseBackend |
backend
|
private BackendWorkerThread |
bwt
|
private java.lang.String |
checkpointName
|
private java.sql.SQLException |
exception
|
private AbstractLoadBalancer |
loadBalancer
|
(package private) static Trace |
logger
|
private int |
recoveryBatchSize
Size of the pendingRecoveryTasks queue used during recovery |
private RecoveryLog |
recoveryLog
|
private AbstractScheduler |
scheduler
|
private java.util.ArrayList |
tids
|
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
RecoverThread(AbstractScheduler scheduler,
RecoveryLog recoveryLog,
DatabaseBackend backend,
AbstractLoadBalancer loadBalancer,
java.lang.String checkpointName)
Creates a new RecoverThread object |
|
| Method Summary | |
private void |
addWorkerTask(BackendWorkerThread bwt,
AbstractTask task)
Add a task to a BackendWorkerThread using the proper synchronization. |
void |
endRecovery()
Properly end the recovery and kill the worker thread used for recovery if it exists. |
java.sql.SQLException |
getException()
Returns the exception value. |
private long |
recover(long logIdx)
Replay the recovery log from the given logIdx index. |
private void |
recoveryFailed(java.sql.SQLException e)
Unset the last known checkpoint and set the backend to disabled state. |
void |
run()
|
void |
startRecovery()
Start the recovery process by forking a BackendWorkerThread. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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 |
| Field Detail |
static Trace logger
private RecoveryLog recoveryLog
private DatabaseBackend backend
private AbstractLoadBalancer loadBalancer
private java.sql.SQLException exception
private BackendWorkerThread bwt
private java.util.ArrayList tids
private AbstractScheduler scheduler
private java.lang.String checkpointName
private int recoveryBatchSize
| Constructor Detail |
public RecoverThread(AbstractScheduler scheduler,
RecoveryLog recoveryLog,
DatabaseBackend backend,
AbstractLoadBalancer loadBalancer,
java.lang.String checkpointName)
RecoverThread object
scheduler - the currently used schedulerrecoveryLog - Recovery log that creates this threadbackend - database backend for loggingloadBalancer - index to start from for recoverycheckpointName - load balancer to use to create a BackendWorkerThread| Method Detail |
public java.sql.SQLException getException()
public void run()
Runnable.run()private void recoveryFailed(java.sql.SQLException e)
e - cause of the recovery failure
private long recover(long logIdx)
throws java.sql.SQLException
logIdx - logIdx used to start the recovery
java.sql.SQLException - if failsstartRecovery(),
endRecovery()
private void addWorkerTask(BackendWorkerThread bwt,
AbstractTask task)
bwt - BackendWorkerThread to synchronize ontask - the task to add to the thread queuepublic void endRecovery()
startRecovery()
public void startRecovery()
throws java.sql.SQLException
java.sql.SQLException - if an error occursendRecovery()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||