A node represents a physical or virtual machine in a cluster. It gives the manager a concrete object for addressing machines, understanding their capacity, tracking allocations, and making scheduling decisions. Workers run on nodes, while the manager is also modeled as a node. section 2.5
A node records the information needed to place and monitor tasks:
- Identity and location: Name identifies the machine, while Ip lets the manager send tasks to it. section 2.5
- Allocation: MemoryAllocated and DiskAllocated track resource consumption as tasks run. section 2.5
The node also owns communication with its machine endpoint. GetStats builds the node's /stats URL, retries transient HTTP failures, checks the response, and decodes JSON into runtime statistics. Moving this responsibility into Node keeps scheduler code focused on scheduling rather than HTTP details. section 10.9
Polling a worker node
A scheduler can call node.GetStats twice, with a delay between calls, and use the returned statistics to calculate CPU usage. If the worker is rebooting or the network is temporarily unavailable, HTTPWithRetry makes several attempts before reporting failure.


















