etha.kvstore.etcd#
EtcdStore implementation using etcd3 library.
Attributes#
Classes#
KVStore implementation backed by etcd. |
Module Contents#
- class etha.kvstore.etcd.EtcdStore(host: str = 'localhost', port: int = 2379, timeout: float | None = None, cleanup: bool = False, namespace: str = 'default', component: str = 'tensorbus')#
Bases:
etha.kvstore.base.KVStoreKVStore implementation backed by etcd.
Uses etcd’s watch mechanism for efficient waiting.
Initialize EtcdStore.
- Parameters:
host – etcd server host
port – etcd server port
timeout – Connection timeout in seconds
cleanup – If True, delete all keys in this namespace on init (should only be True for rank 0)
namespace – Namespace for key isolation
component – Default component name
- wait_for_key(key: str, timeout: float = 3600.0, *, component: str | None = None) bytes#
Wait for a key to exist and return its value.
- wait_for_keys(key_pattern: str, expected_count: int, value: str = '1', timeout: float = 3600.0, candidate_keys: list[str] | None = None, *, component: str | None = None) list[str]#
Wait for keys matching pattern using etcd watch.
- wait_for_value(key: str, expected: str, timeout: float = 3600.0, *, component: str | None = None) bytes#
Wait for a key to have a specific value.
- host = 'localhost'#
- port = 2379#
- etha.kvstore.etcd.logger#