Fluency implements Flushable, Closeable { public boolean isTerminated() { return flusher.isTerminated(); } Fluency(Buffer buffer, Flusher flusher); void emit(final String tag, final long timestamp, final Map<String, Object> data); void emit(String tag, Map<String, Object> data); void emit(final String tag, final EventTime eventTime, final Map<String, Object> data); void emit(final String tag, final long timestamp, final byte[] mapValue, final int offset, final int len); void emit(String tag, byte[] mapValue, int offset, int len); void emit(final String tag, final EventTime eventTime, final byte[] mapValue, final int offset, final int len); void emit(final String tag, final long timestamp, final ByteBuffer mapValue); void emit(String tag, ByteBuffer mapValue); void emit(final String tag, final EventTime eventTime, final ByteBuffer mapValue); @Override void flush(); @Override void close(); void clearBackupFiles(); long getAllocatedBufferSize(); long getBufferedDataSize(); boolean isTerminated(); boolean waitUntilAllBufferFlushed(int maxWaitSeconds); boolean waitUntilFlusherTerminated(int maxWaitSeconds); Buffer getBuffer(); Flusher getFlusher(); @Override String toString();  }
@Test void testIsTerminated() throws IOException, InterruptedException { Buffer buffer = new Buffer(bufferConfig, new JsonRecordFormatter()); Flusher flusher = new Flusher(flusherConfig, buffer, ingester); try (Fluency fluency = new Fluency(buffer, flusher)) { assertFalse(fluency.isTerminated()); fluency.close(); TimeUnit.SECONDS.sleep(1); assertTrue(fluency.isTerminated()); } }