Class CompactionObserver

java.lang.Object
org.cojen.tupl.diag.CompactionObserver

public class CompactionObserver extends Object
Index compaction observer. Implementation does not need to be thread-safe, but instances should not be shared by concurrent compactions.
See Also:
  • Field Details

    • index

      protected Index index
      Index currently being compacted.
  • Constructor Details

    • CompactionObserver

      public CompactionObserver()
  • Method Details

    • indexBegin

      public boolean indexBegin(Index index)
      Called before full index compaction begins. Default implementation records the index, and then simply returns true.
      Parameters:
      index - index to compact
      Returns:
      false if compaction should stop
    • indexComplete

      public boolean indexComplete(Index index)
      Called after index compaction has finished. Default implementation clears the index field, and then returns true.
      Parameters:
      index - index which finished compaction
      Returns:
      false if compaction should stop
    • indexNodeVisited

      public boolean indexNodeVisited(long id)
      Called after an index node has been visited by the compactor. Implementation is free to report incremental progress or throttle compaction. Default implementation does nothing but return true.
      Parameters:
      id - ephemeral node identifier
      Returns:
      false if compaction should stop