예제 #1
0
    /**
     * Check the RepNode.currentCommitVLSN difference to see if there is any dirty data between two
     * actions. We only do the flush when there exists dirty data.
     *
     * <p>The reason that why we only cares about the commit VLSN is those unlogged
     * uncommitted/abort transaction will be aborted during recovery. It's useless to keep track of
     * those VLSNs.
     */
    @Override
    public void run() {
      final VLSN newTxnEndVLSN = repNode.getCurrentTxnEndVLSN();

      /* Do nothing if no updates. */
      if (newTxnEndVLSN == null) {
        return;
      }

      if (lastTxnEndVLSN == null || newTxnEndVLSN.compareTo(lastTxnEndVLSN) == 1) {
        lastTxnEndVLSN = newTxnEndVLSN;
        repNode.getRepImpl().getLogManager().flush();
      }
    }
예제 #2
0
 public LogFlushTask(RepNode repNode) {
   this.repNode = repNode;
   this.lastTxnEndVLSN = repNode.getCurrentTxnEndVLSN();
 }