use of org.apache.drill.common.config.LogicalPlanPersistence in project drill by apache.
the class TestHBaseTableProvider method testTableProvider.
@Test
public void testTableProvider() throws StoreException {
LogicalPlanPersistence lp = PhysicalPlanReaderTestFactory.defaultLogicalPlanPersistence(config);
PersistentStore<String> hbaseStore = provider.getOrCreateStore(PersistentStoreConfig.newJacksonBuilder(lp.getMapper(), String.class).name("hbase").build());
hbaseStore.put("", "v0");
hbaseStore.put("k1", "v1");
hbaseStore.put("k2", "v2");
hbaseStore.put("k3", "v3");
hbaseStore.put("k4", "v4");
hbaseStore.put("k5", "v5");
hbaseStore.put(".test", "testValue");
assertEquals("v0", hbaseStore.get(""));
assertEquals("testValue", hbaseStore.get(".test"));
assertTrue(hbaseStore.contains(""));
assertFalse(hbaseStore.contains("unknown_key"));
assertEquals(7, Lists.newArrayList(hbaseStore.getAll()).size());
PersistentStore<String> hbaseTestStore = provider.getOrCreateStore(PersistentStoreConfig.newJacksonBuilder(lp.getMapper(), String.class).name("hbase.test").build());
hbaseTestStore.put("", "v0");
hbaseTestStore.put("k1", "v1");
hbaseTestStore.put("k2", "v2");
hbaseTestStore.put("k3", "v3");
hbaseTestStore.put("k4", "v4");
hbaseTestStore.put(".test", "testValue");
assertEquals("v0", hbaseStore.get(""));
assertEquals("testValue", hbaseStore.get(".test"));
assertEquals(6, Lists.newArrayList(hbaseTestStore.getAll()).size());
}
Aggregations