code: boolean add(DatanodeDescriptor node) {
      hostmapLock.writeLock().lock();
      try {
        if (node==null || contains(node)) {
          return false;
        }
        
        String host = node.getHost();
        DatanodeDescriptor[] nodes = map.get(host);
        DatanodeDescriptor[] newNodes;
        if (nodes==null) {
          newNodes = new DatanodeDescriptor[1];
          newNodes[0]=node;
        } else { // rare case: more than one datanode on the host
          newNodes = new DatanodeDescriptor[nodes.length+1];
          System.arraycopy(nodes, 0, newNodes, 0, nodes.length);
          newNodes[nodes.length] = node;
        }
        map.put(host, newNodes);
        return true;
      } finally {
        hostmapLock.writeLock().unlock();
      }
    }
docs: add node to the map
  return true if the node is added; false otherwise.