Java Doc for LoggerThread.java in  » Database-JDBC-Connection-Pool » sequoia-2.10.9 » org » continuent » sequoia » controller » recoverylog » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database JDBC Connection Pool » sequoia 2.10.9 » org.continuent.sequoia.controller.recoverylog 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.lang.Thread
      org.continuent.sequoia.controller.recoverylog.LoggerThread

LoggerThread
public class LoggerThread extends Thread (Code)
Logger thread for the RecoveryLog.
author:
   Emmanuel Cecchet
version:
   1.0



Constructor Summary
public  LoggerThread(RecoveryLog log)
    

Method Summary
public  voiddeleteCheckpointTable()
     Delete all entries from the CheckpointTable.
public  voiddeleteLogEntriesAndCheckpointBetween(long commonCheckpointId, long nowCheckpointId)
     Delete all log entries that have an id strictly between the 2 given boundaries (commonCheckpointId
public  voiddeleteLogEntriesBeforeId(long oldId)
     Delete all LogEntries with an identifier lower than oldId (inclusive).
public  PreparedStatementgetLogPreparedStatement()
    
public synchronized  booleangetLogQueueIsEmpty()
    
public  TracegetLogger()
     Returns the logger value.
public  longgetNumberOfLogEntries(long lowerLogId, long upperLogId)
     Return the real number of log entries between 2 log ids (usually matching checkpoint indices).
public  RecoveryLoggetRecoveryLog()
     Returns the recoveryLog value.
public  PreparedStatementgetUpdatePreparedStatement()
    
public synchronized  booleanhasLogEntryForTransaction(long tid)
     Returns true if there is any log event in the queue that belongs to the given transaction.
public  voidinvalidateLogStatements()
     Invalidate both logStmt and unlogStmt so that they can be renewed from a fresh connection.
public synchronized  voidlog(LogEvent logObject)
     Log a write-query into the recovery log.
public synchronized  voidputBackAtHeadOfQueue(LogEvent event, Exception e)
     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.
public  voidremoveCheckpoint(String checkpointName)
     Remove a checkpoint in the recovery log.
In case of error, additionely close and invalidates log and unlog statements (internal) before calling RecoveryLog#invalidateInternalConnection().
public  booleanremoveEmptyTransaction(long transactionId)
     Remove a possibly empty transaction from the recovery log.
public synchronized  voidremoveQueriesOfTransactionFromQueue(long tid)
     Remove all queries that have not been logged yet and belonging to the specified transaction.
public  voidrun()
     Log the requests from queue until the thread is explicetly killed.
public  voidshiftLogEntriesAfterId(long fromId, long shiftValue)
     Shift LogEntries identifiers from the specified shiftValue (value is added to existing identifiers) starting with identifier with a value strictly greater than the given id.
public  voidshiftLogEntriesIds(long shiftValue)
     Shift LogEntries identifiers from the specified value (value is added to existing identifiers).
public synchronized  voidshutdown()
     Shutdown the current thread.
public  voidstoreCheckpointWithLogId(String checkpointName, long checkpointLogId)
     Store a checkpoint in the recovery log using the provided local log id.
Moreover, in case of error, additionally closes and invalidates log and unlog statements (internal) before calling RecoveryLog#invalidateInternalConnection().


Constructor Detail
LoggerThread
public LoggerThread(RecoveryLog log)(Code)
Creates a new LoggerThread object
Parameters:
  log - the RecoveryLog that instanciates this thread




Method Detail
deleteCheckpointTable
public void deleteCheckpointTable() throws SQLException(Code)
Delete all entries from the CheckpointTable.
throws:
  SQLException - if an error occurs



deleteLogEntriesAndCheckpointBetween
public void deleteLogEntriesAndCheckpointBetween(long commonCheckpointId, long nowCheckpointId) throws SQLException(Code)
Delete all log entries that have an id strictly between the 2 given boundaries (commonCheckpointIdParameters:
  commonCheckpointId - lower id bound
Parameters:
  nowCheckpointId - upper id bound
throws:
  SQLException - if an error occurs accessing the log



deleteLogEntriesBeforeId
public void deleteLogEntriesBeforeId(long oldId) throws SQLException(Code)
Delete all LogEntries with an identifier lower than oldId (inclusive). oldId is normally derived from a checkpoint name, which marks the last request before the checkpoint.
Parameters:
  oldId - the id up to which entries should be removed.
throws:
  SQLException - if an error occurs



getLogPreparedStatement
public PreparedStatement getLogPreparedStatement() throws SQLException(Code)
Return a PreparedStatement to log an entry as follows:

INSERT INTO LogTableName VALUES(?,?,?,?,?,?,?) a PreparedStatement
throws:
  SQLException - if an error occurs




getLogQueueIsEmpty
public synchronized boolean getLogQueueIsEmpty()(Code)
Tells whether there are pending logs true if no more jobs in the log queue



getLogger
public Trace getLogger()(Code)
Returns the logger value. Returns the logger.



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 excludes both boundaries.
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



getRecoveryLog
public RecoveryLog getRecoveryLog()(Code)
Returns the recoveryLog value. Returns the recoveryLog.



getUpdatePreparedStatement
public PreparedStatement getUpdatePreparedStatement() throws SQLException(Code)
Return a PreparedStatement to update an entry as follows:

UPDATE LogTableName SET exec_status=?,exec_time=? WHERE log_id=? a PreparedStatement
throws:
  SQLException - if an error occurs




hasLogEntryForTransaction
public synchronized boolean hasLogEntryForTransaction(long tid)(Code)
Returns true if there is any log event in the queue that belongs to the given transaction.
Parameters:
  tid - transaction id to look for true if a log entry belongs to this transaction



invalidateLogStatements
public void invalidateLogStatements()(Code)
Invalidate both logStmt and unlogStmt so that they can be renewed from a fresh connection.
See Also:   LoggerThread.getLogPreparedStatement()
See Also:   LoggerThread.getUpdatePreparedStatement()



log
public synchronized void log(LogEvent logObject)(Code)
Log a write-query into the recovery log. This posts the specified logObject (query) into this loggerThread queue. The actual write to the recoverly-log db is performed asynchronously by the thread.
Parameters:
  logObject - the log event to be processed



putBackAtHeadOfQueue
public synchronized void putBackAtHeadOfQueue(LogEvent event, Exception e)(Code)
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.
Parameters:
  event - the event to be used next by the logger thread.
Parameters:
  e - exception causing the event to fail and to be retried



removeCheckpoint
public void removeCheckpoint(String checkpointName) throws SQLException(Code)
Remove a checkpoint in the recovery log.
In case of error, additionely close and invalidates log and unlog statements (internal) before calling RecoveryLog#invalidateInternalConnection().
Parameters:
  checkpointName - name of the checkpoint to remove
throws:
  SQLException - if a database access error occurs
See Also:   org.continuent.sequoia.controller.recoverylog.events.RemoveCheckpointEvent



removeEmptyTransaction
public boolean removeEmptyTransaction(long transactionId) throws SQLException(Code)
Remove a possibly empty transaction from the recovery log. This method returns true if no entry or just a begin is found for that transaction. If a begin was found it will be removed from the log.
Parameters:
  transactionId - the id of the transaction true if the transaction was empty
throws:
  SQLException - if an error occurs



removeQueriesOfTransactionFromQueue
public synchronized void removeQueriesOfTransactionFromQueue(long tid)(Code)
Remove all queries that have not been logged yet and belonging to the specified transaction.
Parameters:
  tid - transaction id to rollback



run
public void run()(Code)
Log the requests from queue until the thread is explicetly killed. The logger used is the one of the RecoveryLog.



shiftLogEntriesAfterId
public void shiftLogEntriesAfterId(long fromId, long shiftValue) throws SQLException(Code)
Shift LogEntries identifiers from the specified shiftValue (value is added to existing identifiers) starting with identifier with a value strictly greater than the given id.
Parameters:
  fromId - id to start shifting from
Parameters:
  shiftValue - the value to shift
throws:
  SQLException - if an error occurs



shiftLogEntriesIds
public void shiftLogEntriesIds(long shiftValue) throws SQLException(Code)
Shift LogEntries identifiers from the specified value (value is added to existing identifiers).
Parameters:
  shiftValue - the value to shift
throws:
  SQLException - if an error occurs



shutdown
public synchronized void shutdown()(Code)
Shutdown the current thread. This will cause the log to terminate as soon as the current event is finished processing. Any remaining events in the log queue will be discarded.



storeCheckpointWithLogId
public void storeCheckpointWithLogId(String checkpointName, long checkpointLogId) throws SQLException(Code)
Store a checkpoint in the recovery log using the provided local log id.
Moreover, in case of error, additionally closes and invalidates log and unlog statements (internal) before calling RecoveryLog#invalidateInternalConnection().
Parameters:
  checkpointName - checkpoint name to insert
Parameters:
  checkpointLogId - checkpoint log identifier
throws:
  SQLException - if a database access error occurs
See Also:   RecoveryLog.storeCheckpointWithLogEntry(StringCheckpointLogEntry)
See Also:   LoggerThread.invalidateLogStatements()



Fields inherited from java.lang.Thread
final public static int MAX_PRIORITY(Code)(Java Doc)
final public static int MIN_PRIORITY(Code)(Java Doc)
final public static int NORM_PRIORITY(Code)(Java Doc)

Methods inherited from java.lang.Thread
public static int activeCount()(Code)(Java Doc)
final public void checkAccess()(Code)(Java Doc)
native public int countStackFrames()(Code)(Java Doc)
native public static Thread currentThread()(Code)(Java Doc)
public void destroy()(Code)(Java Doc)
public static void dumpStack()(Code)(Java Doc)
public static int enumerate(Thread tarray)(Code)(Java Doc)
public static Map<Thread, StackTraceElement[]> getAllStackTraces()(Code)(Java Doc)
public ClassLoader getContextClassLoader()(Code)(Java Doc)
public static UncaughtExceptionHandler getDefaultUncaughtExceptionHandler()(Code)(Java Doc)
public long getId()(Code)(Java Doc)
final public String getName()(Code)(Java Doc)
final public int getPriority()(Code)(Java Doc)
public StackTraceElement[] getStackTrace()(Code)(Java Doc)
public State getState()(Code)(Java Doc)
final public ThreadGroup getThreadGroup()(Code)(Java Doc)
public UncaughtExceptionHandler getUncaughtExceptionHandler()(Code)(Java Doc)
native public static boolean holdsLock(Object obj)(Code)(Java Doc)
public void interrupt()(Code)(Java Doc)
public static boolean interrupted()(Code)(Java Doc)
final native public boolean isAlive()(Code)(Java Doc)
final public boolean isDaemon()(Code)(Java Doc)
public boolean isInterrupted()(Code)(Java Doc)
final public synchronized void join(long millis) throws InterruptedException(Code)(Java Doc)
final public synchronized void join(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void join() throws InterruptedException(Code)(Java Doc)
final public void resume()(Code)(Java Doc)
public void run()(Code)(Java Doc)
public void setContextClassLoader(ClassLoader cl)(Code)(Java Doc)
final public void setDaemon(boolean on)(Code)(Java Doc)
public static void setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler eh)(Code)(Java Doc)
final public void setName(String name)(Code)(Java Doc)
final public void setPriority(int newPriority)(Code)(Java Doc)
public void setUncaughtExceptionHandler(UncaughtExceptionHandler eh)(Code)(Java Doc)
native public static void sleep(long millis) throws InterruptedException(Code)(Java Doc)
public static void sleep(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
public synchronized void start()(Code)(Java Doc)
final public void stop()(Code)(Java Doc)
final public synchronized void stop(Throwable obj)(Code)(Java Doc)
final public void suspend()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
native public static void yield()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.