public void doStop() throws Exception { started = false; logger.close(); recovered = null; }
public void doStart() throws Exception { started = true; setLogFileDir(logFileDir); log.debug("Initiating transaction manager recovery"); recovered = new HashMap(); logger.open(null); ReplayListener replayListener = new GeronimoReplayListener(xidFactory, recovered); logger.replayActiveTx(replayListener); log.debug("In doubt transactions recovered from log"); }
/** * write the Commit record to the Howl Log * @param xaCmRec the Commit Record * @return the XACommittingTx returned by putCommit * @throws LogException could not log the record * @throws IOException * @throws InterruptedException */ public XACommittingTx howlCommitLog(byte [][] xaCmRec) throws LogException, IOException, InterruptedException { if (TraceTm.recovery.isDebugEnabled()) { TraceTm.recovery.debug("Commit howl log"); } return xaLog.putCommit(xaCmRec); }
/** * add a USER record consisting of byte[] to the log. * <p>waits for overflow notification processing to complete * prior to putting the data to the log. * * @throws LogClosedException * If the TM has called open() but has not called replay(). * Also thrown if log is actually closed. * Check the toString() for details. * * @see org.objectweb.howl.log.Logger#put(byte[], boolean) */ public long put(byte[] data, boolean sync) throws LogClosedException, LogRecordSizeException, LogFileOverflowException, InterruptedException, IOException { checkPutEnabled(); // wait for overflow notification processor to finish. onpWait(); return put(LogRecordType.USER, new byte[][]{data}, sync); }
long overflowFence = 0L; checkPutEnabled(); onpWait(); key = put(LogRecordType.XACOMMIT, record, true); synchronized(this) { overflowFence = this.overflowFence; } } while (key < overflowFence); return activeTxAdd(key, record);
/** * Wrapp Logger#replay(ReplayListener) so we can * intercept onRecord() notifications to process * XACOMMIT and XACOMMITMOVED records. */ public void replay(ReplayListener listener) throws LogConfigurationException { try { this.replay(listener, getActiveMark()); } catch (InvalidLogKeyException e) { // should not happen assert false : "Unhandled InvalidLogKeyException" + e.toString(); } }
xaLog = new XALogger(cfg); } catch (LogConfigurationException e) { TraceTm.jotm.error("XALogger: LogConfigurationException" + e.getMessage()); xaLog.open(null); } catch (LogException e) { TraceTm.jotm.error("xaLog.open: LogException" + e.getMessage()); xaLog.replayActiveTx (myxarl);
/** * write the Done record to the Howl Log * @param xaDnRec the Done Record * @param xaCmTx the XACommittingTx * @throws LogException could not log the record * @throws IOException * @throws InterruptedException */ public void howlDoneLog(byte [][] xaDnRec, XACommittingTx xaCmTx) throws LogException, IOException, InterruptedException { if (TraceTm.recovery.isDebugEnabled()) { TraceTm.recovery.debug("Done howl log"); } xaLog.putDone(xaDnRec, xaCmTx); }
public Collection<Recovery.XidBranchesPair> recover(XidFactory xidFactory) throws LogException { log.debug("Initiating transaction manager recovery"); Map<Xid, Recovery.XidBranchesPair> recovered = new HashMap<Xid, Recovery.XidBranchesPair>(); ReplayListener replayListener = new GeronimoReplayListener(xidFactory, recovered); logger.replayActiveTx(replayListener); log.debug("In doubt transactions recovered from log"); return recovered.values(); }
setThreadsWaitingForceThreshold(threadsWaitingForceThreshold); this.xidFactory = xidFactory; this.logger = new XALogger(configuration);
InterruptedException, IOException checkPutEnabled(); doneKey = put(LogRecordType.USER, record, false); } catch (LogFileOverflowException e) { Thread.sleep(10); do { try { xadoneKey = put(LogRecordType.XADONE, tx.logKeyData, false); } catch (LogFileOverflowException e) { Thread.sleep(10);
public String getXMLStats() { return logger.getStats(); }
super.replay(xaListener, getActiveMark(), true); // replay CTRL records also } catch (InvalidLogKeyException e) { throw new LogClosedException(e);
xaLog = new XALogger(cfg); } catch (LogConfigurationException e) { TraceTm.jotm.error("XALogger: LogConfigurationException" + e.getMessage()); xaLog.open(null); } catch (LogException e) { TraceTm.jotm.error("xaLog.open: LogException" + e.getMessage()); xaLog.replayActiveTx (myxarl);
/** * add a USER record consisting of byte[] to the log. * <p>waits for overflow notification processing to complete * prior to putting the data to the log. * * @throws LogClosedException * If the TM has called open() but has not called replay(). * Also thrown if log is actually closed. * Check the toString() for details. * * @see org.objectweb.howl.log.Logger#put(byte[], boolean) */ public long put(byte[] data, boolean sync) throws LogClosedException, LogRecordSizeException, LogFileOverflowException, InterruptedException, IOException { checkPutEnabled(); // wait for overflow notification processor to finish. onpWait(); return put(LogRecordType.USER, new byte[][]{data}, sync); }
long overflowFence = 0L; checkPutEnabled(); onpWait(); key = put(LogRecordType.XACOMMIT, record, true); synchronized(this) { overflowFence = this.overflowFence; } } while (key < overflowFence); return activeTxAdd(key, record);
/** * write the Done record to the Howl Log * @param xaDnRec the Done Record * @param xaCmTx the XACommittingTx * @throws LogException could not log the record * @throws IOException * @throws InterruptedException */ public void howlDoneLog(byte [][] xaDnRec, XACommittingTx xaCmTx) throws LogException, IOException, InterruptedException { if (TraceTm.recovery.isDebugEnabled()) { TraceTm.recovery.debug("Done howl log"); } xaLog.putDone(xaDnRec, xaCmTx); }
public Collection recover(XidFactory xidFactory) throws LogException { log.debug("Initiating transaction manager recovery"); Map recovered = new HashMap(); ReplayListener replayListener = new GeronimoReplayListener(xidFactory, recovered); logger.replayActiveTx(replayListener); log.debug("In doubt transactions recovered from log"); return recovered.values(); }
setThreadsWaitingForceThreshold(threadsWaitingForceThreshold); this.xidFactory = xidFactory; this.logger = new XALogger(configuration);
/** * Wrapp Logger#replay(ReplayListener) so we can * intercept onRecord() notifications to process * XACOMMIT and XACOMMITMOVED records. */ public void replay(ReplayListener listener) throws LogConfigurationException { try { this.replay(listener, getActiveMark()); } catch (InvalidLogKeyException e) { // should not happen assert false : "Unhandled InvalidLogKeyException" + e.toString(); } }