| Modifier and Type | Class and Description |
|---|---|
class |
LocalKafkaJournal.DirtyLogFlusher |
class |
LocalKafkaJournal.LogRetentionCleaner
Java implementation of the Kafka log retention cleaner.
|
class |
LocalKafkaJournal.OffsetFileFlusher |
class |
LocalKafkaJournal.RecoveryCheckpointFlusher |
Journal.Entry, Journal.JournalReadEntry| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_COMMITTED_OFFSET |
static String |
GAUGE_UNCOMMITTED_MESSAGES |
static String |
METER_READ_MESSAGES |
static String |
METER_WRITTEN_MESSAGES |
static int |
NOTIFY_ON_UTILIZATION_PERCENTAGE |
static int |
THRESHOLD_THROTTLING_DISABLED |
| Constructor and Description |
|---|
LocalKafkaJournal(Path journalDirectory,
ScheduledExecutorService scheduler,
com.github.joschi.jadconfig.util.Size segmentSize,
org.joda.time.Duration segmentAge,
com.github.joschi.jadconfig.util.Size retentionSize,
org.joda.time.Duration retentionAge,
long flushInterval,
org.joda.time.Duration flushAge,
int throttleThresholdPercentage,
com.codahale.metrics.MetricRegistry metricRegistry,
ServerStatus serverStatus) |
LocalKafkaJournal(Path journalDirectory,
ScheduledExecutorService scheduler,
com.github.joschi.jadconfig.util.Size segmentSize,
org.joda.time.Duration segmentAge,
com.github.joschi.jadconfig.util.Size retentionSize,
org.joda.time.Duration retentionAge,
long flushInterval,
org.joda.time.Duration flushAge,
int throttleThresholdPercentage,
com.codahale.metrics.MetricRegistry metricRegistry,
ServerStatus serverStatus,
String metricPrefix) |
| Modifier and Type | Method and Description |
|---|---|
int |
cleanupLogs() |
Journal.Entry |
createEntry(byte[] idBytes,
byte[] messageBytes)
Creates an opaque object which can be passed to
write(java.util.List) for a bulk journal write. |
protected void |
flushDirtyLogs()
A Java transliteration of what the scala implementation does, which unfortunately is declared as private
|
long |
getCommittedOffset() |
long |
getCommittedReadOffset()
Returns the highest journal offset that has been writting to persistent storage by Graylog.
|
long |
getLogEndOffset()
returns the offset for the next value to be inserted in the entire journal.
|
long |
getLogStartOffset()
Returns the first valid offset in the entire journal.
|
long |
getNextReadOffset() |
int |
getPurgedSegmentsInLastRetention() |
Iterable<org.graylog.shaded.kafka09.log.LogSegment> |
getSegments() |
ThrottleState |
getThrottleState()
For informational purposes this method provides access to the current state of the journal.
|
void |
markJournalOffsetCommitted(long offset)
Upon fully processing, and persistently storing, a batch of messages, the system should mark the message with the
highest offset as committed.
|
int |
numberOfSegments()
Returns the number of segments this journal consists of.
|
List<Journal.JournalReadEntry> |
read(long requestedMaximumCount) |
List<Journal.JournalReadEntry> |
read(long readOffset,
long requestedMaximumCount) |
void |
setThrottleState(ThrottleState state) |
protected void |
shutDown() |
long |
size()
Returns the journal size in bytes, exluding index files.
|
protected void |
startUp() |
void |
truncateTo(long offset)
Discards all data in the journal prior to the given offset.
|
long |
write(byte[] idBytes,
byte[] messageBytes)
Writes a single message to the journal and returns the new write position
|
long |
write(List<Journal.Entry> entries)
Writes the list of entries to the journal.
|
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toStringpublic static final long DEFAULT_COMMITTED_OFFSET
public static final int NOTIFY_ON_UTILIZATION_PERCENTAGE
public static final int THRESHOLD_THROTTLING_DISABLED
public static final String METER_WRITTEN_MESSAGES
public static final String METER_READ_MESSAGES
public static final String GAUGE_UNCOMMITTED_MESSAGES
@Inject
public LocalKafkaJournal(@Named(value="message_journal_dir")
Path journalDirectory,
@Named(value="scheduler")
ScheduledExecutorService scheduler,
@Named(value="message_journal_segment_size")
com.github.joschi.jadconfig.util.Size segmentSize,
@Named(value="message_journal_segment_age")
org.joda.time.Duration segmentAge,
@Named(value="message_journal_max_size")
com.github.joschi.jadconfig.util.Size retentionSize,
@Named(value="message_journal_max_age")
org.joda.time.Duration retentionAge,
@Named(value="message_journal_flush_interval")
long flushInterval,
@Named(value="message_journal_flush_age")
org.joda.time.Duration flushAge,
@Named(value="lb_throttle_threshold_percentage")
int throttleThresholdPercentage,
com.codahale.metrics.MetricRegistry metricRegistry,
ServerStatus serverStatus)
public LocalKafkaJournal(Path journalDirectory, ScheduledExecutorService scheduler, com.github.joschi.jadconfig.util.Size segmentSize, org.joda.time.Duration segmentAge, com.github.joschi.jadconfig.util.Size retentionSize, org.joda.time.Duration retentionAge, long flushInterval, org.joda.time.Duration flushAge, int throttleThresholdPercentage, com.codahale.metrics.MetricRegistry metricRegistry, ServerStatus serverStatus, String metricPrefix)
throttleThresholdPercentage - The journal utilization percent at which throttling will be triggered.
Expressed as an integer between 1 and 100. The value -1 disables throttling.public int getPurgedSegmentsInLastRetention()
public Journal.Entry createEntry(byte[] idBytes, byte[] messageBytes)
write(java.util.List) for a bulk journal write.createEntry in interface JournalidBytes - a byte array which represents the key for the entrymessageBytes - the journal entry's payload, i.e. the message itselfwrite(java.util.List)public long write(List<Journal.Entry> entries)
public long write(byte[] idBytes,
byte[] messageBytes)
public List<Journal.JournalReadEntry> read(long requestedMaximumCount)
public List<Journal.JournalReadEntry> read(long readOffset, long requestedMaximumCount)
public void markJournalOffsetCommitted(long offset)
markJournalOffsetCommitted in interface Journaloffset - the offset of the latest committed messageprotected void flushDirtyLogs()
public long getCommittedOffset()
public long getNextReadOffset()
protected void startUp()
throws Exception
startUp in class com.google.common.util.concurrent.AbstractIdleServiceExceptionprotected void shutDown()
throws Exception
shutDown in class com.google.common.util.concurrent.AbstractIdleServiceExceptionpublic int cleanupLogs()
public Iterable<org.graylog.shaded.kafka09.log.LogSegment> getSegments()
public long size()
public int numberOfSegments()
public long getCommittedReadOffset()
Every message at an offset prior to this one can be considered as processed and does not need to be held in the journal any longer. By default Graylog will try to aggressively flush the journal to consume a smaller amount of disk space.
public void truncateTo(long offset)
offset - offset to truncate to, so that no offset in the journal is larger than this.public long getLogStartOffset()
public long getLogEndOffset()
public ThrottleState getThrottleState()
public void setThrottleState(ThrottleState state)
Copyright © 2012–2021 Graylog, Inc.. All rights reserved.