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
FieldsModifier and TypeFieldDescriptionprotected final List<KafkaLogConfig>protected final KafkaLogConfigstatic final Stringprotected final Map<KafkaLogConfig,KafkaUtils> Fields inherited from class org.nuxeo.lib.stream.log.internals.AbstractLogManager
ADMIN_GROUP, appenders, tailers, tailersAssignments -
Constructor Summary
ConstructorsConstructorDescriptionKafkaLogManager(String prefix, Properties producerProperties, Properties consumerProperties) KafkaLogManager(List<KafkaLogConfig> kafkaConfigs) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckValidPartition(LogPartition partition) voidclose()void<M extends Externalizable>
CloseableLogAppender<M>createAppender(Name name, Codec<M> codec) booleanTries to delete a Log.voidRemove all existing consumers and their committed positions.voiddeleteRecords(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) booleanReturnstrueif a Log with thisnameexists.protected StringfilterDisplayedProperties(Properties properties) protected KafkaLogConfigprotected KafkaLogConfigprotected KafkaLogConfiggetLagPerPartition(Name name, Name group) Returns the lag between consumergroupand the producers for each partition.protected intReturns all the Log names.listConsumerGroups(Name name) List the consumer groups for a Log.booleanbooleansupportSubscribe(Name stream) Returnstrueif 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, subscribeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
createin classAbstractLogManager
-
getSize
- Specified by:
getSizein classAbstractLogManager
-
exists
Description copied from interface:LogManagerReturnstrueif a Log with thisnameexists. -
createAppender
- Specified by:
createAppenderin classAbstractLogManager
-
doCreateTailer
protected <M extends Externalizable> LogTailer<M> doCreateTailer(Collection<LogPartition> partitions, Name group, Codec<M> codec) - Specified by:
doCreateTailerin classAbstractLogManager
-
checkValidPartition
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceLogManager- Overrides:
closein classAbstractLogManager
-
supportSubscribe
public boolean supportSubscribe()Description copied from interface:LogManagerReturnstrueif 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:
supportSubscribein interfaceLogManager- Overrides:
supportSubscribein classAbstractLogManager
-
supportSubscribe
Description copied from interface:LogManagerReturnstrueif 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:
supportSubscribein interfaceLogManager- Overrides:
supportSubscribein classAbstractLogManager
-
doSubscribe
protected <M extends Externalizable> LogTailer<M> doSubscribe(Name group, Collection<Name> names, RebalanceListener listener, Codec<M> codec) - Specified by:
doSubscribein classAbstractLogManager
-
getLagPerPartition
Description copied from interface:LogManagerReturns the lag between consumergroupand the producers for each partition. The result list is ordered, for instance index 0 is lag for partition 0.- Specified by:
getLagPerPartitionin interfaceLogManager- Specified by:
getLagPerPartitionin classAbstractLogManager
-
listAllNames
Description copied from interface:LogManagerReturns all the Log names. -
toString
-
filterDisplayedProperties
-
listConsumerGroups
Description copied from interface:LogManagerList the consumer groups for a Log. -
delete
Description copied from interface:LogManagerTries to delete a Log. Returns true if successfully deleted, might not be possible depending on the implementation.- Specified by:
deletein interfaceLogManager- Overrides:
deletein classAbstractLogManager
-
deleteRecords
Description copied from interface:LogManagerDelete 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:LogManagerRemove all existing consumers and their committed positions. Exposed for testing purpose, might not be implemented by all implementation.
-