Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog Class Reference

Inheritance diagram for org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog:

Inheritance graph
[legend]
List of all members.

Public Member Functions

long getRecoveringNb ()
abstract void logRequest (AbstractWriteRequest request) throws SQLException
abstract void logRequest (StoredProcedure proc, boolean isRead) throws SQLException
abstract long getLastTransactionId () throws SQLException
abstract void begin (TransactionMarkerMetaData tm) throws SQLException
abstract void abort (TransactionMarkerMetaData tm) throws SQLException
abstract void commit (TransactionMarkerMetaData tm) throws SQLException
abstract void rollback (TransactionMarkerMetaData tm) throws SQLException
synchronized void beginRecovery ()
abstract void cleanRecoveryLog () throws SQLException
synchronized void endRecovery ()
synchronized boolean isRecovering ()
abstract RecoveryTask recoverNextRequest (long previousRequestId) throws SQLException
abstract BackendRecoveryInfo getBackendRecoveryInfo (String databaseName, String backendName) throws SQLException
abstract ArrayList getCheckpointNames () throws SQLException
abstract long getCheckpointRequestId (String checkpointName) throws SQLException
abstract void removeCheckpoint (String checkpointName) throws SQLException
abstract void storeBackendRecoveryInfo (String databaseName, BackendRecoveryInfo backendRecoveryInfo) throws SQLException
abstract void storeCheckpoint (String checkpointName) throws SQLException
abstract void storeCheckpoint (String checkpointName, long requestId) throws SQLException
String getXml ()
abstract String getXmlImpl ()
abstract String[][] getData ()

Protected Member Functions

 AbstractRecoveryLog (Class mBeanInterface) throws NotCompliantMBeanException

Static Package Attributes

Trace logger

Detailed Description

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

Author:
Emmanuel Cecchet

Julie Marguerite

Version:
1.0

Definition at line 50 of file AbstractRecoveryLog.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.AbstractRecoveryLog Class  mBeanInterface  )  throws NotCompliantMBeanException [protected]
 

Generic constructor.

Parameters:
mBeanInterface the MBean interface
Exceptions:
NotCompliantMBeanException if the MBean is not JMX compliant

Definition at line 67 of file AbstractRecoveryLog.java.

00069   {
00070     super(mBeanInterface);
00071   }


Member Function Documentation

abstract void org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.abort TransactionMarkerMetaData  tm  )  throws SQLException [pure virtual]
 

Log a transaction abort. This is used only for transaction that were started but where no request was executed, which is in fact an empty transaction. The underlying implementation might safely discard the corresponding begin from the log as an optimization.

Parameters:
tm The transaction marker metadata
Exceptions:
SQLException if an error occurs

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

abstract void org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.begin TransactionMarkerMetaData  tm  )  throws SQLException [pure virtual]
 

Log the beginning of a new transaction.

Parameters:
tm The transaction marker metadata
Exceptions:
SQLException if an error occurs

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

Referenced by org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager.begin(), and org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager.lazyTransactionStart().

synchronized void org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.beginRecovery  ) 
 

Notify the recovery log that a recovery process has started.

Definition at line 157 of file AbstractRecoveryLog.java.

Referenced by org.objectweb.cjdbc.controller.recoverylog.JDBCRecoverThread.run().

00159   {
00160     recoveringNb++;
00161   }

abstract void org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.cleanRecoveryLog  )  throws SQLException [pure virtual]
 

Possibly clean the recovery log after all recovery process are done.

Exceptions:
SQLException if an error occurs

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

Referenced by org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.endRecovery().

abstract void org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.commit TransactionMarkerMetaData  tm  )  throws SQLException [pure virtual]
 

Log a transaction commit.

Parameters:
tm The transaction marker metadata
Exceptions:
SQLException if an error occurs

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

synchronized void org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.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()

Definition at line 176 of file AbstractRecoveryLog.java.

References org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.cleanRecoveryLog().

Referenced by org.objectweb.cjdbc.controller.recoverylog.JDBCRecoverThread.run().

00177   {
00178     recoveringNb--;
00179     if (recoveringNb == 0)
00180     {
00181       try
00182       {
00183         cleanRecoveryLog();
00184       }
00185       catch (SQLException e)
00186       {
00187         logger.error(Translate.get("recovery.cleaning.failed", e));
00188       }
00189     }
00190   }

abstract BackendRecoveryInfo org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.getBackendRecoveryInfo String  databaseName,
String  backendName
throws SQLException [pure virtual]
 

Retrieve recovery information on a backend. This includes, the last known state of the backend, and the last known checkpoint

Parameters:
databaseName the virtual database name
backendName the backend name
Returns:
BackendRecoveryInfo instance or null if the backend does not exist
Exceptions:
SQLException if cannot proceed

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

Referenced by org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.enableAllBackendsFromCheckpoint().

