private static final void cleanupSingleNamespaceNode(ZooKeeper zkc,String path,String selfBrokerUrl) throws Exception {
  String brokerUrl=null;
  try {
    byte[] data=zkc.getData(path,false,null);
    if (data.length == 0) {
      return;
    }
    NamespaceEphemeralData zdata=jsonMapper.readValue(data,NamespaceEphemeralData.class);
    brokerUrl=zdata.getNativeUrl();
    if (selfBrokerUrl.equals(brokerUrl)) {
      zkc.delete(path,-1);
    }
  }
 catch (  NoNodeException nne) {
  }
}

private static final void cleanupSingleNamespaceNode ( ZooKeeper zkc , String path , String selfBrokerUrl ) throws Exception { String brokerUrl = null ; try { byte [ ] data = zkc . getData ( path , false , null ) ; if ( data . length == 0 ) { return ; } NamespaceEphemeralData zdata = jsonMapper . readValue ( data , NamespaceEphemeralData . class ) ; brokerUrl = zdata . getNativeUrl ( ) ; if ( selfBrokerUrl . equals ( brokerUrl ) ) { zkc . delete ( path , - 1 ) ; } } catch ( NoNodeException nne ) { } }
cleanupsinglenamespacenode is only called when the namespaceservice is initialized . so , no need for synchronization .
