@Test public void shouldFailingTimeSeriesNotBePropagated() throws IOException { final CloseableStorage storage = new CloseableStorage(); final Database database = new Database(Mockito.mock(Dispatcher.class), createStorageFactory(storage)); create(database, "id1"); create(database, "id2"); database.close(); }
public boolean close(final String id) throws IOException { Preconditions.checkNotNull(id, "null id"); final Pair<WindowedTimeSeries, ?> pair = this.timeSeriess.remove(id); if (pair != null) { pair.first.close(); return true; } return false; }
Database implements Closeable { public boolean close(final String id) throws IOException { Preconditions.checkNotNull(id, "null id"); final Pair<WindowedTimeSeries, ?> pair = this.timeSeriess.remove(id); if (pair != null) { pair.first.close(); return true; } return false; } }
Database implements Closeable { public boolean close(final String id) throws IOException { Preconditions.checkNotNull(id, "null id"); final Pair<WindowedTimeSeries, ?> pair = this.timeSeriess.remove(id); if (pair != null) { pair.first.close(); return true; } return false; } Database(final Dispatcher dispatcher, final StorageFactory<?> storageFactory); }
Database implements Closeable { public boolean close(final String id) throws IOException { Preconditions.checkNotNull(id, "null id"); final Pair<WindowedTimeSeries, ?> pair = this.timeSeriess.remove(id); if (pair != null) { pair.first.close(); return true; } return false; } Database(final Dispatcher dispatcher, final StorageFactory<?> storageFactory); WindowedTimeSeries createOrOpen(final String id, final long duration, final Window ... windows); WindowedTimeSeries createOrOpen(final String id, final int granularity, final long duration, final Window ... windows); Optional<Map<Window, ? extends Reader>> getReaders(final String id); boolean close(final String id); @Idempotent @Override void close(); }
Database implements Closeable { public boolean close(final String id) throws IOException { Preconditions.checkNotNull(id, "null id"); final Pair<WindowedTimeSeries, ?> pair = this.timeSeriess.remove(id); if (pair != null) { pair.first.close(); return true; } return false; } Database(final Dispatcher dispatcher, final StorageFactory<?> storageFactory); WindowedTimeSeries createOrOpen(final String id, final long duration, final Window ... windows); WindowedTimeSeries createOrOpen(final String id, final int granularity, final long duration, final Window ... windows); Optional<Map<Window, ? extends Reader>> getReaders(final String id); boolean close(final String id); @Idempotent @Override void close();  }