org.objectweb.cjdbc.controller.recoverylog
Class JDBCRecoverThread

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.objectweb.cjdbc.controller.recoverylog.JDBCRecoverThread
All Implemented Interfaces:
java.lang.Runnable

public class JDBCRecoverThread
extends java.lang.Thread

This class defines a JDBCRecoverThread

Version:
1.0
Author:
Nicolas Modrzyk

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  AbstractRecoveryLog recoveryLog
           
private  AbstractScheduler scheduler
           
private  java.util.ArrayList tids
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
JDBCRecoverThread(AbstractScheduler scheduler, AbstractRecoveryLog recoveryLog, DatabaseBackend backend, AbstractLoadBalancer loadBalancer, java.lang.String checkpointName)
          Creates a new JDBCRecoverThread 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)
           
 void run()
           
 
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

logger

static Trace logger

recoveryLog

private AbstractRecoveryLog recoveryLog

backend

private DatabaseBackend backend

loadBalancer

private AbstractLoadBalancer loadBalancer

exception

private java.sql.SQLException exception

bwt

private BackendWorkerThread bwt

tids

private java.util.ArrayList tids

scheduler

private AbstractScheduler scheduler

checkpointName

private java.lang.String checkpointName
Constructor Detail

JDBCRecoverThread

public JDBCRecoverThread(AbstractScheduler scheduler,
                         AbstractRecoveryLog recoveryLog,
                         DatabaseBackend backend,
                         AbstractLoadBalancer loadBalancer,
                         java.lang.String checkpointName)
Creates a new JDBCRecoverThread object

Parameters:
scheduler - the currently used scheduler
recoveryLog - Recovery log that creates this thread
backend - database backend for logging
loadBalancer - index to start from for recovery
checkpointName - load balancer to use to create a BackendWorkerThread
Method Detail

getException

public java.sql.SQLException getException()
Returns the exception value.

Returns:
Returns the exception.

run

public void run()
See Also:
Runnable.run()

recoveryFailed

private void recoveryFailed(java.sql.SQLException e)

recover

private long recover(long logIdx)
              throws java.sql.SQLException
Replay the recovery log from the given logIdx index

Parameters:
logIdx - logIdx used to start the recovery
Returns:
last logIdx that was replayed.
Throws:
java.sql.SQLException - if fails

addWorkerTask

private void addWorkerTask(BackendWorkerThread bwt,
                           AbstractTask task)
Add a task to a BackendWorkerThread using the proper synchronization.

Parameters:
bwt - BackendWorkerThread to synchronize on
task - the task to add to the thread queue

endRecovery

public void endRecovery()
Properly end the recovery and kill the worker thread used for recovery if it exists



Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.