use of org.apache.rya.accumulo.AccumuloRdfConfiguration in project incubator-rya by apache.
the class GeoIndexerSfTest method before.
/**
* Run before each test method.
* @throws Exception
*/
@Before
public void before() throws Exception {
conf = new AccumuloRdfConfiguration();
conf.setTablePrefix("triplestore_");
final String tableName = GeoMesaGeoIndexer.getTableName(conf);
conf.setBoolean(ConfigUtils.USE_MOCK_INSTANCE, true);
conf.set(ConfigUtils.CLOUDBASE_USER, "USERNAME");
conf.set(ConfigUtils.CLOUDBASE_PASSWORD, "PASS");
conf.set(ConfigUtils.CLOUDBASE_INSTANCE, "INSTANCE");
conf.set(ConfigUtils.CLOUDBASE_ZOOKEEPERS, "localhost");
conf.set(ConfigUtils.CLOUDBASE_AUTHS, "U");
conf.set(OptionalConfigUtils.USE_GEO, "true");
conf.set(OptionalConfigUtils.GEO_INDEXER_TYPE, GeoIndexerType.GEO_MESA.toString());
final TableOperations tops = ConfigUtils.getConnector(conf).tableOperations();
// get all of the table names with the prefix
final Set<String> toDel = Sets.newHashSet();
for (final String t : tops.list()) {
if (t.startsWith(tableName)) {
toDel.add(t);
}
}
for (final String t : toDel) {
tops.delete(t);
}
g = new GeoMesaGeoIndexer();
g.setConf(conf);
// Convert the statements as schema WKT or GML, then GML has two methods to encode.
g.storeStatement(createRyaStatement(A, schemaToTest, encodeMethod));
g.storeStatement(createRyaStatement(B, schemaToTest, encodeMethod));
g.storeStatement(createRyaStatement(C, schemaToTest, encodeMethod));
g.storeStatement(createRyaStatement(D, schemaToTest, encodeMethod));
g.storeStatement(createRyaStatement(F, schemaToTest, encodeMethod));
g.storeStatement(createRyaStatement(E, schemaToTest, encodeMethod));
g.storeStatement(createRyaStatement(G, schemaToTest, encodeMethod));
}
use of org.apache.rya.accumulo.AccumuloRdfConfiguration in project incubator-rya by apache.
the class GeoWaveIndexerTest method before.
@Before
public void before() throws Exception {
conf = new AccumuloRdfConfiguration();
conf.setTablePrefix("triplestore_");
final String tableName = GeoWaveGeoIndexer.getTableName(conf);
conf.setBoolean(ConfigUtils.USE_MOCK_INSTANCE, IS_MOCK);
conf.set(ConfigUtils.CLOUDBASE_USER, ACCUMULO_USER);
conf.set(ConfigUtils.CLOUDBASE_PASSWORD, ACCUMULO_PASSWORD);
conf.set(ConfigUtils.CLOUDBASE_INSTANCE, IS_MOCK ? "INSTANCE" : accumulo.getInstanceName());
conf.set(ConfigUtils.CLOUDBASE_ZOOKEEPERS, IS_MOCK ? "localhost" : accumulo.getZooKeepers());
conf.set(ConfigUtils.CLOUDBASE_AUTHS, "U");
conf.set(OptionalConfigUtils.USE_GEO, "true");
conf.set(OptionalConfigUtils.GEO_INDEXER_TYPE, GeoIndexerType.GEO_WAVE.toString());
final TableOperations tops = ConfigUtils.getConnector(conf).tableOperations();
// get all of the table names with the prefix
final Set<String> toDel = Sets.newHashSet();
for (final String t : tops.list()) {
if (t.startsWith(tableName)) {
toDel.add(t);
}
}
for (final String t : toDel) {
tops.delete(t);
}
}
use of org.apache.rya.accumulo.AccumuloRdfConfiguration in project incubator-rya by apache.
the class RyaSailFactory method getRyaSail.
private static Sail getRyaSail(final Configuration config) throws InferenceEngineException, RyaDAOException, AccumuloException, AccumuloSecurityException, SailException {
final RdfCloudTripleStore store = new RdfCloudTripleStore();
final RyaDAO<?> dao;
final RdfCloudTripleStoreConfiguration rdfConfig;
final String user;
final String pswd;
// XXX Should(?) be MongoDBRdfConfiguration.MONGO_COLLECTION_PREFIX inside the if below. RYA-135
final String ryaInstance = config.get(RdfCloudTripleStoreConfiguration.CONF_TBL_PREFIX);
Objects.requireNonNull(ryaInstance, "RyaInstance or table prefix is missing from configuration." + RdfCloudTripleStoreConfiguration.CONF_TBL_PREFIX);
if (ConfigUtils.getUseMongo(config)) {
// Get a reference to a Mongo DB configuration object.
final MongoDBRdfConfiguration mongoConfig = (config instanceof MongoDBRdfConfiguration) ? (MongoDBRdfConfiguration) config : new MongoDBRdfConfiguration(config);
// Instantiate a Mongo client and Mongo DAO.
dao = getMongoDAO(mongoConfig);
// Then use the DAO's newly-created stateful conf in place of the original
rdfConfig = dao.getConf();
} else {
rdfConfig = new AccumuloRdfConfiguration(config);
user = rdfConfig.get(ConfigUtils.CLOUDBASE_USER);
pswd = rdfConfig.get(ConfigUtils.CLOUDBASE_PASSWORD);
Objects.requireNonNull(user, "Accumulo user name is missing from configuration." + ConfigUtils.CLOUDBASE_USER);
Objects.requireNonNull(pswd, "Accumulo user password is missing from configuration." + ConfigUtils.CLOUDBASE_PASSWORD);
rdfConfig.setTableLayoutStrategy(new TablePrefixLayoutStrategy(ryaInstance));
updateAccumuloConfig((AccumuloRdfConfiguration) rdfConfig, user, pswd, ryaInstance);
dao = getAccumuloDAO((AccumuloRdfConfiguration) rdfConfig);
}
store.setRyaDAO(dao);
rdfConfig.setTablePrefix(ryaInstance);
if (rdfConfig.isInfer()) {
final InferenceEngine inferenceEngine = new InferenceEngine();
inferenceEngine.setConf(rdfConfig);
inferenceEngine.setRyaDAO(dao);
inferenceEngine.init();
store.setInferenceEngine(inferenceEngine);
}
store.initialize();
return store;
}
use of org.apache.rya.accumulo.AccumuloRdfConfiguration in project incubator-rya by apache.
the class AccumuloAddUserIT method makeRyaConfig.
private static AccumuloRdfConfiguration makeRyaConfig(final String ryaInstanceName, final String username, final String password, final String instanceName, final String zookeepers) {
final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
conf.setTablePrefix(ryaInstanceName);
// Accumulo connection information.
conf.set(ConfigUtils.CLOUDBASE_USER, username);
conf.set(ConfigUtils.CLOUDBASE_PASSWORD, password);
conf.set(ConfigUtils.CLOUDBASE_INSTANCE, instanceName);
conf.set(ConfigUtils.CLOUDBASE_ZOOKEEPERS, zookeepers);
conf.set(ConfigUtils.CLOUDBASE_AUTHS, "");
return conf;
}
use of org.apache.rya.accumulo.AccumuloRdfConfiguration in project incubator-rya by apache.
the class RdfCloudTripleStoreSelectivityEvaluationStatisticsTest method init.
@Before
public void init() throws AccumuloException, AccumuloSecurityException, TableNotFoundException, TableExistsException {
mock = new MockInstance("accumulo");
PasswordToken pToken = new PasswordToken("pass".getBytes());
conn = mock.getConnector("user", pToken);
config = new BatchWriterConfig();
config.setMaxMemory(1000);
config.setMaxLatency(1000, TimeUnit.SECONDS);
config.setMaxWriteThreads(10);
if (conn.tableOperations().exists("rya_prospects")) {
conn.tableOperations().delete("rya_prospects");
}
if (conn.tableOperations().exists("rya_selectivity")) {
conn.tableOperations().delete("rya_selectivity");
}
arc = new AccumuloRdfConfiguration();
arc.setTableLayoutStrategy(new TablePrefixLayoutStrategy());
arc.setMaxRangesForScanner(300);
}
Aggregations