DefaultCommandStore extends AbstractStore implements CommandStore { @Override public long totalLength() { synchronized (cmdFileCtxRefLock) { return cmdFileCtxRef.get().totalLength(); } } DefaultCommandStore(File file, int maxFileSize, KeeperMonitor keeperMonitor);  DefaultCommandStore(File file, int maxFileSize, int minTimeMilliToGcAfterModified, IntSupplier fileNumToKeep, long commandReaderFlyingThreshold, KeeperMonitor keeperMonitor); @Override int appendCommands(ByteBuf byteBuf); @Override long totalLength(); @Override CommandReader beginRead(long startOffset); @Override boolean awaitCommandsOffset(long offset, int timeMilli); @Override long lowestReadingOffset(); @Override void addCommandsListener(long offset, final CommandsListener listener); @Override void close(); @Override void destroy(); @Override String toString(); String simpleDesc(); @Override long lowestAvailableOffset(); @Override void gc(); static final long DEFAULT_COMMAND_READER_FLYING_THRESHOLD; }
@Test public void testInterruptClose() throws InterruptedException{ Thread thread = new Thread(new AbstractExceptionLogTask() { @Override protected void doRun() throws Exception { while(true){ commandStore.totalLength(); sleep(10); } } }); thread.start(); thread.interrupt(); thread.join(100); commandStore.totalLength(); }