Search in sources :

Example 1 with AccumuloPcjStorageSupplier

use of org.apache.rya.indexing.external.accumulo.AccumuloPcjStorageSupplier in project incubator-rya by apache.

the class PrecomputedJoinStorageSupplierTest method configuredForAccumulo.

@Test
public void configuredForAccumulo() {
    // Create a supplier that does not return any configuration.
    final Supplier<Configuration> configSupplier = mock(Supplier.class);
    final Configuration config = new Configuration();
    config.set(PrecomputedJoinIndexerConfig.PCJ_STORAGE_TYPE, PrecomputedJoinStorageType.ACCUMULO.toString());
    when(configSupplier.get()).thenReturn(config);
    final AccumuloPcjStorageSupplier accumuloSupplier = mock(AccumuloPcjStorageSupplier.class);
    final AccumuloPcjStorage mockAccumuloStorage = mock(AccumuloPcjStorage.class);
    when(accumuloSupplier.get()).thenReturn(mockAccumuloStorage);
    final PrecomputedJoinStorageSupplier storageSupplier = new PrecomputedJoinStorageSupplier(configSupplier, accumuloSupplier);
    // Ensure the mock AccumuloPcjStorage is what was returned.
    final PrecomputedJoinStorage storage = storageSupplier.get();
    assertEquals(mockAccumuloStorage, storage);
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) AccumuloPcjStorage(org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage) PrecomputedJoinStorage(org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage) AccumuloPcjStorageSupplier(org.apache.rya.indexing.external.accumulo.AccumuloPcjStorageSupplier) Test(org.junit.Test)

Aggregations

Configuration (org.apache.hadoop.conf.Configuration)1 AccumuloPcjStorageSupplier (org.apache.rya.indexing.external.accumulo.AccumuloPcjStorageSupplier)1 PrecomputedJoinStorage (org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage)1 AccumuloPcjStorage (org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage)1 Test (org.junit.Test)1