use of org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration in project incubator-rya by apache.
the class PCJOptimizer method setConf.
@Override
public final void setConf(final Configuration conf) {
checkNotNull(conf);
if (!init) {
try {
this.conf = conf;
useOptimal = ConfigUtils.getUseOptimalPCJ(conf);
if (conf instanceof StatefulMongoDBRdfConfiguration) {
final StatefulMongoDBRdfConfiguration mongoConf = (StatefulMongoDBRdfConfiguration) conf;
provider = new MongoPcjIndexSetProvider(mongoConf);
} else {
provider = new AccumuloIndexSetProvider(conf);
}
} catch (final Exception e) {
throw new Error(e);
}
init = true;
}
}
use of org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration in project incubator-rya by apache.
the class GeoEnabledFilterFunctionOptimizer method init.
/**
* Load instances of the selected indexers. This is tricky because some (geomesa vs geowave) have incompatible dependencies (geotools versions).
*/
private synchronized void init() {
if (!init) {
if (ConfigUtils.getUseMongo(conf)) {
// create a new MongoGeoIndexer() without having it at compile time.
StatefulMongoDBRdfConfiguration stateConf = (StatefulMongoDBRdfConfiguration) conf;
for (final MongoSecondaryIndex indexer : stateConf.getAdditionalIndexers()) {
if (indexer instanceof FreeTextIndexer) {
freeTextIndexer = (FreeTextIndexer) indexer;
} else if (indexer instanceof TemporalIndexer) {
temporalIndexer = (TemporalIndexer) indexer;
} else if (indexer instanceof GeoIndexer) {
geoIndexer = (GeoIndexer) indexer;
}
}
} else {
GeoIndexerType geoIndexerType = OptionalConfigUtils.getGeoIndexerType(conf);
if (geoIndexerType == GeoIndexerType.UNSPECIFIED) {
geoIndexer = instantiate(GeoIndexerType.GEO_MESA.getGeoIndexerClassString(), GeoIndexer.class);
} else {
geoIndexer = instantiate(geoIndexerType.getGeoIndexerClassString(), GeoIndexer.class);
}
geoIndexer.setConf(conf);
freeTextIndexer = new AccumuloFreeTextIndexer();
freeTextIndexer.setConf(conf);
temporalIndexer = new AccumuloTemporalIndexer();
temporalIndexer.setConf(conf);
}
init = true;
}
}
Aggregations