Class XALogger.OpenReplayListener

  • All Implemented Interfaces:
    ReplayListener
    Enclosing class:
    XALogger

    private class XALogger.OpenReplayListener
    extends java.lang.Object
    implements ReplayListener
    private class used by XALogger to replay the log during log open processing.

    As log records are replayed through onRecord method, the HashMap activeTxHashMap is updated. XACOMMIT type records are added to the activeTxHashMap, and XADONE type records remove an entry.

    When the END_OF_LOG record is encountered, the activeTx table is up to date and ready for new entries to be added by the TM.

    • Field Detail

      • tmListener

        final ReplayListener tmListener
        ReplayListener registered by TM that instantiated this XALogger.

        During replay, non-CTRL records are returned to the TM's replayListener.

      • activeTxHashMap

        final java.util.HashMap activeTxHashMap
        Used to keep track of XACOMMIT records encountered during replay. An entry is added to the activeTxHashMap when XACOMMIT type record is replayed, and removed when XADONE type record is replayed.
      • unmatchedDoneCount

        public int unmatchedDoneCount
      • commitCount

        public int commitCount
      • doneCount

        public int doneCount
      • movedCount

        public int movedCount
    • Constructor Detail

      • OpenReplayListener

        OpenReplayListener​(ReplayListener tmListener)
    • Method Detail

      • onRecord

        public void onRecord​(LogRecord lr)
        Description copied from interface: ReplayListener
        Called by Logger for each record retrieved from the log.

        when the entire log has been processed, lr.type is set to LogRecordType.END_OF_LOG.

        Specified by:
        onRecord in interface ReplayListener
        Parameters:
        lr - LogRecord to be processed
      • onError

        public void onError​(LogException e)
        Description copied from interface: ReplayListener
        Called by Logger when an exception is encountered during replay.
        Specified by:
        onError in interface ReplayListener
        Parameters:
        e - LogException object that was thrown when the error occurred.
      • getLogRecord

        public LogRecord getLogRecord()
        Description copied from interface: ReplayListener
        Called by Logger when ReplayListener is registered for replay.

        The Logger calls getLogRecord to obtain a LogRecord instance to be used to process log records.

        The same LogRecord instance is used to return all log records to the ReplayListener.

        Specified by:
        getLogRecord in interface ReplayListener
        Returns:
        LogRecord object to be used when calling onRecord()