use of org.apache.rya.indexing.pcj.fluo.app.export.kafka.KafkaBindingSetExporterParameters in project incubator-rya by apache.
the class KafkaExportITBase method preFluoInitHook.
/**
* Add info about the Kafka queue/topic to receive the export.
*/
@Override
protected void preFluoInitHook() throws Exception {
// Setup the observers that will be used by the Fluo PCJ Application.
final List<ObserverSpecification> observers = new ArrayList<>();
observers.add(new ObserverSpecification(TripleObserver.class.getName()));
observers.add(new ObserverSpecification(BatchObserver.class.getName()));
observers.add(new ObserverSpecification(StatementPatternObserver.class.getName()));
observers.add(new ObserverSpecification(JoinObserver.class.getName()));
observers.add(new ObserverSpecification(FilterObserver.class.getName()));
observers.add(new ObserverSpecification(AggregationObserver.class.getName()));
observers.add(new ObserverSpecification(ProjectionObserver.class.getName()));
observers.add(new ObserverSpecification(ConstructQueryResultObserver.class.getName()));
// Configure the export observer to export new PCJ results to the mini
// accumulo cluster.
final HashMap<String, String> exportParams = new HashMap<>();
final KafkaBindingSetExporterParameters kafkaParams = new KafkaBindingSetExporterParameters(exportParams);
kafkaParams.setUseKafkaBindingSetExporter(true);
kafkaParams.setKafkaBootStrapServers(BROKERHOST + ":" + BROKERPORT);
final KafkaSubGraphExporterParameters kafkaConstructParams = new KafkaSubGraphExporterParameters(exportParams);
kafkaConstructParams.setUseKafkaSubgraphExporter(true);
final ObserverSpecification exportObserverConfig = new ObserverSpecification(QueryResultObserver.class.getName(), exportParams);
observers.add(exportObserverConfig);
// Add the observers to the Fluo Configuration.
super.getFluoConfiguration().addObservers(observers);
}
use of org.apache.rya.indexing.pcj.fluo.app.export.kafka.KafkaBindingSetExporterParameters in project incubator-rya by apache.
the class KafkaExportParametersTest method notConfigured.
@Test
public void notConfigured() {
final Map<String, String> params = new HashMap<>();
// Ensure an unconfigured parameters map will say kafka export is disabled.
final KafkaBindingSetExporterParameters kafkaParams = new KafkaBindingSetExporterParameters(params);
assertFalse(kafkaParams.getUseKafkaBindingSetExporter());
}
use of org.apache.rya.indexing.pcj.fluo.app.export.kafka.KafkaBindingSetExporterParameters in project incubator-rya by apache.
the class KafkaExportParametersTest method writeParams.
@Test
public void writeParams() {
final Map<String, String> params = new HashMap<>();
// Load some values into the params using the wrapper.
final KafkaBindingSetExporterParameters kafkaParams = new KafkaBindingSetExporterParameters(params);
kafkaParams.setUseKafkaBindingSetExporter(true);
// Ensure the params map has the expected values.
final Map<String, String> expectedParams = new HashMap<>();
expectedParams.put(KafkaBindingSetExporterParameters.CONF_USE_KAFKA_BINDING_SET_EXPORTER, "true");
assertTrue(kafkaParams.getUseKafkaBindingSetExporter());
assertEquals(expectedParams, params);
// now go the other way.
expectedParams.put(KafkaBindingSetExporterParameters.CONF_USE_KAFKA_BINDING_SET_EXPORTER, "false");
kafkaParams.setUseKafkaBindingSetExporter(false);
assertFalse(kafkaParams.getUseKafkaBindingSetExporter());
assertEquals(expectedParams, params);
}
Aggregations