Cluster¶
- class aerospike_sdk.aio.cluster.Cluster[source]¶
Bases:
objectLive connection to a cluster, obtained from
ClusterDefinition.connect().Owns a connected
Clientand exposescreate_session()/create_transactional_session(). Preferasync with await ClusterDefinition(...).connect() as clustersoclose()runs on exit.Example:
async with await ClusterDefinition("localhost", 3100).connect() as cluster: session = cluster.create_session(Behavior.DEFAULT)
See also
- __init__(sdk_client)[source]¶
Initialize a Cluster instance.
- Parameters:
sdk_client (
Client) – The underlying Client instance
Note
This should not be called directly. Use ClusterDefinition.connect() instead.
- create_session(behavior=None)[source]¶
Open a
Sessionwith optional behavior.A session represents a logical connection to the cluster with specific behavior settings that control how operations are performed (timeouts, retry policies, consistency levels, etc.).
- Parameters:
- Return type:
- Returns:
Session bound to this cluster’s SDK client.
See also
- create_transactional_session(behavior=None)[source]¶
Return a transactional session facade (behavior reserved for API parity).
- Parameters:
behavior (
Optional[Behavior]) – Accepted for symmetry withcreate_session(); the underlying client may not apply it yet.- Return type:
- Returns:
See also
- is_connected()[source]¶
Mirror
is_connected.- Return type: