Aerospike.BatchResult (Aerospike Driver v0.3.1)

Copy Markdown View Source

Per-key outcome returned by batch helpers that need record-level metadata.

Each result keeps the original key and a status so callers can handle partial batch outcomes without losing caller-order context.

Field invariants

  • When status is :ok, error is nil. record may contain returned data or be nil for successful operations that do not return bins.
  • When status is :error, record is nil, error is set, and in_doubt reports whether a write outcome may be ambiguous.

Summary

Types

Per-key batch error returned for failed entries.

Per-key batch status, preserving caller order across partial outcomes.

t()

Per-key result returned by heterogeneous batch helpers.

Functions

Converts one command-layer batch result into a public batch result struct.

Converts command-layer batch results into public batch result structs.

Types

error_reason()

@type error_reason() :: Aerospike.Error.t() | atom()

Per-key batch error returned for failed entries.

Command paths normally return %Aerospike.Error{}; atom reasons are kept in the type because lower-level routing failures can surface before an error struct is available.

status()

@type status() :: :ok | :error

Per-key batch status, preserving caller order across partial outcomes.

t()

@type t() :: %Aerospike.BatchResult{
  error: error_reason() | nil,
  in_doubt: boolean(),
  key: Aerospike.Key.t(),
  record: Aerospike.Record.t() | map() | nil,
  status: status()
}

Per-key result returned by heterogeneous batch helpers.

record contains returned bins or metadata for successful entries that produce data. error is set only when status is :error. in_doubt indicates that a write-style entry may have reached the server even though the client received an error.

Functions

from_command_result(result)

@spec from_command_result(term()) :: t()

Converts one command-layer batch result into a public batch result struct.

from_command_results(results)

@spec from_command_results([term()]) :: [t()]

Converts command-layer batch results into public batch result structs.

The returned list preserves the command result order, which matches the caller's key or entry order for public batch helpers.