Class SQLQueries
java.lang.Object
uk.ac.manchester.spinnaker.alloc.db.SQLQueries
- Direct Known Subclasses:
DatabaseAwareBean
,DirInfo
The literal SQL queries used in this package.
The schema they query against (defined in spalloc.sql
) is:
- Author:
- Donal Fellows
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
Add a chip on a board to that board's blacklist.protected static final String
Add a core on a board to that board's blacklist.protected static final String
Add a link on a board to that board's blacklist.protected static final String
Adds a user to a group.protected static final String
Add or remove time from a quota.protected static final String
Tell a board that it is allocated.protected static final String
Tell a job that it is allocated.protected static final String
Increases the importance of a job.protected static final String
Check a board with a specific board ID is allocatable.protected SQL
Check that a rectangle of triads of boards that may be allocated.protected SQL
Find a rectangle of triads of boards rooted at a specific board that may be allocated.protected static final String
Delete all blacklist entries for chips on a board.protected static final String
Delete all blacklist entries for cores on a board.protected static final String
Delete all blacklist entries for links on a board.protected static final String
Mark a write of a blacklist as completed.protected static final String
Mark a read of a blacklist or ADC data as completed.protected static final String
Mark a read of serial data as completed.protected static final String
Get the number of changes that are not completed for a job.protected static final String
Check there is a single free board.protected static final String
Count things on a machine.protected static final String
Counts the number of powered-on boards of a job.protected Resource
Count the number of connected boards (i.e., have at least one path over enabled links to the root board of the allocation) within a rectangle of triads.protected static final String
Insert a request to read a board's blacklist.protected static final String
Insert a request to write a board's blacklist.protected static final String
Create a group record.protected static final String
Create a group record.protected static final String
Insert a request to read a board's serial information.protected static final String
Insert a request to read a board's temperature data.protected static final String
Create a user.protected static final String
Tell the boards of a job that they're no longer allocated to the job.protected static final String
Reduce a group's quota on a machine by a specified amount.protected static final String
Actually delete an allocation record.protected static final String
Delete a blacklist request.protected static final String
Delete a single group record and returns the name of the deleted group.protected static final String
Actually delete a job record.protected static final String
Delete all tags for a machine.protected static final String
Actually delete an NMPI job record.protected static final String
Actually delete an NMPI session record.protected static final String
Delete a requests to change the power of a board.protected static final String
Delete an allocation task.protected static final String
Delete a user.protected static final String
Destroy all live jobs.protected static final String
Mark a job as dead.protected static final String
Set a request to change the power of a board to an error.protected static final String
Mark a read or write of a blacklist as failed, noting the reason.protected static final String
Get a board's full coordinate info given it's ID.protected static final String
Get a board's ID given it's physical coordinates.protected static final String
Get a board's ID given it's IP address.protected static final String
Get a board's ID given it's triad coordinates.protected static final String
Find jobs that have expired their keepalive interval.protected static final String
Find a single free board.protected static final String
Find an allocatable board with a specific board ID.protected Resource
Locate a board (using a full set of coordinates) based on global chip coordinates.protected Resource
Locate a board (using a full set of coordinates) based on the IP address of its ethernet chip.protected Resource
Locate a board (using a full set of coordinates) based on allocation-local chip coordinates.protected Resource
Locate a board (using a full set of coordinates) based on logical triad coordinates.protected Resource
Locate a board (using a full set of coordinates) based on physical cabinet-frame-board coordinates.protected SQL
Find a rectangle of triads of boards that may be allocated.protected SQL
Find a rectangle of triads of boards rooted at a specific board that may be allocated.protected static final String
Delete a request to change the power of a board.protected static final String
Get all the boards of a BMP.protected static final String
Get all the BMPs.protected static final String
Get all the boards (and related info) of a machine.protected static final String
Get all the boards (and related info) known to the service.protected static final String
Select all live jobs.protected static final String
Get basic information about all machines.protected static final String
Get the boards that are available for allocation.protected static final String
Get the list of reads (from the machine) of blacklist data to perform.protected static final String
Get the list of writes (to the machine) of blacklist data to perform.protected static final String
Read the blacklisted chips for a board.protected static final String
Read the blacklisted cores for a board.protected static final String
Read the blacklisted links for a board.protected static final String
Get the address of the BMP of the root board of the machine.protected static final String
Get the boards of a BMP that can be used.protected static final String
Get the address of the root chip of a board.protected static final String
Get a board's ID by its coordinates.protected static final String
Get connection info for board allocated to a job.protected static final String
Get What job is allocated to a board.protected static final String
Get the boards of a machine that can be used.protected static final String
Get whether a board is powered.protected static final String
Get the problem reports about a board.protected static final String
Get the requests to change the power of boards on a BMP.protected static final String
Retrieve a completed request to read or write a BMP-related data for a board.protected static final String
Get resource usage info about completed jobs that have yet to be consolidated into the main quota table.protected static final String
Get the current non-consolidated usage for a group.protected static final String
Get the boards (and related info) of a machine that have been disabled.protected static final String
Get the value of a board'sfunctioning
column.protected static final String
Get a group by it's ID.protected static final String
Get a group by it's name.protected static final String
Get the ID of a particular group that a particular user must be a member of.protected static final String
List all the groups that a user is a member of and that have quota left.protected static final String
Get the quota for a group.protected static final String
Get basic information about a specific job.protected static final String
Get the coords of boards assigned to a job.protected static final String
Get what boards are allocated to a job.protected static final String
Get the chip dimensions of a job.protected static final String
Get basic information about jobs.protected static final String
Get the NMPI Job for a Job.protected static final String
Get the NMPI Session for a Job.protected static final String
Get usage of a job and the quota against which that applies.protected static final String
Get the boards (and related info) of a machine that are in service.protected static final String
Get basic information about live jobs.protected static final String
Get a local user's basic details.protected static final String
Get basic information about a specific machine.protected static final String
Get basic info about active jobs on a machine.protected static final String
Get the problem reports about boards in a machine.protected static final String
Get whether a machine wraps in horizontal or vertical directions.protected static final String
Get the details from a specific membership.protected static final String
Get the memberships of a user.protected static final String
Get basic information about a specific machine.protected static final String
Get the address of the BMP of the root board of the machine.protected static final String
Get the coordinates of a board.protected static final String
Get the coordinates of the root chip of a board.protected static final String
Get the list of reads (from the machine) of serial data to perform.protected static final String
Get the number of boards that are allocated to a job that are switched on.protected static final String
Get a machine's tags.protected static final String
Get the list of reads (from the machine) of temperature data to perform.protected static final String
Get the permissions and encrypted password for a user.protected static final String
Get details about a user.protected static final String
Get details about a user.protected static final String
Get details about a user.protected static final String
Get the ID of a user.protected static final String
Get the quota for a user.protected static final String
List the members of a group.protected Resource
Get the list of allocation tasks.protected Resource
Get the set of boards at some coordinates within a triad rectangle that are connected (i.e., have at least one path over enableable links) to the root board.protected Resource
Get the links of a machine that have been disabled.protected Resource
Get jobs on a machine that have changes that can be processed.protected Resource
Get the links on the perimeter of the allocation to a job.protected Resource
Get enabled boards with at least as many reported problems as a given threshold.protected static final String
Step 3 of group synchronisation: add real missing groups.protected static final String
Step 5 of group synchronisation: drop the temporary table.protected static final String
Step 2 of group synchronisation: add a desired group to the temp table.protected static final String
Step 1 of group synchronisation: make a temporary table.protected static final String
Step 4 of group synchronisation: remove real groups no longer wanted.protected static final String
Insert a BMP.protected static final String
Insert a board.protected static final String
Create a board issue report.protected static final String
Create a job.protected static final String
Insert a link.protected static final String
Insert a machine.protected static final String
Create a request to allocate a specific board.protected static final String
Create a request to allocate a number of boards.protected static final String
Create a request to allocate a rectangle of boards.protected static final String
Create a request to allocate triads starting at a particular board.protected static final String
Insert a tag.protected static final String
Asks whether the blacklist model for a board is believed to be synchronised to the hardware.protected static final String
Test if a user account is locked or disabled.protected Resource
Create a request to change the power status of a board.protected static final String
Delete all requests to allocate resources for a job.protected static final String
Delete a request to allocate resources for a job.protected static final String
Get a list of all groups.protected static final String
Get a list of all groups of a given type.protected static final String
Get a list of all users.protected static final String
Get a list of all users.protected static final String
Gets information about live jobs.protected static final String
Get the machine names in alphabetical order.protected static final String
Get descriptions of how to move from a board to its neighbours.protected static final String
Mark a board as having had its blacklist modified.protected static final String
Mark a board as having had its blacklist synchronised with the hardware.protected static final String
Mark a job as having had its resource usage consolidated.protected static final String
Note the login failure.protected static final String
Note the login success.protected static final String
Record the reason for a job being destroyed.protected static final String
Read historical allocations to be written to the historical data DB.protected static final String
Read historical jobs to be written to the historical data DB.protected static final String
Removes a user from a group.protected static final String
Set all boards to off.protected static final String
Set the power state of a board.protected static final String
Set the power state of a board.protected static final String
Set the BMP and physical serial IDs based on the information actually read off the machine.protected static final String
Set a quota.protected static final String
Set the value of a board'sfunctioning
column.protected static final String
Set the NMPI Job for a Job.protected static final String
Set the NMPI session for a Job.protected static final String
Set the in-service flag for a machine.protected static final String
Note down the maximum chip coordinates so we can calculate wraparounds correctly.protected static final String
Set the state destroyed and number of pending changes for a job.protected static final String
Set the state for a job.protected static final String
Set whether a user is administratively disabled.protected static final String
Set whether a user is locked.protected static final String
Set a user's name.protected static final String
Set a user's password.protected static final String
Set the amount a user is trusted.protected static final String
Unlock accounts.protected static final String
Update a single group record's name and quota.protected static final String
Update the keepalive timestamp.protected static final String
Write to the historical allocations database.protected static final String
Write to the historical jobs database. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
GET_ALL_MACHINES
@Parameter("allow_out_of_service") @ResultColumn("machine_id") @ResultColumn("machine_name") @ResultColumn("width") @ResultColumn("height") @ResultColumn("in_service") protected static final String GET_ALL_MACHINESGet basic information about all machines.- See Also:
-
LIST_MACHINE_NAMES
@Parameter("allow_out_of_service") @ResultColumn("machine_name") @ResultColumn("in_service") protected static final String LIST_MACHINE_NAMESGet the machine names in alphabetical order.- See Also:
-
GET_MACHINE_BY_ID
@Parameter("machine_id") @Parameter("allow_out_of_service") @ResultColumn("machine_id") @ResultColumn("machine_name") @ResultColumn("width") @ResultColumn("height") @ResultColumn("in_service") @SingleRowResult protected static final String GET_MACHINE_BY_IDGet basic information about a specific machine. Looks up by ID.- See Also:
-
GET_NAMED_MACHINE
@Parameter("machine_name") @Parameter("allow_out_of_service") @ResultColumn("machine_id") @ResultColumn("machine_name") @ResultColumn("width") @ResultColumn("height") @ResultColumn("in_service") @SingleRowResult protected static final String GET_NAMED_MACHINEGet basic information about a specific machine. Looks up by name.- See Also:
-
GET_MACHINE_WRAPS
@Parameter("machine_id") @ResultColumn("horizontal_wrap") @ResultColumn("vertical_wrap") @SingleRowResult protected static final String GET_MACHINE_WRAPSGet whether a machine wraps in horizontal or vertical directions. Machines (especially of any size) are usually expected to do so.- See Also:
-
COUNT_MACHINE_THINGS
@Parameter("machine_id") @ResultColumn("board_count") @ResultColumn("in_use") @ResultColumn("num_jobs") @SingleRowResult protected static final String COUNT_MACHINE_THINGSCount things on a machine.- See Also:
-
GET_JOB_IDS
@Parameter("limit") @Parameter("offset") @ResultColumn("job_id") @ResultColumn("machine_id") @ResultColumn("job_state") @ResultColumn("keepalive_timestamp") protected static final String GET_JOB_IDSGet basic information about jobs. Supports paging.- See Also:
-
GET_LIVE_JOB_IDS
@Parameter("limit") @Parameter("offset") @ResultColumn("job_id") @ResultColumn("machine_id") @ResultColumn("job_state") @ResultColumn("keepalive_timestamp") protected static final String GET_LIVE_JOB_IDSGet basic information about live jobs. Supports paging.- See Also:
-
GET_ALL_LIVE_JOBS
Select all live jobs.- See Also:
-
DESTROY_ALL_LIVE_JOBS
Destroy all live jobs.- See Also:
-
GET_JOB
@Parameter("job_id") @ResultColumn("job_id") @ResultColumn("machine_id") @ResultColumn("machine_name") @ResultColumn("width") @ResultColumn("height") @ResultColumn("depth") @ResultColumn("root_id") @ResultColumn("job_state") @ResultColumn("keepalive_timestamp") @ResultColumn("keepalive_host") @ResultColumn("keepalive_interval") @ResultColumn("create_timestamp") @ResultColumn("death_reason") @ResultColumn("death_timestamp") @ResultColumn("original_request") @ResultColumn("owner") @SingleRowResult protected static final String GET_JOBGet basic information about a specific job.- See Also:
-
GET_JOB_CHIP_DIMENSIONS
@Parameter("job_id") @ResultColumn("width") @ResultColumn("height") @SingleRowResult protected static final String GET_JOB_CHIP_DIMENSIONSGet the chip dimensions of a job.- See Also:
-
GET_JOB_BOARDS
@Parameter("job_id") @ResultColumn("board_id") @ResultColumn("bmp_id") @ResultColumn("machine_id") protected static final String GET_JOB_BOARDSGet what boards are allocated to a job.- See Also:
-
LIST_LIVE_JOBS
@ResultColumn("job_id") @ResultColumn("machine_id") @ResultColumn("create_timestamp") @ResultColumn("keepalive_interval") @ResultColumn("job_state") @ResultColumn("allocation_size") @ResultColumn("keepalive_host") @ResultColumn("user_name") @ResultColumn("machine_name") @ResultColumn("original_request") protected static final String LIST_LIVE_JOBSGets information about live jobs.- See Also:
-
COUNT_POWERED_BOARDS
@Parameter("job_id") @ResultColumn("c") @SingleRowResult protected static final String COUNT_POWERED_BOARDSCounts the number of powered-on boards of a job.- See Also:
-
GET_ROOT_OF_BOARD
@Parameter("board_id") @ResultColumn("root_x") @ResultColumn("root_y") @SingleRowResult protected static final String GET_ROOT_OF_BOARDGet the coordinates of the root chip of a board.- See Also:
-
INSERT_JOB
@Parameter("machine_id") @Parameter("user_id") @Parameter("group_id") @Parameter("keepalive_interval") @Parameter("original_request") @GeneratesID protected static final String INSERT_JOBCreate a job.- See Also:
-
INSERT_REQ_N_BOARDS
@Parameter("job_id") @Parameter("num_boards") @Parameter("max_dead_boards") @Parameter("priority") @GeneratesID protected static final String INSERT_REQ_N_BOARDSCreate a request to allocate a number of boards.- See Also:
-
INSERT_REQ_SIZE
@Parameter("job_id") @Parameter("width") @Parameter("height") @Parameter("max_dead_boards") @Parameter("priority") @GeneratesID protected static final String INSERT_REQ_SIZECreate a request to allocate a rectangle of boards.- See Also:
-
INSERT_REQ_BOARD
@Parameter("job_id") @Parameter("board_id") @Parameter("priority") @GeneratesID protected static final String INSERT_REQ_BOARDCreate a request to allocate a specific board.- See Also:
-
INSERT_REQ_SIZE_BOARD
@Parameter("job_id") @Parameter("board_id") @Parameter("width") @Parameter("height") @Parameter("max_dead_boards") @Parameter("priority") @GeneratesID protected static final String INSERT_REQ_SIZE_BOARDCreate a request to allocate triads starting at a particular board.- See Also:
-
BUMP_IMPORTANCE
Increases the importance of a job.- See Also:
-
GET_ROOT_BMP_ADDRESS
@Parameter("machine_id") @ResultColumn("address") @SingleRowResult protected static final String GET_ROOT_BMP_ADDRESSGet the address of the BMP of the root board of the machine.- See Also:
-
GET_BMP_ADDRESS
@Parameter("machine_id") @Parameter("cabinet") @Parameter("frame") @ResultColumn("address") @SingleRowResult protected static final String GET_BMP_ADDRESSGet the address of the BMP of the root board of the machine.- See Also:
-
GET_ALL_BMPS
@ResultColumn("bmp_id") @ResultColumn("machine_name") @ResultColumn("address") @ResultColumn("cabinet") @ResultColumn("frame") protected static final String GET_ALL_BMPSGet all the BMPs.- See Also:
-
GET_ALL_BMP_BOARDS
@Parameter("bmp_id") @ResultColumn("board_id") @ResultColumn("board_num") @ResultColumn("address") protected static final String GET_ALL_BMP_BOARDSGet all the boards of a BMP.- See Also:
-
GET_BOARD_ADDRESS
@Parameter("board_id") @ResultColumn("address") @SingleRowResult protected static final String GET_BOARD_ADDRESSGet the address of the root chip of a board.- See Also:
-
GET_BOARD_NUMBERS
Get the boards of a machine that can be used. Excludes disabled boards.- See Also:
-
GET_BMP_BOARD_NUMBERS
@Parameter("machine_id") @Parameter("cabinet") @Parameter("frame") @ResultColumn("board_num") protected static final String GET_BMP_BOARD_NUMBERSGet the boards of a BMP that can be used. Excludes disabled boards.- See Also:
-
GET_LIVE_BOARDS
@Parameter("machine_id") @ResultColumn("board_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("board_num") @ResultColumn("address") @ResultColumn("bmp_id") @ResultColumn("machine_id") protected static final String GET_LIVE_BOARDSGet the boards (and related info) of a machine that are in service.- See Also:
-
GET_DEAD_BOARDS
@Parameter("machine_id") @ResultColumn("board_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("board_num") @ResultColumn("address") @ResultColumn("bmp_id") @ResultColumn("machine_id") protected static final String GET_DEAD_BOARDSGet the boards (and related info) of a machine that have been disabled.- See Also:
-
GET_ALL_BOARDS
@Parameter("machine_id") @ResultColumn("board_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("board_num") @ResultColumn("address") @ResultColumn("bmp_id") @ResultColumn("machine_id") protected static final String GET_ALL_BOARDSGet all the boards (and related info) of a machine.- See Also:
-
GET_ALL_BOARDS_OF_ALL_MACHINES
@ResultColumn("board_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("board_num") @ResultColumn("address") @ResultColumn("bmp_id") @ResultColumn("machine_id") protected static final String GET_ALL_BOARDS_OF_ALL_MACHINESGet all the boards (and related info) known to the service.- See Also:
-
GET_JOB_BOARD_COORDS
@Parameter("job_id") @ResultColumn("board_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("board_num") @ResultColumn("address") @ResultColumn("bmp_id") @ResultColumn("machine_id") protected static final String GET_JOB_BOARD_COORDSGet the coords of boards assigned to a job.- See Also:
-
GET_MACHINE_JOBS
@Parameter("machine_id") @ResultColumn("job_id") @ResultColumn("owner_name") protected static final String GET_MACHINE_JOBSGet basic info about active jobs on a machine.- See Also:
-
GET_AVAILABLE_BOARD_NUMBERS
@Parameter("machine_id") @ResultColumn("board_num") protected static final String GET_AVAILABLE_BOARD_NUMBERSGet the boards that are available for allocation.- See Also:
-
GET_TAGS
Get a machine's tags. Theoretically when selecting a machine by tags we should put the query in the DB, but it is awkward to move a list into SQL as part of a query and we don't really ever have that many machines or tags. So we just pull the collection of tags and do the match in Java.- See Also:
-
UPDATE_KEEPALIVE
Update the keepalive timestamp.- See Also:
-
DESTROY_JOB
Mark a job as dead.- See Also:
-
NOTE_DESTROY_REASON
Record the reason for a job being destroyed.- See Also:
-
GET_SUM_BOARDS_POWERED
@Parameter("job_id") @ResultColumn("total_on") @SingleRowResult protected static final String GET_SUM_BOARDS_POWEREDGet the number of boards that are allocated to a job that are switched on.- See Also:
-
GET_BOARD_CONNECT_INFO
@Parameter("job_id") @ResultColumn("board_id") @ResultColumn("address") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("root_x") @ResultColumn("root_y") protected static final String GET_BOARD_CONNECT_INFOGet connection info for board allocated to a job.- See Also:
-
GET_ROOT_COORDS
@Parameter("board_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("root_x") @ResultColumn("root_y") @SingleRowResult protected static final String GET_ROOT_COORDSGet the coordinates of a board.- See Also:
-
GET_BOARD_POWER_INFO
@Parameter("board_id") @ResultColumn("board_power") @ResultColumn("power_off_timestamp") @ResultColumn("power_on_timestamp") @SingleRowResult protected static final String GET_BOARD_POWER_INFOGet whether a board is powered.- See Also:
-
GET_BOARD_JOB
@Parameter("board_id") @ResultColumn("allocated_job") @SingleRowResult protected static final String GET_BOARD_JOBGet What job is allocated to a board.- See Also:
-
GET_MACHINE_REPORTS
@Parameter("machine_id") @ResultColumn("board_id") @ResultColumn("report_id") @ResultColumn("reported_issue") @ResultColumn("report_timestamp") @ResultColumn("reporter_name") protected static final String GET_MACHINE_REPORTSGet the problem reports about boards in a machine.- See Also:
-
GET_BOARD_REPORTS
@Parameter("board_id") @ResultColumn("board_id") @ResultColumn("report_id") @ResultColumn("reported_issue") @ResultColumn("report_timestamp") @ResultColumn("reporter_name") protected static final String GET_BOARD_REPORTSGet the problem reports about a board.- See Also:
-
DELETE_TASK
Delete an allocation task.- See Also:
-
FIND_FREE_BOARD
@Parameter("machine_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @SingleRowResult protected static final String FIND_FREE_BOARDFind a single free board.- See Also:
-
COUNT_FUNCTIONING_BOARDS
@Parameter("machine_id") @ResultColumn("c") @SingleRowResult protected static final String COUNT_FUNCTIONING_BOARDSCheck there is a single free board.- See Also:
-
ALLOCATE_BOARDS_JOB
@Parameter("width") @Parameter("height") @Parameter("depth") @Parameter("board_id") @Parameter("num_boards") @Parameter("allocated_board_id") @Parameter("job_id") protected static final String ALLOCATE_BOARDS_JOBTell a job that it is allocated. Doesn't set the state.- See Also:
-
GET_BOARD_BY_COORDS
@Parameter("machine_id") @Parameter("x") @Parameter("y") @Parameter("z") @ResultColumn("board_id") @SingleRowResult protected static final String GET_BOARD_BY_COORDSGet a board's ID by its coordinates.- See Also:
-
ALLOCATE_BOARDS_BOARD
Tell a board that it is allocated.- See Also:
-
DEALLOCATE_BMP_BOARDS_JOB
Tell the boards of a job that they're no longer allocated to the job.- See Also:
-
SET_BOARD_POWER_ON
Set the power state of a board.- See Also:
-
SET_BOARD_POWER_OFF
Set the power state of a board.- See Also:
-
SET_ALL_BOARDS_OFF
Set all boards to off.- See Also:
-
FIND_EXPIRED_JOBS
Find jobs that have expired their keepalive interval.- See Also:
-
SET_STATE_PENDING
Set the state for a job.- See Also:
-
SET_STATE_DESTROYED
Set the state destroyed and number of pending changes for a job.- See Also:
-
KILL_JOB_ALLOC_TASK
Delete a request to allocate resources for a job.- See Also:
-
KILL_ALL_JOB_ALLOC_TASK
Delete all requests to allocate resources for a job.- See Also:
-
FINISHED_PENDING
Delete a request to change the power of a board. Used once the change has been completed.- See Also:
-
DELETE_PENDING
@Parameter("job_id") @Parameter("from_state") @Parameter("to_state") protected static final String DELETE_PENDINGDelete a requests to change the power of a board. Used once the errors have been handled.- See Also:
-
ERROR_PENDING
Set a request to change the power of a board to an error.- See Also:
-
LOAD_DIR_INFO
@ResultColumn("z") @ResultColumn("direction") @ResultColumn("dx") @ResultColumn("dy") @ResultColumn("dz") protected static final String LOAD_DIR_INFOGet descriptions of how to move from a board to its neighbours.- See Also:
-
GET_CHANGES
@Parameter("bmp_id") @ResultColumn("change_id") @ResultColumn("job_id") @ResultColumn("board_id") @ResultColumn("power") @ResultColumn("fpga_n") @ResultColumn("fpga_s") @ResultColumn("fpga_ne") @ResultColumn("fpga_nw") @ResultColumn("fpga_se") @ResultColumn("fpga_sw") @ResultColumn("from_state") @ResultColumn("to_state") @ResultColumn("board_num") @ResultColumn("bmp_id") @ResultColumn("power_off_timestamp") protected static final String GET_CHANGESGet the requests to change the power of boards on a BMP.- See Also:
-
COUNT_CHANGES_FOR_JOB
@Parameter("job_id") @Parameter("from_state") @Parameter("to_state") @ResultColumn("n_changes") @ResultColumn("n_errors") protected static final String COUNT_CHANGES_FOR_JOBGet the number of changes that are not completed for a job.- See Also:
-
INSERT_BMP
@Parameter("machine_id") @Parameter("address") @Parameter("cabinet") @Parameter("frame") @GeneratesID protected static final String INSERT_BMPInsert a BMP.- See Also:
-
INSERT_BOARD
@Parameter("machine_id") @Parameter("address") @Parameter("bmp_id") @Parameter("board_num") @Parameter("x") @Parameter("y") @Parameter("z") @Parameter("root_x") @Parameter("root_y") @Parameter("enabled") @GeneratesID protected static final String INSERT_BOARDInsert a board.- See Also:
-
INSERT_LINK
@Parameter("board_1") @Parameter("dir_1") @Parameter("board_2") @Parameter("dir_2") @Parameter("live") @GeneratesID protected static final String INSERT_LINKInsert a link.- See Also:
-
INSERT_MACHINE_SPINN_5
@Parameter("name") @Parameter("width") @Parameter("height") @Parameter("depth") @GeneratesID protected static final String INSERT_MACHINE_SPINN_5Insert a machine.- See Also:
-
INSERT_TAG
Insert a tag. -
DELETE_MACHINE_TAGS
Delete all tags for a machine.- See Also:
-
SET_MACHINE_STATE
Set the in-service flag for a machine.- See Also:
-
SET_MAX_COORDS
@Parameter("max_x") @Parameter("max_y") @Parameter("machine_id") protected static final String SET_MAX_COORDSNote down the maximum chip coordinates so we can calculate wraparounds correctly.- See Also:
-
FIND_BOARD_BY_ID
@Parameter("board_id") @ResultColumn("board_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("board_num") @ResultColumn("address") @ResultColumn("machine_name") @ResultColumn("bmp_serial_id") @ResultColumn("physical_serial_id") @ResultColumn("bmp_id") @ResultColumn("machine_id") @SingleRowResult protected static final String FIND_BOARD_BY_IDGet a board's full coordinate info given it's ID.- See Also:
-
FIND_BOARD_BY_NAME_AND_XYZ
@Parameter("machine_name") @Parameter("x") @Parameter("y") @Parameter("z") @ResultColumn("board_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("board_num") @ResultColumn("address") @ResultColumn("machine_name") @ResultColumn("bmp_serial_id") @ResultColumn("physical_serial_id") @ResultColumn("bmp_id") @ResultColumn("machine_id") @SingleRowResult protected static final String FIND_BOARD_BY_NAME_AND_XYZGet a board's ID given it's triad coordinates.- See Also:
-
FIND_BOARD_BY_NAME_AND_CFB
@Parameter("machine_name") @Parameter("cabinet") @Parameter("frame") @Parameter("board") @ResultColumn("board_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("board_num") @ResultColumn("address") @ResultColumn("machine_name") @ResultColumn("bmp_serial_id") @ResultColumn("physical_serial_id") @ResultColumn("bmp_id") @ResultColumn("machine_id") @SingleRowResult protected static final String FIND_BOARD_BY_NAME_AND_CFBGet a board's ID given it's physical coordinates.- See Also:
-
FIND_BOARD_BY_NAME_AND_IP_ADDRESS
@Parameter("machine_name") @Parameter("address") @ResultColumn("board_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("board_num") @ResultColumn("address") @ResultColumn("machine_name") @ResultColumn("bmp_serial_id") @ResultColumn("physical_serial_id") @ResultColumn("bmp_id") @ResultColumn("machine_id") @SingleRowResult protected static final String FIND_BOARD_BY_NAME_AND_IP_ADDRESSGet a board's ID given it's IP address.- See Also:
-
GET_FUNCTIONING_FIELD
@Parameter("board_id") @ResultColumn("functioning") @SingleRowResult protected static final String GET_FUNCTIONING_FIELDGet the value of a board'sfunctioning
column.- See Also:
-
SET_FUNCTIONING_FIELD
Set the value of a board'sfunctioning
column. Enables or disables allocation of the board.- See Also:
-
GET_USER_QUOTA
@Parameter("user_name") @ResultColumn("quota_total") @ResultColumn("user_id") @SingleRowResult protected static final String GET_USER_QUOTAGet the quota for a user.- See Also:
-
GET_GROUP_QUOTA
@Parameter("group_id") @ResultColumn("quota") @SingleRowResult protected static final String GET_GROUP_QUOTAGet the quota for a group.- See Also:
-
GET_CURRENT_USAGE
@Parameter("group_id") @ResultColumn("current_usage") @SingleRowResult protected static final String GET_CURRENT_USAGEGet the current non-consolidated usage for a group.- See Also:
-
GET_JOB_USAGE_AND_QUOTA
@Parameter("job_id") @ResultColumn("quota_used") @ResultColumn("quota") @SingleRowResult protected static final String GET_JOB_USAGE_AND_QUOTAGet usage of a job and the quota against which that applies.- See Also:
-
GET_CONSOLIDATION_TARGETS
@ResultColumn("job_id") @ResultColumn("group_id") @ResultColumn("quota_used") protected static final String GET_CONSOLIDATION_TARGETSGet resource usage info about completed jobs that have yet to be consolidated into the main quota table.- See Also:
-
DECREMENT_QUOTA
Reduce a group's quota on a machine by a specified amount.- See Also:
-
MARK_CONSOLIDATED
Mark a job as having had its resource usage consolidated.- See Also:
-
ADJUST_QUOTA
Add or remove time from a quota. Used when someone's administratively adjusting the quota.- See Also:
-
SET_COLLAB_QUOTA
Set a quota. Used when the system is aligning quota with NMPI data.- See Also:
-
GET_USER_DETAILS
@Parameter("user_id") @ResultColumn("user_id") @ResultColumn("user_name") @ResultColumn("has_password") @ResultColumn("trust_level") @ResultColumn("locked") @ResultColumn("disabled") @ResultColumn("last_successful_login_timestamp") @ResultColumn("last_fail_timestamp") @ResultColumn("openid_subject") @ResultColumn("is_internal") @SingleRowResult protected static final String GET_USER_DETAILSGet details about a user. This is pretty much everything except their password.- See Also:
-
GET_USER_DETAILS_BY_NAME
@Parameter("user_name") @ResultColumn("user_id") @ResultColumn("user_name") @ResultColumn("has_password") @ResultColumn("trust_level") @ResultColumn("locked") @ResultColumn("disabled") @ResultColumn("last_successful_login_timestamp") @ResultColumn("last_fail_timestamp") @ResultColumn("openid_subject") @ResultColumn("is_internal") @SingleRowResult protected static final String GET_USER_DETAILS_BY_NAMEGet details about a user. This is pretty much everything except their password.- See Also:
-
GET_USER_DETAILS_BY_SUBJECT
@Parameter("openid_subject") @ResultColumn("user_id") @ResultColumn("user_name") @ResultColumn("has_password") @ResultColumn("trust_level") @ResultColumn("locked") @ResultColumn("disabled") @ResultColumn("last_successful_login_timestamp") @ResultColumn("last_fail_timestamp") @ResultColumn("openid_subject") @ResultColumn("is_internal") @SingleRowResult protected static final String GET_USER_DETAILS_BY_SUBJECTGet details about a user. This is pretty much everything except their password.- See Also:
-
GET_LOCAL_USER_DETAILS
@Parameter("user_name") @ResultColumn("user_id") @ResultColumn("user_name") @ResultColumn("encrypted_password") @SingleRowResult protected static final String GET_LOCAL_USER_DETAILSGet a local user's basic details.- See Also:
-
GET_GROUP_BY_NAME_AND_MEMBER
@Parameter("user_name") @Parameter("group_name") @ResultColumn("group_id") @SingleRowResult protected static final String GET_GROUP_BY_NAME_AND_MEMBERGet the ID of a particular group that a particular user must be a member of.- See Also:
-
GET_GROUP_NAMES_OF_USER
@Parameter("user_name") @ResultColumn("group_name") protected static final String GET_GROUP_NAMES_OF_USERList all the groups that a user is a member of and that have quota left.- See Also:
-
GET_USERS_OF_GROUP
@Parameter("group_id") @ResultColumn("membership_id") @ResultColumn("group_id") @ResultColumn("group_name") @ResultColumn("user_id") @ResultColumn("user_name") protected static final String GET_USERS_OF_GROUPList the members of a group.- See Also:
-
GET_MEMBERSHIP
@Parameter("membership_id") @ResultColumn("membership_id") @ResultColumn("user_id") @ResultColumn("group_id") @ResultColumn("user_name") @ResultColumn("group_name") @SingleRowResult protected static final String GET_MEMBERSHIPGet the details from a specific membership.- See Also:
-
GET_MEMBERSHIPS_OF_USER
@Parameter("user_id") @ResultColumn("membership_id") @ResultColumn("user_id") @ResultColumn("group_id") @ResultColumn("group_name") @ResultColumn("user_name") protected static final String GET_MEMBERSHIPS_OF_USERGet the memberships of a user.- See Also:
-
CREATE_GROUP
@Parameter("group_name") @Parameter("quota") @Parameter("group_type") @GeneratesID protected static final String CREATE_GROUPCreate a group record.- See Also:
-
CREATE_GROUP_IF_NOT_EXISTS
@Parameter("group_name") @Parameter("quota") @Parameter("group_type") protected static final String CREATE_GROUP_IF_NOT_EXISTSCreate a group record.- See Also:
-
DELETE_GROUP
@Parameter("group_id") @ResultColumn("group_name") @SingleRowResult protected static final String DELETE_GROUPDelete a single group record and returns the name of the deleted group.- See Also:
-
UPDATE_GROUP
@Parameter("group_name") @Parameter("quota") @Parameter("group_id") @SingleRowResult protected static final String UPDATE_GROUPUpdate a single group record's name and quota.- See Also:
-
ADD_USER_TO_GROUP
@Parameter("user_id") @Parameter("group_id") @GeneratesID protected static final String ADD_USER_TO_GROUPAdds a user to a group.- See Also:
-
REMOVE_USER_FROM_GROUP
Removes a user from a group.- See Also:
-
GROUP_SYNC_MAKE_TEMP_TABLE
Step 1 of group synchronisation: make a temporary table. Should be performed in a transaction with the other group synch steps.- See Also:
-
GROUP_SYNC_INSERT_TEMP_ROW
@Parameter("group_name") @Parameter("group_type") protected static final String GROUP_SYNC_INSERT_TEMP_ROWStep 2 of group synchronisation: add a desired group to the temp table. Should be performed in a transaction with the other group synch steps. Requires thatGROUP_SYNC_MAKE_TEMP_TABLE
was run first and thatGROUP_SYNC_DROP_TEMP_TABLE
has not yet run.- See Also:
-
GROUP_SYNC_ADD_GROUPS
Step 3 of group synchronisation: add real missing groups. Requires the temporary table to have been set up already. Should be performed in a transaction with the other group synch steps. Requires thatGROUP_SYNC_MAKE_TEMP_TABLE
was run first and thatGROUP_SYNC_DROP_TEMP_TABLE
has not yet run.- See Also:
-
GROUP_SYNC_REMOVE_GROUPS
Step 4 of group synchronisation: remove real groups no longer wanted. Requires the temporary table to have been set up already. Should be performed in a transaction with the other group synch steps. Requires thatGROUP_SYNC_MAKE_TEMP_TABLE
was run first and thatGROUP_SYNC_DROP_TEMP_TABLE
has not yet run.- See Also:
-
GROUP_SYNC_DROP_TEMP_TABLE
Step 5 of group synchronisation: drop the temporary table. Except we don't because that doesn't work in a transaction; squelching the contents works though (the table itself is dropped automatically when the connection is dropped so we don't need to clean it up here). Should be performed in a transaction with the other group synch steps. Requires thatGROUP_SYNC_MAKE_TEMP_TABLE
was run first.- See Also:
-
IS_USER_LOCKED
@Parameter("username") @ResultColumn("user_id") @ResultColumn("locked") @ResultColumn("disabled") @SingleRowResult protected static final String IS_USER_LOCKEDTest if a user account is locked or disabled.- See Also:
-
GET_USER_AUTHORITIES
@Parameter("user_id") @ResultColumn("trust_level") @ResultColumn("encrypted_password") @ResultColumn("openid_subject") @SingleRowResult protected static final String GET_USER_AUTHORITIESGet the permissions and encrypted password for a user.- See Also:
-
MARK_LOGIN_SUCCESS
Note the login success.- See Also:
-
MARK_LOGIN_FAILURE
Note the login failure.- See Also:
-
UNLOCK_LOCKED_USERS
Unlock accounts.- See Also:
-
DELETE_USER
Delete a user.- See Also:
-
GET_USER_ID
@Parameter("user_name") @ResultColumn("user_id") @SingleRowResult protected static final String GET_USER_IDGet the ID of a user. Used for safety checks.- See Also:
-
SET_USER_TRUST
Set the amount a user is trusted.- See Also:
-
SET_USER_LOCKED
Set whether a user is locked. Can be used to unlock a user early.- See Also:
-
SET_USER_DISABLED
Set whether a user is administratively disabled.- See Also:
-
SET_USER_PASS
Set a user's password. Passwords are either encrypted (with bcrypt) ornull
to indicate that they should be using some other system (OIDC?) to authenticate them.- See Also:
-
SET_USER_NAME
Set a user's name.- See Also:
-
LIST_ALL_USERS
@ResultColumn("user_id") @ResultColumn("user_name") @ResultColumn("openid_subject") protected static final String LIST_ALL_USERSGet a list of all users.- See Also:
-
LIST_ALL_USERS_OF_TYPE
@Parameter("internal") @ResultColumn("user_id") @ResultColumn("user_name") @ResultColumn("openid_subject") protected static final String LIST_ALL_USERS_OF_TYPEGet a list of all users.- See Also:
-
CREATE_USER
@Parameter("user_name") @Parameter("encoded_password") @Parameter("trust_level") @Parameter("disabled") @Parameter("openid_subject") @GeneratesID protected static final String CREATE_USERCreate a user. Passwords are either encrypted (with bcrypt) ornull
to indicate that they should be using some other system to authenticate them.- See Also:
-
LIST_ALL_GROUPS
@ResultColumn("group_id") @ResultColumn("group_name") @ResultColumn("quota") @ResultColumn("group_type") protected static final String LIST_ALL_GROUPSGet a list of all groups.- See Also:
-
LIST_ALL_GROUPS_OF_TYPE
@Parameter("type") @ResultColumn("group_id") @ResultColumn("group_name") @ResultColumn("quota") @ResultColumn("group_type") protected static final String LIST_ALL_GROUPS_OF_TYPEGet a list of all groups of a given type.- See Also:
-
GET_GROUP_BY_ID
@Parameter("group_id") @ResultColumn("group_id") @ResultColumn("group_name") @ResultColumn("quota") @ResultColumn("group_type") @SingleRowResult protected static final String GET_GROUP_BY_IDGet a group by it's ID.- See Also:
-
GET_GROUP_BY_NAME
@Parameter("group_name") @ResultColumn("group_id") @ResultColumn("group_name") @ResultColumn("quota") @ResultColumn("group_type") @SingleRowResult protected static final String GET_GROUP_BY_NAMEGet a group by it's name.- See Also:
-
INSERT_BOARD_REPORT
@Parameter("board_id") @Parameter("job_id") @Parameter("issue") @Parameter("user_id") @GeneratesID protected static final String INSERT_BOARD_REPORTCreate a board issue report.- See Also:
-
DELETE_JOB_RECORD
Actually delete a job record. Only called by the data tombstone-r. This is the only thing that deletes jobs from the active database. -
DELETE_ALLOC_RECORD
Actually delete an allocation record. Only called by the data tombstone-r. This and triggers are the only things that delete allocation records from the active database. -
DELETE_NMPI_JOB
Actually delete an NMPI job record. Only called by the data tombstone-r.- See Also:
-
DELETE_NMPI_SESSION
Actually delete an NMPI session record. Only called by the data tombstone-r.- See Also:
-
GET_BLACKLISTED_CHIPS
@Parameter("board_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("notes") protected static final String GET_BLACKLISTED_CHIPSRead the blacklisted chips for a board.- See Also:
-
GET_BLACKLISTED_CORES
@Parameter("board_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("p") @ResultColumn("notes") protected static final String GET_BLACKLISTED_CORESRead the blacklisted cores for a board.- See Also:
-
GET_BLACKLISTED_LINKS
@Parameter("board_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("direction") @ResultColumn("notes") protected static final String GET_BLACKLISTED_LINKSRead the blacklisted links for a board.- See Also:
-
MARK_BOARD_BLACKLIST_CHANGED
Mark a board as having had its blacklist modified.- See Also:
-
MARK_BOARD_BLACKLIST_SYNCHED
Mark a board as having had its blacklist synchronised with the hardware.- See Also:
-
IS_BOARD_BLACKLIST_CURRENT
@Parameter("board_id") @ResultColumn("current") @SingleRowResult protected static final String IS_BOARD_BLACKLIST_CURRENTAsks whether the blacklist model for a board is believed to be synchronised to the hardware.- See Also:
-
ADD_BLACKLISTED_CHIP
@Parameter("board_id") @Parameter("x") @Parameter("y") protected static final String ADD_BLACKLISTED_CHIPAdd a chip on a board to that board's blacklist. Does not cause the blacklist to be written to anywhere. Thex
,y
are board-local coordinates.- See Also:
-
ADD_BLACKLISTED_CORE
@Parameter("board_id") @Parameter("x") @Parameter("y") @Parameter("p") protected static final String ADD_BLACKLISTED_COREAdd a core on a board to that board's blacklist. Does not cause the blacklist to be written to anywhere. Thex
,y
are board-local coordinates.- See Also:
-
ADD_BLACKLISTED_LINK
@Parameter("board_id") @Parameter("x") @Parameter("y") @Parameter("direction") protected static final String ADD_BLACKLISTED_LINKAdd a link on a board to that board's blacklist. Does not cause the blacklist to be written to anywhere. Thex
,y
are board-local coordinates.- See Also:
-
CLEAR_BLACKLISTED_CHIPS
Delete all blacklist entries for chips on a board.- See Also:
-
CLEAR_BLACKLISTED_CORES
Delete all blacklist entries for cores on a board.- See Also:
-
CLEAR_BLACKLISTED_LINKS
Delete all blacklist entries for links on a board.- See Also:
-
GET_BLACKLIST_WRITES
@Parameter("bmp_id") @ResultColumn("op_id") @ResultColumn("board_id") @ResultColumn("bmp_serial_id") @ResultColumn("board_num") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("machine_id") protected static final String GET_BLACKLIST_WRITESGet the list of writes (to the machine) of blacklist data to perform.- See Also:
-
GET_BLACKLIST_READS
@Parameter("bmp_id") @ResultColumn("op_id") @ResultColumn("board_id") @ResultColumn("bmp_serial_id") @ResultColumn("board_num") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("machine_id") protected static final String GET_BLACKLIST_READSGet the list of reads (from the machine) of blacklist data to perform.- See Also:
-
GET_SERIAL_INFO_REQS
@Parameter("bmp_id") @ResultColumn("op_id") @ResultColumn("board_id") @ResultColumn("bmp_serial_id") @ResultColumn("board_num") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("machine_id") protected static final String GET_SERIAL_INFO_REQSGet the list of reads (from the machine) of serial data to perform.- See Also:
-
GET_TEMP_INFO_REQS
@Parameter("bmp_id") @ResultColumn("op_id") @ResultColumn("board_id") @ResultColumn("bmp_serial_id") @ResultColumn("board_num") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("machine_id") protected static final String GET_TEMP_INFO_REQSGet the list of reads (from the machine) of temperature data to perform.- See Also:
-
SET_BOARD_SERIAL_IDS
@Parameter("board_id") @Parameter("bmp_serial_id") @Parameter("physical_serial_id") @GeneratesID protected static final String SET_BOARD_SERIAL_IDSSet the BMP and physical serial IDs based on the information actually read off the machine. A bit of care is needed because we might not yet have a row for that board.- See Also:
-
COMPLETED_BOARD_INFO_READ
Mark a read of a blacklist or ADC data as completed.- See Also:
-
COMPLETED_BLACKLIST_WRITE
Mark a write of a blacklist as completed.- See Also:
-
COMPLETED_GET_SERIAL_REQ
Mark a read of serial data as completed. (Text same asCOMPLETED_BLACKLIST_WRITE
for now, but logically distinct.)- See Also:
-
FAILED_BLACKLIST_OP
Mark a read or write of a blacklist as failed, noting the reason.- See Also:
-
GET_COMPLETED_BLACKLIST_OP
@Parameter("op_id") @ResultColumn("board_id") @ResultColumn("op") @ResultColumn("data") @ResultColumn("failure") @SingleRowResult protected static final String GET_COMPLETED_BLACKLIST_OPRetrieve a completed request to read or write a BMP-related data for a board.- See Also:
-
DELETE_BLACKLIST_OP
Delete a blacklist request.- See Also:
-
CREATE_BLACKLIST_READ
Insert a request to read a board's blacklist.- See Also:
-
CREATE_BLACKLIST_WRITE
@Parameter("board_id") @Parameter("blacklist") @GeneratesID protected static final String CREATE_BLACKLIST_WRITEInsert a request to write a board's blacklist.- See Also:
-
CREATE_SERIAL_READ_REQ
Insert a request to read a board's serial information.- See Also:
-
CREATE_TEMP_READ_REQ
Insert a request to read a board's temperature data.- See Also:
-
READ_HISTORICAL_ALLOCS
@Parameter("grace_period") @ResultColumn("alloc_id") @ResultColumn("job_id") @ResultColumn("board_id") @ResultColumn("alloc_timestamp") protected static final String READ_HISTORICAL_ALLOCSRead historical allocations to be written to the historical data DB. Only allocations that are already completed will ever get read here. -
READ_HISTORICAL_JOBS
@Parameter("grace_period") @ResultColumn("job_id") @ResultColumn("machine_id") @ResultColumn("owner") @ResultColumn("create_timestamp") @ResultColumn("width") @ResultColumn("height") @ResultColumn("depth") @ResultColumn("allocated_root") @ResultColumn("keepalive_interval") @ResultColumn("keepalive_host") @ResultColumn("death_reason") @ResultColumn("death_timestamp") @ResultColumn("original_request") @ResultColumn("allocation_timestamp") @ResultColumn("allocation_size") @ResultColumn("machine_name") @ResultColumn("user_name") @ResultColumn("group_id") @ResultColumn("group_name") @ResultColumn("nmpi_job_id") @ResultColumn("nmpi_session_id") protected static final String READ_HISTORICAL_JOBSRead historical jobs to be written to the historical data DB. Only jobs that are already completed will ever get read here.- See Also:
-
WRITE_HISTORICAL_ALLOCS
@Parameter("alloc_id") @Parameter("job_id") @Parameter("board_id") @Parameter("allocation_timestamp") protected static final String WRITE_HISTORICAL_ALLOCSWrite to the historical allocations database.- See Also:
-
WRITE_HISTORICAL_JOBS
@Parameter("job_id") @Parameter("machine_id") @Parameter("owner") @Parameter("create_timestamp") @Parameter("width") @Parameter("height") @Parameter("depth") @Parameter("root_id") @Parameter("keepalive_interval") @Parameter("keepalive_host") @Parameter("death_reason") @Parameter("death_timestamp") @Parameter("original_request") @Parameter("allocation_timestamp") @Parameter("allocation_size") @Parameter("machine_name") @Parameter("owner_name") @Parameter("group_id") @Parameter("group_name") @Parameter("nmpi_job_id") @Parameter("nmpi_session_id") protected static final String WRITE_HISTORICAL_JOBSWrite to the historical jobs database.- See Also:
-
SET_JOB_SESSION
@Parameter("job_id") @Parameter("session_id") @Parameter("quota_units") protected static final String SET_JOB_SESSIONSet the NMPI session for a Job.- See Also:
-
SET_JOB_NMPI_JOB
@Parameter("job_id") @Parameter("nmpi_job_id") @Parameter("quota_units") protected static final String SET_JOB_NMPI_JOBSet the NMPI Job for a Job.- See Also:
-
GET_JOB_SESSION
@Parameter("job_id") @ResultColumn("session_id") @ResultColumn("quota_units") protected static final String GET_JOB_SESSIONGet the NMPI Session for a Job.- See Also:
-
GET_JOB_NMPI_JOB
@Parameter("job_id") @ResultColumn("nmpi_job_id") @ResultColumn("quota_units") protected static final String GET_JOB_NMPI_JOBGet the NMPI Job for a Job.- See Also:
-
FIND_LOCATION
@Parameter("machine_id") @Parameter("board_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @SingleRowResult protected static final String FIND_LOCATIONFind an allocatable board with a specific board ID. (This will have been previously converted from some other form of board coordinates.)- See Also:
-
CHECK_LOCATION
@Parameter("machine_id") @Parameter("board_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @SingleRowResult protected static final String CHECK_LOCATIONCheck a board with a specific board ID is allocatable. (This will have been previously converted from some other form of board coordinates.)- See Also:
-
findRectangle
@Parameter("width") @Parameter("height") @Parameter("machine_id") @Parameter("max_dead_boards") @ResultColumn("id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("available") protected SQL findRectangleFind a rectangle of triads of boards that may be allocated. Themax_dead_boards
gives the amount of allowance for non-allocatable resources to be made within the rectangle.- See Also:
-
checkRectangle
@Parameter("width") @Parameter("height") @Parameter("machine_id") @Parameter("max_dead_boards") @ResultColumn("id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("available") protected SQL checkRectangleCheck that a rectangle of triads of boards that may be allocated. Themax_dead_boards
gives the amount of allowance for non-allocatable resources to be made within the rectangle.- See Also:
-
findRectangleAt
@Parameter("board_id") @Parameter("width") @Parameter("height") @Parameter("machine_id") @Parameter("max_dead_boards") @ResultColumn("id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("available") @SingleRowResult protected SQL findRectangleAtFind a rectangle of triads of boards rooted at a specific board that may be allocated. Themax_dead_boards
gives the amount of allowance for non-allocatable resources to be made within the rectangle.- See Also:
-
checkRectangleAt
@Parameter("board_id") @Parameter("width") @Parameter("height") @Parameter("machine_id") @Parameter("max_dead_boards") @ResultColumn("id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("available") @SingleRowResult protected SQL checkRectangleAtFind a rectangle of triads of boards rooted at a specific board that may be allocated. Themax_dead_boards
gives the amount of allowance for non-allocatable resources to be made within the rectangle.- See Also:
-
issueChangeForJob
@Parameter("job_id") @Parameter("board_id") @Parameter("from_state") @Parameter("to_state") @Parameter("power") @Parameter("fpga_n") @Parameter("fpga_e") @Parameter("fpga_se") @Parameter("fpga_s") @Parameter("fpga_w") @Parameter("fpga_nw") @GeneratesID @Value("classpath:queries/issue_change_for_job.sql") protected Resource issueChangeForJobCreate a request to change the power status of a board. -
countConnected
@Parameter("machine_id") @Parameter("x") @Parameter("y") @Parameter("width") @Parameter("height") @ResultColumn("connected_size") @SingleRowResult @Value("classpath:queries/allocation_connected.sql") protected Resource countConnectedCount the number of connected boards (i.e., have at least one path over enabled links to the root board of the allocation) within a rectangle of triads. The triads are taken as being full depth.Ideally this would be part of
findRectangle
, but both that query and this one are entirely complicated enough already! Also, we don't expect to have this query reject many candidate allocations.- See Also:
-
getPerimeterLinks
@Parameter("job_id") @ResultColumn("board_id") @ResultColumn("direction") @Value("classpath:queries/perimeter.sql") protected Resource getPerimeterLinksGet the links on the perimeter of the allocation to a job. The perimeter is defined as being the links between a board that is part of the allocation and a board that is not; it's not a geometric definition, but rather a relational algebraic one.- See Also:
-
findBoardByGlobalChip
@Parameter("machine_id") @Parameter("x") @Parameter("y") @ResultColumn("board_id") @ResultColumn("address") @ResultColumn("bmp_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("job_id") @ResultColumn("machine_name") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("board_num") @ResultColumn("chip_x") @ResultColumn("chip_y") @ResultColumn("board_chip_x") @ResultColumn("board_chip_y") @ResultColumn("job_root_chip_x") @ResultColumn("job_root_chip_y") @SingleRowResult @Value("classpath:queries/find_board_by_global_chip.sql") protected Resource findBoardByGlobalChipLocate a board (using a full set of coordinates) based on global chip coordinates.- See Also:
-
findBoardByJobChip
@Parameter("job_id") @Parameter("board_id") @Parameter("x") @Parameter("y") @ResultColumn("board_id") @ResultColumn("address") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("job_id") @ResultColumn("machine_name") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("board_num") @ResultColumn("chip_x") @ResultColumn("chip_y") @ResultColumn("board_chip_x") @ResultColumn("board_chip_y") @SingleRowResult @Value("classpath:queries/find_board_by_job_chip.sql") protected Resource findBoardByJobChipLocate a board (using a full set of coordinates) based on allocation-local chip coordinates.- See Also:
-
findBoardByLogicalCoords
@Parameter("machine_id") @Parameter("x") @Parameter("y") @Parameter("z") @ResultColumn("board_id") @ResultColumn("address") @ResultColumn("bmp_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("job_id") @ResultColumn("machine_name") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("board_num") @ResultColumn("chip_x") @ResultColumn("chip_y") @ResultColumn("board_chip_x") @ResultColumn("board_chip_y") @SingleRowResult @Value("classpath:queries/find_board_by_logical_coords.sql") protected Resource findBoardByLogicalCoordsLocate a board (using a full set of coordinates) based on logical triad coordinates.- See Also:
-
findBoardByPhysicalCoords
@Parameter("machine_id") @Parameter("cabinet") @Parameter("frame") @Parameter("board") @ResultColumn("board_id") @ResultColumn("address") @ResultColumn("bmp_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("job_id") @ResultColumn("machine_name") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("board_num") @ResultColumn("chip_x") @ResultColumn("chip_y") @ResultColumn("board_chip_x") @ResultColumn("board_chip_y") @SingleRowResult @Value("classpath:queries/find_board_by_physical_coords.sql") protected Resource findBoardByPhysicalCoordsLocate a board (using a full set of coordinates) based on physical cabinet-frame-board coordinates.- See Also:
-
findBoardByIPAddress
@Parameter("machine_id") @Parameter("address") @ResultColumn("board_id") @ResultColumn("address") @ResultColumn("bmp_id") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("job_id") @ResultColumn("machine_name") @ResultColumn("cabinet") @ResultColumn("frame") @ResultColumn("board_num") @ResultColumn("chip_x") @ResultColumn("chip_y") @ResultColumn("board_chip_x") @ResultColumn("board_chip_y") @SingleRowResult @Value("classpath:queries/find_board_by_ip_address.sql") protected Resource findBoardByIPAddressLocate a board (using a full set of coordinates) based on the IP address of its ethernet chip.- See Also:
-
getJobsWithChanges
@Parameter("machine_id") @ResultColumn("job_id") @Value("classpath:queries/get_jobs_with_changes.sql") protected Resource getJobsWithChangesGet jobs on a machine that have changes that can be processed. (A policy of how long after switching a board on or off is applied.) -
getConnectedBoards
@Parameter("machine_id") @Parameter("x") @Parameter("y") @Parameter("z") @Parameter("width") @Parameter("height") @Parameter("depth") @ResultColumn("board_id") @Value("classpath:queries/connected_boards_at_coords.sql") protected Resource getConnectedBoardsGet the set of boards at some coordinates within a triad rectangle that are connected (i.e., have at least one path over enableable links) to the root board.- See Also:
-
getDeadLinks
@Parameter("machine_id") @ResultColumn("board_1_x") @ResultColumn("board_1_y") @ResultColumn("board_1_z") @ResultColumn("board_1_c") @ResultColumn("board_1_f") @ResultColumn("board_1_b") @ResultColumn("board_1_addr") @ResultColumn("dir_1") @ResultColumn("board_2_x") @ResultColumn("board_2_y") @ResultColumn("board_2_z") @ResultColumn("board_2_c") @ResultColumn("board_2_f") @ResultColumn("board_2_b") @ResultColumn("board_2_addr") @ResultColumn("dir_2") @Value("classpath:queries/get_dead_links.sql") protected Resource getDeadLinksGet the links of a machine that have been disabled. -
getAllocationTasks
@Parameter("job_state") @ResultColumn("req_id") @ResultColumn("job_id") @ResultColumn("num_boards") @ResultColumn("width") @ResultColumn("height") @ResultColumn("board_id") @ResultColumn("machine_id") @ResultColumn("max_dead_boards") @ResultColumn("max_width") @ResultColumn("max_height") @ResultColumn("job_state") @ResultColumn("importance") @Value("classpath:queries/get_allocation_tasks.sql") protected Resource getAllocationTasksGet the list of allocation tasks. -
getReportedBoards
@Parameter("threshold") @ResultColumn("board_id") @ResultColumn("num_reports") @ResultColumn("x") @ResultColumn("y") @ResultColumn("z") @ResultColumn("address") @Value("classpath:queries/get_reported_boards.sql") protected Resource getReportedBoardsGet enabled boards with at least as many reported problems as a given threshold.
-
-
Constructor Details
-
SQLQueries
public SQLQueries()
-