SyncBatchOperationBuilder¶
- class aerospike_sdk.sync.operations.batch.SyncBatchOperationBuilder[source]¶
Bases:
objectSync wrapper for
BatchOperationBuilder.See also
- execute(on_error=None)[source]¶
Buffered sync batch execute — writes-complete-on-return.
Awaits all per-key results before returning a
SyncRecordStreambacked 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) -> Nonecallback. 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:
- Returns:
A
SyncRecordStreamof per-keyRecordResultitems (positional viaRecordResult.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_blockingcall and returns aSyncRecordStreamwhose__next__pulls(idx, BatchRecord)tuples from the PAC stream one at a time.Caveats — differ from
execute():Yields completion order, not input order. Each
RecordResultcarries its originating op’s input position inRecordResult.index; sort after collecting if you need positional results.Per-key errors inline on
RecordResult(whenon_erroris 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) -> Nonecallback. 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:
- 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:
objectSync wrapper for
BatchKeyOperationBuilder.See also
- 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, seeexecute_stream().- Parameters:
on_error (
Optional[Callable[[Key,int,AerospikeError],None]]) – Optional(key, index, exception) -> Nonecallback. Failed per-key results are dispatched to the handler and excluded from the returned stream.- Return type:
- 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 vsexecute().- Parameters:
on_error (
Optional[Callable[[Key,int,AerospikeError],None]]) – Optional(key, index, exception) -> Nonecallback. Per-key failures are dispatched to the handler and excluded from the returned stream; cluster-level errors still raise.- Return type:
- class aerospike_sdk.sync.operations.batch.SyncBatchBinBuilder[source]¶
Bases:
objectSync wrapper for
BatchBinBuilder.See also
- insert_from(expression, *, ignore_op_failure=False, ignore_eval_failure=False, delete_if_null=False)[source]¶
- Return type:
- update_from(expression, *, ignore_op_failure=False, ignore_eval_failure=False, delete_if_null=False)[source]¶
- Return type:
- upsert_from(expression, *, ignore_op_failure=False, ignore_eval_failure=False, delete_if_null=False)[source]¶
- Return type:
- hll_init(config, *, create_only=False, update_only=False, no_fail=False, allow_fold=False)[source]¶
- Return type:
- hll_add(values, *, config=None, create_only=False, update_only=False, no_fail=False, allow_fold=False)[source]¶
- Return type:
- hll_set_union(hll_list, *, create_only=False, update_only=False, no_fail=False, allow_fold=False)[source]¶
- Return type: