blueflood-core/src/main/java/com/rackspacecloud/blueflood/cache/ConfigTtlProvider.java
private boolean put(
        ImmutableTable.Builder<Granularity, RollupType, TimeValue> ttlMapBuilder,
        Configuration config,
        Granularity gran,
        RollupType rollupType,
        TtlConfig configKey) {
        int value;
        try {
            value = config.getIntegerProperty(configKey);
            if (value < 0) return false;
        } catch (NumberFormatException ex) {
            log.trace(String.format("No valid TTL config set for granularity: %s, rollup type: %s",
                    gran.name(), rollupType.name()), ex);
            return false;
        }
        ttlMapBuilder.put(gran, rollupType, new TimeValue(value, TimeUnit.DAYS));
        return true;
    }
private boolean put(
        ImmutableTable.Builder<Granularity, RollupType, TimeValue> ttlMapBuilder,
        Configuration config,
        Granularity gran,
        RollupType rollupType,
        TtlConfig configKey) {
        int value;
        try {
            value = config.getIntegerProperty(configKey);
            if (value < 0) return false;
        } catch (NumberFormatException ex) {
            log.trace(String.format("No valid TTL config set for granularity: %s, rollup type: %s",
                    gran.name(), rollupType.name()), ex);
            return false;
        }
        ttlMapBuilder.put(gran, rollupType, new TimeValue(value, TimeUnit.DAYS));
        return true;
    }
Helper function to build the ttl mapping. Only insert to the mapping if the value is a valid date.
@param ttlMapBuilder
@param config
@param gran
@param rollupType
@param configKey
@return true if the insertion is successful, false otherwise.