private void mkRefreshConfThread ( final NimbusData nimbusData ) { nimbusData . getScheduExec ( ) . scheduleAtFixedRate ( new RunnableCallback ( ) { @ Override public void run ( ) { LOG . debug ( "checking changes in storm.yaml..." ) ; Map newConf = Utils . readStormConfig ( ) ; if ( Utils . isConfigChanged ( nimbusData . getConf ( ) , newConf ) ) { LOG . warn ( "detected changes in storm.yaml, updating..." ) ; synchronized ( nimbusData . getConf ( ) ) { nimbusData . getConf ( ) . clear ( ) ; nimbusData . getConf ( ) . putAll ( newConf ) ; } RefreshableComponents . refresh ( newConf ) ; } else { LOG . debug ( "no changes detected, stay put." ) ; } } @ Override public Object getResult ( ) { return 15 ; } } , 15 , 15 , TimeUnit . SECONDS ) ; LOG . info ( "Successfully init configuration refresh thread" ) ; }
handle manual conf changes check every 15 sec