use of org.talend.components.kafka.dataset.KafkaDatasetProperties in project components by Talend.
the class KafkaTestConstants method createDatasetCSV.
public static KafkaDatasetProperties createDatasetCSV(KafkaDatastoreProperties datastore, String topic, KafkaDatasetProperties.FieldDelimiterType fieldDelimiter, String specificFieldDelimiter) {
KafkaDatasetProperties dataset = createDataset(datastore);
dataset.topic.setValue(topic);
dataset.valueFormat.setValue(KafkaDatasetProperties.ValueFormat.CSV);
dataset.fieldDelimiter.setValue(fieldDelimiter);
dataset.specificFieldDelimiter.setValue(specificFieldDelimiter);
return dataset;
}
use of org.talend.components.kafka.dataset.KafkaDatasetProperties in project components by Talend.
the class KafkaDatastoreDefinition method createDatasetProperties.
@Override
public DatasetProperties createDatasetProperties(KafkaDatastoreProperties storeProp) {
KafkaDatasetProperties datasetProperties = new KafkaDatasetProperties(KafkaDatasetDefinition.NAME);
datasetProperties.init();
datasetProperties.setDatastoreProperties(storeProp);
return datasetProperties;
}
use of org.talend.components.kafka.dataset.KafkaDatasetProperties in project components by Talend.
the class KafkaDatasetTestIT method createDatasetProperties.
/**
* @return the properties for this dataset, fully initialized with the default values and the datastore credentials
* from the System environment.
*/
public static KafkaDatasetProperties createDatasetProperties() {
// Configure the dataset.
String systemPropertyHost = System.getProperty("kafka.bootstrap");
String broker = systemPropertyHost != null ? systemPropertyHost : "localhost:9092";
KafkaDatastoreProperties datastoreProps = new KafkaDatastoreProperties(null);
datastoreProps.init();
datastoreProps.brokers.setValue(broker);
KafkaDatasetProperties datasetProps = new KafkaDatasetProperties(null);
datasetProps.init();
datasetProps.topic.setValue("test_in");
datasetProps.setDatastoreProperties(datastoreProps);
return datasetProps;
}
use of org.talend.components.kafka.dataset.KafkaDatasetProperties in project components by Talend.
the class KafkaAvroBeamRuntimeTestIT method init.
@Before
public void init() throws IOException {
datastoreProperties = new KafkaDatastoreProperties("datastore");
datastoreProperties.init();
datastoreProperties.brokers.setValue(BOOTSTRAP_HOST);
inputDatasetProperties = new KafkaDatasetProperties("inputDataset");
inputDatasetProperties.init();
inputDatasetProperties.setDatastoreProperties(datastoreProperties);
inputDatasetProperties.topic.setValue(TOPIC_AVRO_IN);
inputDatasetProperties.valueFormat.setValue(KafkaDatasetProperties.ValueFormat.AVRO);
inputDatasetProperties.isHierarchy.setValue(false);
inputDatasetProperties.main.schema.setValue(Person.schema);
outputDatasetProperties = new KafkaDatasetProperties("outputDataset");
outputDatasetProperties.init();
outputDatasetProperties.setDatastoreProperties(datastoreProperties);
outputDatasetProperties.topic.setValue(TOPIC_AVRO_OUT);
outputDatasetProperties.valueFormat.setValue(KafkaDatasetProperties.ValueFormat.AVRO);
outputDatasetProperties.isHierarchy.setValue(false);
outputDatasetProperties.main.schema.setValue(Person.schema);
}
Aggregations