HBaseStore extends Store { @Override public void initialise(final String graphId, final Schema schema, final StoreProperties properties) throws StoreException { preInitialise(graphId, schema, properties); TableUtils.ensureTableExists(this); }  @Override void initialise(final String graphId, final Schema schema, final StoreProperties properties); void preInitialise(final String graphId, final Schema schema, final StoreProperties properties); Configuration getConfiguration(); Connection getConnection(); TableName getTableName(); Table getTable(); HBaseRetriever<OP> createRetriever(final OP operation,
                    final User user,
                    final Iterable<? extends ElementId> ids,
                    final boolean includeMatchedVertex,
                    final Class<?>... extraProcessors); @Override void validateSchemas(); @Override Set<StoreTrait> getTraits(); @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST_OF_RETURN_VALUE", justification = "The properties should always be HBaseProperties") @Override HBaseProperties getProperties(); static final Set<StoreTrait> TRAITS; }
@Test public void shouldCreateAStoreUsingGraphIdIfItIsEqualToTableName() throws Exception { final HBaseProperties properties = HBaseProperties.loadStoreProperties(StreamUtil.storeProps(HBaseStoreTest.class)); properties.setTable("tableName"); final SingleUseMiniHBaseStore store = new SingleUseMiniHBaseStore(); store.initialise("tableName", SCHEMA, properties); assertEquals("tableName", store.getGraphId()); }
@Test public void shouldThrowExceptionIfGraphIdAndTableNameAreProvidedAndDifferent() throws Exception { final HBaseProperties properties = HBaseProperties.loadStoreProperties(StreamUtil.storeProps(HBaseStoreTest.class)); properties.setTable("tableName"); final SingleUseMiniHBaseStore store = new SingleUseMiniHBaseStore(); try { store.initialise("graphId", SCHEMA, properties); fail("Exception expected"); } catch (final IllegalArgumentException e) { assertNotNull(e.getMessage()); } }
@Test public void shouldCreateAStoreUsingGraphId() throws Exception { final HBaseProperties properties = HBaseProperties.loadStoreProperties(StreamUtil.storeProps(HBaseStoreTest.class)); final SingleUseMiniHBaseStore store = new SingleUseMiniHBaseStore(); store.initialise("graphId", SCHEMA, properties); assertEquals("graphId", store.getGraphId()); }