public interface LogManager extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
createIfNotExists(String name,
int size)
Creates a new Log with
size partitions if the Log does not exists. |
<M extends Externalizable> |
createTailer(String group,
Collection<LogPartition> partitions)
Create a tailer for a consumer
group and assign multiple partitions . |
default <M extends Externalizable> |
createTailer(String group,
LogPartition partition)
Create a tailer for a consumer
group and assign a single partition . |
default <M extends Externalizable> |
createTailer(String group,
String name)
Create a tailer for a consumer
group and assign all partitions of the Log. |
boolean |
delete(String name)
Try to delete a Log.
|
boolean |
exists(String name)
Returns
true if a Log with this name exists. |
<M extends Externalizable> |
getAppender(String name)
Get an appender for the Log named
name . |
default LogLag |
getLag(String name,
String group)
Returns the lag between consumer
group and producers for a Log. |
List<LogLag> |
getLagPerPartition(String name,
String group)
Returns the lag between consumer
group and the producers for each partition. |
List<String> |
listAll()
Returns all the Log names.
|
List<String> |
listConsumerGroups(String name)
List the consumer groups for a Log.
|
<M extends Externalizable> |
subscribe(String group,
Collection<String> names,
RebalanceListener listener)
Create a tailer for a consumer
group and subscribe to multiple Logs. |
boolean |
supportSubscribe()
Returns
true if the Log subscribe(java.lang.String, java.util.Collection<java.lang.String>, org.nuxeo.lib.stream.log.RebalanceListener) method is supported. |
boolean createIfNotExists(String name, int size)
size
partitions if the Log does not exists. Returns true it the Log has been
created.boolean delete(String name)
<M extends Externalizable> LogAppender<M> getAppender(String name)
name
. An appender is thread safe.<M extends Externalizable> LogTailer<M> createTailer(String group, Collection<LogPartition> partitions)
group
and assign multiple partitions
. Note that partitions
can be from different Logs. A tailer is NOT thread safe.default <M extends Externalizable> LogTailer<M> createTailer(String group, LogPartition partition)
group
and assign a single partition
. A tailer is NOT thread safe.default <M extends Externalizable> LogTailer<M> createTailer(String group, String name)
group
and assign all partitions
of the Log. A tailer is NOT thread
safe.boolean supportSubscribe()
true
if the Log subscribe(java.lang.String, java.util.Collection<java.lang.String>, org.nuxeo.lib.stream.log.RebalanceListener)
method is supported.<M extends Externalizable> LogTailer<M> subscribe(String group, Collection<String> names, RebalanceListener listener)
group
and subscribe to multiple Logs. The partitions assignment is done
dynamically depending on the number of subscribers. The partitions can change during tailers life, this is called
a rebalancing. A listener can be used to be notified on assignment changes.
A tailer is NOT thread safe.
You should not mix createTailer(java.lang.String, java.util.Collection<org.nuxeo.lib.stream.log.LogPartition>)
and subscribe
usage using the same group
.List<LogLag> getLagPerPartition(String name, String group)
group
and the producers for each partition. The result list is ordered,
for instance index 0 is lag for partition 0.default LogLag getLag(String name, String group)
group
and producers for a Log.List<String> listConsumerGroups(String name)
void close()
close
in interface AutoCloseable
Copyright © 2018 Nuxeo. All rights reserved.