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 .