SyncBatchOperationBuilder

class aerospike_sdk.sync.operations.batch.SyncBatchOperationBuilder[source]

Bases: object

Sync wrapper for BatchOperationBuilder.

__init__(inner)[source]
insert(key)[source]
Return type:

SyncBatchKeyOperationBuilder

update(key)[source]
Return type:

SyncBatchKeyOperationBuilder

upsert(key)[source]
Return type:

SyncBatchKeyOperationBuilder

replace(key)[source]
Return type:

SyncBatchKeyOperationBuilder

replace_if_exists(key)[source]
Return type:

SyncBatchKeyOperationBuilder

delete(key)[source]
Return type:

SyncBatchKeyOperationBuilder

execute(on_error=None)[source]

Buffered sync batch execute — writes-complete-on-return.

Awaits all per-key results before returning a SyncRecordStream backed by a fully-materialized list. Safe for “fire-and-forget” use; subsequent reads observe the new state without races.

For true per-record streaming, see execute_stream().

Parameters:

on_error (Optional[Callable[[Key, int, AerospikeError], None]]) – Optional (key, index, exception) -> None callback. When set, failed per-key results are dispatched to the callback and excluded from the returned stream — the stream contains only successes. Cluster-level errors still raise.

Return type:

SyncRecordStream

Returns:

A SyncRecordStream of per-key RecordResult items (positional via RecordResult.index).

execute_stream(on_error=None)[source]

Lazy sync batch execute — yields records in completion order.

Dispatches all ops in a single mixed batch_stream_blocking call and returns a SyncRecordStream whose __next__ pulls (idx, BatchRecord) tuples from the PAC stream one at a time.

Caveats — differ from execute():

  • Yields completion order, not input order. Each RecordResult carries its originating op’s input position in RecordResult.index; sort after collecting if you need positional results.

  • Per-key errors inline on RecordResult (when on_error is unset); cluster-level errors raise from __next__.

  • No writes-complete-on-return guarantee. Per-node tasks dispatch in the background; if the caller discards the stream without draining, server-side writes may still be in-flight. Tests / callers that follow “execute then immediately read” should use execute() instead.

Parameters:

on_error (Optional[Callable[[Key, int, AerospikeError], None]]) – Optional (key, index, exception) -> None callback. When set, per-key failures are dispatched to the handler as records arrive and excluded from the returned stream; cluster-level errors still raise from __next__.

Return type:

SyncRecordStream

Returns:

A lazy SyncRecordStream. Iterate to drive PAC’s per-record yield.

Raises:

ValueError – If no operations have been added.

class aerospike_sdk.sync.operations.batch.SyncBatchKeyOperationBuilder[source]

Bases: object

Sync wrapper for BatchKeyOperationBuilder.

__init__(inner)[source]
bin(bin_name)[source]
Return type:

SyncBatchBinBuilder

put(bins)[source]
Return type:

SyncBatchKeyOperationBuilder

insert(key)[source]
Return type:

SyncBatchKeyOperationBuilder

update(key)[source]
Return type:

SyncBatchKeyOperationBuilder

upsert(key)[source]
Return type:

SyncBatchKeyOperationBuilder

replace(key)[source]
Return type:

SyncBatchKeyOperationBuilder

replace_if_exists(key)[source]
Return type:

SyncBatchKeyOperationBuilder

delete(key)[source]
Return type:

SyncBatchKeyOperationBuilder

execute(on_error=None)[source]

Buffered sync batch execute — writes-complete-on-return.

Mirrors aerospike_sdk.aio.operations.batch.BatchOperationBuilder.execute(). For lazy per-record streaming, see execute_stream().

Parameters:

on_error (Optional[Callable[[Key, int, AerospikeError], None]]) – Optional (key, index, exception) -> None callback. Failed per-key results are dispatched to the handler and excluded from the returned stream.

Return type:

SyncRecordStream

execute_stream(on_error=None)[source]

Streaming sync batch execute — yields records in completion order.

See SyncBatchOperationBuilder.execute_stream() for full documentation, including the trade-offs vs execute().

Parameters:

on_error (Optional[Callable[[Key, int, AerospikeError], None]]) – Optional (key, index, exception) -> None callback. Per-key failures are dispatched to the handler and excluded from the returned stream; cluster-level errors still raise.

Return type:

SyncRecordStream

class aerospike_sdk.sync.operations.batch.SyncBatchBinBuilder[source]

Bases: object

Sync wrapper for BatchBinBuilder.

See also

BatchBinBuilder

__init__(inner)[source]
set_to(value)[source]
Return type:

SyncBatchKeyOperationBuilder

set_to_geo_json(geo_json)[source]
Return type:

SyncBatchKeyOperationBuilder

add(value)[source]
Return type:

SyncBatchKeyOperationBuilder

increment_by(value)[source]
Return type:

SyncBatchKeyOperationBuilder

append(value)[source]
Return type:

SyncBatchKeyOperationBuilder

prepend(value)[source]
Return type:

SyncBatchKeyOperationBuilder

select_from(expression, *, ignore_eval_failure=False)[source]
Return type:

SyncBatchKeyOperationBuilder

insert_from(expression, *, ignore_op_failure=False, ignore_eval_failure=False, delete_if_null=False)[source]
Return type:

SyncBatchKeyOperationBuilder

update_from(expression, *, ignore_op_failure=False, ignore_eval_failure=False, delete_if_null=False)[source]
Return type:

SyncBatchKeyOperationBuilder

upsert_from(expression, *, ignore_op_failure=False, ignore_eval_failure=False, delete_if_null=False)[source]
Return type:

SyncBatchKeyOperationBuilder

hll_init(config, *, create_only=False, update_only=False, no_fail=False, allow_fold=False)[source]
Return type:

SyncBatchKeyOperationBuilder

hll_add(values, *, config=None, create_only=False, update_only=False, no_fail=False, allow_fold=False)[source]
Return type:

SyncBatchKeyOperationBuilder

hll_set_union(hll_list, *, create_only=False, update_only=False, no_fail=False, allow_fold=False)[source]
Return type:

SyncBatchKeyOperationBuilder

hll_fold(index_bit_count)[source]
Return type:

SyncBatchKeyOperationBuilder

hll_refresh_count()[source]
Return type:

SyncBatchKeyOperationBuilder

hll_get_count()[source]
Return type:

SyncBatchKeyOperationBuilder

hll_describe()[source]
Return type:

SyncBatchKeyOperationBuilder

hll_get_union(hll_list)[source]
Return type:

SyncBatchKeyOperationBuilder

hll_get_union_count(hll_list)[source]
Return type:

SyncBatchKeyOperationBuilder

hll_get_intersect_count(hll_list)[source]
Return type:

SyncBatchKeyOperationBuilder

hll_get_similarity(hll_list)[source]
Return type:

SyncBatchKeyOperationBuilder