InfoCommands (sync)

class aerospike_sdk.sync.info.InfoCommands[source]

Bases: InfoCommandsBase

Synchronous high-level info-command helpers.

Constructed by info() (no args). Calls PNC’s info_blocking / info_on_all_nodes_blocking directly — no asyncio loop is involved.

__init__(pnc_client)[source]

Pair with the PNC aerospike_native.Client from the session.

build()[source]

Build strings from every node.

Return type:

Set[str]

namespaces()[source]

Namespace names across the cluster.

Return type:

Set[str]

namespace_details(namespace)[source]

Per-namespace info; None when the namespace is unknown.

Returns a NamespaceDetail: a mapping of every reported key, with typed properties for the fields the SDK consults.

Return type:

Optional[NamespaceDetail]

sets(namespace=None)[source]

Every set with its counters, ordered by namespace then set name.

Omit namespace for every set in every namespace, which is what the bare sets info command answers.

Counters come from the first node reporting each set, so they describe that node’s share rather than a cluster-wide total; sets_per_node() keeps each node’s own numbers.

Parameters:

namespace (Optional[str]) – Restrict to one namespace; omit for all of them.

Return type:

List[SetDetail]

Returns:

One SetDetail per set.

Example:

for detail in session.info().sets("customers"):
    print(detail.name, detail.objects, detail.data_used_bytes)

See also

set(): One set by name. sets_per_node(): Per-node counters instead of merged ones.

set(namespace, name)[source]

One set’s detail by name; None when the namespace has no such set.

Parameters:
  • namespace (str) – The name of the namespace.

  • name (str) – The set name.

Return type:

Optional[SetDetail]

Returns:

The SetDetail, or None.

secondary_indexes(namespace=None)[source]

All secondary indexes (optionally filtered by namespace).

Returns one Sindex per index. These are mappings, so existing key access keeps working.

Return type:

List[Sindex]

secondary_index_details(namespace, index_name)[source]

Details for one secondary index; None when missing.

Returns the parsed counters, not the raw {command: body} envelope.

Return type:

Optional[SindexDetail]

namespace_details_per_node(namespace)[source]

Each node’s own view of namespace, keyed by node name.

The cluster-wide namespace_details() asks one node; config that has not finished propagating shows up only when every node is asked. Nodes that do not host the namespace are omitted.

Parameters:

namespace (str) – The name of the namespace.

Return type:

Dict[str, NamespaceDetail]

Returns:

One NamespaceDetail per node.

Example:

per_node = session.info().namespace_details_per_node("customers")
modes = {node: d.strong_consistency for node, d in per_node.items()}
sets_per_node(namespace)[source]

Each node’s own set counters for namespace, keyed by node name.

Parameters:

namespace (str) – The name of the namespace.

Return type:

Dict[str, List[SetDetail]]

Returns:

One list of SetDetail per node, ordered by set name.

Example:

for node, details in session.info().sets_per_node("customers").items():
    print(node, sum(d.objects for d in details))

See also

sets(): One merged view across the cluster.

secondary_indexes_per_node(namespace=None)[source]

Each node’s own secondary-index list, keyed by node name.

Parameters:

namespace (Optional[str]) – Optional namespace filter.

Return type:

Dict[str, List[Sindex]]

Returns:

One list of Sindex per node.

See also

secondary_indexes(): One deduplicated list for the cluster.

secondary_index_details_per_node(namespace, index_name)[source]

Each node’s own counters for one index, keyed by node name.

Index build progress is per node, so this is what shows whether a rebuild has finished everywhere. Nodes not reporting the index are omitted.

Parameters:
  • namespace (str) – The namespace containing the index.

  • index_name (str) – The name of the index.

Return type:

Dict[str, SindexDetail]

Returns:

One SindexDetail per node.

is_cluster_stable()[source]

True when every node reports cluster-stable=true.

Return type:

bool

get_cluster_size()[source]

Number of cluster nodes.

Return type:

int

info(command)[source]

Raw info command against one random node.

Return type:

Dict[str, str]

info_on_all_nodes(command)[source]

Raw info command against every node.

Return type:

Dict[str, Dict[str, str]]