1 21 22 package org.continuent.sequoia.controller.recoverylog.events; 23 24 import java.sql.SQLException ; 25 26 import org.continuent.sequoia.common.i18n.Translate; 27 import org.continuent.sequoia.controller.recoverylog.LoggerThread; 28 29 35 public class ResetLogEvent implements LogEvent 36 { 37 private long oldId; 38 private long newId; 39 private String checkpointName; 40 41 48 public ResetLogEvent(long oldCheckpointId, long newCheckpointId, 49 String checkpointName) 50 { 51 this.oldId = oldCheckpointId; 52 this.newId = newCheckpointId; 53 this.checkpointName = checkpointName; 54 } 55 56 59 public boolean belongToTransaction(long tid) 60 { 61 return false; 62 } 63 64 67 public void execute(LoggerThread loggerThread) 68 { 69 try 70 { 71 loggerThread.deleteCheckpointTable(); 72 loggerThread.storeCheckpointWithLogId(checkpointName, newId); 73 loggerThread.deleteLogEntriesBeforeId(oldId); 74 } 75 catch (SQLException e) 76 { 77 loggerThread.invalidateLogStatements(); 78 loggerThread.getLogger().error( 79 Translate.get("recovery.jdbc.loggerthread.log.reset.failed", 80 checkpointName), e); 81 loggerThread.putBackAtHeadOfQueue(this, e); 83 } 84 } 85 86 89 public String toString() 90 { 91 return "ResetLogEvent for checkpoint " + checkpointName; 92 } 93 94 } 95 | Popular Tags |