Interface PowerController

All Known Implementing Classes:
AllocatorTask

public interface PowerController
A service that knows how to initiate the setting of the power state of a job.
Author:
Donal Fellows
  • Method Summary

    Modifier and Type Method Description
    void destroyJob​(int jobId, String reason)
    Destroy a job.
    boolean setPower​(int jobId, PowerState power, JobState targetState)
    Issue a power change for a job.
  • Method Details

    • destroyJob

      void destroyJob​(int jobId, String reason)
      Destroy a job. The power controller has the responsibility because it releases any resources held by the job.
      Parameters:
      jobId - The ID of the job.
      reason - Why is the job being destroyed.
    • setPower

      boolean setPower​(int jobId, PowerState power, JobState targetState)
      Issue a power change for a job.
      Parameters:
      jobId - The ID of the allocated job.
      power - What state to change the job's boards' power to.
      targetState - What state are we aiming to put the job into once the power has been switched. Should be JobState.READY or JobState.QUEUED. NB: Use destroyJob(int, String) to move to JobState.DESTROYED.
      Returns:
      Whether any change has been requested.