Search in sources :

Example 21 with RdfCloudTripleStore

use of org.apache.rya.rdftriplestore.RdfCloudTripleStore in project incubator-rya by apache.

the class MRReasoningUtils method getRepository.

/**
 * Get a Repository from the configuration variables
 */
static RyaSailRepository getRepository(Configuration conf) throws AccumuloException, AccumuloSecurityException {
    boolean mock = conf.getBoolean(MRUtils.AC_MOCK_PROP, false);
    String instance = conf.get(MRUtils.AC_INSTANCE_PROP, "instance");
    String username = conf.get(MRUtils.AC_USERNAME_PROP, "root");
    String password = conf.get(MRUtils.AC_PWD_PROP, "root");
    Instance accumulo;
    if (mock) {
        accumulo = new MockInstance(instance);
    } else {
        String zookeepers = conf.get(MRUtils.AC_ZK_PROP, "zoo");
        accumulo = new ZooKeeperInstance(instance, zookeepers);
    }
    Connector connector = accumulo.getConnector(username, new PasswordToken(password));
    AccumuloRdfConfiguration aconf = new AccumuloRdfConfiguration(conf);
    aconf.setTablePrefix(conf.get(MRUtils.TABLE_PREFIX_PROPERTY, RdfCloudTripleStoreConstants.TBL_PRFX_DEF));
    AccumuloRyaDAO dao = new AccumuloRyaDAO();
    dao.setConnector(connector);
    dao.setConf(aconf);
    RdfCloudTripleStore store = new RdfCloudTripleStore();
    store.setRyaDAO(dao);
    return new RyaSailRepository(store);
}
Also used : Connector(org.apache.accumulo.core.client.Connector) AccumuloRyaDAO(org.apache.rya.accumulo.AccumuloRyaDAO) RdfCloudTripleStore(org.apache.rya.rdftriplestore.RdfCloudTripleStore) PasswordToken(org.apache.accumulo.core.client.security.tokens.PasswordToken) MockInstance(org.apache.accumulo.core.client.mock.MockInstance) Instance(org.apache.accumulo.core.client.Instance) ZooKeeperInstance(org.apache.accumulo.core.client.ZooKeeperInstance) MockInstance(org.apache.accumulo.core.client.mock.MockInstance) RyaSailRepository(org.apache.rya.rdftriplestore.RyaSailRepository) AccumuloRdfConfiguration(org.apache.rya.accumulo.AccumuloRdfConfiguration) ZooKeeperInstance(org.apache.accumulo.core.client.ZooKeeperInstance)

Aggregations

RdfCloudTripleStore (org.apache.rya.rdftriplestore.RdfCloudTripleStore)21 AccumuloRdfConfiguration (org.apache.rya.accumulo.AccumuloRdfConfiguration)12 RyaSailRepository (org.apache.rya.rdftriplestore.RyaSailRepository)11 AccumuloRyaDAO (org.apache.rya.accumulo.AccumuloRyaDAO)10 SailRepository (org.openrdf.repository.sail.SailRepository)6 MockInstance (org.apache.accumulo.core.client.mock.MockInstance)5 StatefulMongoDBRdfConfiguration (org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration)5 InferenceEngine (org.apache.rya.rdftriplestore.inference.InferenceEngine)5 Test (org.junit.Test)5 PasswordToken (org.apache.accumulo.core.client.security.tokens.PasswordToken)4 MongoDBRyaDAO (org.apache.rya.mongodb.MongoDBRyaDAO)4 Statement (org.openrdf.model.Statement)4 StatementImpl (org.openrdf.model.impl.StatementImpl)4 SailRepositoryConnection (org.openrdf.repository.sail.SailRepositoryConnection)4 HashSet (java.util.HashSet)3 PcjMetadata (org.apache.rya.indexing.pcj.storage.PcjMetadata)3 NamespaceManager (org.apache.rya.rdftriplestore.namespace.NamespaceManager)3 LiteralImpl (org.openrdf.model.impl.LiteralImpl)3 NumericLiteralImpl (org.openrdf.model.impl.NumericLiteralImpl)3 URIImpl (org.openrdf.model.impl.URIImpl)3