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:
fn main() io {
let me = cluster.selfInfo()
print("{me.isSelf} {me.state} {me.isUp()}")
}true alive true
pub(api) data ClusterMemberС версии. 1.0.0-beta
Поля
pub(api) id: NodeId | Identity of the node. |
pub(api) state: str |
|
pub(api) incarnation: i64 | Raised by the node itself; the higher number wins (SWIM). |
pub(api) addr: str |
|
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). |
Методы
isUp | () -> boolAlive, or suspected but not yet declared dead. |
hasRole | (role: str) -> boolWhether 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) -> boolThe node serves the service name (fully qualified, or just the type name). |
Определено в: std/core/node.oxl:94