public static int createRejoinNodeIndicator ( ZooKeeper zk , int hostId ) { try { zk . create ( rejoin_node_blocker , ByteBuffer . allocate ( 4 ) . putInt ( hostId ) . array ( ) , Ids . OPEN_ACL_UNSAFE , CreateMode . PERSISTENT ) ; } catch ( KeeperException e ) { if ( e . code ( ) == KeeperException . Code . NODEEXISTS ) { try { return ByteBuffer . wrap ( zk . getData ( rejoin_node_blocker , false , null ) ) . getInt ( ) ; } catch ( KeeperException e1 ) { if ( e1 . code ( ) != KeeperException . Code . NONODE ) { org . voltdb . VoltDB . crashLocalVoltDB ( "Unable to get the current rejoining node indicator" ) ; } } catch ( InterruptedException e1 ) { } } else { org . voltdb . VoltDB . crashLocalVoltDB ( "Unable to create rejoin node Indicator" , true , e ) ; } } catch ( InterruptedException e ) { org . voltdb . VoltDB . crashLocalVoltDB ( "Unable to create rejoin node Indicator" , true , e ) ; } return - 1 ; }
Creates a rejoin blocker for the given rejoining host . This prevents other hosts from rejoining at the same time .