Interface RetentionPolicy
- All Known Implementing Classes:
RetentionPolicy.Composite, RetentionPolicy.SizeBased, RetentionPolicy.TimeBased
public sealed interface RetentionPolicy
permits RetentionPolicy.TimeBased, RetentionPolicy.SizeBased, RetentionPolicy.Composite
Sealed interface for journal retention policies.
Retention policies determine which entries should be compacted/removed based on various criteria (time, size, composite).
- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordComposite retention policy.static final recordSize-based retention policy.static final recordTime-based retention policy. -
Method Summary
Modifier and TypeMethodDescriptionbooleanshouldRetain(JournalEntry entry, long currentTimeNanos) Check if an entry should be retained.
-
Method Details
-
shouldRetain
Check if an entry should be retained.- Parameters:
entry- The entry to checkcurrentTimeNanos- Current time in nanoseconds- Returns:
- true if the entry should be kept, false if it can be removed
-