Beispiel #1
0
 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);
   }
 }
Beispiel #2
0
 /** @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();
   }
 }