long start = System.currentTimeMillis();
DateTime startTime = hour(3).minusHours(1).minusSeconds(1);
DateTime endTime = hour(3);
final CountDownLatch rawDataArrival = new CountDownLatch(100);
final RawNumericMetricMapper mapper = new RawNumericMetricMapper();
final Map<Integer, List<RawNumericMetric>> rawDataMap =
new ConcurrentHashMap<Integer, List<RawNumericMetric>>(100);
for (int i = 0; i < NUM_SCHEDULES; ++i) {
final int scheduleId = i;
// readPermits.acquire();
StorageResultSetFuture rawDataFuture = dao.findRawMetricsAsync(scheduleId, startTime.getMillis(),
endTime.getMillis());
Futures.addCallback(rawDataFuture, new FutureCallback<ResultSet>() {
@Override
public void onSuccess(ResultSet result) {
List<RawNumericMetric> rawData = mapper.mapAll(result);
rawDataMap.put(scheduleId, rawData);
rawDataArrival.countDown();
}
@Override