# `Aerospike.PartitionFilter`
[🔗](https://github.com/luisgabrielroldan/aerospike_driver/blob/v0.3.1/lib/aerospike/partition_filter.ex#L1)

Describes which partitions participate in a scan or query.

This is a pure data container. It does not own routing, retries, or
execution state.

# `partition_entry`

```elixir
@type partition_entry() :: %{
  :id =&gt; non_neg_integer(),
  optional(:digest) =&gt; binary() | nil,
  optional(:bval) =&gt; integer() | nil
}
```

Per-partition resume state used by scan/query pagination.

`:digest` and `:bval` represent the last server cursor position for the
partition, not user-key order.

# `t`

```elixir
@type t() :: %Aerospike.PartitionFilter{
  begin: non_neg_integer(),
  count: pos_integer(),
  digest: binary() | nil,
  done?: boolean(),
  partitions: [partition_entry()],
  retry?: boolean()
}
```

Partition selection and resume state for scans and queries.

`begin` and `count` select the partition range for new work. `digest` is an
optional digest resume point. `partitions` carries per-partition resume
entries produced during pagination. `done?` and `retry?` are runtime state
flags used by the scan/query executor.

# `all`

```elixir
@spec all() :: t()
```

All partitions (`begin: 0`, `count: 4096`).

# `by_digest`

```elixir
@spec by_digest(&lt;&lt;_::160&gt;&gt;) :: t()
```

Resume from a specific record digest.

The digest must be exactly 20 bytes. This selects the full partition space
with an initial digest resume point.

# `by_id`

```elixir
@spec by_id(non_neg_integer()) :: t()
```

One partition by id.

Valid ids are `0..4095`.

# `by_range`

```elixir
@spec by_range(non_neg_integer(), pos_integer()) :: t()
```

A contiguous partition range.

`begin_part + count` must not exceed `partition_count/0`.

# `partition_count`

```elixir
@spec partition_count() :: pos_integer()
```

Returns the fixed Aerospike partition count.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
