public interface Log
MessageReader
s.Modifier and Type | Method and Description |
---|---|
Future<Message> |
add(StaticBuffer content)
Attempts to add the given content to the log and returns a
Future for this action. |
Future<Message> |
add(StaticBuffer content,
StaticBuffer key)
Attempts to add the given content to the log and returns a
Future for this action. |
void |
close()
Closes this log and stops the reading process.
|
String |
getName()
Returns the name of this log
|
void |
registerReader(ReadMarker readMarker,
MessageReader... reader) |
void |
registerReaders(ReadMarker readMarker,
Iterable<MessageReader> readers)
Registers the given readers with this log.
|
boolean |
unregisterReader(MessageReader reader)
Removes the given reader from the list of registered readers and returns whether this reader was registered in the
first place.
|
Future<Message> add(StaticBuffer content)
Future
for this action.
If the log is configured for immediate sending, then any exception encountered during this process is thrown by this method. Otherwise, encountered exceptions are attached to the returned future.
content
- Future<Message> add(StaticBuffer content, StaticBuffer key)
Future
for this action.
In addition, a key is provided to signal the recipient of the log message in partitioned logging systems.
If the log is configured for immediate sending, then any exception encountered during this process is thrown by this method. Otherwise, encountered exceptions are attached to the returned future.
content
- void registerReader(ReadMarker readMarker, MessageReader... reader)
readMarker
- Indicates where to start reading from the log once message readers are registeredreader
- The readers to register (all at once)registerReaders(ReadMarker, Iterable)
void registerReaders(ReadMarker readMarker, Iterable<MessageReader> readers)
ReadMarker
.
If no previous readers were registered, invoking this method triggers reader threads to be instantiated.
If readers have been previously registered, then the provided ReadMarker
must be compatible with the
previous ReadMarker
or an exception will be thrown.
readMarker
- Indicates where to start reading from the log once message readers are registeredreaders
- The readers to register (all at once)boolean unregisterReader(MessageReader reader)
close()
instead.reader
- String getName()
void close() throws BackendException
BackendException
Copyright © 2012–2023. All rights reserved.