OxL Reference

data ClusterMember

A member of the cluster as the registry sees it (§12.2, D-4206): the data every node publishes through membership. A node outside a cluster sees only itself.

Example:

oxl✓ checked in CI
fn main() io {
  let me = cluster.selfInfo()
  print("{me.isSelf} {me.state} {me.isUp()}")
}
Output
true alive true
pub(api) data ClusterMember

Since. 1.0.0-beta

Fields

pub(api) id: NodeId

Identity of the node.

pub(api) state: str

"alive", "suspect" (probably failed, may still refute), "dead" or "left" (graceful leave).

pub(api) incarnation: i64

Raised by the node itself; the higher number wins (SWIM).

pub(api) addr: str

host:port of the node's cluster port.

pub(api) zone: str

Availability zone of the node; empty when none.

pub(api) roles: List<str>

Cluster roles the node has.

pub(api) labels: Map<str, str>

Free-form labels of the node.

pub(api) version: str

Binary version and schema hash the node announced (rolling upgrades, §9.2).

pub(api) schemaHash: str

Hash of the data schema the node runs.

pub(api) load: f64

Requests in flight on the node at its last message.

pub(api) isSelf: bool

This is the node asking.

pub(api) services: List<str>

Fully qualified names of the services the node serves (registry, §12.2).

Methods

isUp() -> bool
Alive, or suspected but not yet declared dead.
hasRole(role: str) -> bool
Whether the member has the role role (a member with the role all, or with no roles at all - the implicit role all of a node without a cluster - matches every role).
serves(name: str) -> bool
The node serves the service name (fully qualified, or just the type name).

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

See also