code: boolean contains(DatanodeDescriptor node) {
      if (node==null) {
        return false;
      }
        
      String host = node.getHost();
      hostmapLock.readLock().lock();
      try {
        DatanodeDescriptor[] nodes = map.get(host);
        if (nodes != null) {
          for(DatanodeDescriptor containedNode:nodes) {
            if (node==containedNode) {
              return true;
            }
          }
        }
      } finally {
        hostmapLock.readLock().unlock();
      }
      return false;
    }
docs: Check if node is already in the map.