Group

@Serializable
@SerialName(value = "group")
data class Group(val name: String, val weight: String = "1", val children: List<TopologyDocument.Node> = emptyList(), val template: TopologyDocument.ChildTemplate? = null, val maxConcurrent: Long? = null) : TopologyDocument.Node

A group of children that share its slice between them.

Samples

val text = """
    {"root": "pool", "children": [
      {"type": "group", "name": "repos", "maxConcurrent": 8, "template": {"maxConcurrent": 2}}
    ]}
"""
val written = Json.decodeFromString<TopologyDocument>(text)
val repos = (Topology.from(written) as TopologyParse.Valid).topology.children.single() as Topology.Group
check(repos.maxConcurrent == 8L)
check(repos.template == Topology.ChildTemplate(Weight.ONE, maxConcurrent = 2L))

Constructors

Link copied to clipboard
constructor(name: String, weight: String = "1", children: List<TopologyDocument.Node> = emptyList(), template: TopologyDocument.ChildTemplate? = null, maxConcurrent: Long? = null)

Properties

Link copied to clipboard
Link copied to clipboard
open override val maxConcurrent: Long?

the group's ceiling, over all its children together; null for none.

Link copied to clipboard
open override val name: String

The child's name, unique among its siblings once checked.

Link copied to clipboard

what each child the consumer attaches while running gets, or null when the group has only the children written here. A group with a template may declare no children of its own. template: {} attaches children at weight 1 with no ceiling. Migrating from v0.7.4: runtimeChildren: "1" is now template: { weight: "1" }. A strict decode refuses the old key; a lenient one (ignoreUnknownKeys) drops it silently, and a group that also declares children then loses its attached children without a problem, so decode strictly.

Link copied to clipboard
open override val weight: String

The child's share relative to its siblings, as text: "3" or "3/2".