Search in sources :

Example 1 with AccumuloMergeConfiguration

use of org.apache.rya.export.api.conf.AccumuloMergeConfiguration in project incubator-rya by apache.

the class StatementStoreFactory method getBaseStatementStore.

/**
 * @param isParent
 * @param config
 *          These parameters are hacks until the Accumulo DAO only accepts a connector.
 *          Once that happens this will be much, much cleaner, and make the {@link AccumuloInstanceDriver}
 *          obsolete.
 * @throws Exception
 */
private RyaStatementStore getBaseStatementStore(final DBType dbType, final String hostname, final int port, final String ryaInstancename, final String tablePrefix, final MergeConfiguration config, final boolean isParent) throws Exception {
    RyaStatementStore store;
    if (dbType == DBType.MONGO) {
        store = getBaseMongoStore(hostname, port, ryaInstancename);
    } else {
        final AccumuloMergeConfiguration aConfig = (AccumuloMergeConfiguration) config;
        final InstanceType type = isParent ? aConfig.getParentInstanceType() : aConfig.getChildInstanceType();
        store = getBaseAccumuloStore(ryaInstancename, type, isParent, ryaInstancename, tablePrefix, tablePrefix, tablePrefix, tablePrefix);
    }
    return store;
}
Also used : AccumuloMergeConfiguration(org.apache.rya.export.api.conf.AccumuloMergeConfiguration) InstanceType(org.apache.rya.export.InstanceType) MongoRyaStatementStore(org.apache.rya.export.mongo.MongoRyaStatementStore) AccumuloRyaStatementStore(org.apache.rya.export.accumulo.AccumuloRyaStatementStore) TimestampPolicyAccumuloRyaStatementStore(org.apache.rya.export.accumulo.policy.TimestampPolicyAccumuloRyaStatementStore) RyaStatementStore(org.apache.rya.export.api.store.RyaStatementStore) TimestampPolicyMongoRyaStatementStore(org.apache.rya.export.mongo.policy.TimestampPolicyMongoRyaStatementStore)

Example 2 with AccumuloMergeConfiguration

use of org.apache.rya.export.api.conf.AccumuloMergeConfiguration in project incubator-rya by apache.

the class AccumuloRyaStatementStoreTest method createAccumuloMergeConfiguration.

private static AccumuloMergeConfiguration createAccumuloMergeConfiguration() {
    final AccumuloMergeConfiguration accumuloMergeConfiguration = mock(AccumuloMergeConfiguration.class);
    when(accumuloMergeConfiguration.getParentRyaInstanceName()).thenReturn(INSTANCE_NAME);
    when(accumuloMergeConfiguration.getParentUsername()).thenReturn(USER_NAME);
    when(accumuloMergeConfiguration.getParentPassword()).thenReturn(PASSWORD);
    when(accumuloMergeConfiguration.getParentInstanceType()).thenReturn(INSTANCE_TYPE);
    when(accumuloMergeConfiguration.getParentTablePrefix()).thenReturn(RYA_TABLE_PREFIX);
    when(accumuloMergeConfiguration.getParentAuths()).thenReturn(AUTHS);
    // Other
    when(accumuloMergeConfiguration.getMergePolicy()).thenReturn(MergePolicy.TIMESTAMP);
    return accumuloMergeConfiguration;
}
Also used : AccumuloMergeConfiguration(org.apache.rya.export.api.conf.AccumuloMergeConfiguration)

Aggregations

AccumuloMergeConfiguration (org.apache.rya.export.api.conf.AccumuloMergeConfiguration)2 InstanceType (org.apache.rya.export.InstanceType)1 AccumuloRyaStatementStore (org.apache.rya.export.accumulo.AccumuloRyaStatementStore)1 TimestampPolicyAccumuloRyaStatementStore (org.apache.rya.export.accumulo.policy.TimestampPolicyAccumuloRyaStatementStore)1 RyaStatementStore (org.apache.rya.export.api.store.RyaStatementStore)1 MongoRyaStatementStore (org.apache.rya.export.mongo.MongoRyaStatementStore)1 TimestampPolicyMongoRyaStatementStore (org.apache.rya.export.mongo.policy.TimestampPolicyMongoRyaStatementStore)1