from _typeshed import Incomplete
from collections import OrderedDict as OrderedDict

log: Incomplete
socketpair: Incomplete

class KafkaClient:
    DEFAULT_CONFIG: Incomplete
    config: Incomplete
    cluster: Incomplete
    def __init__(self, **configs) -> None: ...
    def maybe_connect(self, node_id, wakeup: bool = True): ...
    def connection_failed(self, node_id): ...
    def ready(self, node_id, metadata_priority: bool = True): ...
    def connected(self, node_id): ...
    def close(self, node_id=None) -> None: ...
    def __del__(self) -> None: ...
    def is_disconnected(self, node_id): ...
    def connection_delay(self, node_id): ...
    def throttle_delay(self, node_id): ...
    def is_ready(self, node_id, metadata_priority: bool = True): ...
    def send(self, node_id, request, wakeup: bool = True, request_timeout_ms=None): ...
    def poll(self, timeout_ms=None, future=None): ...
    def in_flight_request_count(self, node_id=None): ...
    def least_loaded_node(self): ...
    def least_loaded_node_refresh_ms(self): ...
    def set_topics(self, topics): ...
    def add_topic(self, topic): ...
    def get_api_versions(self): ...
    def check_version(self, node_id=None, timeout=None, **kwargs): ...
    def api_version(self, operation, max_version=None): ...
    def wakeup(self) -> None: ...
    def bootstrap_connected(self): ...
    def await_ready(self, node_id, timeout_ms: int = 30000): ...
    def send_and_receive(self, node_id, request): ...

class IdleConnectionManager:
    connections_max_idle: Incomplete
    next_idle_close_check_time: Incomplete
    lru_connections: Incomplete
    def __init__(self, connections_max_idle_ms) -> None: ...
    def update(self, conn_id) -> None: ...
    def remove(self, conn_id) -> None: ...
    def is_expired(self, conn_id): ...
    def next_check_ms(self): ...
    def update_next_idle_close_check_time(self, ts) -> None: ...
    def poll_expired_connection(self): ...

class KafkaClientMetrics:
    metrics: Incomplete
    metric_group_name: Incomplete
    connection_closed: Incomplete
    connection_created: Incomplete
    select_time: Incomplete
    io_time: Incomplete
    def __init__(self, metrics, metric_group_prefix, conns) -> None: ...
