Aerospike.IndexTask (Aerospike Driver v0.3.1)

Copy Markdown View Source

Tracks secondary-index build progress.

Summary

Types

t()

Handle returned while a secondary index is being built.

Option accepted by wait/2.

Keyword options accepted by wait/2.

Functions

Returns the current secondary-index build status.

Blocks until the secondary-index build completes or the timeout is exceeded.

Types

t()

@type t() :: %Aerospike.IndexTask{
  conn: GenServer.server(),
  index_name: String.t(),
  namespace: String.t()
}

Handle returned while a secondary index is being built.

Use status/1 for one poll or wait/2 to block until the index is visible. wait/2 accepts :poll_interval and :timeout in milliseconds.

wait_opt()

@type wait_opt() ::
  {:poll_interval, non_neg_integer()} | {:timeout, non_neg_integer()}

Option accepted by wait/2.

wait_opts()

@type wait_opts() :: [wait_opt()]

Keyword options accepted by wait/2.

Functions

status(index_task)

@spec status(t()) :: {:ok, :complete | :in_progress} | {:error, Aerospike.Error.t()}

Returns the current secondary-index build status.

wait(task, opts \\ [])

@spec wait(struct(), keyword()) :: :ok | {:error, Aerospike.Error.t()}
@spec wait(t(), wait_opts()) :: :ok | {:error, Aerospike.Error.t()}

Blocks until the secondary-index build completes or the timeout is exceeded.

Supported options:

  • :poll_interval — milliseconds to sleep between status checks. Defaults to 1_000.
  • :timeout — maximum milliseconds to wait. When omitted, polling continues until the index is complete or returns an error.