@ LifecycleStart @ Override public void start ( ) throws Exception { super . start ( ) ; synchronized ( lifecycleLock ) { Preconditions . checkState ( ! started , "already started" ) ; started = true ; try { cleanupStaleAnnouncements ( ) ; registerRunListener ( ) ; pathChildrenCache . start ( ) ; log . info ( "Started WorkerTaskMonitor." ) ; started = true ; } catch ( InterruptedException e ) { throw e ; } catch ( Exception e ) { log . makeAlert ( e , "Exception starting WorkerTaskMonitor" ) . emit ( ) ; throw e ; } } }
Register a monitor for new tasks . When new tasks appear the worker node announces a status to indicate it has started the task . When the task is complete the worker node updates the status .