Public Member Functions | |
JDBCRecoverThread (AbstractScheduler scheduler, AbstractRecoveryLog recoveryLog, DatabaseBackend backend, AbstractLoadBalancer loadBalancer, String checkpointName) | |
SQLException | getException () |
void | run () |
void | endRecovery () |
Static Package Attributes | |
Trace | logger |
Definition at line 49 of file JDBCRecoverThread.java.
|
Creates a new
Definition at line 75 of file JDBCRecoverThread.java. 00078 { 00079 this.scheduler = scheduler; 00080 this.recoveryLog = recoveryLog; 00081 this.backend = backend; 00082 this.loadBalancer = loadBalancer; 00083 this.checkpointName = checkpointName; 00084 tids = new ArrayList(); 00085 }
|
|
Properly end the recovery and kill the worker thread used for recovery if it exists Definition at line 304 of file JDBCRecoverThread.java. 00305 { 00306 // We are done with the recovery 00307 logger.info(Translate.get("recovery.process.complete")); 00308 if (bwt != null) 00309 { 00310 addWorkerTask(bwt, new KillThreadTask(1, 1)); 00311 try 00312 { 00313 bwt.join(); 00314 } 00315 catch (InterruptedException e) 00316 { 00317 recoveryLog.endRecovery(); 00318 String msg = Translate.get("recovery.join.failed", e); 00319 logger.error(msg, e); 00320 exception = new SQLException(msg); 00321 } 00322 } 00323 00324 recoveryLog.endRecovery(); 00325 }
|
|
Returns the exception value.
Definition at line 92 of file JDBCRecoverThread.java. 00093 {
00094 return exception;
00095 }
|
|
Definition at line 100 of file JDBCRecoverThread.java. References org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.beginRecovery(), org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.endRecovery(), and org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.getCheckpointRequestId(). 00101 { 00102 backend.setState(BackendState.REPLAYING); 00103 try 00104 { 00105 backend.initializeConnections(); 00106 } 00107 catch (SQLException e) 00108 { 00109 recoveryFailed(e); 00110 return; 00111 } 00112 recoveryLog.beginRecovery(); 00113 00114 // Get the checkpoint from the recovery log 00115 long logIdx; 00116 try 00117 { 00118 logIdx = recoveryLog.getCheckpointRequestId(checkpointName); 00119 } 00120 catch (SQLException e) 00121 { 00122 recoveryLog.endRecovery(); 00123 String msg = Translate.get("recovery.cannot.get.checkpoint", e); 00124 logger.error(msg); 00125 recoveryFailed(new SQLException(msg)); 00126 return; 00127 } 00128 00129 try 00130 { 00131 // Play writes from the recovery log until the last possible transaction 00132 // without blocking the scheduler 00133 logIdx = recover(logIdx); 00134 } 00135 catch (SQLException e) 00136 { 00137 recoveryFailed(e); 00138 return; 00139 } 00140 00141 try 00142 { 00143 // Suspend the writes 00144 scheduler.suspendWrites(); 00145 } 00146 catch (SQLException e1) 00147 { 00148 recoveryFailed(e1); 00149 return; 00150 } 00151 00152 try 00153 { 00154 // Play the remaining writes that were pending 00155 logIdx = recover(logIdx + 1); 00156 } 00157 catch (SQLException e2) 00158 { 00159 recoveryFailed(e2); 00160 return; 00161 } 00162 00163 try 00164 { 00165 // Now enable it 00166 loadBalancer.enableBackend(backend, true); 00167 } 00168 catch (SQLException e3) 00169 { 00170 recoveryFailed(e3); 00171 return; 00172 } 00173 scheduler.resumeWrites(); 00174 logger.info(Translate.get("backend.state.enabled", backend.getName())); 00175 }
|
|
Initial value: Trace.getLogger(JDBCRecoverThread.class .getName()) Definition at line 51 of file JDBCRecoverThread.java. |