Search in sources :

Example 1 with AccumuloRdfConfiguration

use of org.apache.rya.accumulo.AccumuloRdfConfiguration in project incubator-rya by apache.

the class AccumuloIndexSetColumnVisibilityTest method getConf.

private static Configuration getConf() {
    final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
    conf.set(RdfCloudTripleStoreConfiguration.CONF_TBL_PREFIX, ryaInstanceName);
    conf.set(ConfigUtils.CLOUDBASE_USER, "root");
    conf.set(ConfigUtils.CLOUDBASE_PASSWORD, "password");
    conf.set(ConfigUtils.CLOUDBASE_INSTANCE, instance);
    conf.set(ConfigUtils.CLOUDBASE_ZOOKEEPERS, zooKeepers);
    conf.set(RdfCloudTripleStoreConfiguration.CONF_QUERY_AUTH, "U,USA");
    return conf;
}
Also used : AccumuloRdfConfiguration(org.apache.rya.accumulo.AccumuloRdfConfiguration)

Example 2 with AccumuloRdfConfiguration

use of org.apache.rya.accumulo.AccumuloRdfConfiguration in project incubator-rya by apache.

the class AccumuloDocIndexerTest method init.

@Before
public void init() throws Exception {
    final String INSTANCE = "instance";
    Configuration config = new Configuration();
    config.set(ConfigUtils.CLOUDBASE_AUTHS, "U");
    config.set(ConfigUtils.CLOUDBASE_INSTANCE, INSTANCE);
    config.set(ConfigUtils.CLOUDBASE_USER, "root");
    config.set(ConfigUtils.CLOUDBASE_PASSWORD, "");
    conf = new AccumuloRdfConfiguration(config);
    conf.set(ConfigUtils.USE_MOCK_INSTANCE, "true");
    conf.setAdditionalIndexers(EntityCentricIndex.class);
    conf.setTablePrefix("EntityCentric_");
    tableName = EntityCentricIndex.getTableName(conf);
    // Access the accumulo instance.  If you assign a name, it persists statically, but otherwise, can't get it by name.
    accCon = new MockInstance(INSTANCE).getConnector("root", new PasswordToken(""));
    if (accCon.tableOperations().exists(tableName)) {
        throw new Exception("New mock accumulo already has a table!  Should be deleted in AfterTest.");
    }
    // This should happen in the index initialization, but some tests need it before:
    accCon.tableOperations().create(tableName);
}
Also used : PasswordToken(org.apache.accumulo.core.client.security.tokens.PasswordToken) Configuration(org.apache.hadoop.conf.Configuration) AccumuloRdfConfiguration(org.apache.rya.accumulo.AccumuloRdfConfiguration) MockInstance(org.apache.accumulo.core.client.mock.MockInstance) AccumuloRdfConfiguration(org.apache.rya.accumulo.AccumuloRdfConfiguration) QueryEvaluationException(org.openrdf.query.QueryEvaluationException) Before(org.junit.Before)

Example 3 with AccumuloRdfConfiguration

use of org.apache.rya.accumulo.AccumuloRdfConfiguration in project incubator-rya by apache.

the class AccumuloStatementMetadataOptimizerIT method getConf.

private static RdfCloudTripleStoreConfiguration getConf() {
    RdfCloudTripleStoreConfiguration conf;
    Set<RyaURI> propertySet = new HashSet<RyaURI>(Arrays.asList(new RyaURI("http://createdBy"), new RyaURI("http://createdOn")));
    conf = new AccumuloRdfConfiguration();
    conf.setBoolean(ConfigUtils.USE_MOCK_INSTANCE, true);
    conf.set(RdfCloudTripleStoreConfiguration.CONF_TBL_PREFIX, "rya_");
    conf.set(ConfigUtils.CLOUDBASE_USER, "root");
    conf.set(ConfigUtils.CLOUDBASE_PASSWORD, "");
    conf.set(ConfigUtils.CLOUDBASE_INSTANCE, "instance");
    conf.set(ConfigUtils.CLOUDBASE_AUTHS, "");
    conf.setUseStatementMetadata(true);
    conf.setStatementMetadataProperties(propertySet);
    return conf;
}
Also used : RyaURI(org.apache.rya.api.domain.RyaURI) RdfCloudTripleStoreConfiguration(org.apache.rya.api.RdfCloudTripleStoreConfiguration) AccumuloRdfConfiguration(org.apache.rya.accumulo.AccumuloRdfConfiguration) HashSet(java.util.HashSet)

Example 4 with AccumuloRdfConfiguration

use of org.apache.rya.accumulo.AccumuloRdfConfiguration in project incubator-rya by apache.

the class StatementMetadataExample method getConf.

