Package org.graylog2.shared.journal
Interface Journal
- All Known Implementing Classes:
LocalKafkaJournal,NoopJournal
public interface Journal
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptioncreateEntry(byte[] idBytes, byte[] messageBytes) voidflush()Returns anOptionalcontaining the current journal utilization as a percentage of the maximum retention size.voidmarkJournalOffsetCommitted(long offset) read(long maximumCount) intExecutes the retention policy on the journal, deleting outdated or excess data based on the configured retention rules.longwrite(byte[] idBytes, byte[] messageBytes) longwrite(List<Journal.Entry> entries)
-
Method Details
-
createEntry
-
write
-
write
long write(byte[] idBytes, byte[] messageBytes) -
read
-
markJournalOffsetCommitted
void markJournalOffsetCommitted(long offset) -
flush
void flush() -
getJournalUtilization
Returns anOptionalcontaining the current journal utilization as a percentage of the maximum retention size. This default implementation returns an emptyOptional, indicating that no utilization data is available.- Returns:
- an
Optional<Double>representing the journal utilization percentage, or an emptyOptionalif utilization data is unavailable.
-
runRetention
int runRetention()Executes the retention policy on the journal, deleting outdated or excess data based on the configured retention rules.- Returns:
- an integer representing the amount of data deleted during the retention process.
-