private void createAccumulator ( String producerId , Accumulate annotation , String accName , String statsName ) { if ( annotation != null && producerId != null && ! producerId . isEmpty ( ) && accName != null && ! accName . isEmpty ( ) && statsName != null && ! statsName . isEmpty ( ) ) { AccumulatorDefinition definition = new AccumulatorDefinition ( ) ; if ( annotation . name ( ) . length ( ) > 0 ) { definition . setName ( annotation . name ( ) ) ; } else { definition . setName ( accName ) ; } definition . setIntervalName ( annotation . intervalName ( ) ) ; definition . setProducerName ( producerId ) ; definition . setStatName ( statsName ) ; definition . setValueName ( annotation . valueName ( ) ) ; definition . setTimeUnit ( annotation . timeUnit ( ) ) ; AccumulatorRepository . getInstance ( ) . createAccumulator ( definition ) ; } }
Create accumulator and register it .