code: static int newNamespaceID() {
      Random r = new Random();
      r.setSeed(FSNamesystem.now());
      int newID = 0;
      while(newID == 0)
        newID = r.nextInt(0x7FFFFFFF);  // use 31 bits only
      return newID;
    }
docs: Generate new namespaceID.
  
  namespaceID is a persistent attribute of the namespace.
  It is generated when the namenode is formatted and remains the same
  during the life cycle of the namenode.
  When a datanodes register they receive it as the registrationID,
  which is checked every time the datanode is communicating with the
  namenode. Datanodes that do not 'know' the namespaceID are rejected.
  
  @return new namespaceID