blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/datastax/DCounterIO.java
@Override
    protected BoundStatement getBoundStatementForMetric(IMetric metric, Granularity granularity) {
        Object metricValue = metric.getMetricValue();
        if (!(metricValue instanceof BluefloodCounterRollup)) {
            throw new InvalidDataException(
                    String.format("getBoundStatementForMetric(locator=%s, granularity=%s): metric value %s is not type BluefloodCounterRollup",
                            metric.getLocator(), granularity, metric.getMetricValue().getClass().getSimpleName())
            );
        }
        PreparedStatement statement = metricsCFPreparedStatements.preaggrGranToInsertStatement.get(granularity);
        return statement.bind(
                metric.getLocator().toString(),
                metric.getCollectionTime(),
                serDes.serialize( (BluefloodCounterRollup) metricValue ),
                metric.getTtlInSeconds() );
    }
@Override
    protected BoundStatement getBoundStatementForMetric(IMetric metric, Granularity granularity) {
        Object metricValue = metric.getMetricValue();
        if (!(metricValue instanceof BluefloodCounterRollup)) {
            throw new InvalidDataException(
                    String.format("getBoundStatementForMetric(locator=%s, granularity=%s): metric value %s is not type BluefloodCounterRollup",
                            metric.getLocator(), granularity, metric.getMetricValue().getClass().getSimpleName())
            );
        }
        PreparedStatement statement = metricsCFPreparedStatements.preaggrGranToInsertStatement.get(granularity);
        return statement.bind(
                metric.getLocator().toString(),
                metric.getCollectionTime(),
                serDes.serialize( (BluefloodCounterRollup) metricValue ),
                metric.getTtlInSeconds() );
    }
@ Override protected BoundStatement getBoundStatementForMetric ( IMetric metric , Granularity granularity ) { Object metricValue = metric . getMetricValue ( ) ; if ( ! ( metricValue instanceof BluefloodCounterRollup ) ) { throw new InvalidDataException ( String . format ( "getBoundStatementForMetric(locator=%s, granularity=%s): metric value %s is not type BluefloodCounterRollup" , metric . getLocator ( ) , granularity , metric . getMetricValue ( ) . getClass ( ) . getSimpleName ( ) ) ) ; } PreparedStatement statement = metricsCFPreparedStatements . preaggrGranToInsertStatement . get ( granularity ) ; return statement . bind ( metric . getLocator ( ) . toString ( ) , metric . getCollectionTime ( ) , serDes . serialize ( ( BluefloodCounterRollup ) metricValue ) , metric . getTtlInSeconds ( ) ) ; }
Retrieves the {@link BoundStatement} for a particular counter metric
@param metric
@param granularity
@return
Retrieves the {