@Override
 public void run() {
   Timer.Context rollupTimerContext = rollupTimer.time();
   try {
     Rollup.Type rollupComputer =
         RollupRunnable.getRollupComputer(RollupType.BF_BASIC, Granularity.FULL);
     Rollup rollup = rollupComputer.compute(points);
     writer.enqueueRollupForWrite(
         new SingleRollupWriteContext(
             rollup, loc, Granularity.MIN_5, CassandraModel.CF_METRICS_5M, range.getStart()));
     log.info("Calculated and queued rollup for " + loc + " within range " + range);
   } catch (Exception e) {
     // I want to be very harsh with exceptions encountered while validating and computing rollups.
     // Just stop everything.
     log.error("Error encountered while validating and calculating rollups", e);
     rollupValidationAndComputeFailed.inc();
     RollupGenerator.rollupExecutors.shutdownNow();
     OutOFBandRollup.getRollupGeneratorThread().interrupt();
     // Stop the monitoring thread
     OutOFBandRollup.getMonitoringThread().interrupt();
     // Stop the file handler thread pool from sending data to buildstore
     FileHandler.handlerThreadPool.shutdownNow();
     throw new RuntimeException(e);
   } finally {
     rollupTimerContext.stop();
   }
 }
예제 #2
0
  @Test
  public void testGetStartAndStop() {
    Range myRange = new Range(1, 2);

    Assert.assertEquals(1, myRange.getStart());
    Assert.assertEquals(2, myRange.getStop());
  }