Node

@Serializable
data class Node(val id: String, val parent: String, val host: String, val type: KrillApp, val state: NodeState = NodeState.NONE, val meta: NodeMetaData, val timestamp: Long = 0)(source)

A single node in a Krill swarm.

Constructors

Link copied to clipboard
constructor(id: String, parent: String, host: String, type: KrillApp, state: NodeState = NodeState.NONE, meta: NodeMetaData, timestamp: Long = 0)

Properties

Link copied to clipboard

UUID of the server hosting this node.

Link copied to clipboard
val id: String

Stable per-node UUID, unique within host.

Link copied to clipboard

Polymorphic metadata payload; the concrete subtype matches type.

Link copied to clipboard

UUID of the parent node — for top-level nodes, equals their own id.

Link copied to clipboard

Lifecycle / status — see NodeState. Defaults to NONE.

Link copied to clipboard

Producer-supplied epoch millis used for ordering and snapshot keys.

Link copied to clipboard

Type discriminator — selects the concrete shape of meta.

Functions

Link copied to clipboard

Renders a debug-friendly one-liner of the node — used in log lines to give the timestamp / type / display name / state in a compact form.

Link copied to clipboard
fun Node.https(): Url

Returns the canonical https://<resolvedHost>:<port> Url for a server node. Caller must guarantee node.meta is a ServerMetaData — typically by checking node.type is KrillApp.Server.

Link copied to clipboard

Returns this node's address pair — (nodeId, hostId) — as a NodeIdentity suitable for use inside SourceMetaData source / target lists.

Link copied to clipboard
Link copied to clipboard
fun Node.key(): String

Renders the node as a "<timestamp>:<id>" key. Used as a stable cache / comparison key in places where (timestamp, id) tuples need to be compared by value rather than by structural equality of the full node.

Link copied to clipboard

Returns the human-readable display name for the node. Each KrillApp subtype reads its name out of the appropriate concrete MetaData field.

Link copied to clipboard

For a DataPoint whose DataType is COLOR, returns the snapshot value parsed as a packed ARGB Long (0xFFRRGGBB). For any other node type or an unparseable value, returns opaque black (0xFF000000) so callers can unconditionally render the result without null-checking.