private static AccumuloRdfConfiguration getConf() {
    AccumuloRdfConfiguration conf;
    Set<RyaURI> propertySet = new HashSet<RyaURI>(Arrays.asList(new RyaURI("http://createdBy"), new RyaURI("http://createdOn"), new RyaURI("http://hasTimeStamp")));
    conf = new AccumuloRdfConfiguration();
    conf.setDisplayQueryPlan(false);
    conf.setBoolean(ConfigUtils.USE_MOCK_INSTANCE, true);
    conf.set(RdfCloudTripleStoreConfiguration.CONF_TBL_PREFIX, "rya_");
    conf.set(ConfigUtils.CLOUDBASE_USER, "root");
    conf.set(ConfigUtils.CLOUDBASE_PASSWORD, "");
    conf.set(ConfigUtils.CLOUDBASE_INSTANCE, "instance");
    conf.set(ConfigUtils.CLOUDBASE_AUTHS, "");
    conf.setUseStatementMetadata(true);
    conf.setStatementMetadataProperties(propertySet);
    return conf;
}
Also used : RyaURI(org.apache.rya.api.domain.RyaURI) AccumuloRdfConfiguration(org.apache.rya.accumulo.AccumuloRdfConfiguration) HashSet(java.util.HashSet)

Example 5 with AccumuloRdfConfiguration

use of org.apache.rya.accumulo.AccumuloRdfConfiguration in project incubator-rya by apache.

the class QueryBenchmark method setup.

@Setup
public void setup() throws Exception {
    // Setup logging.
    final ConsoleAppender console = new ConsoleAppender();
    console.setLayout(new PatternLayout("%d [%p|%c|%C{1}] %m%n"));
    console.setThreshold(Level.INFO);
    console.activateOptions();
    Logger.getRootLogger().addAppender(console);
    // Load the benchmark's configuration file.
    final InputStream queriesStream = Files.newInputStream(QUERY_BENCHMARK_CONFIGURATION_FILE);
    final QueriesBenchmarkConf benchmarkConf = new QueriesBenchmarkConfReader().load(queriesStream);
    // Create the Rya Configuration object using the benchmark's configuration.
    final AccumuloRdfConfiguration ryaConf = new AccumuloRdfConfiguration();
    final Rya rya = benchmarkConf.getRya();
    ryaConf.setTablePrefix(rya.getRyaInstanceName());
    final Accumulo accumulo = rya.getAccumulo();
    ryaConf.set(ConfigUtils.CLOUDBASE_USER, accumulo.getUsername());
    ryaConf.set(ConfigUtils.CLOUDBASE_PASSWORD, accumulo.getPassword());
    ryaConf.set(ConfigUtils.CLOUDBASE_ZOOKEEPERS, accumulo.getZookeepers());
    ryaConf.set(ConfigUtils.CLOUDBASE_INSTANCE, accumulo.getInstanceName());
    // Print the query plan so that you can visually inspect how PCJs are being applied for each benchmark.
    ryaConf.set(ConfigUtils.DISPLAY_QUERY_PLAN, "true");
    // Turn on PCJs if we are configured to use them.
    final SecondaryIndexing secondaryIndexing = rya.getSecondaryIndexing();
    if (secondaryIndexing.isUsePCJ()) {
        ryaConf.set(ConfigUtils.USE_PCJ, "true");
        ryaConf.set(ConfigUtils.PCJ_STORAGE_TYPE, PrecomputedJoinStorageType.ACCUMULO.toString());
        ryaConf.set(ConfigUtils.PCJ_UPDATER_TYPE, PrecomputedJoinUpdaterType.NO_UPDATE.toString());
    } else {
        ryaConf.set(ConfigUtils.USE_PCJ, "false");
    }
    // Create the connections used to execute the benchmark.
    sail = RyaSailFactory.getInstance(ryaConf);
    sailConn = sail.getConnection();
}
Also used : ConsoleAppender(org.apache.log4j.ConsoleAppender) InputStream(java.io.InputStream) Accumulo(org.apache.rya.benchmark.query.Rya.Accumulo) PatternLayout(org.apache.log4j.PatternLayout) AccumuloRdfConfiguration(org.apache.rya.accumulo.AccumuloRdfConfiguration) SecondaryIndexing(org.apache.rya.benchmark.query.Rya.SecondaryIndexing) Setup(org.openjdk.jmh.annotations.Setup)

Aggregations

AccumuloRdfConfiguration (org.apache.rya.accumulo.AccumuloRdfConfiguration)108 MockInstance (org.apache.accumulo.core.client.mock.MockInstance)26 AccumuloRyaDAO (org.apache.rya.accumulo.AccumuloRyaDAO)25 Test (org.junit.Test)24 RyaURI (org.apache.rya.api.domain.RyaURI)22 Connector (org.apache.accumulo.core.client.Connector)21 PasswordToken (org.apache.accumulo.core.client.security.tokens.PasswordToken)20 RyaStatement (org.apache.rya.api.domain.RyaStatement)20 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)15 Sail (org.openrdf.sail.Sail)15 RyaType (org.apache.rya.api.domain.RyaType)14 StatementPattern (org.openrdf.query.algebra.StatementPattern)14 AccumuloException (org.apache.accumulo.core.client.AccumuloException)13 Before (org.junit.Before)13 ArrayList (java.util.ArrayList)12 RdfCloudTripleStore (org.apache.rya.rdftriplestore.RdfCloudTripleStore)12 RyaDAOException (org.apache.rya.api.persist.RyaDAOException)11 LiteralImpl (org.openrdf.model.impl.LiteralImpl)10 BindingSet (org.openrdf.query.BindingSet)10 QueryEvaluationException (org.openrdf.query.QueryEvaluationException)10