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);
}
Aggregations