Search in sources :

Example 6 with KafkaDatasetProperties

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;
}
Also used : KafkaDatasetProperties(org.talend.components.kafka.dataset.KafkaDatasetProperties)

Example 7 with KafkaDatasetProperties

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;
}
Also used : KafkaDatasetProperties(org.talend.components.kafka.dataset.KafkaDatasetProperties)

Example 8 with KafkaDatasetProperties

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;
}
Also used : KafkaDatastoreProperties(org.talend.components.kafka.datastore.KafkaDatastoreProperties) KafkaDatasetProperties(org.talend.components.kafka.dataset.KafkaDatasetProperties)

Example 9 with KafkaDatasetProperties

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);
}
Also used : KafkaDatastoreProperties(org.talend.components.kafka.datastore.KafkaDatastoreProperties) KafkaDatasetProperties(org.talend.components.kafka.dataset.KafkaDatasetProperties) Before(org.junit.Before)

Aggregations

KafkaDatasetProperties (org.talend.components.kafka.dataset.KafkaDatasetProperties)9 Test (org.junit.Test)3 KafkaDatastoreProperties (org.talend.components.kafka.datastore.KafkaDatastoreProperties)3 ArrayList (java.util.ArrayList)2 Before (org.junit.Before)2 List (java.util.List)1 Schema (org.apache.avro.Schema)1 IndexedRecord (org.apache.avro.generic.IndexedRecord)1 DatasetRuntime (org.talend.components.common.dataset.runtime.DatasetRuntime)1 RuntimeInfo (org.talend.daikon.runtime.RuntimeInfo)1 SandboxedInstance (org.talend.daikon.sandbox.SandboxedInstance)1