Package com.tuladb

Class SmartLedgerClient

java.lang.Object
com.tuladb.SmartLedgerClient
All Implemented Interfaces:
Closeable, AutoCloseable

public final class SmartLedgerClient extends Object implements Closeable
Leader-aware Ledger client. Accepts a cluster connection string such as: ledger://127.0.0.1:7701,127.0.0.1:7702,127.0.0.1:7703 It probes MSG_CLUSTER_STATUS on all endpoints, chooses the endpoint whose self_id == leader_id, sends writes to that leader, and on a failure that is not final (transport, leader movement, a non-final server status such as ERR_CAPACITY) refreshes and retries up to retryAttempts times with jittered exponential backoff (see SmartLedgerClient.RetryPolicy).