private void ensureCleanStartup ( ) { forceShutdown ( ) ; ScheduledThreadPoolExecutor oldPool = pool . getAndSet ( createScheduledThreadExecutor ( ) ) ; oldPool . shutdownNow ( ) ; claimedForHandoff . clear ( ) ; workUnitsPeggedToMe . clear ( ) ; state . set ( NodeState . Fresh ) ; }
In the event that the node has been evicted and is reconnecting this method clears out all existing state before relaunching to ensure a clean launch .