Class CompactionObserver
java.lang.Object
org.cojen.tupl.diag.CompactionObserver
Index compaction observer. Implementation does not need to be thread-safe, but instances
should not be shared by concurrent compactions.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
indexBegin
(Index index) Called before full index compaction begins.boolean
indexComplete
(Index index) Called after index compaction has finished.boolean
indexNodeVisited
(long id) Called after an index node has been visited by the compactor.
-
Field Details
-
index
Index currently being compacted.
-
-
Constructor Details
-
CompactionObserver
public CompactionObserver()
-
-
Method Details
-
indexBegin
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
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
-