use of org.talend.components.kinesis.KinesisDatasetProperties in project components by Talend.
the class KinesisTestConstants method getDatasetForAvro.
public static KinesisDatasetProperties getDatasetForAvro(KinesisDatastoreProperties datastore, String streamName, String avroSchema) {
KinesisDatasetProperties dataset = new KinesisDatasetProperties("kinesisDataset");
dataset.init();
dataset.setDatastoreProperties(datastore);
dataset.streamName.setValue(streamName);
dataset.valueFormat.setValue(KinesisDatasetProperties.ValueFormat.AVRO);
dataset.avroSchema.setValue(avroSchema);
return dataset;
}
use of org.talend.components.kinesis.KinesisDatasetProperties in project components by Talend.
the class KinesisTestConstants method getDatasetForListStreams.
public static KinesisDatasetProperties getDatasetForListStreams(KinesisDatastoreProperties datastore, KinesisRegion region, String customRegion) {
KinesisDatasetProperties dataset = new KinesisDatasetProperties("kinesisDataset");
dataset.init();
dataset.setDatastoreProperties(datastore);
dataset.region.setValue(region);
if (KinesisRegion.OTHER.equals(region)) {
dataset.unknownRegion.setValue(customRegion);
}
return dataset;
}
use of org.talend.components.kinesis.KinesisDatasetProperties in project components by Talend.
the class KinesisTestConstants method getDatasetForCsv.
public static KinesisDatasetProperties getDatasetForCsv(KinesisDatastoreProperties datastore, String streamName, KinesisDatasetProperties.FieldDelimiterType fieldDelimiter) {
KinesisDatasetProperties dataset = new KinesisDatasetProperties("kinesisDataset");
dataset.init();
dataset.setDatastoreProperties(datastore);
dataset.streamName.setValue(streamName);
dataset.valueFormat.setValue(KinesisDatasetProperties.ValueFormat.CSV);
dataset.fieldDelimiter.setValue(fieldDelimiter);
return dataset;
}
use of org.talend.components.kinesis.KinesisDatasetProperties in project components by Talend.
the class KinesisTestConstants method getDatasetForListStreams.
public static KinesisDatasetProperties getDatasetForListStreams(KinesisDatastoreProperties datastore, KinesisRegion region, String customRegion) {
KinesisDatasetProperties dataset = new KinesisDatasetProperties("kinesisDataset");
dataset.init();
dataset.setDatastoreProperties(datastore);
dataset.region.setValue(region);
if (KinesisRegion.OTHER.equals(region)) {
dataset.unknownRegion.setValue(customRegion);
}
return dataset;
}
use of org.talend.components.kinesis.KinesisDatasetProperties in project components by Talend.
the class KinesisDatasetRuntimeTestIT method listStreams.
// Can't use localstack to list streams by region
@Test
public void listStreams() {
KinesisDatasetProperties props = getDatasetForListStreams(getDatastore(), KinesisRegion.DEFAULT, null);
RuntimeInfo ri = def.getRuntimeInfo(props);
try (SandboxedInstance si = RuntimeUtil.createRuntimeClass(ri, getClass().getClassLoader())) {
IKinesisDatasetRuntime runtime = (IKinesisDatasetRuntime) si.getInstance();
runtime.initialize(null, props);
Set<String> streams = runtime.listStreams();
// no exception is ok
assertTrue(true);
}
}
Aggregations