public NodeState join ( ZooKeeperClient injectedClient ) throws InterruptedException { switch ( state . get ( ) ) { case Fresh : connect ( injectedClient ) ; break ; case Shutdown : connect ( injectedClient ) ; break ; case Draining : LOG . warn ( "'join' called while draining; ignoring." ) ; break ; case Started : LOG . warn ( "'join' called after started; ignoring." ) ; break ; } // why not Enum itself? return state . get ( ) ; }
Joins the cluster using a custom zk client claims work and begins operation .