Class LogCompactor

java.lang.Object
io.atomix.raft.impl.LogCompactor

public final class LogCompactor extends Object
  • Constructor Details

  • Method Details

    • compact

      public boolean compact()
      Assumes our snapshots are being taken asynchronously, and we regularly update the compactable index. It can happen that nothing is compacted (e.g. there are no snapshots since the last compaction).

      The log is compacted up to the latest compactable index, minus the configured replication threshold. This is done in order to avoid replicating snapshots too much, which is often times more expensive than replicating some entries.

      Returns:
      true if any data was deleted, false otherwise
    • compactIgnoringReplicationThreshold

      public boolean compactIgnoringReplicationThreshold()
      Assumes our snapshots are being taken asynchronously, and we regularly update the compactable index. It can happen that nothing is compacted (e.g. there are no snapshots since the last compaction).

      The log is compacted up to the latest compactable index, ignoring the replication threshold.

      Returns:
      true if any data was deleted, false otherwise
    • setCompactableIndex

      public void setCompactableIndex(long index)