blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/datastax/DLocatorIO.java
@Override
    public Collection<Locator> getLocators(long shard) throws IOException {

        Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_LOCATOR_NAME);
        Session session = DatastaxIO.getSession();

        Collection<Locator> locators = new ArrayList<Locator>();

        try {
            // bind value
            BoundStatement bs = getValue.bind(shard);
            List<Row> results = session.execute(bs).all();
            for ( Row row : results ) {
                if ( LOG.isTraceEnabled() ) {
                    LOG.trace( "Read metrics_locators with shard " + shard + ": " +
                            row.getString( KEY ) +
                            row.getString( COLUMN1 ));
                }
                locators.add(Locator.createLocatorFromDbKey(row.getString(COLUMN1)));
            }

            // return results
            if (locators.size() == 0) {
                Instrumentation.markNotFound(CassandraModel.CF_METRICS_LOCATOR_NAME);
                return Collections.emptySet();
            }
            else {
                return locators;
            }
        } finally {
            ctx.stop();
        }
    }
@Override
    public Collection<Locator> getLocators(long shard) throws IOException {

        Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_LOCATOR_NAME);
        Session session = DatastaxIO.getSession();

        Collection<Locator> locators = new ArrayList<Locator>();

        try {
            // bind value
            BoundStatement bs = getValue.bind(shard);
            List<Row> results = session.execute(bs).all();
            for ( Row row : results ) {
                if ( LOG.isTraceEnabled() ) {
                    LOG.trace( "Read metrics_locators with shard " + shard + ": " +
                            row.getString( KEY ) +
                            row.getString( COLUMN1 ));
                }
                locators.add(Locator.createLocatorFromDbKey(row.getString(COLUMN1)));
            }

            // return results
            if (locators.size() == 0) {
                Instrumentation.markNotFound(CassandraModel.CF_METRICS_LOCATOR_NAME);
                return Collections.emptySet();
            }
            else {
                return locators;
            }
        } finally {
            ctx.stop();
        }
    }
@ Override public Collection < Locator > getLocators ( long shard ) throws IOException { Timer . Context ctx = Instrumentation . getReadTimerContext ( CassandraModel . CF_METRICS_LOCATOR_NAME ) ; Session session = DatastaxIO . getSession ( ) ; Collection < Locator > locators = new ArrayList < Locator > ( ) ; try { // bind value BoundStatement bs = getValue . bind ( shard ) ; List < Row > results = session . execute ( bs ) . all ( ) ; for ( Row row : results ) { if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "Read metrics_locators with shard " + shard + ": " + row . getString ( KEY ) + row . getString ( COLUMN1 ) ) ; } locators . add ( Locator . createLocatorFromDbKey ( row . getString ( COLUMN1 ) ) ) ; } // return results if ( locators . size ( ) == 0 ) { Instrumentation . markNotFound ( CassandraModel . CF_METRICS_LOCATOR_NAME ) ; return Collections . emptySet ( ) ; } else { return locators ; } } finally { ctx . stop ( ) ; } }
Returns the locators for a shard, i.e. those that should be rolled up, for a given shard.
'Should' means:
1) A locator is capable of rollup.
2) A locator has had new data in the past LOCATOR_TTL seconds.

@param shard Number of the shard you want the locators for. 0-127 inclusive.
@return Collection of locators
@throws IOException
Returns the locators for a shard i . e . those that should be rolled up for a given shard . Should means : 1 ) A locator is capable of rollup . 2 ) A locator has had new data in the past LOCATOR_TTL seconds .