doc.go 986 B

123456789101112131415161718
  1. // Package allocator aims to manage allocation of different
  2. // cluster-wide resources on behalf of the manager. In particular, it
  3. // manages a set of independent allocator processes which can mostly
  4. // execute concurrently with only a minimal need for coordination.
  5. //
  6. // One of the instances where it needs coordination is when deciding to
  7. // move a task to the PENDING state. Since a task can move to the
  8. // PENDING state only when all the task allocators have completed,
  9. // they must cooperate. The way `allocator` achieves this is by creating
  10. // a `taskBallot` to which all task allocators register themselves as
  11. // mandatory voters. For each task that needs allocation, each allocator
  12. // independently votes to indicate the completion of their allocation.
  13. // Once all registered voters have voted then the task is moved to the
  14. // PENDING state.
  15. //
  16. // Other than the coordination needed for task PENDING state, all
  17. // the allocators function fairly independently.
  18. package allocator