Package org.nuxeo.lib.stream.log.kafka
Class KafkaLogManager
java.lang.Object
org.nuxeo.lib.stream.log.internals.AbstractLogManager
org.nuxeo.lib.stream.log.kafka.KafkaLogManager
- All Implemented Interfaces:
AutoCloseable
,LogManager
- Since:
- 9.3
-
Field Summary
Modifier and TypeFieldDescriptionprotected final List<KafkaLogConfig>
protected final KafkaLogConfig
static final String
protected final Map<KafkaLogConfig,
KafkaUtils> Fields inherited from class org.nuxeo.lib.stream.log.internals.AbstractLogManager
ADMIN_GROUP, appenders, tailers, tailersAssignments
-
Constructor Summary
ConstructorDescriptionKafkaLogManager
(String prefix, Properties producerProperties, Properties consumerProperties) KafkaLogManager
(List<KafkaLogConfig> kafkaConfigs) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkValidPartition
(LogPartition partition) void
close()
void
<M extends Externalizable>
CloseableLogAppender<M>createAppender
(Name name, Codec<M> codec) boolean
Tries to delete a Log.void
Remove all existing consumers and their committed positions.void
deleteRecords
(Name name) Delete all records of a stream by moving the first offsets to end of each partition.protected <M extends Externalizable>
LogTailer<M>doCreateTailer
(Collection<LogPartition> partitions, Name group, Codec<M> codec) protected <M extends Externalizable>
LogTailer<M>doSubscribe
(Name group, Collection<Name> names, RebalanceListener listener, Codec<M> codec) boolean
Returnstrue
if a Log with thisname
exists.protected String
filterDisplayedProperties
(Properties properties) protected KafkaLogConfig
protected KafkaLogConfig
protected KafkaLogConfig
getLagPerPartition
(Name name, Name group) Returns the lag between consumergroup
and the producers for each partition.protected int
Returns all the Log names.listConsumerGroups
(Name name) List the consumer groups for a Log.boolean
boolean
supportSubscribe
(Name stream) Returnstrue
if theLogManager.subscribe(org.nuxeo.lib.stream.log.Name, java.util.Collection<org.nuxeo.lib.stream.log.Name>, org.nuxeo.lib.stream.log.RebalanceListener, org.nuxeo.lib.stream.codec.Codec<M>)
method is supported for the specific Log.toString()
Methods inherited from class org.nuxeo.lib.stream.log.internals.AbstractLogManager
checkInvalidAssignment, checkInvalidCodec, cleanTailers, createIfNotExists, createTailer, getAppender, getLatencyPerPartition, guessCodec, sameCodec, size, subscribe
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.nuxeo.lib.stream.log.LogManager
createIfNotExists, createTailer, createTailer, createTailer, createTailer, createTailer, createTailer, createTailer, createTailer, createTailer, createTailer, createTailer, delete, exists, getAppender, getAppender, getAppender, getLag, getLag, getLagPerPartition, getLatency, getLatency, getLatencyPerPartition, listAll, listConsumerGroups, size, subscribe, subscribe, subscribe
-
Field Details
-
DISABLE_SUBSCRIBE_PROP
- See Also:
-
configs
-
defaultConfig
-
kUtils
-
-
Constructor Details
-
KafkaLogManager
- Since:
- 10.2
-
KafkaLogManager
- Since:
- 11.1
-
-
Method Details
-
findDefaultConfig
-
getConfig
-
getConfig
-
create
- Specified by:
create
in classAbstractLogManager
-
getSize
- Specified by:
getSize
in classAbstractLogManager
-
exists
Description copied from interface:LogManager
Returnstrue
if a Log with thisname
exists. -
createAppender
- Specified by:
createAppender
in classAbstractLogManager
-
doCreateTailer
protected <M extends Externalizable> LogTailer<M> doCreateTailer(Collection<LogPartition> partitions, Name group, Codec<M> codec) - Specified by:
doCreateTailer
in classAbstractLogManager
-
checkValidPartition
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceLogManager
- Overrides:
close
in classAbstractLogManager
-
supportSubscribe
public boolean supportSubscribe()Description copied from interface:LogManager
Returnstrue
if the LogLogManager.subscribe(org.nuxeo.lib.stream.log.Name, java.util.Collection<org.nuxeo.lib.stream.log.Name>, org.nuxeo.lib.stream.log.RebalanceListener, org.nuxeo.lib.stream.codec.Codec<M>)
method is supported. Now deprecated because some implementations support subscribe only on specific Log names.- Specified by:
supportSubscribe
in interfaceLogManager
- Overrides:
supportSubscribe
in classAbstractLogManager
-
supportSubscribe
Description copied from interface:LogManager
Returnstrue
if theLogManager.subscribe(org.nuxeo.lib.stream.log.Name, java.util.Collection<org.nuxeo.lib.stream.log.Name>, org.nuxeo.lib.stream.log.RebalanceListener, org.nuxeo.lib.stream.codec.Codec<M>)
method is supported for the specific Log.- Specified by:
supportSubscribe
in interfaceLogManager
- Overrides:
supportSubscribe
in classAbstractLogManager
-
doSubscribe
protected <M extends Externalizable> LogTailer<M> doSubscribe(Name group, Collection<Name> names, RebalanceListener listener, Codec<M> codec) - Specified by:
doSubscribe
in classAbstractLogManager
-
getLagPerPartition
Description copied from interface:LogManager
Returns the lag between consumergroup
and the producers for each partition. The result list is ordered, for instance index 0 is lag for partition 0.- Specified by:
getLagPerPartition
in interfaceLogManager
- Specified by:
getLagPerPartition
in classAbstractLogManager
-
listAllNames
Description copied from interface:LogManager
Returns all the Log names. -
toString
-
filterDisplayedProperties
-
listConsumerGroups
Description copied from interface:LogManager
List the consumer groups for a Log. -
delete
Description copied from interface:LogManager
Tries to delete a Log. Returns true if successfully deleted, might not be possible depending on the implementation.- Specified by:
delete
in interfaceLogManager
- Overrides:
delete
in classAbstractLogManager
-
deleteRecords
Description copied from interface:LogManager
Delete all records of a stream by moving the first offsets to end of each partition. Exposed for testing purpose, might not be implemented on all implementation. -
deleteConsumers
public void deleteConsumers()Description copied from interface:LogManager
Remove all existing consumers and their committed positions. Exposed for testing purpose, might not be implemented by all implementation.
-