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