private String createRequestNode ( SnapshotInitiationInfo snapInfo ) { String requestId = null ; try { requestId = java . util . UUID . randomUUID ( ) . toString ( ) ; if ( ! snapInfo . isTruncationRequest ( ) ) { final JSONObject jsObj = snapInfo . getJSONObjectForZK ( ) ; jsObj . put ( "requestId" , requestId ) ; String zkString = jsObj . toString ( 4 ) ; byte zkBytes [ ] = zkString . getBytes ( "UTF-8" ) ; m_zk . create ( VoltZK . user_snapshot_request , zkBytes , Ids . OPEN_ACL_UNSAFE , CreateMode . PERSISTENT ) ; } else { m_zk . create ( VoltZK . request_truncation_snapshot_node , null , Ids . OPEN_ACL_UNSAFE , CreateMode . PERSISTENT_SEQUENTIAL ) ; } } catch ( KeeperException . NodeExistsException e ) { return null ; } catch ( Exception e ) { VoltDB . crashLocalVoltDB ( "Exception while attempting to create user snapshot request in ZK" , true , e ) ; } return requestId ; }
Try to create the ZK node to request the snapshot .