abstract ArrayList org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.getCheckpointNames  )  throws SQLException [pure virtual]
 

Returns an array of names of all the checkpoint available in the recovery log

Returns:
ArrayList of String checkpoint names
Exceptions:
SQLException if fails

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

Referenced by org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.viewCheckpointNames().

abstract long org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.getCheckpointRequestId String  checkpointName  )  throws SQLException [pure virtual]
 

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.
Exceptions:
SQLException if an error occurs
See also:
recoverNextRequest(long)

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

Referenced by org.objectweb.cjdbc.controller.recoverylog.JDBCRecoverThread.run().

abstract String [][] org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.getData  )  [pure virtual]
 

Allow to get the content of the recovery log for viewing

Returns:
String[][]
See also:
org.objectweb.cjdbc.console.views.RecoveryLogViewer

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

Referenced by org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveRecoveryLogData().

abstract long org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.getLastTransactionId  )  throws SQLException [pure virtual]
 

Get the id of the last transaction logged in the recovery log.

Returns:
the last transaction id.
Exceptions:
SQLException if an error occured while retrieving the id.

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

long org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.getRecoveringNb  ) 
 

Returns the recoveringNb value.

Returns:
Returns the recoveringNb.

Definition at line 78 of file AbstractRecoveryLog.java.

00079   {
00080     return recoveringNb;
00081   }

String org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.getXml  ) 
 

Get xml information of the current recovery load in the system.

Returns:
xml formatted string

Definition at line 300 of file AbstractRecoveryLog.java.

References org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.getXmlImpl(), and org.objectweb.cjdbc.controller.recoverylog.BackendRecoveryInfo.toString().

00302   {
00303     StringBuffer info = new StringBuffer();
00304     info.append("<" + DatabasesXmlTags.ELT_RecoveryLog + ">");
00305     info.append(getXmlImpl());
00306     info.append("</" + DatabasesXmlTags.ELT_RecoveryLog + ">");
00307     return info.toString();
00308   }

abstract String org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.getXmlImpl  )  [pure virtual]
 

See also:
org.objectweb.cjdbc.common.xml.XmlComponent.getXml()

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

Referenced by org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.getXml().

synchronized boolean org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.isRecovering  ) 
 

Returns true if at least one backend has started a recover process.

Returns:
boolean

Definition at line 198 of file AbstractRecoveryLog.java.

00199   {
00200     return recoveringNb > 0;
00201   }

abstract void org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.logRequest StoredProcedure  proc,
boolean  isRead
throws SQLException [pure virtual]
 

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
Exceptions:
SQLException if an error occurs

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

abstract void org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.logRequest AbstractWriteRequest  request  )  throws SQLException [pure virtual]
 

Log a write request.

Parameters:
request The write request to log
Exceptions:
SQLException if an error occurs

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

abstract RecoveryTask org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.recoverNextRequest long  previousRequestId  )  throws SQLException [pure virtual]
 

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
Exceptions:
SQLException if an error occurs
See also:
getCheckpointRequestId(String)

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

abstract void org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.removeCheckpoint String  checkpointName  )  throws SQLException [pure virtual]
 

Remove a checkpoint from the recovery. This is useful for recovery maintenant

Parameters:
checkpointName to remove
Exceptions:
SQLException if an error occurs

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

abstract void org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.rollback TransactionMarkerMetaData  tm  )  throws SQLException [pure virtual]
 

Log a transaction rollback.

Parameters:
tm The transaction marker metadata
Exceptions:
SQLException if an error occurs

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

abstract void org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.storeBackendRecoveryInfo String  databaseName,
BackendRecoveryInfo  backendRecoveryInfo
throws SQLException [pure virtual]
 

Store the state of the backend in the recovery log

Parameters:
databaseName the virtual database name
backendRecoveryInfo the backend recovery information to store
Exceptions:
SQLException if cannot proceed

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

Referenced by org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.setBackendLastKnownCheckpoint().

abstract void org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.storeCheckpoint String  checkpointName,
long  requestId
throws SQLException [pure virtual]
 

Store a Checkpoint using the given request id.

Parameters:
checkpointName Name of the checkpoint
requestId request identifier
Exceptions:
SQLException if an error occurs

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.

abstract void org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.storeCheckpoint String  checkpointName  )  throws SQLException [pure virtual]
 

Store a Checkpoint using the current log state.

Parameters:
checkpointName Name of the checkpoint
Exceptions:
SQLException if an error occurs

Implemented in org.objectweb.cjdbc.controller.recoverylog.JDBCRecoveryLog.


Member Data Documentation

Trace org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.logger [static, package]
 

Initial value:

 Trace
                                .getLogger("org.objectweb.cjdbc.controller.recoverylog")

Definition at line 56 of file AbstractRecoveryLog.java.


The documentation for this class was generated from the following file:
Generated on Mon Apr 11 22:04:21 2005 for C-JDBC by  doxygen 1.3.9.1