private void doDraw(String bucket, Iterable<Mark> marks, long timestamp) { try { writer.write(bucket, marks, timestamp); } catch (IOException e) { throw new RuntimeException("Can't draw mark to bucket " + bucket, e); } }
/** @inheritDoc */ @Override public void close() throws IOException { try { if (!blocking) { background.shutdownNow(); try { background.awaitTermination(10, TimeUnit.SECONDS); } catch (InterruptedException e) { throw new IOException("Shutdown thread is interrupted", e); } } } finally { writer.close(); } }