code: public DatanodeProtocol getNSNamenode(int namespaceId) throws IOException {
      NamespaceService nsos = namespaceManager.get(namespaceId);
      if(nsos == null || nsos.getDatanodeProtocol() == null) {
        throw new IOException("cannot find a namnode proxy for namespaceId=" + namespaceId);
      }
      return nsos.getDatanodeProtocol();
    }
docs: Get namenode corresponding to a namespace
  @param namespaceId
  @return Namenode corresponding to the namespace
  @throws IOException