Search in sources :

Example 6 with ObserverSpecification

use of org.apache.fluo.api.config.ObserverSpecification in project incubator-rya by apache.

the class FluoITBase method startMiniFluo.

/**
 * Setup a Mini Fluo cluster that uses a temporary directory to store its
 * data.
 *
 * @return A Mini Fluo cluster.
 */
protected MiniFluo startMiniFluo() throws AlreadyInitializedException, TableExistsException {
    // 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(ProjectionObserver.class.getName()));
    observers.add(new ObserverSpecification(ConstructQueryResultObserver.class.getName()));
    // Provide export parameters child test classes may provide to the
    // export observer.
    final ObserverSpecification exportObserverConfig = new ObserverSpecification(QueryResultObserver.class.getName(), makeExportParams());
    observers.add(exportObserverConfig);
    // Configure how the mini fluo will run.
    final FluoConfiguration config = new FluoConfiguration();
    config.setMiniStartAccumulo(false);
    config.setAccumuloInstance(instanceName);
    config.setAccumuloUser(clusterInstance.getUsername());
    config.setAccumuloPassword(clusterInstance.getPassword());
    config.setInstanceZookeepers(zookeepers + "/fluo");
    config.setAccumuloZookeepers(zookeepers);
    config.setApplicationName(getRyaInstanceName());
    config.setAccumuloTable("fluo" + getRyaInstanceName());
    config.addObservers(observers);
    FluoFactory.newAdmin(config).initialize(new FluoAdmin.InitializationOptions().setClearTable(true).setClearZookeeper(true));
    return FluoFactory.newMiniFluo(config);
}
Also used : ObserverSpecification(org.apache.fluo.api.config.ObserverSpecification) FluoAdmin(org.apache.fluo.api.client.FluoAdmin) FluoConfiguration(org.apache.fluo.api.config.FluoConfiguration) ArrayList(java.util.ArrayList) QueryResultObserver(org.apache.rya.indexing.pcj.fluo.app.observers.QueryResultObserver) ConstructQueryResultObserver(org.apache.rya.indexing.pcj.fluo.app.observers.ConstructQueryResultObserver)

Aggregations

ArrayList (java.util.ArrayList)6 ObserverSpecification (org.apache.fluo.api.config.ObserverSpecification)6 QueryResultObserver (org.apache.rya.indexing.pcj.fluo.app.observers.QueryResultObserver)6 HashMap (java.util.HashMap)5 FluoConfiguration (org.apache.fluo.api.config.FluoConfiguration)3 RyaExportParameters (org.apache.rya.indexing.pcj.fluo.app.export.rya.RyaExportParameters)3 ConstructQueryResultObserver (org.apache.rya.indexing.pcj.fluo.app.observers.ConstructQueryResultObserver)3 FluoAdmin (org.apache.fluo.api.client.FluoAdmin)2 KafkaSubGraphExporterParameters (org.apache.rya.indexing.pcj.fluo.app.export.kafka.KafkaSubGraphExporterParameters)2 File (java.io.File)1 MiniFluo (org.apache.fluo.api.mini.MiniFluo)1 KafkaBindingSetExporterParameters (org.apache.rya.indexing.pcj.fluo.app.export.kafka.KafkaBindingSetExporterParameters)1