Package org.graylog2.shared.journal
Class NoopJournal
java.lang.Object
com.google.common.util.concurrent.AbstractIdleService
org.graylog2.shared.journal.NoopJournal
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
,Journal
public class NoopJournal
extends com.google.common.util.concurrent.AbstractIdleService
implements Journal
NoopJournal is used when disk journalling is turned off. In order to avoid propagating the knowledge about whether
journalling is happening or not, we inject a no-op journal.
Any use of this journal will throw an IllegalStateException.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.graylog2.shared.journal.Journal
Journal.Entry, Journal.JournalReadEntry
Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateEntry
(byte[] idBytes, byte[] messageBytes) void
flush()
void
markJournalOffsetCommitted
(long offset) read
(long maximumCount) protected void
shutDown()
protected void
startUp()
long
write
(byte[] idBytes, byte[] messageBytes) long
write
(List<Journal.Entry> entries) Methods inherited from class com.google.common.util.concurrent.AbstractIdleService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toString
-
Constructor Details
-
NoopJournal
public NoopJournal()
-
-
Method Details
-
createEntry
- Specified by:
createEntry
in interfaceJournal
-
write
-
write
public long write(byte[] idBytes, byte[] messageBytes) -
read
-
markJournalOffsetCommitted
public void markJournalOffsetCommitted(long offset) - Specified by:
markJournalOffsetCommitted
in interfaceJournal
-
startUp
- Specified by:
startUp
in classcom.google.common.util.concurrent.AbstractIdleService
- Throws:
Exception
-
shutDown
- Specified by:
shutDown
in classcom.google.common.util.concurrent.AbstractIdleService
- Throws:
Exception
-
flush
public void flush()
-