Interface SpallocAPI.Job

All Superinterfaces:
SpallocAPI.Waitable
Enclosing interface:
SpallocAPI

public static interface SpallocAPI.Job
extends SpallocAPI.Waitable
Describes a particular job known to the allocator.
Author:
Donal Fellows
  • Method Details

    • getId

      int getId()
      Returns:
      Job ID
    • access

      void access​(@NotNull @IPAddress @NotNull @IPAddress String keepaliveAddress)
      Update the keepalive.
      Parameters:
      keepaliveAddress - Where was the access from.
    • destroy

      void destroy​(String reason)
      Mark the job as destroyed. To do this to an already destroyed job is a no-op.
      Parameters:
      reason - Why the job is being destroyed.
    • setPower

      void setPower​(boolean power)
      Power a job on or off.
      Parameters:
      power - True for on, False for off
    • getState

      JobState getState()
      Returns:
      The state of the job.
    • getStartTime

      Instant getStartTime()
      Returns:
      When the job started.
    • getKeepaliveHost

      Optional<String> getKeepaliveHost()
      Returns:
      Host address that issued last keepalive event, or empty() if this information is not available to the current user.
    • getKeepaliveTimestamp

      Instant getKeepaliveTimestamp()
      Returns:
      Time of the last keepalive event.
    • getOwner

      Optional<String> getOwner()
      Returns:
      The creator of the job. empty() if this is not available to the current user.
    • getOriginalRequest

      Optional<byte[]> getOriginalRequest()
      Returns:
      The serialized original request to create the job. empty() if this is not available to the current user.
    • getFinishTime

      Optional<Instant> getFinishTime()
      Returns:
      When the job finished. empty() if the job is not yet finished.
    • getReason

      Optional<String> getReason()
      Returns:
      Why the job died. Might be empty() if this isn't known (including if the job is alive).
    • getMachine

      Returns:
      The (sub-)machine allocated to the job. empty() if no resources allocated.
    • whereIs

      Optional<SpallocAPI.BoardLocation> whereIs​(@ValidX @uk.ac.manchester.spinnaker.machine.ValidX int x, @ValidY @uk.ac.manchester.spinnaker.machine.ValidY int y)
      Locate a board within the allocation.
      Parameters:
      x - The X coordinate of a chip on the board of interest.
      y - The Y coordinate of a chip on the board of interest.
      Returns:
      The location, if resources allocated and the location maps. empty() otherwise.
    • getRootChip

      Optional<uk.ac.manchester.spinnaker.machine.ChipLocation> getRootChip()
      Returns:
      The absolute location of root chip. empty() if no resources allocated.
    • getWidth

      Optional<Integer> getWidth()
      Returns:
      the allocated width of the job's rectangle of triads, or empty() if not allocated (or not known).
    • getHeight

      Optional<Integer> getHeight()
      Returns:
      the allocated height of the job's rectangle of triads, or empty() if not allocated (or not known).
    • getDepth

      Optional<Integer> getDepth()
      Returns:
      the allocated depth of this sub-machine, or empty() if not allocated (or not known). When supplied, will be 1 (single board) or 3 (by triad)
    • reportIssue

      String reportIssue​(IssueReportRequest reqBody, Permit permit)
      Report an issue with some boards in the job.
      Parameters:
      reqBody - The description of the issue.
      permit - Who is actually reporting this?
      Returns:
      The text part of the response
    • rememberProxy

      void rememberProxy​(ProxyCore proxy)
      Note that a proxy has been set up for the job. This allows the proxy to be closed when the job state changes. (The proxy may already be closed at that point.)
      Parameters:
      proxy - The proxy.
    • forgetProxy

      void forgetProxy​(ProxyCore proxy)
      Note that a proxy has been dropped from the job and doesn't need to be remembered any more.
      Parameters:
      proxy - The proxy.
    • getTransceiver

      Get a way to talk to the machine directly. Note that it might not be booted...
      Returns:
      The transceiver interface.
      Throws:
      IOException - if there is an issue creating the transceiver.
      InterruptedException - if the operation is interrupted.
      SpinnmanException - if there is an issue speaking to the machine.
    • getFastDataIn

      @MustBeClosed FastDataIn getFastDataIn​(uk.ac.manchester.spinnaker.machine.CoreLocation gathererCore, uk.ac.manchester.spinnaker.machine.tags.IPTag iptag) throws ProcessException, IOException, InterruptedException
      Get a FastDataIn protocol instance for an Ethernet within a job.
      Parameters:
      gathererCore - The core that will do the gathering.
      iptag - The IPTag to use.
      Returns:
      A FastDataIn instance.
      Throws:
      ProcessException - if there is an issue setting up the tag.
      IOException - if there is an issue communicating.
      InterruptedException - if the operation is interrupted.
    • getDownloader

      @MustBeClosed Downloader getDownloader​(uk.ac.manchester.spinnaker.machine.tags.IPTag iptag) throws ProcessException, IOException, InterruptedException
      Get a Downloader protocol instance for an Ethernet within a job.
      Parameters:
      iptag - The IPTag to use.
      Returns:
      A Downloader instance.
      Throws:
      ProcessException - if there is an issue setting up the tag.
      IOException - if there is an issue communicating.
      InterruptedException - if the operation is interrupted.