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 Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Composite retention policy.
    static final record 
    Size-based retention policy.
    static final record 
    Time-based retention policy.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    shouldRetain(JournalEntry entry, long currentTimeNanos)
    Check if an entry should be retained.
  • Method Details

    • shouldRetain

      boolean shouldRetain(JournalEntry entry, long currentTimeNanos)
      Check if an entry should be retained.
      Parameters:
      entry - The entry to check
      currentTimeNanos - Current time in nanoseconds
      Returns:
      true if the entry should be kept, false if it can be removed