private void scheduleRebalancing ( ) { int interval = config . autoRebalanceInterval ; Runnable runRebalance = new Runnable ( ) { @ Override public void run ( ) { try { rebalance ( ) ; } catch ( Exception e ) { LOG . error ( "Error running auto-rebalance." , e ) ; } } } ; autoRebalanceFuture = pool . get ( ) . scheduleAtFixedRate ( runRebalance , interval , interval , TimeUnit . SECONDS ) ; }
Schedules auto - rebalancing if auto - rebalancing is enabled . The task is scheduled to run every 60 seconds by default or according to the config .