use of org.apache.rya.accumulo.AccumuloRdfConfiguration in project incubator-rya by apache.
the class ProspectorServiceEvalStatsDAO method make.
/**
* Creates an instance of {@link ProspectorServiceEvalStatsDAO} that is connected to the Accumulo and Rya instance
* that is specified within the provided {@link Configuration}.
*
* @param config - Configures which instance of Accumulo Rya this DAO will be backed by. (not null)
* @return A new instance of {@link ProspectorServiceEvalStatsDAO}.
* @throws AccumuloException The connector couldn't be created because of an Accumulo problem.
* @throws AccumuloSecurityException The connector couldn't be created because of an Accumulo security violation.
*/
public static ProspectorServiceEvalStatsDAO make(Configuration config) throws AccumuloException, AccumuloSecurityException {
requireNonNull(config);
AccumuloRdfConfiguration accConfig = new AccumuloRdfConfiguration(config);
return new ProspectorServiceEvalStatsDAO(ConnectorFactory.connect(accConfig), accConfig);
}
use of org.apache.rya.accumulo.AccumuloRdfConfiguration in project incubator-rya by apache.
the class AccumuloBatchUpdatePCJ method connectToRya.
private Sail connectToRya(final String ryaInstanceName) throws RyaClientException {
try {
final AccumuloConnectionDetails connectionDetails = super.getAccumuloConnectionDetails();
final AccumuloRdfConfiguration ryaConf = new AccumuloRdfConfiguration();
ryaConf.setTablePrefix(ryaInstanceName);
ryaConf.set(ConfigUtils.CLOUDBASE_USER, connectionDetails.getUsername());
ryaConf.set(ConfigUtils.CLOUDBASE_PASSWORD, new String(connectionDetails.getUserPass()));
ryaConf.set(ConfigUtils.CLOUDBASE_ZOOKEEPERS, connectionDetails.getZookeepers());
ryaConf.set(ConfigUtils.CLOUDBASE_INSTANCE, connectionDetails.getInstanceName());
// Turn PCJs off so that we will only scan the core Rya tables while building the PCJ results.
ryaConf.set(ConfigUtils.USE_PCJ, "false");
return RyaSailFactory.getInstance(ryaConf);
} catch (SailException | AccumuloException | AccumuloSecurityException | RyaDAOException | InferenceEngineException e) {
throw new RyaClientException("Could not connect to the Rya instance named '" + ryaInstanceName + "'.", e);
}
}
use of org.apache.rya.accumulo.AccumuloRdfConfiguration in project incubator-rya by apache.
the class PcjTablesIT method setupRya.
/**
* Format a Mini Accumulo to be a Rya repository.
*
* @return The Rya repository sitting on top of the Mini Accumulo.
*/
private RyaSailRepository setupRya() throws AccumuloException, AccumuloSecurityException, RepositoryException {
// Setup the Rya Repository that will be used to create Repository Connections.
final RdfCloudTripleStore ryaStore = new RdfCloudTripleStore();
final AccumuloRyaDAO crdfdao = new AccumuloRyaDAO();
crdfdao.setConnector(cluster.getConnector());
// Setup Rya configuration values.
final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
conf.setTablePrefix(getRyaInstanceName());
conf.setDisplayQueryPlan(true);
conf.setBoolean(USE_MOCK_INSTANCE, false);
conf.set(RdfCloudTripleStoreConfiguration.CONF_TBL_PREFIX, getRyaInstanceName());
conf.set(CLOUDBASE_USER, cluster.getUsername());
conf.set(CLOUDBASE_PASSWORD, cluster.getPassword());
conf.set(CLOUDBASE_INSTANCE, cluster.getInstanceName());
crdfdao.setConf(conf);
ryaStore.setRyaDAO(crdfdao);
final RyaSailRepository ryaRepo = new RyaSailRepository(ryaStore);
ryaRepo.initialize();
return ryaRepo;
}
use of org.apache.rya.accumulo.AccumuloRdfConfiguration in project incubator-rya by apache.
the class GeoIndexerTest method before.
@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);
}
}
use of org.apache.rya.accumulo.AccumuloRdfConfiguration in project incubator-rya by apache.
the class GeoWaveFeatureReaderTest method setupConf.
private void setupConf() throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
conf = new AccumuloRdfConfiguration();
conf.setTablePrefix("triplestore_");
final String tableName = GeoWaveGeoIndexer.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_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);
}
}
Aggregations