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 ShiftLogEntriesEvent implements LogEvent 36 { 37 private long fromId; 38 private long shift; 39 40 46 public ShiftLogEntriesEvent(long fromId, long shift) 47 { 48 this.fromId = fromId; 49 this.shift = shift; 50 } 51 52 55 public boolean belongToTransaction(long tid) 56 { 57 return false; 58 } 59 60 63 public void execute(LoggerThread loggerThread) 64 { 65 try 66 { 67 loggerThread.shiftLogEntriesAfterId(fromId, shift); 68 } 69 catch (SQLException e) 70 { 71 loggerThread.invalidateLogStatements(); 72 loggerThread.getLogger().error( 73 Translate.get("recovery.jdbc.loggerthread.shift.failed", e 74 .getMessage()), e); 75 loggerThread.putBackAtHeadOfQueue(this, e); 77 } 78 } 79 80 83 public String toString() 84 { 85 return "Shift log entries from " + fromId + " with shift of " + shift; 86 } 87 88 } 89 | Popular Tags |