public class KafkaLogManager extends AbstractLogManager
Modifier and Type | Field and Description |
---|---|
protected Properties |
adminProperties |
protected Properties |
consumerProperties |
static String |
DEFAULT_REPLICATION_FACTOR_PROP |
protected short |
defaultReplicationFactor |
static String |
DISABLE_SUBSCRIBE_PROP |
protected boolean |
disableSubscribe |
protected KafkaUtils |
kUtils |
protected String |
prefix |
protected Properties |
producerProperties |
appenders, tailers, tailersAssignments
Constructor and Description |
---|
KafkaLogManager(String zkServers,
Properties producerProperties,
Properties consumerProperties) |
KafkaLogManager(String zkServers,
String topicPrefix,
Properties producerProperties,
Properties consumerProperties) |
checkInvalidAssignment, createIfNotExists, createTailer, delete, getAppender, subscribe
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createTailer, createTailer, getLag
public static final String DISABLE_SUBSCRIBE_PROP
public static final String DEFAULT_REPLICATION_FACTOR_PROP
protected final KafkaUtils kUtils
protected final Properties producerProperties
protected final Properties consumerProperties
protected final Properties adminProperties
protected final short defaultReplicationFactor
protected final boolean disableSubscribe
public KafkaLogManager(String zkServers, Properties producerProperties, Properties consumerProperties)
public KafkaLogManager(String zkServers, String topicPrefix, Properties producerProperties, Properties consumerProperties)
protected String getTopicName(String name)
protected String getNameFromTopic(String topic)
public void create(String name, int size)
create
in class AbstractLogManager
public boolean exists(String name)
LogManager
true
if a Log with this name
exists.public <M extends Externalizable> CloseableLogAppender<M> createAppender(String name)
createAppender
in class AbstractLogManager
protected <M extends Externalizable> LogTailer<M> doCreateTailer(Collection<LogPartition> partitions, String group)
doCreateTailer
in class AbstractLogManager
protected void checkValidPartition(LogPartition partition)
public Properties getProducerProperties()
public Properties getConsumerProperties()
public Properties getAdminProperties()
public void close()
close
in interface AutoCloseable
close
in interface LogManager
close
in class AbstractLogManager
public boolean supportSubscribe()
LogManager
true
if the Log LogManager.subscribe(java.lang.String, java.util.Collection<java.lang.String>, org.nuxeo.lib.stream.log.RebalanceListener)
method is supported.supportSubscribe
in interface LogManager
supportSubscribe
in class AbstractLogManager
protected <M extends Externalizable> LogTailer<M> doSubscribe(String group, Collection<String> names, RebalanceListener listener)
doSubscribe
in class AbstractLogManager
protected Properties normalizeProducerProperties(Properties producerProperties)
protected Properties normalizeConsumerProperties(Properties consumerProperties)
protected Properties createAdminProperties(Properties producerProperties, Properties consumerProperties)
public List<LogLag> getLagPerPartition(String name, String group)
LogManager
group
and the producers for each partition. The result list is ordered,
for instance index 0 is lag for partition 0.public List<String> listAll()
LogManager
public List<String> listConsumerGroups(String name)
LogManager
Copyright © 2018 Nuxeo. All rights reserved.