OxL Reference

data ShardInfo

One shard group of the cluster (cluster.shards()).

Example:

oxl✓ checked in CI
fn main() io {
  for s in cluster.shards() {
    print("{s.group} {s.kind} leader={s.leader}")
  }
  print("done")
}
Output
done
pub(api) data ShardInfo

Since. 1.0.0-beta

Fields

pub(api) group: i64

Number of the shard group.

pub(api) kind: str

"kv" (std.kv, actors) or "sql" (builtin tables).

pub(api) db: str

Name of the database the group belongs to.

pub(api) index: i64

Index of the shard in its database and the number of shards of the database.

pub(api) count: i64

Number of shards of the database.

pub(api) leader: str

The node believed to lead the group ("" when unknown) and the nodes holding replicas.

pub(api) replicas: List<str>

Names of the nodes holding replicas.

pub(api) moving: bool

A replica is being moved.

Defined in: std/core/node.oxl:745

See also