code: @Override
    public void close() {
      // Go through all clients and close them if they are active.
      for (ClientPool clientPool : connectionPool.values()) {
        for (int i = 0; i < clientPool.clients.length; i++) {
          TransportClient client = clientPool.clients[i];
          if (client != null) {
            clientPool.clients[i] = null;
            JavaUtils.closeQuietly(client);
          }
        }
      }
      connectionPool.clear();
  
      if (workerGroup != null) {
        workerGroup.shutdownGracefully();
        workerGroup = null;
      }
    }
docs: Close all connections in the connection pool, and shutdown the worker thread pool.