Search in sources :

Example 1 with KafkaSubGraphExporterParameters

use of org.apache.rya.indexing.pcj.fluo.app.export.kafka.KafkaSubGraphExporterParameters 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);
}
Also used : ObserverSpecification(org.apache.fluo.api.config.ObserverSpecification) HashMap(java.util.HashMap) KafkaBindingSetExporterParameters(org.apache.rya.indexing.pcj.fluo.app.export.kafka.KafkaBindingSetExporterParameters) ArrayList(java.util.ArrayList) QueryResultObserver(org.apache.rya.indexing.pcj.fluo.app.observers.QueryResultObserver) ConstructQueryResultObserver(org.apache.rya.indexing.pcj.fluo.app.observers.ConstructQueryResultObserver) KafkaSubGraphExporterParameters(org.apache.rya.indexing.pcj.fluo.app.export.kafka.KafkaSubGraphExporterParameters)

Example 2 with KafkaSubGraphExporterParameters

use of org.apache.rya.indexing.pcj.fluo.app.export.kafka.KafkaSubGraphExporterParameters in project incubator-rya by apache.

the class KafkaRyaSubGraphExportIT method preFluoInitHook.

/**
 * Add info about the Kafka queue/topic to receive the export.
 *
 * @see org.apache.rya.indexing.pcj.fluo.ITBase#setExportParameters(java.util.HashMap)
 */
@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(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 KafkaSubGraphExporterParameters kafkaParams = new KafkaSubGraphExporterParameters(exportParams);
    kafkaParams.setUseKafkaSubgraphExporter(true);
    kafkaParams.setKafkaBootStrapServers(BROKERHOST + ":" + BROKERPORT);
    final ObserverSpecification exportObserverConfig = new ObserverSpecification(QueryResultObserver.class.getName(), exportParams);
    observers.add(exportObserverConfig);
    // Add the observers to the Fluo Configuration.
    super.getFluoConfiguration().addObservers(observers);
}
Also used : ObserverSpecification(org.apache.fluo.api.config.ObserverSpecification) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) QueryResultObserver(org.apache.rya.indexing.pcj.fluo.app.observers.QueryResultObserver) ConstructQueryResultObserver(org.apache.rya.indexing.pcj.fluo.app.observers.ConstructQueryResultObserver) KafkaSubGraphExporterParameters(org.apache.rya.indexing.pcj.fluo.app.export.kafka.KafkaSubGraphExporterParameters)

Aggregations

ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 ObserverSpecification (org.apache.fluo.api.config.ObserverSpecification)2 KafkaSubGraphExporterParameters (org.apache.rya.indexing.pcj.fluo.app.export.kafka.KafkaSubGraphExporterParameters)2 ConstructQueryResultObserver (org.apache.rya.indexing.pcj.fluo.app.observers.ConstructQueryResultObserver)2 QueryResultObserver (org.apache.rya.indexing.pcj.fluo.app.observers.QueryResultObserver)2 KafkaBindingSetExporterParameters (org.apache.rya.indexing.pcj.fluo.app.export.kafka.KafkaBindingSetExporterParameters)1