@Override
        public void run(GetConnectionRegistryResponse resp) {
          if (!controller.failed()) {
            LOG.debug("Got connection registry info: {}", resp);
            future.complete(resp.getClusterId());
            return;
          }
          if (ConnectionUtils.isUnexpectedPreambleHeaderException(controller.getFailed())) {
            // this means we have connected to an old server where it does not support passing
            // cluster id through preamble connnection header, so we fallback to use null
            // cluster id, which is the old behavior
            LOG.debug("Failed to get connection registry info, should be an old server,"
              + " fallback to use null cluster id", controller.getFailed());
            future.complete(null);
          } else {
            LOG.debug("Failed to get connection registry info", controller.getFailed());
            if (index == bootstrapServers.size() - 1) {
              future.completeExceptionally(controller.getFailed());
            } else {
              // try next bootstrap server
              getClusterId(index + 1);
            }
          }
        }
Try get cluster id from the server with the given {@code index} in {@link #bootstrapServers}.
hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClusterIdFetcher.java