FileStore extends AbstractFileStore { @Override public void close() { try (ShutDownCloser ignored = shutDown.shutDown()) { fileStoreScheduler.close(); try { doFlush(); } catch (IOException e) { log.warn("Unable to flush the store", e); } Closer closer = Closer.create(); closer.register(repositoryLock::unlock); closer.register(tarFiles) ; closer.register(revisions); closeAndLogOnFail(closer); } System.gc(); fileReaper.reap(); log.info("TarMK closed: {}", directory); } FileStore(final FileStoreBuilder builder); Runnable getGCRunner(); GCNodeWriteMonitor getGCNodeWriteMonitor(); int readerCount(); int getSegmentCount(); FileStoreStats getStats(); void flush(); void tryFlush(); void fullGC(); void tailGC(); boolean compactFull(); boolean compactTail(); void cleanup(); @Override void collectBlobReferences(Consumer<String> collector); void cancelGC(); @Override @NotNull SegmentWriter getWriter(); @Override @NotNull TarRevisions getRevisions(); @Override void close(); @Override boolean containsSegment(SegmentId id); @Override @NotNull Segment readSegment(final SegmentId id); @Override void writeSegment(SegmentId id, byte[] buffer, int offset, int length);  }
@Test public void overlapping() throws Exception { FileStore fileStore = fileStoreBuilder(getFileStoreFolder()).build(); try { fileStoreBuilder(getFileStoreFolder()).build(); Assert.fail("should not be able to open 2 stores on the same path"); } catch (Exception ex) { } finally { fileStore.close(); } }