use of org.apache.rya.accumulo.AccumuloRyaDAO in project incubator-rya by apache.
the class PcjAdminClient method makeRyaRepository.
private static RyaSailRepository makeRyaRepository(final PcjAdminClientProperties clientProps, final Connector accumulo) throws RepositoryException {
checkNotNull(clientProps);
checkNotNull(accumulo);
// Setup Rya configuration values.
final AccumuloRdfConfiguration ryaConf = new AccumuloRdfConfiguration();
ryaConf.setTablePrefix(clientProps.getRyaTablePrefix());
// Connect to the Rya repo.
final AccumuloRyaDAO accumuloRyaDao = new AccumuloRyaDAO();
accumuloRyaDao.setConnector(accumulo);
accumuloRyaDao.setConf(ryaConf);
final RdfCloudTripleStore ryaStore = new RdfCloudTripleStore();
ryaStore.setRyaDAO(accumuloRyaDao);
final RyaSailRepository ryaRepo = new RyaSailRepository(ryaStore);
ryaRepo.initialize();
return ryaRepo;
}
use of org.apache.rya.accumulo.AccumuloRyaDAO in project incubator-rya by apache.
the class DemoDriver method setupRya.
/**
* Format a Mini Accumulo to be a Rya repository.
*
* @param accumulo - The Mini Accumulo cluster Rya will sit on top of. (not null)
* @return The Rya repository sitting on top of the Mini Accumulo.
*/
private static RyaSailRepository setupRya(final MiniAccumuloCluster accumulo) throws AccumuloException, AccumuloSecurityException, RepositoryException, AlreadyInitializedException, RyaDetailsRepositoryException {
checkNotNull(accumulo);
// Setup the Rya Repository that will be used to create Repository Connections.
final RdfCloudTripleStore ryaStore = new RdfCloudTripleStore();
final AccumuloRyaDAO crdfdao = new AccumuloRyaDAO();
crdfdao.setConnector(accumuloConn);
// Setup Rya configuration values.
final String ryaInstanceName = "demo_";
final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
conf.setTablePrefix("demo_");
conf.setDisplayQueryPlan(true);
conf.setBoolean(USE_MOCK_INSTANCE, true);
conf.set(RdfCloudTripleStoreConfiguration.CONF_TBL_PREFIX, RYA_TABLE_PREFIX);
conf.set(CLOUDBASE_USER, "root");
conf.set(CLOUDBASE_PASSWORD, "password");
conf.set(CLOUDBASE_INSTANCE, accumulo.getInstanceName());
crdfdao.setConf(conf);
ryaStore.setRyaDAO(crdfdao);
final RyaSailRepository ryaRepo = new RyaSailRepository(ryaStore);
ryaRepo.initialize();
// Create Rya Details for the instance name.
final RyaDetailsRepository detailsRepo = new AccumuloRyaInstanceDetailsRepository(accumuloConn, ryaInstanceName);
final RyaDetails details = RyaDetails.builder().setRyaInstanceName(ryaInstanceName).setRyaVersion("0.0.0.0").setFreeTextDetails(new FreeTextIndexDetails(true)).setEntityCentricIndexDetails(new EntityCentricIndexDetails(true)).setTemporalIndexDetails(new TemporalIndexDetails(true)).setPCJIndexDetails(PCJIndexDetails.builder().setEnabled(true)).setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.<Date>absent())).setProspectorDetails(new ProspectorDetails(Optional.<Date>absent())).build();
detailsRepo.initialize(details);
return ryaRepo;
}
use of org.apache.rya.accumulo.AccumuloRyaDAO in project incubator-rya by apache.
the class AccumuloInstanceDriver method setUpDao.
/**
* Sets up the {@link AccumuloRyaDAO}.
* @throws Exception
*/
public void setUpDao() throws Exception {
// Setup dao
log.info("Creating " + driverName + " DAO");
dao = new AccumuloRyaDAO();
dao.setConnector(connector);
dao.setConf(config);
// Flush the tables before initializing the DAO
for (final String tableName : tableList) {
connector.tableOperations().flush(tableName, null, null, false);
}
dao.init();
}
use of org.apache.rya.accumulo.AccumuloRyaDAO in project incubator-rya by apache.
the class MergeJoinTest method init.
@Before
public void init() throws Exception {
dao = new AccumuloRyaDAO();
connector = new MockInstance().getConnector("", "");
dao.setConnector(connector);
dao.setConf(conf);
dao.init();
}
use of org.apache.rya.accumulo.AccumuloRyaDAO in project incubator-rya by apache.
the class RdfCloudTripleStoreTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
connector = new MockInstance().getConnector("", "");
RdfCloudTripleStore sail = new RdfCloudTripleStore();
AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
conf.setTablePrefix("lubm_");
sail.setConf(conf);
AccumuloRyaDAO crdfdao = new AccumuloRyaDAO();
crdfdao.setConnector(connector);
crdfdao.setConf(conf);
sail.setRyaDAO(crdfdao);
repository = new SailRepository(sail);
repository.initialize();
connection = repository.getConnection();
loadData();
}
Aggregations