Ejemplo n.º 1
0
  public void init() {
    aggregationManager = new AggregationManager(dao, dateTimeService, configuration);
    invalidMetricsManager = new InvalidMetricsManager(dateTimeService, dao);

    numericQueue = new ArrayBlockingQueue<MeasurementDataNumeric>(QUEUE_SIZE);
    numericQueueConsumer = new NumericQueueConsumer();
    numericQueueConsumer.setName("MetricsServer numericQueueConsumer");
    numericQueueConsumer.start();
  }
Ejemplo n.º 2
0
 public void shutdown() {
   numericQueueConsumer.shutdown();
   try {
     numericQueueConsumer.join(); // Lets wait for it to finish before we continue..
   } catch (InterruptedException e) {
     log.warn("Potential data loss while waiting for the queue to empty, ", e);
   }
   aggregationManager.shutdown();
   invalidMetricsManager.shutdown();
 }