org.objectweb.cjdbc.controller.recoverylog
Class AbstractRecoveryLog

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog
Direct Known Subclasses:
JDBCRecoveryLog

public abstract class AbstractRecoveryLog
extends java.lang.Object

Log Recovery is responsible for logging performed queries, managing checkpoints and retrieving write requests executed from a given checkpoint.

Version:
1.0
Author:
Emmanuel Cecchet, Julie Marguerite

Field Summary
(package private) static Trace logger
           
private  int recoveringNb
           
 
Constructor Summary
AbstractRecoveryLog()
           
 
Method Summary
abstract  void begin(TransactionMarkerMetaData tm)
          Log the beginning of a new transaction.
 void beginRecovery()
          Notify the recovery log that a recovery process has started.
abstract  void cleanRecoveryLog()
          Possibly clean the recovery log after all recovery process are done.
abstract  void commit(TransactionMarkerMetaData tm)
          Log a transaction commit.
 void endRecovery()
          Notify the recovery log that a recovery process has finished.
abstract  int getCheckpointRequestId(java.lang.String checkpointName)
          Get the request id corresponding to a given checkpoint.
abstract  java.lang.String getXmlInformation()
          Get xml information of the current recovery load in the system.
 boolean isRecovering()
          Returns true if at least one backend has started a recover process.
abstract  void logRequest(AbstractWriteRequest request)
          Log a write request.
abstract  void logRequest(StoredProcedure proc, boolean isRead)
          Log a call to a stored procedure.
abstract  RecoveryTask recoverNextRequest(int previousRequestId)
          Get the next request (begin/commit/rollback or WriteRequest) from the recovery log given the id of the previously recovered request.
abstract  void rollback(TransactionMarkerMetaData tm)
          Log a transaction rollback.
abstract  void storeCheckpoint(java.lang.String checkpointName)
          Store a Checkpoint using the current log state.
abstract  void storeCheckpoint(java.lang.String checkpointName, int requestId)
          Store a Checkpoint using the given request id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static Trace logger

recoveringNb

private int recoveringNb
Constructor Detail

AbstractRecoveryLog

public AbstractRecoveryLog()
Method Detail

logRequest

public abstract void logRequest(AbstractWriteRequest request)
                         throws java.sql.SQLException
Log a write request.

Parameters:
request - The write request to log
Throws:
java.sql.SQLException - if an error occurs

logRequest

public abstract void logRequest(StoredProcedure proc,
                                boolean isRead)
                         throws java.sql.SQLException
Log a call to a stored procedure.

Parameters:
proc - The stored procedure call to log
isRead - True if the stored procedure call returns a ResultSet
Throws:
java.sql.SQLException - if an error occurs

begin

public abstract void begin(TransactionMarkerMetaData tm)
                    throws java.sql.SQLException
Log the beginning of a new transaction.

Parameters:
tm - The transaction marker metadata
Throws:
java.sql.SQLException - if an error occurs

commit

public abstract void commit(TransactionMarkerMetaData tm)
                     throws java.sql.SQLException
Log a transaction commit.

Parameters:
tm - The transaction marker metadata
Throws:
java.sql.SQLException - if an error occurs

rollback

public abstract void rollback(TransactionMarkerMetaData tm)
                       throws java.sql.SQLException
Log a transaction rollback.

Parameters:
tm - The transaction marker metadata
Throws:
java.sql.SQLException - if an error occurs

storeCheckpoint

public abstract void storeCheckpoint(java.lang.String checkpointName)
                              throws java.sql.SQLException
Store a Checkpoint using the current log state.

Parameters:
checkpointName - Name of the checkpoint
Throws:
java.sql.SQLException - if an error occurs

storeCheckpoint

public abstract void storeCheckpoint(java.lang.String checkpointName,
                                     int requestId)
                              throws java.sql.SQLException
Store a Checkpoint using the given request id.

Parameters:
checkpointName - Name of the checkpoint
requestId - request identifier
Throws:
java.sql.SQLException - if an error occurs

getCheckpointRequestId

public abstract int getCheckpointRequestId(java.lang.String checkpointName)
                                    throws java.sql.SQLException
Get the request id corresponding to a given checkpoint. This is the first step in a recovery process. Following steps consist in calling recoverNextRequest.

Parameters:
checkpointName - Name of the checkpoint
Returns:
int the request identifier corresponding to this checkpoint.
Throws:
java.sql.SQLException - if an error occurs
See Also:
recoverNextRequest(int)

recoverNextRequest

public abstract RecoveryTask recoverNextRequest(int previousRequestId)
                                         throws java.sql.SQLException
Get the next request (begin/commit/rollback or WriteRequest) from the recovery log given the id of the previously recovered request.

The id of the request before the first one to recover is given by getCheckpointRequestId.

Parameters:
previousRequestId - id of the previously recovered request
Returns:
AbstractTask task corresponding to the next request to recover
Throws:
java.sql.SQLException - if an error occurs
See Also:
getCheckpointRequestId(String)

beginRecovery

public void beginRecovery()
Notify the recovery log that a recovery process has started.


endRecovery

public void endRecovery()
Notify the recovery log that a recovery process has finished. If this is the last recovery process to finish, the cleanRecoveryLog method is called

See Also:
cleanRecoveryLog()

isRecovering

public boolean isRecovering()
Returns true if at least one backend has started a recover process.

Returns:
boolean

cleanRecoveryLog

public abstract void cleanRecoveryLog()
                               throws java.sql.SQLException
Possibly clean the recovery log after all recovery process are done.

Throws:
java.sql.SQLException - if an error occurs

getXmlInformation

public abstract java.lang.String getXmlInformation()
Get xml information of the current recovery load in the system.

Returns:
xml formatted string


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