public class KafkaTestEnvironmentImpl extends Object implements KafkaTestEnvironment
KafkaTestEnvironment.Config, KafkaTestEnvironment.KafkaOffsetHandler| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOG |
KAFKA_HOST| Constructor and Description |
|---|
KafkaTestEnvironmentImpl() |
| Modifier and Type | Method and Description |
|---|---|
KafkaTestEnvironment.KafkaOffsetHandler |
createOffsetHandler() |
void |
createTestTopic(String topic,
int numberOfPartitions,
short replicationFactor) |
void |
createTestTopic(String topic,
int numberOfPartitions,
short replicationFactor,
Properties topicConfig) |
void |
deleteTestTopic(String topic) |
<K,V> Collection<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>> |
getAllRecordsFromTopic(Properties properties,
String topic,
int partition,
long timeout) |
String |
getBrokerConnectionString() |
int |
getBrokerId(kafka.server.KafkaServer server) |
List<kafka.server.KafkaServer> |
getBrokers() |
Map<String,Object> |
getDefaultClientConfig() |
protected kafka.server.KafkaServer |
getKafkaServer(int brokerId,
File tmpFolder) |
int |
getLeaderToShutDown(String topic) |
Properties |
getSecureProperties() |
Properties |
getStandardProperties() |
String |
getVersion() |
boolean |
isSecureRunSupported() |
void |
prepare(KafkaTestEnvironment.Config config) |
void |
restartBroker(int leaderId) |
void |
shutdown() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateConfigpublic String getBrokerConnectionString()
getBrokerConnectionString in interface KafkaTestEnvironmentpublic Properties getStandardProperties()
getStandardProperties in interface KafkaTestEnvironmentpublic Properties getSecureProperties()
getSecureProperties in interface KafkaTestEnvironmentpublic String getVersion()
getVersion in interface KafkaTestEnvironmentpublic List<kafka.server.KafkaServer> getBrokers()
getBrokers in interface KafkaTestEnvironmentpublic <K,V> Collection<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>> getAllRecordsFromTopic(Properties properties, String topic, int partition, long timeout)
getAllRecordsFromTopic in interface KafkaTestEnvironmentpublic KafkaTestEnvironment.KafkaOffsetHandler createOffsetHandler()
createOffsetHandler in interface KafkaTestEnvironmentpublic void restartBroker(int leaderId)
throws Exception
restartBroker in interface KafkaTestEnvironmentExceptionpublic int getLeaderToShutDown(String topic) throws Exception
getLeaderToShutDown in interface KafkaTestEnvironmentExceptionpublic int getBrokerId(kafka.server.KafkaServer server)
getBrokerId in interface KafkaTestEnvironmentpublic boolean isSecureRunSupported()
isSecureRunSupported in interface KafkaTestEnvironmentpublic void prepare(KafkaTestEnvironment.Config config)
prepare in interface KafkaTestEnvironmentpublic void shutdown()
shutdown in interface KafkaTestEnvironmentpublic void createTestTopic(String topic, int numberOfPartitions, short replicationFactor)
createTestTopic in interface KafkaTestEnvironmentpublic void createTestTopic(String topic, int numberOfPartitions, short replicationFactor, Properties topicConfig)
createTestTopic in interface KafkaTestEnvironmentpublic void deleteTestTopic(String topic)
deleteTestTopic in interface KafkaTestEnvironmentCopyright © 2019. All rights reserved.