Search in sources :

Example 16 with StatefulMongoDBRdfConfiguration

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;
    }
}
Also used : StatefulMongoDBRdfConfiguration(org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration) AccumuloIndexSetProvider(org.apache.rya.indexing.pcj.matching.provider.AccumuloIndexSetProvider) MongoPcjIndexSetProvider(org.apache.rya.indexing.mongodb.pcj.MongoPcjIndexSetProvider)

Example 17 with StatefulMongoDBRdfConfiguration

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;
    }
}
Also used : StatefulMongoDBRdfConfiguration(org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration) AccumuloFreeTextIndexer(org.apache.rya.indexing.accumulo.freetext.AccumuloFreeTextIndexer) AccumuloTemporalIndexer(org.apache.rya.indexing.accumulo.temporal.AccumuloTemporalIndexer) AccumuloTemporalIndexer(org.apache.rya.indexing.accumulo.temporal.AccumuloTemporalIndexer) MongoSecondaryIndex(org.apache.rya.mongodb.MongoSecondaryIndex) AccumuloFreeTextIndexer(org.apache.rya.indexing.accumulo.freetext.AccumuloFreeTextIndexer)

Aggregations

StatefulMongoDBRdfConfiguration (org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration)17 MongoDBRyaDAO (org.apache.rya.mongodb.MongoDBRyaDAO)8 MongoClient (com.mongodb.MongoClient)6 MongoSecondaryIndex (org.apache.rya.mongodb.MongoSecondaryIndex)5 Test (org.junit.Test)5 LiteralImpl (org.openrdf.model.impl.LiteralImpl)5 URIImpl (org.openrdf.model.impl.URIImpl)5 RdfCloudTripleStore (org.apache.rya.rdftriplestore.RdfCloudTripleStore)4 SailRepositoryConnection (org.openrdf.repository.sail.SailRepositoryConnection)4 HashSet (java.util.HashSet)3 RyaDetailsRepositoryException (org.apache.rya.api.instance.RyaDetailsRepository.RyaDetailsRepositoryException)3 MongoRyaStatementStore (org.apache.rya.export.mongo.MongoRyaStatementStore)3 TimestampPolicyMongoRyaStatementStore (org.apache.rya.export.mongo.policy.TimestampPolicyMongoRyaStatementStore)3 ExternalTupleSet (org.apache.rya.indexing.external.tupleSet.ExternalTupleSet)3 MongoPcjIndexSetProvider (org.apache.rya.indexing.mongodb.pcj.MongoPcjIndexSetProvider)3 PcjMetadata (org.apache.rya.indexing.pcj.storage.PcjMetadata)3 MongoDBRdfConfiguration (org.apache.rya.mongodb.MongoDBRdfConfiguration)3 MongoRyaInstanceDetailsRepository (org.apache.rya.mongodb.instance.MongoRyaInstanceDetailsRepository)3 RyaSailRepository (org.apache.rya.rdftriplestore.RyaSailRepository)3 Statement (org.openrdf.model.Statement)3