blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/datastax/DAbstractMetricsRW.java
public Map<Locator, MetricData> getDatapointsForRange( List<Locator> locators,
                                                              Range range,
                                                              String columnFamily,
                                                              Granularity granularity ) {

        Timer.Context ctx = Instrumentation.getReadTimerContext(columnFamily);

        try {

            MetadataCache metadataCache = MetadataCache.getInstance();

            // in this loop, we will fire all the executeAsync() of
            // various select statements, the collect all of the
            // ResultSetFutures
            Map<Locator, List<ResultSetFuture>> locatorToFuturesMap = new HashMap<Locator, List<ResultSetFuture>>();
            Map<Locator, DAbstractMetricIO> locatorIOMap = new HashMap<Locator, DAbstractMetricIO>();

            for (Locator locator : locators) {
                try {

                    String rType = metadataCache.get(locator, MetricMetadata.ROLLUP_TYPE.name().toLowerCase());

                    DAbstractMetricIO io = getIO( rType, granularity );

                    // put everything in a map of locator -> io so
                    // we can use em up later
                    locatorIOMap.put( locator, io );

                    // do the query
                    List<ResultSetFuture> selectFutures = io.selectForLocatorAndRange( columnFamily, locator, range );

                    // add all ResultSetFutures for a particular locator together
                    List<ResultSetFuture> existing = locatorToFuturesMap.get(locator);
                    if (existing == null) {
                        existing = new ArrayList<ResultSetFuture>();
                        locatorToFuturesMap.put(locator, existing);
                    }
                    existing.addAll(selectFutures);

                } catch (CacheException ex) {
                    Instrumentation.markReadError();
                    LOG.error(String.format("Error looking up locator %s in cache", locator), ex);
                }
            }
            return resultSetsToMetricData(locatorToFuturesMap, locatorIOMap, columnFamily, range);
        }
        finally {

            ctx.stop();
        }
    }
public Map<Locator, MetricData> getDatapointsForRange( List<Locator> locators,
                                                              Range range,
                                                              String columnFamily,
                                                              Granularity granularity ) {

        Timer.Context ctx = Instrumentation.getReadTimerContext(columnFamily);

        try {

            MetadataCache metadataCache = MetadataCache.getInstance();

            // in this loop, we will fire all the executeAsync() of
            // various select statements, the collect all of the
            // ResultSetFutures
            Map<Locator, List<ResultSetFuture>> locatorToFuturesMap = new HashMap<Locator, List<ResultSetFuture>>();
            Map<Locator, DAbstractMetricIO> locatorIOMap = new HashMap<Locator, DAbstractMetricIO>();

            for (Locator locator : locators) {
                try {

                    String rType = metadataCache.get(locator, MetricMetadata.ROLLUP_TYPE.name().toLowerCase());

                    DAbstractMetricIO io = getIO( rType, granularity );

                    // put everything in a map of locator -> io so
                    // we can use em up later
                    locatorIOMap.put( locator, io );

                    // do the query
                    List<ResultSetFuture> selectFutures = io.selectForLocatorAndRange( columnFamily, locator, range );

                    // add all ResultSetFutures for a particular locator together
                    List<ResultSetFuture> existing = locatorToFuturesMap.get(locator);
                    if (existing == null) {
                        existing = new ArrayList<ResultSetFuture>();
                        locatorToFuturesMap.put(locator, existing);
                    }
                    existing.addAll(selectFutures);

                } catch (CacheException ex) {
                    Instrumentation.markReadError();
                    LOG.error(String.format("Error looking up locator %s in cache", locator), ex);
                }
            }
            return resultSetsToMetricData(locatorToFuturesMap, locatorIOMap, columnFamily, range);
        }
        finally {

            ctx.stop();
        }
    }
public Map < Locator , MetricData > getDatapointsForRange ( List < Locator > locators , Range range , String columnFamily , Granularity granularity ) { Timer . Context ctx = Instrumentation . getReadTimerContext ( columnFamily ) ; try { MetadataCache metadataCache = MetadataCache . getInstance ( ) ; // in this loop, we will fire all the executeAsync() of // various select statements, the collect all of the // ResultSetFutures Map < Locator , List < ResultSetFuture > > locatorToFuturesMap = new HashMap < Locator , List < ResultSetFuture > > ( ) ; Map < Locator , DAbstractMetricIO > locatorIOMap = new HashMap < Locator , DAbstractMetricIO > ( ) ; for ( Locator locator : locators ) { try { String rType = metadataCache . get ( locator , MetricMetadata . ROLLUP_TYPE . name ( ) . toLowerCase ( ) ) ; DAbstractMetricIO io = getIO ( rType , granularity ) ; // put everything in a map of locator -> io so // we can use em up later locatorIOMap . put ( locator , io ) ; // do the query List < ResultSetFuture > selectFutures = io . selectForLocatorAndRange ( columnFamily , locator , range ) ; // add all ResultSetFutures for a particular locator together List < ResultSetFuture > existing = locatorToFuturesMap . get ( locator ) ; if ( existing == null ) { existing = new ArrayList < ResultSetFuture > ( ) ; locatorToFuturesMap . put ( locator , existing ) ; } existing . addAll ( selectFutures ) ; } catch ( CacheException ex ) { Instrumentation . markReadError ( ) ; LOG . error ( String . format ( "Error looking up locator %s in cache" , locator ) , ex ) ; } } return resultSetsToMetricData ( locatorToFuturesMap , locatorIOMap , columnFamily , range ) ; } finally { ctx . stop ( ) ; } }
Fetches {@link com.rackspacecloud.blueflood.outputs.formats.MetricData} objects for the
specified {@link com.rackspacecloud.blueflood.types.Locator} and
{@link com.rackspacecloud.blueflood.types.Range} from the specified column family

This is a helper method used to get basic metrics as well as preaggregated metrics.  Hence, both granularity
and columnFamily are required.

@param locators
@param range
@param columnFamily
@param granularity
@return
Fetches { @link com . rackspacecloud . blueflood . outputs . formats . MetricData } objects for the specified { @link com . rackspacecloud . blueflood . types . Locator } and { @link com . rackspacecloud . blueflood . types . Range } from the specified column family