|
|||||||||||
| 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.LoggerThread
Logger thread for the RecoveryLog.
| Field Summary | |
private boolean |
killed
|
private Trace |
logger
|
private java.util.LinkedList |
logQueue
|
private java.sql.PreparedStatement |
logStmt
|
private RecoveryLog |
recoveryLog
|
private java.sql.PreparedStatement |
unlogStmt
|
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
LoggerThread(RecoveryLog log)
Creates a new LoggerThread object |
|
| Method Summary | |
void |
deleteCheckpointTable()
Delete all entries from the CheckpointTable. |
void |
deleteLogEntriesBeforeId(long oldId)
Delete all LogEntries with an identifier lower than oldId (inclusive). |
Trace |
getLogger()
Returns the logger value. |
java.sql.PreparedStatement |
getLogPreparedStatement()
Return a PreparedStatement to log an entry as follows: INSERT INTO LogTableName VALUES(? |
boolean |
getLogQueueIsEmpty()
Tells whether there are pending logs |
RecoveryLog |
getRecoveryLog()
Returns the recoveryLog value. |
java.sql.PreparedStatement |
getUnlogPreparedStatement()
Return a PreparedStatement to unlog an entry as follows: DELETE FROM LogTableName WHERE id=? |
void |
invalidateLogStatements()
Invalidate both logStmt and unlogStmt so that they can be renewed from a fresh connection. |
void |
log(LogEvent logObject)
Log a write-query into the recovery log. |
void |
putBackAtHeadOfQueue(LogEvent event)
Put back a log entry at the head of the queue in case a problem happened with this entry and we need to retry it right away. |
void |
removeQueriesOfTransactionFromQueue(long tid)
Remove all queries that have not been logged yet and belonging to the specified transaction. |
void |
removeRollbackedTransaction(long transactionId)
Remove a transaction that has rollbacked (no check is made if the transaction has really rollbacked or not). |
void |
run()
Log the requests from queue until the thread is explicetly killed. |
void |
shiftLogEntriesIds(long shiftValue)
Shift LogEntries identifiers from the specified value (value is added to existing identifiers). |
void |
shutdown()
Shutdown the current thread. |
void |
storeCheckpoint(java.lang.String checkpointName,
long checkpointId)
Looks like a copy paste from RecoveryLog#storeCheckpoint(String, long), but does not wait for queue completion to store the checkpoint. |
| 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 |
private boolean killed
private java.util.LinkedList logQueue
private Trace logger
private java.sql.PreparedStatement logStmt
private java.sql.PreparedStatement unlogStmt
private RecoveryLog recoveryLog
| Constructor Detail |
public LoggerThread(RecoveryLog log)
LoggerThread object
log - the RecoveryLog that instanciates this thread| Method Detail |
public Trace getLogger()
public boolean getLogQueueIsEmpty()
public java.sql.PreparedStatement getLogPreparedStatement()
throws java.sql.SQLException
INSERT INTO LogTableName VALUES(?,?,?,?)
java.sql.SQLException - if an error occurspublic RecoveryLog getRecoveryLog()
public java.sql.PreparedStatement getUnlogPreparedStatement()
throws java.sql.SQLException
DELETE FROM LogTableName WHERE id=? AND vlogin=? AND SqlColumnName=? AND transaction_id=?
java.sql.SQLException - if an error occurspublic void invalidateLogStatements()
getLogPreparedStatement(),
getUnlogPreparedStatement()public void log(LogEvent logObject)
logObject - the log event to be processedpublic void putBackAtHeadOfQueue(LogEvent event)
event - the event to be used next by the logger thread.public void removeQueriesOfTransactionFromQueue(long tid)
tid - transaction id to rollback
public void removeRollbackedTransaction(long transactionId)
throws java.sql.SQLException
transactionId - the id of the transaction
java.sql.SQLException - if an error occurs
public void deleteCheckpointTable()
throws java.sql.SQLException
java.sql.SQLException - if an error occurs
public void storeCheckpoint(java.lang.String checkpointName,
long checkpointId)
throws java.sql.SQLException
checkpointName - checkpoint name to insertcheckpointId - checkpoint request identifier
java.sql.SQLException - if a database access error occursRecoveryLog.storeCheckpoint(String, long),
invalidateLogStatements()
public void deleteLogEntriesBeforeId(long oldId)
throws java.sql.SQLException
oldId - the id up to which entries should be removed.
java.sql.SQLException - if an error occurs
public void shiftLogEntriesIds(long shiftValue)
throws java.sql.SQLException
shiftValue - the value to shift
java.sql.SQLException - if an error occurspublic void run()
public void shutdown()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||