@Test public void testCreatePersistentStore() throws IOException { try (Backend backend = context().factory().createBackend(context().createUri(currentTempFile()), context().config())) { try (Store store = StoreFactory.getInstance().createStore(backend, context().config())) { assertThat(store).isInstanceOf(NoopStore.class); assertThat(store.backend()).isSameAs(backend); } } }
@Nonnull @Override public Backend createBackend(URI uri, ImmutableConfig baseConfig) { checkNotNull(uri, "uri"); checkNotNull(baseConfig, "baseConfig"); checkArgument(uri.isFile() || uri.isHierarchical(), "URI '%s' must be either file-based or hierarchical", uri.toString()); try { return uri.isFile() ? createLocalBackend(uri, baseConfig) : createRemoteBackend(uri, baseConfig); } catch (Exception e) { throw new InvalidBackendException("Unable to create/open the database", e); } }
AbstractBackendFactory extends AbstractMapperFactory implements BackendFactory { @Nonnull @Override public Backend createBackend(URI uri, ImmutableConfig baseConfig) { checkNotNull(uri, "uri"); checkNotNull(baseConfig, "baseConfig"); checkArgument(uri.isFile() || uri.isHierarchical(), "URI '%s' must be either file-based or hierarchical", uri.toString()); try { return uri.isFile() ? createLocalBackend(uri, baseConfig) : createRemoteBackend(uri, baseConfig); } catch (Exception e) { throw new InvalidBackendException("Unable to create/open the database", e); } } }
AbstractBackendFactory extends AbstractMapperFactory implements BackendFactory { @Nonnull @Override public Backend createBackend(URI uri, ImmutableConfig baseConfig) { checkNotNull(uri, "uri"); checkNotNull(baseConfig, "baseConfig"); checkArgument(uri.isFile() || uri.isHierarchical(), "URI '%s' must be either file-based or hierarchical", uri.toString()); try { return uri.isFile() ? createLocalBackend(uri, baseConfig) : createRemoteBackend(uri, baseConfig); } catch (Exception e) { throw new InvalidBackendException("Unable to create/open the database", e); } } protected  AbstractBackendFactory(String name); protected  AbstractBackendFactory(String name, boolean supportsTransient); }
AbstractBackendFactory extends AbstractMapperFactory implements BackendFactory { @Nonnull @Override public Backend createBackend(URI uri, ImmutableConfig baseConfig) { checkNotNull(uri, "uri"); checkNotNull(baseConfig, "baseConfig"); checkArgument(uri.isFile() || uri.isHierarchical(), "URI '%s' must be either file-based or hierarchical", uri.toString()); try { return uri.isFile() ? createLocalBackend(uri, baseConfig) : createRemoteBackend(uri, baseConfig); } catch (Exception e) { throw new InvalidBackendException("Unable to create/open the database", e); } } protected  AbstractBackendFactory(String name); protected  AbstractBackendFactory(String name, boolean supportsTransient); @Override final String name(); @Override boolean supportsTransient(); @Nonnull @Override Backend createBackend(URI uri, ImmutableConfig baseConfig); }
AbstractBackendFactory extends AbstractMapperFactory implements BackendFactory { @Nonnull @Override public Backend createBackend(URI uri, ImmutableConfig baseConfig) { checkNotNull(uri, "uri"); checkNotNull(baseConfig, "baseConfig"); checkArgument(uri.isFile() || uri.isHierarchical(), "URI '%s' must be either file-based or hierarchical", uri.toString()); try { return uri.isFile() ? createLocalBackend(uri, baseConfig) : createRemoteBackend(uri, baseConfig); } catch (Exception e) { throw new InvalidBackendException("Unable to create/open the database", e); } } protected  AbstractBackendFactory(String name); protected  AbstractBackendFactory(String name, boolean supportsTransient); @Override final String name(); @Override boolean supportsTransient(); @Nonnull @Override Backend createBackend(URI uri, ImmutableConfig baseConfig);  }