public class KafkaSource extends AbstractModuleFixture<KafkaSource>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_OUTPUT_TYPE |
static java.lang.String |
DEFAULT_TOPIC |
static java.lang.String |
DEFAULT_ZK_CLIENT |
label
Constructor and Description |
---|
KafkaSource(java.lang.String zkConnect)
Initializes a KafkaSource fixture;
|
Modifier and Type | Method and Description |
---|---|
KafkaSource |
ensureReady()
Ensure that the zookeeper socket is available by polling it for up to 2 seconds and creates the topic
required by this source.
|
KafkaSource |
outputType(java.lang.String outputType)
set the outputType for the kafka source
|
protected java.lang.String |
toDSL()
Returns a representation of the module suitable for inclusion in a stream definition, e.g.
file --dir=xxxx --name=yyyy |
KafkaSource |
topic(java.lang.String topic)
sets the topic for the kafka source
|
static KafkaSource |
withDefaults()
Returns an instance of the KafkaSource using defaults.
|
KafkaSource |
zkConnect(java.lang.String zkConnect)
set the zkConnect for the kafka source
|
label, toString
public static final java.lang.String DEFAULT_ZK_CLIENT
public static final java.lang.String DEFAULT_TOPIC
public static final java.lang.String DEFAULT_OUTPUT_TYPE
public KafkaSource(java.lang.String zkConnect)
zkConnect
- The zookeeper connection string.public static KafkaSource withDefaults()
protected java.lang.String toDSL()
AbstractModuleFixture
file --dir=xxxx --name=yyyy
toDSL
in class AbstractModuleFixture<KafkaSource>
public KafkaSource topic(java.lang.String topic)
topic
- the topic that data will be posted.public KafkaSource zkConnect(java.lang.String zkConnect)
zkConnect
- the zookeeper connection string to be usedpublic KafkaSource outputType(java.lang.String outputType)
outputType
- the output type to be used.public KafkaSource ensureReady()
java.lang.IllegalStateException
- if can not connect in 2 seconds.