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 Summary
Modifier and Type Method Description void
access(@NotNull @IPAddress String keepaliveAddress)
Update the keepalive.void
destroy(String reason)
Mark the job as destroyed.void
forgetProxy(ProxyCore proxy)
Note that a proxy has been dropped from the job and doesn't need to be remembered any more.Optional<Integer>
getDepth()
Optional<Instant>
getFinishTime()
Optional<Integer>
getHeight()
int
getId()
Optional<String>
getKeepaliveHost()
Instant
getKeepaliveTimestamp()
Optional<SpallocAPI.SubMachine>
getMachine()
Optional<byte[]>
getOriginalRequest()
Optional<String>
getOwner()
Optional<String>
getReason()
Optional<ChipLocation>
getRootChip()
Instant
getStartTime()
JobState
getState()
TransceiverInterface
getTransceiver()
Get a way to talk to the machine directly.Optional<Integer>
getWidth()
void
rememberProxy(ProxyCore proxy)
Note that a proxy has been set up for the job.String
reportIssue(IssueReportRequest reqBody, Permit permit)
Report an issue with some boards in the job.void
setPower(boolean power)
Power a job on or off.Optional<SpallocAPI.BoardLocation>
whereIs(@uk.ac.manchester.spinnaker.machine.ValidX int x, @uk.ac.manchester.spinnaker.machine.ValidY int y)
Locate a board within the allocation.Methods inherited from interface uk.ac.manchester.spinnaker.alloc.allocator.SpallocAPI.Waitable
waitForChange
-
Method Details
-
getId
int getId()- Returns:
- Job ID
-
access
Update the keepalive.- Parameters:
keepaliveAddress
- Where was the access from.
-
destroy
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
- 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
- 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
- Returns:
- When the job finished.
empty()
if the job is not yet finished.
-
getReason
- Returns:
- Why the job died. Might be
empty()
if this isn't known (including if the job is alive).
-
getMachine
Optional<SpallocAPI.SubMachine> 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<ChipLocation> getRootChip()- Returns:
- The absolute location of root chip.
empty()
if no resources allocated.
-
getWidth
- Returns:
- the allocated width of the job's rectangle of triads, or
empty()
if not allocated (or not known).
-
getHeight
- Returns:
- the allocated height of the job's rectangle of triads, or
empty()
if not allocated (or not known).
-
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
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
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
Note that a proxy has been dropped from the job and doesn't need to be remembered any more.- Parameters:
proxy
- The proxy.
-
getTransceiver
@MustBeClosed TransceiverInterface getTransceiver() throws IOException, InterruptedException, SpinnmanExceptionGet 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.
-