@Test public void connectionExceptionMarksUnsuccessful() throws Exception { Throwable cause = new IOException("exception for testing purposes") { }; doThrow(cause).when(writer).insertRollups( Matchers.<ArrayList<SingleRollupWriteContext>>any()); rbwr.run(); verify(writer).insertRollups(Matchers.<ArrayList<SingleRollupWriteContext>>any()); verifyNoMoreInteractions(writer); verify(ctx).markUnsuccessful(Matchers.<Throwable>any()); verify(ctx).decrementWriteCounter(anyLong()); verifyNoMoreInteractions(ctx); }
@Override public void run() { Timer.Context ctx = batchWriteTimer.time(); try { metricsRW.insertRollups(writeContexts); } catch (Exception e) { LOG.warn("not able to insert rollups", e); executionContext.markUnsuccessful(e); } finally { executionContext.decrementWriteCounter(writeContexts.size()); rollupsPerBatch.update(writeContexts.size()); rollupsWriteRate.mark(writeContexts.size()); RollupService.lastRollupTime.set(System.currentTimeMillis()); ctx.stop(); } }
RollupBatchWriteRunnable implements Runnable { @Override public void run() { Timer.Context ctx = batchWriteTimer.time(); try { metricsRW.insertRollups(writeContexts); } catch (Exception e) { LOG.warn("not able to insert rollups", e); executionContext.markUnsuccessful(e); } finally { executionContext.decrementWriteCounter(writeContexts.size()); rollupsPerBatch.update(writeContexts.size()); rollupsWriteRate.mark(writeContexts.size()); RollupService.lastRollupTime.set(System.currentTimeMillis()); ctx.stop(); } } }
RollupBatchWriteRunnable implements Runnable { @Override public void run() { Timer.Context ctx = batchWriteTimer.time(); try { metricsRW.insertRollups(writeContexts); } catch (Exception e) { LOG.warn("not able to insert rollups", e); executionContext.markUnsuccessful(e); } finally { executionContext.decrementWriteCounter(writeContexts.size()); rollupsPerBatch.update(writeContexts.size()); rollupsWriteRate.mark(writeContexts.size()); RollupService.lastRollupTime.set(System.currentTimeMillis()); ctx.stop(); } } RollupBatchWriteRunnable(List<SingleRollupWriteContext> writeContexts,
                                    RollupExecutionContext executionContext,
                                    AbstractMetricsRW metricsRW); }
RollupBatchWriteRunnable implements Runnable { @Override public void run() { Timer.Context ctx = batchWriteTimer.time(); try { metricsRW.insertRollups(writeContexts); } catch (Exception e) { LOG.warn("not able to insert rollups", e); executionContext.markUnsuccessful(e); } finally { executionContext.decrementWriteCounter(writeContexts.size()); rollupsPerBatch.update(writeContexts.size()); rollupsWriteRate.mark(writeContexts.size()); RollupService.lastRollupTime.set(System.currentTimeMillis()); ctx.stop(); } } RollupBatchWriteRunnable(List<SingleRollupWriteContext> writeContexts,
                                    RollupExecutionContext executionContext,
                                    AbstractMetricsRW metricsRW); @Override void run(); }
RollupBatchWriteRunnable implements Runnable { @Override public void run() { Timer.Context ctx = batchWriteTimer.time(); try { metricsRW.insertRollups(writeContexts); } catch (Exception e) { LOG.warn("not able to insert rollups", e); executionContext.markUnsuccessful(e); } finally { executionContext.decrementWriteCounter(writeContexts.size()); rollupsPerBatch.update(writeContexts.size()); rollupsWriteRate.mark(writeContexts.size()); RollupService.lastRollupTime.set(System.currentTimeMillis()); ctx.stop(); } } RollupBatchWriteRunnable(List<SingleRollupWriteContext> writeContexts,
                                    RollupExecutionContext executionContext,
                                    AbstractMetricsRW metricsRW); @Override void run();  }