Interface SpallocClient.Job
- Enclosing interface:
- SpallocClient
public static interface SpallocClient.Job
The services offered relating to a Spalloc job. Jobs run on
machines, and have boards allocated to them while
they do so. Those boards (which will be connected) are a fundamental
resource that allows SpiNNaker programs to be run.
-
Method Summary
Modifier and Type Method Description void
delete(String reason)
Mark a job as deleted.default JobDescription
describe()
Get a description of a job.JobDescription
describe(boolean waitForChange)
Get a description of a job.boolean
getPower()
Get whether the boards of the machine are all switched on.TransceiverInterface
getTransceiver()
Create a proxied transceiver for talking to the boards of the job.void
keepalive()
Must be periodically called to prevent the service watchdog from culling the job.AllocatedMachine
machine()
Get a description of what's been allocated to the job.boolean
setPower(boolean switchOn)
Set the power state of the boards of the machine.default void
waitForPower()
Wait until the job's boards are powered on or the job is destroyed.WhereIs
whereIs(@NotNull @Valid HasChipLocation chip)
Given the location of a chip within an allocation, return more info about a board.
-
Method Details
-
describe
Get a description of a job. Includes the state of the job.- Parameters:
waitForChange
- Iftrue
, will wait until the jobs may have changed. (Best-effort only; waiting time is bounded at 30 seconds.)- Returns:
- The job description & state. Check the state to see whether the job has had resources allocated yet.
- Throws:
IOException
- If communication fails.
-
describe
Get a description of a job. Includes the state of the job.- Returns:
- The job description & state. Check the state to see whether the job has had resources allocated yet.
- Throws:
IOException
- If communication fails.
-
keepalive
Must be periodically called to prevent the service watchdog from culling the job.- Throws:
IOException
- If communication fails.
-
delete
Mark a job as deleted.- Parameters:
reason
- Why the job is to be deleted.- Throws:
IOException
- If communication fails.
-
machine
Get a description of what's been allocated to the job.- Returns:
- a description of the allocated resources
- Throws:
IOException
- If communication fails, the resources have not yet been allocated, or the job is deleted.
-
getPower
Get whether the boards of the machine are all switched on.- Returns:
true
iff the boards are all on.- Throws:
IOException
- If communication fails, the resources have not yet been allocated, or the job is deleted.
-
setPower
Set the power state of the boards of the machine. Note that actually changing the power state of the boards may take some time.- Parameters:
switchOn
-true
to switch the boards on,false
to switch them off.- Returns:
true
iff the boards are all on.- Throws:
IOException
- If communication fails, the resources have not yet been allocated, or the job is deleted.
-
whereIs
WhereIs whereIs(@NotNull @Valid @NotNull @Valid HasChipLocation chip) throws FileNotFoundException, IOExceptionGiven the location of a chip within an allocation, return more info about a board.- Parameters:
chip
- Chip location (relative to the root of the allocation).- Returns:
- Board information
- Throws:
FileNotFoundException
- If the board doesn't exist or no boards are allocated to the job currently.IOException
- If communication fails or the job is deleted.
-
getTransceiver
@MustBeClosed TransceiverInterface getTransceiver() throws IOException, InterruptedException, SpinnmanExceptionCreate a proxied transceiver for talking to the boards of the job. The transceiver will be configured so that it can talk to all the boards of the job and nothing else; the BMP(s) will not be accessible by this transceiver.- Returns:
- The transceiver. It is the caller's responsibility to close this transceiver at the right time.
- Throws:
IOException
- If communication fails or the job is deleted.InterruptedException
- If interrupted waiting for the connection to be set up.SpinnmanException
- If transceiver construction fails.
-
waitForPower
Wait until the job's boards are powered on or the job is destroyed.- Throws:
IOException
- If communication fails.
-