public void start ( ) throws Exception { Preconditions . checkState ( state . compareAndSet ( State . LATENT , State . STARTED ) , "Cannot be started more than once" ) ; startTask . set ( AfterConnectionEstablished . execute ( client , new Runnable ( ) { @ Override public void run ( ) { try { internalStart ( ) ; } finally { startTask . set ( null ) ; } } } ) ) ; }
Add this instance to the leadership election and attempt to acquire leadership .