| java.lang.Object org.continuent.sequoia.controller.recoverylog.RecoveryLog
Inner Class :abstract class QueryHandler | |
Method Summary | |
public synchronized void | beginRecovery() Notify the recovery log that a recovery process has started. | void | checkDatabaseConnection() Checks that the connection to the recoverylog database is still valid and
if it is not attempts one reconnect. | public void | checkRecoveryLogConsistency() Check the recovery log consistency for the first controller starting in a
cluster (might come back from a complete cluster outage). | public void | checkRecoveryLogTables() Checks if the recovery log and checkpoint tables exist, and create them if
they do not exist. | public void | cleanRecoveryLog() Possibly clean the recovery log after all recovery process are done. | public void | clearLastManDown() | public void | deleteLogEntriesAndCheckpointBetween(long fromId, long toId) Delete the log entries from the fromId id to toId. | public void | deleteLogEntriesBeforeCheckpoint(String checkpointName) Deletes recovery log entries that are older than specified checkpoint. | public synchronized void | endRecovery() Notify the recovery log that a recovery process has finished. | Object | executeQuery(String query, QueryHandler handler) | public boolean | findCloseForPersistentConnection(long persistentConnectionId) Tries to find a close for a given persistent connection ID. | public boolean | findCommitForTransaction(long transactionId) Tries to find a commit for a given transaction ID. | public boolean | findRollbackForTransaction(long transactionId) Tries to find a rollback for a given transaction ID. | public String | getAssociatedString() | public BackendRecoveryInfo | getBackendRecoveryInfo(String databaseName, String backendName) Retrieve recovery information on a backend. | public String | getBackendTableName() Returns the backendTableName value. | public CheckpointLogEntry | getCheckpointLogEntry(String checkpointName) Get the log entry corresponding to a given checkpoint. | public long | getCheckpointLogId(String checkpointName) Get the log id corresponding to a given checkpoint. | public String[] | getCheckpointNameAliases(String checkpointName) Returns a list of checkpoint names (strings) that all represent the same
point in time (same log id) as specified 'checkpointName'. | public ArrayList | getCheckpointNames() Returns a time-ordered odered (most recent first) array of names of all the
checkpoint available in the recovery log. | public String | getCheckpointTableName() Returns the checkpointTableName value. | Map | getCheckpoints() Returns a Map<String, String> of checkpoints where the
keys are the checkpoint names and the values are the corresponding log IDs. | String[] | getColumnNames() | public String | getCommitStatusForTransaction(long transactionId) Tries to find a commit for a given transaction ID. | protected long | getCurrentLogId() Return the current log id. | public String[][] | getData() | protected synchronized Connection | getDatabaseConnection() Gets a connection to the database. | public DumpInfo | getDumpInfo(String dumpName) Get the DumpInfo element corresponding to the given dump name. | public ArrayList | getDumpList() Retrieve the list of available dumps. | long[] | getIndexes() | public long | getLastConnectionId(long controllerId) Get the id of the last transaction logged in the recovery log. | public long | getLastRequestId(long controllerId) Get the id of the last request logged in the recovery log. | public long | getLastTransactionId(long controllerId) Get the id of the last transaction logged in the recovery log. | String[][] | getLogEntries(long from, int maxrows) | String[][] | getLogEntriesInTransaction(long tid) | public String | getLogTableName() Returns the logTableName value. | public String | getLogTableSqlColumnName() Returns the logTableSqlColumnName value. | public LogEntry | getNextLogEntry(long previousLogEntryId) Get the next log entry from the recovery log given the id of the previous
log entry. | public long | getNumberOfLogEntries(long lowerLogId, long upperLogId) Return the real number of log entries between 2 log ids (usually matching
checkpoint indices). | long | getNumberOfLogEntries() Returns the number of log entries currently in the log table. | public long | getRecoveringNb() Returns the recoveringNb value. | public int | getRecoveryBatchSize() | public int | getRecoveryLogSize() | public String | getRollbackStatusForTransaction(long transactionId) Tries to find a rollback for a given transaction ID and returns its status
if found. | public int | getUpdateCountResultForQuery(long requestId) Get the update count result for the execution of the query that has the
provided unique id. | public String | getXml() | public boolean | hasLoggedBeginForTransaction(Long tid) Returns true if the recovery log has logged a Begin for the given
transaction id. | synchronized long | incrementLogTableId() Increments the value of logTableId. | protected synchronized void | invalidateInternalConnection() Invalidate the connection when an error occurs so that the next call to
getDatabaseConnection() re-allocates a new connection. | public boolean | isLastManDown() | public synchronized boolean | isRecovering() Returns true if at least one backend has started a recover
process. | public long | logAbort(TransactionMetaData tm) Log a transaction abort. | public long | logBegin(TransactionMetaData tm) Log the beginning of a new transaction (always as a SUCCESS not EXECUTING). | public long | logClosePersistentConnection(String login, long persistentConnectionId) Log the closing of the given persistent connection (always as a SUCCESS). | public long | logCommit(TransactionMetaData tm) Log a transaction commit. | public void | logLogEntry(LogEntry logEntry) Log a log entry in the recovery log. | public long | logOpenPersistentConnection(String login, long persistentConnectionId) Log the opening of the given persistent connection (always as a SUCCESS). | public long | logReleaseSavepoint(TransactionMetaData tm, String name) Log a transaction savepoint removal. | public void | logRequestCompletion(long logId, boolean success, long execTime) Update the completion status of a request completion in the recovery log
given its id. | public void | logRequestCompletion(long logId, boolean success, long execTimeInMs, int updateCount) Update the completion status of a request completion in the recovery log
given its id. | public void | logRequestExecuteUpdateCompletion(long logId, boolean success, int updateCount, long execTime) Update the completion status of a request executed with executeUpdate(). | public long | logRequestExecuting(AbstractRequest request) Log a request (read or write) that is going to execute and set the logId on
the request object. | public long | logRollback(TransactionMetaData tm) Log a transaction rollback. | public long | logRollbackToSavepoint(TransactionMetaData tm, String savepointName) | public long | logSetSavepoint(TransactionMetaData tm, String name) Log a transaction savepoint. | public void | moveEntries(long fromId, long shift) Shift the log entries from the given checkpoint id by the shift factor
provided. | public RecoveryTask | recoverNextRequest(long previousRequestId, AbstractScheduler scheduler) Get the next request (begin/commit/rollback or WriteRequest) from the
recovery log given the id of the previously recovered request. | public void | removeCheckpoint(String checkpointName) Remove a checkpoint from the recovery. | public void | removeDump(DumpInfo dumpInfo) Remove a dump information from the dump table base. | public void | resetLogTableIdAndDeleteRecoveryLog(String checkpointName, long newCheckpointId) Reset the current log table id and delete the recovery log information
older than the given checkpoint. | public void | resetRecoveryLog(boolean resetLogId) Reset the recovery log by deleting the log table and checkpoint table. | void | scheduleCloserTask() | public void | setAutoCloseTimeout(int seconds) used by vdb.xml parser (element Recoverylog) to enable and set optional
autoclosing mechanism. | public void | setBackendTableCreateStatement(String createTable, String tableName, String checkpointNameType, String backendNameType, String backendStateType, String databaseNameType, String extraStatement) | public void | setCheckConnectionValidity() | public void | setCheckpointTableCreateStatement(String createTable, String tableName, String nameType, String logIdType, String extraStatement) Sets the checkpoint table name and create statement. | public void | setDumpInfo(DumpInfo dumpInfo) Set DumpInfo, thereby making a new dump available for restore. | public void | setDumpTableCreateStatement(String createTable, String tableName, String dumpNameColumnType, String dumpDateColumnType, String dumpPathColumnType, String dumpFormatColumnType, String checkpointNameColumnType, String backendNameColumnType, String tablesColumnName, String tablesColumnType, String extraStatement) Sets the dump table name and create statement. | public void | setLastManDown() | public void | setLogTableCreateStatement(String createTable, String tableName, String idType, String vloginType, String sqlName, String sqlType, String sqlParamsType, String autoConnTranColumnType, String transactionIdType, String requestIdType, String execTimeType, String updateCountType, String extraStatement) Sets the log table name and create statement. | public void | shutdown() Shutdown the recovery log and all its threads by enqueueing a log shutdown
event and waiting until it is processed. | public void | storeBackendRecoveryInfo(String databaseName, BackendRecoveryInfo backendRecoveryInfo) | public void | storeCheckpoint(String checkpointName) Store a Checkpoint using the current log state. | public void | storeCheckpoint(String checkpointName, long logId) Store a Checkpoint with the given log id. | public void | storeDump(DumpInfo dump) | public void | storeDumpCheckpointName(String dumpCheckpointName, long checkpointId) | public void | updateDumpCheckpoint(String dumpName, String checkpointName) Update the checkpoint name for specified dump, making it available for
restore operations. | public void | updateDumpPath(String dumpName, String newPath) Update the path name for a given checkpoint. | void | updateDumpTableColumn(String dumpName, String columnName, String value) Updates specified DumpTable entry column with specified value. |
COLUMN_INDEX_AUTO_CONN_TRAN | final public static int COLUMN_INDEX_AUTO_CONN_TRAN(Code) | | Index of the auto_conn_tran column in the log table
|
COLUMN_INDEX_EXEC_STATUS | final public static int COLUMN_INDEX_EXEC_STATUS(Code) | | Index of the exec_status column in the log table
|
COLUMN_INDEX_EXEC_TIME | final public static int COLUMN_INDEX_EXEC_TIME(Code) | | Index of the exec_time column in the log table
|
COLUMN_INDEX_LOG_ID | final public static int COLUMN_INDEX_LOG_ID(Code) | | Index of the log id column in the log table
|
COLUMN_INDEX_REQUEST_ID | final public static int COLUMN_INDEX_REQUEST_ID(Code) | | Index of the request id column in the log table
|
COLUMN_INDEX_SQL | final public static int COLUMN_INDEX_SQL(Code) | | Index of the sql column in the log table
|
COLUMN_INDEX_SQL_PARAMS | final public static int COLUMN_INDEX_SQL_PARAMS(Code) | | Index of the sql_param column in the log table
|
COLUMN_INDEX_TRANSACTION_ID | final public static int COLUMN_INDEX_TRANSACTION_ID(Code) | | Index of the transaction id column in the log table
|
COLUMN_INDEX_UPDATE_COUNT | final public static int COLUMN_INDEX_UPDATE_COUNT(Code) | | Index of the update_count column in the log table
|
COLUMN_INDEX_VLOGIN | final public static int COLUMN_INDEX_VLOGIN(Code) | | Index of the vlogin column in the log table
|
UNKNOWN_USER | final public static String UNKNOWN_USER(Code) | | Unkown user used for transaction abort when the transactional context
cannot be retrieved
|
recoveryBatchSize | protected int recoveryBatchSize(Code) | | Size of the pendingRecoveryTasks queue used by the recover thread
|
RecoveryLog | public RecoveryLog(String driverName, String driverClassName, String url, String login, String password, int requestTimeout, int recoveryBatchSize)(Code) | | Creates a new RecoveryLog instance.
Parameters: driverName - the driverClassName name. Parameters: driverClassName - the driverClassName class name. Parameters: url - the JDBC URL. Parameters: login - the login to use to connect to the database. Parameters: password - the password to connect to the database. Parameters: requestTimeout - timeout in seconds for update queries. Parameters: recoveryBatchSize - number of queries that can be accumulated into abatch when recovering |
beginRecovery | public synchronized void beginRecovery()(Code) | | Notify the recovery log that a recovery process has started.
|
checkDatabaseConnection | void checkDatabaseConnection() throws SQLException(Code) | | Checks that the connection to the recoverylog database is still valid and
if it is not attempts one reconnect.
throws: SQLException - if an error happens at re-connection |
checkRecoveryLogConsistency | public void checkRecoveryLogConsistency() throws SQLException(Code) | | Check the recovery log consistency for the first controller starting in a
cluster (might come back from a complete cluster outage).
throws: SQLException - if a recovery log access error occurs |
checkRecoveryLogTables | public void checkRecoveryLogTables()(Code) | | Checks if the recovery log and checkpoint tables exist, and create them if
they do not exist. This method also starts the logger thread.
|
cleanRecoveryLog | public void cleanRecoveryLog() throws SQLException(Code) | | Possibly clean the recovery log after all recovery process are done. This
removes all failed statements or transactions without side effect from the
recovery log.
exception: SQLException - if an error occurs. |
deleteLogEntriesAndCheckpointBetween | public void deleteLogEntriesAndCheckpointBetween(long fromId, long toId)(Code) | | Delete the log entries from the fromId id to toId.
Parameters: fromId - id where to start the move Parameters: toId - increment to add to log entries id |
deleteLogEntriesBeforeCheckpoint | public void deleteLogEntriesBeforeCheckpoint(String checkpointName) throws SQLException(Code) | | Deletes recovery log entries that are older than specified checkpoint. The
log entry pointed to by 'checkpointName' is kept in the recovery log to
make sure that logId numbering is not reset in case of full clearance.
(upon vdb restart, member logTableId is initialized with max(log_id) found
in the database, see code in intializeDatabase()).
Parameters: checkpointName - the name of the checkpoint uptil which log entriesshould be removed throws: SQLException - in case of error. |
endRecovery | public synchronized void endRecovery()(Code) | | 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: RecoveryLog.cleanRecoveryLog() |
findCloseForPersistentConnection | public boolean findCloseForPersistentConnection(long persistentConnectionId) throws SQLException(Code) | | Tries to find a close for a given persistent connection ID.
Parameters: persistentConnectionId - the persistent connection ID to look for true if close was found in recovery log, false otherwise throws: SQLException - if there was a problem while searching the recoverylog |
findCommitForTransaction | public boolean findCommitForTransaction(long transactionId) throws SQLException(Code) | | Tries to find a commit for a given transaction ID.
Parameters: transactionId - the transaction id to look for true if commit was found in recovery log, false otherwise throws: SQLException - if there was a problem while searching the recoverylog |
findRollbackForTransaction | public boolean findRollbackForTransaction(long transactionId) throws SQLException(Code) | | Tries to find a rollback for a given transaction ID.
Parameters: transactionId - the transaction id to look for true if rollback was found in recovery log, false otherwise throws: SQLException - if there was a problem while searching the recoverylog |
getBackendRecoveryInfo | public BackendRecoveryInfo getBackendRecoveryInfo(String databaseName, String backendName) throws SQLException(Code) | | 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 Parameters: backendName - the backend name BackendRecoveryInfo instance or null if the backend does not exist throws: SQLException - if a database access error occurs |
getBackendTableName | public String getBackendTableName()(Code) | | Returns the backendTableName value.
Returns the backendTableName. |
getCheckpointLogEntry | public CheckpointLogEntry getCheckpointLogEntry(String checkpointName) throws SQLException(Code) | | Get the log entry corresponding to a given checkpoint. This is used to set
a checkpoint globally cluster-wide using the unique log entry.
Parameters: checkpointName - Name of the checkpoint a CheckpointLogEntry corresponding to this checkpoint. exception: SQLException - if an error occurs or the checkpoint does not exist See Also: RecoveryLog.recoverNextRequest(long) |
getCheckpointLogId | public long getCheckpointLogId(String checkpointName) throws SQLException(Code) | | Get the log 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 long the log identifier corresponding to this checkpoint. exception: SQLException - if an error occurs or the checkpoint does not exist See Also: RecoveryLog.recoverNextRequest(long) |
getCheckpointNameAliases | public String[] getCheckpointNameAliases(String checkpointName) throws SQLException(Code) | | Returns a list of checkpoint names (strings) that all represent the same
point in time (same log id) as specified 'checkpointName'. The list is
never null and includes the specified 'checkpointName'.
Parameters: checkpointName - the checkpoint name a list of checkpoint names (strings) that all represent the samepoint in time (same log id) throws: SQLException - if no such checkpoint exists of if there is an error |
getCheckpointNames | public ArrayList getCheckpointNames() throws SQLException(Code) | | Returns a time-ordered odered (most recent first) array of names of all the
checkpoint available in the recovery log. this method may not
return the exact list of checkpoint names (since it is called concurrently
to events posted to the recovery log queue).
a time-ordered odered (most recent first) ArrayList of String checkpoint names throws: SQLException - if fails |
getCheckpointTableName | public String getCheckpointTableName()(Code) | | Returns the checkpointTableName value.
Returns the checkpointTableName. |
getCheckpoints | Map getCheckpoints() throws SQLException(Code) | | Returns a Map<String, String> of checkpoints where the
keys are the checkpoint names and the values are the corresponding log IDs.
The Map is orderered by log IDs (newest first).
a Map<String, String> of checkpoints (key=checkpoint name, value = log id) throws: SQLException - if an error occurs while retrieving the checkpointsinformation from the checkpoint table |
getCommitStatusForTransaction | public String getCommitStatusForTransaction(long transactionId) throws SQLException(Code) | | Tries to find a commit for a given transaction ID.
Parameters: transactionId - the transaction id to look for commit status if found in recovery log, "" otherwise throws: SQLException - if there was a problem while searching the recoverylog |
getCurrentLogId | protected long getCurrentLogId()(Code) | | Return the current log id.
the current log id. |
getDumpInfo | public DumpInfo getDumpInfo(String dumpName) throws SQLException(Code) | | Get the DumpInfo element corresponding to the given dump name. Returns null
if no information is found for this dump name.
Parameters: dumpName - the name of the dump to look for a DumpInfo object or null if not found in the table throws: SQLException - if a recovery log database access error occurs |
getDumpList | public ArrayList getDumpList() throws SQLException(Code) | | Retrieve the list of available dumps.
an ArrayList of DumpInfo objects throws: SQLException - if a recovery log database access error occurs |
getIndexes | long[] getIndexes() throws SQLException(Code) | | returns an long[2] for min and max log_id in the log table
an long[2] for min and max log_id in the log table throws: SQLException - if an error occurs while computing the index of thelog table |
getLastConnectionId | public long getLastConnectionId(long controllerId) throws SQLException(Code) | | Get the id of the last transaction logged in the recovery log.
Parameters: controllerId - the controller ID which determines the search space fortransaction IDs the last transaction id. throws: SQLException - if an error occured while retrieving the id. |
getLastRequestId | public long getLastRequestId(long controllerId) throws SQLException(Code) | | Get the id of the last request logged in the recovery log.
Parameters: controllerId - the controller ID which determines the search space forrequest IDs the last request id. throws: SQLException - if an error occured while retrieving the id. |
getLastTransactionId | public long getLastTransactionId(long controllerId) throws SQLException(Code) | | Get the id of the last transaction logged in the recovery log.
Parameters: controllerId - the controller ID which determines the search space fortransaction IDs the last transaction id. throws: SQLException - if an error occured while retrieving the id. |
getLogEntries | String[][] getLogEntries(long from, int maxrows)(Code) | | Exposes the contents of the recovery log table as a matrix of String.
this method should be only used for management/debugging purpose
Parameters: from - the starting index from which the log entries are retrieved(corresponds to the log_id column) Parameters: maxrows - the maximum number of rows to retrieve a matrix of String representing the content of the recovery logtable |
getLogEntriesInTransaction | String[][] getLogEntriesInTransaction(long tid)(Code) | | |
getLogTableName | public String getLogTableName()(Code) | | Returns the logTableName value.
Returns the logTableName. |
getLogTableSqlColumnName | public String getLogTableSqlColumnName()(Code) | | Returns the logTableSqlColumnName value.
Returns the logTableSqlColumnName. |
getNextLogEntry | public LogEntry getNextLogEntry(long previousLogEntryId) throws SQLException(Code) | | Get the next log entry from the recovery log given the id of the previous
log entry.
Parameters: previousLogEntryId - previous log entry identifier the next log entry from the recovery log or null if no furtherentry can be found throws: SQLException - if an error occurs while accesing the recovery log |
getNumberOfLogEntries | public long getNumberOfLogEntries(long lowerLogId, long upperLogId) throws SQLException(Code) | | Return the real number of log entries between 2 log ids (usually matching
checkpoint indices). The SELECT includes both boundaries. The value is
retrieved through an event posted in the logger thread queue (makes sure
that all previous entries have been flushed to the log).
Parameters: lowerLogId - the lower log id Parameters: upperLogId - the upper log id the number of entries between the 2 ids throws: SQLException - if an error occurs querying the recovery log |
getNumberOfLogEntries | long getNumberOfLogEntries() throws SQLException(Code) | | Returns the number of log entries currently in the log table. The method is
not accurate since this number can change very quickly but it is correct
enough for management purposes.
the number of log entries currently in the log table throws: SQLException - if an error occurs while counting the number of logentries in the log table |
getRecoveringNb | public long getRecoveringNb()(Code) | | Returns the recoveringNb value.
Returns the recoveringNb. |
getRecoveryBatchSize | public int getRecoveryBatchSize()(Code) | | Number of queries that can be accumulated into a batch when recovering
the recovery batch size |
getRollbackStatusForTransaction | public String getRollbackStatusForTransaction(long transactionId) throws SQLException(Code) | | Tries to find a rollback for a given transaction ID and returns its status
if found.
Parameters: transactionId - the transaction id to look for commit status if found in recovery log, "" otherwise throws: SQLException - if there was a problem while searching the recoverylog |
getUpdateCountResultForQuery | public int getUpdateCountResultForQuery(long requestId) throws SQLException(Code) | | Get the update count result for the execution of the query that has the
provided unique id.
Parameters: requestId - request result to look for update count or -1 if not found throws: SQLException - if an error occured |
getXml | public String getXml()(Code) | | Gives the log as an XML String
the XML representation of the log |
hasLoggedBeginForTransaction | public boolean hasLoggedBeginForTransaction(Long tid) throws SQLException(Code) | | Returns true if the recovery log has logged a Begin for the given
transaction id.
Parameters: tid - the transaction identifier true if begin has been logged for this transaction throws: SQLException - if the query fails on the recovery database |
incrementLogTableId | synchronized long incrementLogTableId()(Code) | | Increments the value of logTableId.
|
invalidateInternalConnection | protected synchronized void invalidateInternalConnection()(Code) | | Invalidate the connection when an error occurs so that the next call to
getDatabaseConnection() re-allocates a new connection.
See Also: RecoveryLog.getDatabaseConnection() |
isRecovering | public synchronized boolean isRecovering()(Code) | | Returns true if at least one backend has started a recover
process.
boolean |
logAbort | public long logAbort(TransactionMetaData tm)(Code) | | 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 the identifier of the entry in the recovery log |
logBegin | public long logBegin(TransactionMetaData tm)(Code) | | Log the beginning of a new transaction (always as a SUCCESS not EXECUTING).
Parameters: tm - The transaction marker metadata the identifier of the entry in the recovery log |
logClosePersistentConnection | public long logClosePersistentConnection(String login, long persistentConnectionId)(Code) | | Log the closing of the given persistent connection (always as a SUCCESS).
Parameters: login - the login executing the request Parameters: persistentConnectionId - the id of the persistent connection to close the identifier of the entry in the recovery log |
logCommit | public long logCommit(TransactionMetaData tm)(Code) | | Log a transaction commit.
Parameters: tm - The transaction marker metadata the identifier of the entry in the recovery log |
logLogEntry | public void logLogEntry(LogEntry logEntry)(Code) | | Log a log entry in the recovery log.
Parameters: logEntry - the log entry to to be written in the recovery log. |
logOpenPersistentConnection | public long logOpenPersistentConnection(String login, long persistentConnectionId)(Code) | | Log the opening of the given persistent connection (always as a SUCCESS).
Parameters: login - the login executing the request Parameters: persistentConnectionId - the id of the persistent connection to open the identifier of the entry in the recovery log |
logReleaseSavepoint | public long logReleaseSavepoint(TransactionMetaData tm, String name)(Code) | | Log a transaction savepoint removal.
Parameters: tm - The transaction marker metadata Parameters: name - The name of the savepoint to log the identifier of the entry in the recovery log |
logRequestCompletion | public void logRequestCompletion(long logId, boolean success, long execTime)(Code) | | Update the completion status of a request completion in the recovery log
given its id.
Parameters: logId - recovery log id for this request as it was originally logged Parameters: success - true if the request execution was successful Parameters: execTime - request execution time in ms |
logRequestCompletion | public void logRequestCompletion(long logId, boolean success, long execTimeInMs, int updateCount)(Code) | | Update the completion status of a request completion in the recovery log
given its id.
Parameters: logId - recovery log id for this request as it was originally logged Parameters: success - true if the request execution was successful Parameters: execTimeInMs - request execution time in ms Parameters: updateCount - request update count when successful |
logRequestExecuteUpdateCompletion | public void logRequestExecuteUpdateCompletion(long logId, boolean success, int updateCount, long execTime)(Code) | | Update the completion status of a request executed with executeUpdate().
Parameters: logId - recovery log id for this request as it was originally logged Parameters: success - true if the request execution was successful Parameters: updateCount - the number of updated rows returned by executeUpdate()(meaningful only if success) Parameters: execTime - request execution time in ms |
logRequestExecuting | public long logRequestExecuting(AbstractRequest request)(Code) | | Log a request (read or write) that is going to execute and set the logId on
the request object.
Parameters: request - The request to log (read or write) the identifier of the entry in the recovery log |
logRollback | public long logRollback(TransactionMetaData tm)(Code) | | Log a transaction rollback.
Parameters: tm - The transaction marker metadata the identifier of the entry in the recovery log |
logRollbackToSavepoint | public long logRollbackToSavepoint(TransactionMetaData tm, String savepointName)(Code) | | Log a transaction rollback to a savepoint
Parameters: tm - The transaxtion marker metadata Parameters: savepointName - The name of the savepoint the identifier of the entry in the recovery log |
logSetSavepoint | public long logSetSavepoint(TransactionMetaData tm, String name)(Code) | | Log a transaction savepoint.
Parameters: tm - The transaction marker metadata Parameters: name - The name of the savepoint to log the identifier of the entry in the recovery log |
moveEntries | public void moveEntries(long fromId, long shift)(Code) | | Shift the log entries from the given checkpoint id by the shift factor
provided. All entries with an id below nowCheckpointId and all the others
will have their id increased by shift.
Parameters: fromId - id where to start the move Parameters: shift - increment to add to log entries id |
recoverNextRequest | public RecoveryTask recoverNextRequest(long previousRequestId, AbstractScheduler scheduler) throws SQLException(Code) | | 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 Parameters: scheduler - Scheduler that will be used to generate fake TransactionIdwhen recovering requests in autocommit mode AbstractTask task corresponding to the next request to recover ornull if no such request exists exception: SQLException - if an error occurs See Also: RecoveryLog.getCheckpointLogId(String) |
removeCheckpoint | public void removeCheckpoint(String checkpointName)(Code) | | Remove a checkpoint from the recovery. This is useful for recovery
maintenance
Parameters: checkpointName - to remove |
removeDump | public void removeDump(DumpInfo dumpInfo) throws SQLException(Code) | | Remove a dump information from the dump table base.
Parameters: dumpInfo - the DumpInfo to remove throws: SQLException - if the dump has has not been removed from the dumptable |
resetLogTableIdAndDeleteRecoveryLog | public void resetLogTableIdAndDeleteRecoveryLog(String checkpointName, long newCheckpointId) throws SQLException(Code) | | Reset the current log table id and delete the recovery log information
older than the given checkpoint. This method also deletes all entries in
the checkpoint table. This method is asynchronous: the delete is performed
via a post to the logger thread.
Parameters: checkpointName - the checkpoint name to delete from. Parameters: newCheckpointId - the new checkpoint identifier throws: SQLException - if an error occurs |
resetRecoveryLog | public void resetRecoveryLog(boolean resetLogId) throws SQLException(Code) | | Reset the recovery log by deleting the log table and checkpoint table. This
method also clears checkpoint names in the dump table. This method should
only be used to re-initialize the virtual database at initial startup or
after a complete cluster outage.
Parameters: resetLogId - True if the logId has to be reset. This is used only with"initialize force" command. throws: SQLException - if a database access error occurs |
scheduleCloserTask | void scheduleCloserTask()(Code) | | |
setAutoCloseTimeout | public void setAutoCloseTimeout(int seconds)(Code) | | used by vdb.xml parser (element Recoverylog) to enable and set optional
autoclosing mechanism. Default value is 0 (no auto-close).
|
setBackendTableCreateStatement | public void setBackendTableCreateStatement(String createTable, String tableName, String checkpointNameType, String backendNameType, String backendStateType, String databaseNameType, String extraStatement)(Code) | | Sets the backend table create statement
Parameters: createTable - statement to create the table Parameters: tableName - the backend table name Parameters: checkpointNameType - type for the checkpointName column Parameters: backendNameType - type for the backendName column Parameters: backendStateType - type for the backendState column Parameters: databaseNameType - type for the databaseName column Parameters: extraStatement - like primary keys |
setCheckConnectionValidity | public void setCheckConnectionValidity()(Code) | | |
setCheckpointTableCreateStatement | public void setCheckpointTableCreateStatement(String createTable, String tableName, String nameType, String logIdType, String extraStatement)(Code) | | Sets the checkpoint table name and create statement.
Parameters: createTable - statement to create the table Parameters: tableName - name of the checkpoint table. Parameters: nameType - type for the name column Parameters: logIdType - type for the log_id column Parameters: extraStatement - like primary keys |
setDumpTableCreateStatement | public void setDumpTableCreateStatement(String createTable, String tableName, String dumpNameColumnType, String dumpDateColumnType, String dumpPathColumnType, String dumpFormatColumnType, String checkpointNameColumnType, String backendNameColumnType, String tablesColumnName, String tablesColumnType, String extraStatement)(Code) | | Sets the dump table name and create statement.
Parameters: createTable - statement to create the table Parameters: tableName - name of the checkpoint table. Parameters: dumpNameColumnType - the dump name column type Parameters: dumpDateColumnType - the dump data column type Parameters: dumpPathColumnType - the dump path column type Parameters: dumpFormatColumnType - the dump tpe column type Parameters: checkpointNameColumnType - the checkpoint name column type Parameters: backendNameColumnType - the backend name column type Parameters: tablesColumnName - the database tables column name Parameters: tablesColumnType - the database tables column type Parameters: extraStatement - like primary keys |
setLogTableCreateStatement | public void setLogTableCreateStatement(String createTable, String tableName, String idType, String vloginType, String sqlName, String sqlType, String sqlParamsType, String autoConnTranColumnType, String transactionIdType, String requestIdType, String execTimeType, String updateCountType, String extraStatement)(Code) | | Sets the log table name and create statement.
Parameters: createTable - statement to create the table Parameters: tableName - name of the log table Parameters: idType - type of the id column Parameters: vloginType - type of the login column Parameters: sqlName - name of the sql statement column Parameters: sqlType - type of the sql column Parameters: sqlParamsType - type of the sql_param column Parameters: autoConnTranColumnType - type of the auto_conn_tran column Parameters: transactionIdType - type of the transaction column Parameters: extraStatement - extra statement like primary keys ... Parameters: requestIdType - request id column type Parameters: execTimeType - execution time in ms column type Parameters: updateCountType - update count column type |
shutdown | public void shutdown()(Code) | | Shutdown the recovery log and all its threads by enqueueing a log shutdown
event and waiting until it is processed.
|
storeBackendRecoveryInfo | public void storeBackendRecoveryInfo(String databaseName, BackendRecoveryInfo backendRecoveryInfo) throws SQLException(Code) | | Store the state of the backend in the recovery log
Parameters: databaseName - the virtual database name Parameters: backendRecoveryInfo - the backend recovery information to store throws: SQLException - if cannot proceed |
storeCheckpoint | public void storeCheckpoint(String checkpointName) throws SQLException(Code) | | Store a Checkpoint using the current log state.
Parameters: checkpointName - Name of the checkpoint exception: SQLException - if an error occurs |
storeCheckpoint | public void storeCheckpoint(String checkpointName, long logId) throws SQLException(Code) | | Store a Checkpoint with the given log id.
Parameters: checkpointName - Name of the checkpoint Parameters: logId - log id this checkpoint points to exception: SQLException - if an error occurs |
storeDump | public void storeDump(DumpInfo dump) throws SQLException(Code) | | Store the given dump information in the dump table
Parameters: dump - the DumpInfo to store throws: SQLException - if a recovery log database access error occurs |
storeDumpCheckpointName | public void storeDumpCheckpointName(String dumpCheckpointName, long checkpointId)(Code) | | See Also: StoreCheckpointWithLogIdEvent Parameters: dumpCheckpointName - name of the checkpoint to store Parameters: checkpointId - id of the checkpoint |
updateDumpCheckpoint | public void updateDumpCheckpoint(String dumpName, String checkpointName) throws SQLException(Code) | | Update the checkpoint name for specified dump, making it available for
restore operations.
Parameters: dumpName - the dump name Parameters: checkpointName - the new chekpoint to set throws: SQLException - if a recovery log database access error occurs |
updateDumpPath | public void updateDumpPath(String dumpName, String newPath) throws SQLException(Code) | | Update the path name for a given checkpoint.
Parameters: dumpName - the dump name Parameters: newPath - the new path to set throws: SQLException - if a recovery log database access error occurs |
updateDumpTableColumn | void updateDumpTableColumn(String dumpName, String columnName, String value) throws SQLException(Code) | | Updates specified DumpTable entry column with specified value.
Parameters: dumpName - the name of the dump record to update Parameters: columnName - the name of the column to update Parameters: value - the value to set throws: SQLException - if any error occurs (invalid dump name, sql querysyntax errors, hsqldb access errors, ...) |
|
|