blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/LocatorFetchRunnable.java
protected Set<Locator> getLocators(RollupExecutionContext executionContext,
                                       boolean isReroll,
                                       Granularity delayedMetricsRerollGranularity,
                                       Granularity delayedMetricsStorageGranularity) {
        Set<Locator> locators = new HashSet<Locator>();

        //if delayed metric tracking is enabled, if its re-roll, if slot granularity is no coarser than
        // DELAYED_METRICS_REROLL_GRANULARITY, get delayed locators
        if (RECORD_DELAYED_METRICS &&
                isReroll &&
                !getGranularity().isCoarser(delayedMetricsRerollGranularity)) {

            if (getGranularity().isCoarser(delayedMetricsStorageGranularity)) {

                // For example, if we are re-rolling a 60m slot, and we store delayed metrics at 20m, we need to
                // grab delayed metrics for 3 * 20m slots corresponding to the 60m slot.
                for (SlotKey slotKey: parentSlotKey.getChildrenKeys(delayedMetricsStorageGranularity)) {
                    locators.addAll(getDelayedLocators(executionContext, slotKey));
                }

            } else {
                locators = getDelayedLocators(executionContext,
                        parentSlotKey.extrapolate(delayedMetricsStorageGranularity));
            }

        } else {
            locators = getLocators(executionContext);
        }
        return locators;
    }
protected Set<Locator> getLocators(RollupExecutionContext executionContext,
                                       boolean isReroll,
                                       Granularity delayedMetricsRerollGranularity,
                                       Granularity delayedMetricsStorageGranularity) {
        Set<Locator> locators = new HashSet<Locator>();

        //if delayed metric tracking is enabled, if its re-roll, if slot granularity is no coarser than
        // DELAYED_METRICS_REROLL_GRANULARITY, get delayed locators
        if (RECORD_DELAYED_METRICS &&
                isReroll &&
                !getGranularity().isCoarser(delayedMetricsRerollGranularity)) {

            if (getGranularity().isCoarser(delayedMetricsStorageGranularity)) {

                // For example, if we are re-rolling a 60m slot, and we store delayed metrics at 20m, we need to
                // grab delayed metrics for 3 * 20m slots corresponding to the 60m slot.
                for (SlotKey slotKey: parentSlotKey.getChildrenKeys(delayedMetricsStorageGranularity)) {
                    locators.addAll(getDelayedLocators(executionContext, slotKey));
                }

            } else {
                locators = getDelayedLocators(executionContext,
                        parentSlotKey.extrapolate(delayedMetricsStorageGranularity));
            }

        } else {
            locators = getLocators(executionContext);
        }
        return locators;
    }
protected Set < Locator > getLocators ( RollupExecutionContext executionContext , boolean isReroll , Granularity delayedMetricsRerollGranularity , Granularity delayedMetricsStorageGranularity ) { Set < Locator > locators = new HashSet < Locator > ( ) ; //if delayed metric tracking is enabled, if its re-roll, if slot granularity is no coarser than // DELAYED_METRICS_REROLL_GRANULARITY, get delayed locators if ( RECORD_DELAYED_METRICS && isReroll && ! getGranularity ( ) . isCoarser ( delayedMetricsRerollGranularity ) ) { if ( getGranularity ( ) . isCoarser ( delayedMetricsStorageGranularity ) ) { // For example, if we are re-rolling a 60m slot, and we store delayed metrics at 20m, we need to // grab delayed metrics for 3 * 20m slots corresponding to the 60m slot. for ( SlotKey slotKey : parentSlotKey . getChildrenKeys ( delayedMetricsStorageGranularity ) ) { locators . addAll ( getDelayedLocators ( executionContext , slotKey ) ) ; } } else { locators = getDelayedLocators ( executionContext , parentSlotKey . extrapolate ( delayedMetricsStorageGranularity ) ) ; } } else { locators = getLocators ( executionContext ) ; } return locators ; }
This methods gets locators to rollup a slot.

During re-rolls, If the granularity of the slot is finer(or equal) to the configured
DELAYED_METRICS_REROLL_GRANULARITY, we re-roll only the delayed locator's corresponding
to that slot. if not, we re-roll the locators of the entire shard.

@param executionContext
@param isReroll
@param delayedMetricsRerollGranularity
@param delayedMetricsStorageGranularity
@return
This methods gets locators to rollup a slot .