class AbstractCoordinator implements Closeable {

    public void ensureCoordinatorReady() {
        while (coordinatorUnknown()) {// 是否需要重新查找GroupCoordinator，主要检查coordinator字段是否为空，以及与GroupCoordinator
            // 之间的连接是否正常
            RequestFuture<Void> future = sendGroupCoordinatorRequest();// 创建并缓存请求
            client.poll(future);// 阻塞地发送请求

            if (future.failed()) {
                if (future.isRetriable()) {
                    client.awaitMetadataUpdate();
                } else {
                    throw future.exception();
                }
            } else if (coordinator != null && client.connectionFailed(coordinator)) {
                // 如果Coordinator 依旧为null，并且client连接Coordinator节点失败，这里sleep一段时间，然后继续查找Coordinator
                // we found the coordinator, but the connection has failed, so mark
                // it dead and backoff before retrying discovery
                coordinatorDead();
                time.sleep(retryBackoffMs);
            }
        }
    }

    public  AbstractCoordinator(ConsumerNetworkClient client,
        String groupId,
        int sessionTimeoutMs,
        int heartbeatIntervalMs,
        Metrics metrics,
        String metricGrpPrefix,
        Time time,
        long retryBackoffMs);

}