Class SQLQueries
java.lang.Object
uk.ac.manchester.spinnaker.alloc.db.SQLQueries
- Direct Known Subclasses:
DatabaseAwareBean
,DirInfo
public abstract class SQLQueries extends Object
The literal SQL queries used in this package.
The schema they query against (defined in spalloc.sql
) is:
- Author:
- Donal Fellows
-
Field Summary
Fields Modifier and Type Field Description protected static String
ADD_BLACKLISTED_CHIP
Add a chip on a board to that board's blacklist.protected static String
ADD_BLACKLISTED_CORE
Add a core on a board to that board's blacklist.protected static String
ADD_BLACKLISTED_LINK
Add a link on a board to that board's blacklist.protected static String
ADD_USER_TO_GROUP
Adds a user to a group.protected static String
ADJUST_QUOTA
Add or remove time from a quota.protected static String
ALLOCATE_BOARDS_BOARD
Tell a board that it is allocated.protected static String
ALLOCATE_BOARDS_JOB
Tell a job that it is allocated.protected static String
BUMP_IMPORTANCE
Increases the importance of a job.protected static String
CHECK_LOCATION
Check a board with a specific board ID is allocatable.protected SQL
checkRectangle
Check that a rectangle of triads of boards that may be allocated.protected SQL
checkRectangleAt
Find a rectangle of triads of boards rooted at a specific board that may be allocated.protected static String
CLEAR_BLACKLISTED_CHIPS
Delete all blacklist entries for chips on a board.protected static String
CLEAR_BLACKLISTED_CORES
Delete all blacklist entries for cores on a board.protected static String
CLEAR_BLACKLISTED_LINKS
Delete all blacklist entries for links on a board.protected static String
COMPLETED_BLACKLIST_WRITE
Mark a write of a blacklist as completed.protected static String
COMPLETED_BOARD_INFO_READ
Mark a read of a blacklist or ADC data as completed.protected static String
COMPLETED_GET_SERIAL_REQ
Mark a read of serial data as completed.protected static String
COUNT_CHANGES_FOR_JOB
Get the number of changes that are not completed for a job.protected static String
COUNT_FUNCTIONING_BOARDS
Check there is a single free board.protected static String
COUNT_MACHINE_THINGS
Count things on a machine.protected static String
COUNT_POWERED_BOARDS
Counts the number of powered-on boards of a job.protected Resource
countConnected
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 String
CREATE_BLACKLIST_READ
Insert a request to read a board's blacklist.protected static String
CREATE_BLACKLIST_WRITE
Insert a request to write a board's blacklist.protected static String
CREATE_GROUP
Create a group record.protected static String
CREATE_GROUP_IF_NOT_EXISTS
Create a group record.protected static String
CREATE_SERIAL_READ_REQ
Insert a request to read a board's serial information.protected static String
CREATE_TEMP_READ_REQ
Insert a request to read a board's temperature data.protected static String
CREATE_USER
Create a user.protected static String
DEALLOCATE_BMP_BOARDS_JOB
Tell the boards of a job that they're no longer allocated to the job.protected static String
DECREMENT_QUOTA
Reduce a group's quota on a machine by a specified amount.protected static String
DELETE_ALLOC_RECORD
Actually delete an allocation record.protected static String
DELETE_BLACKLIST_OP
Delete a blacklist request.protected static String
DELETE_GROUP
Delete a single group record and returns the name of the deleted group.protected static String
DELETE_JOB_RECORD
Actually delete a job record.protected static String
DELETE_MACHINE_TAGS
Delete all tags for a machine.protected static String
DELETE_NMPI_JOB
Actually delete an NMPI job record.protected static String
DELETE_NMPI_SESSION
Actually delete an NMPI session record.protected static String
DELETE_PENDING
Delete a requests to change the power of a board.protected static String
DELETE_TASK
Delete an allocation task.protected static String
DELETE_USER
Delete a user.protected static String
DESTROY_JOB
Mark a job as dead.protected static String
ERROR_PENDING
Set a request to change the power of a board to an error.protected static String
FAILED_BLACKLIST_OP
Mark a read or write of a blacklist as failed, noting the reason.protected static String
FIND_BOARD_BY_ID
Get a board's full coordinate info given it's ID.protected static String
FIND_BOARD_BY_NAME_AND_CFB
Get a board's ID given it's physical coordinates.protected static String
FIND_BOARD_BY_NAME_AND_IP_ADDRESS
Get a board's ID given it's IP address.protected static String
FIND_BOARD_BY_NAME_AND_XYZ
Get a board's ID given it's triad coordinates.protected static String
FIND_EXPIRED_JOBS
Find jobs that have expired their keepalive interval.protected static String
FIND_FREE_BOARD
Find a single free board.protected static String
FIND_LOCATION
Find an allocatable board with a specific board ID.protected Resource
findBoardByGlobalChip
Locate a board (using a full set of coordinates) based on global chip coordinates.protected Resource
findBoardByIPAddress
Locate a board (using a full set of coordinates) based on the IP address of its ethernet chip.protected Resource
findBoardByJobChip
Locate a board (using a full set of coordinates) based on allocation-local chip coordinates.protected Resource
findBoardByLogicalCoords
Locate a board (using a full set of coordinates) based on logical triad coordinates.protected Resource
findBoardByPhysicalCoords
Locate a board (using a full set of coordinates) based on physical cabinet-frame-board coordinates.protected SQL
findRectangle
Find a rectangle of triads of boards that may be allocated.protected SQL
findRectangleAt
Find a rectangle of triads of boards rooted at a specific board that may be allocated.protected static String
FINISHED_PENDING
Delete a request to change the power of a board.protected static String
GET_ALL_BMP_BOARDS
Get all the boards of a BMP.protected static String
GET_ALL_BMPS
Get all the BMPs.protected static String
GET_ALL_BOARDS
Get all the boards (and related info) of a machine.protected static String
GET_ALL_BOARDS_OF_ALL_MACHINES
Get all the boards (and related info) known to the service.protected static String
GET_ALL_MACHINES
Get basic information about all machines.protected static String
GET_AVAILABLE_BOARD_NUMBERS
Get the boards that are available for allocation.protected static String
GET_BLACKLIST_READS
Get the list of reads (from the machine) of blacklist data to perform.protected static String
GET_BLACKLIST_WRITES
Get the list of writes (to the machine) of blacklist data to perform.protected static String
GET_BLACKLISTED_CHIPS
Read the blacklisted chips for a board.protected static String
GET_BLACKLISTED_CORES
Read the blacklisted cores for a board.protected static String
GET_BLACKLISTED_LINKS
Read the blacklisted links for a board.protected static String
GET_BMP_ADDRESS
Get the address of the BMP of the root board of the machine.protected static String
GET_BMP_BOARD_NUMBERS
Get the boards of a BMP that can be used.protected static String
GET_BOARD_ADDRESS
Get the address of the root chip of a board.protected static String
GET_BOARD_BY_COORDS
Get a board's ID by its coordinates.protected static String
GET_BOARD_CONNECT_INFO
Get connection info for board allocated to a job.protected static String
GET_BOARD_JOB
Get What job is allocated to a board.protected static String
GET_BOARD_NUMBERS
Get the boards of a machine that can be used.protected static String
GET_BOARD_POWER_INFO
Get whether a board is powered.protected static String
GET_BOARD_REPORTS
Get the problem reports about a board.protected static String
GET_CHANGES
Get the requests to change the power of boards on a BMP.protected static String
GET_COMPLETED_BLACKLIST_OP
Retrieve a completed request to read or write a BMP-related data for a board.protected static String
GET_CONSOLIDATION_TARGETS
Get resource usage info about completed jobs that have yet to be consolidated into the main quota table.protected static String
GET_CURRENT_USAGE
Get the current non-consolidated usage for a group.protected static String
GET_DEAD_BOARDS
Get the boards (and related info) of a machine that have been disabled.protected static String
GET_FUNCTIONING_FIELD
Get the value of a board'sfunctioning
column.protected static String
GET_GROUP_BY_ID
Get a group by it's ID.protected static String
GET_GROUP_BY_NAME
Get a group by it's name.protected static String
GET_GROUP_BY_NAME_AND_MEMBER
Get the ID of a particular group that a particular user must be a member of.protected static String
GET_GROUP_NAMES_OF_USER
List all the groups that a user is a member of and that have quota left.protected static String
GET_GROUP_QUOTA
Get the quota for a group.protected static String
GET_JOB
Get basic information about a specific job.protected static String
GET_JOB_BOARD_COORDS
Get the coords of boards assigned to a job.protected static String
GET_JOB_BOARDS
Get what boards are allocated to a job.protected static String
GET_JOB_CHIP_DIMENSIONS
Get the chip dimensions of a job.protected static String
GET_JOB_IDS
Get basic information about jobs.protected static String
GET_JOB_NMPI_JOB
Get the NMPI Job for a Job.protected static String
GET_JOB_SESSION
Get the NMPI Session for a Job.protected static String
GET_JOB_USAGE_AND_QUOTA
Get usage of a job and the quota against which that applies.protected static String
GET_LIVE_BOARDS
Get the boards (and related info) of a machine that are in service.protected static String
GET_LIVE_JOB_IDS
Get basic information about live jobs.protected static String
GET_LOCAL_USER_DETAILS
Get a local user's basic details.protected static String
GET_MACHINE_BY_ID
Get basic information about a specific machine.protected static String
GET_MACHINE_JOBS
Get basic info about active jobs on a machine.protected static String
GET_MACHINE_REPORTS
Get the problem reports about boards in a machine.protected static String
GET_MACHINE_WRAPS
Get whether a machine wraps in horizontal or vertical directions.protected static String
GET_MEMBERSHIP
Get the details from a specific membership.protected static String
GET_MEMBERSHIPS_OF_USER
Get the memberships of a user.protected static String
GET_NAMED_MACHINE
Get basic information about a specific machine.protected static String
GET_ROOT_BMP_ADDRESS
Get the address of the BMP of the root board of the machine.protected static String
GET_ROOT_COORDS
Get the coordinates of a board.protected static String
GET_ROOT_OF_BOARD
Get the coordinates of the root chip of a board.protected static String
GET_SERIAL_INFO_REQS
Get the list of reads (from the machine) of serial data to perform.protected static String
GET_SUM_BOARDS_POWERED
Get the number of boards that are allocated to a job that are switched on.protected static String
GET_TAGS
Get a machine's tags.protected static String
GET_TEMP_INFO_REQS
Get the list of reads (from the machine) of temperature data to perform.protected static String
GET_USER_AUTHORITIES
Get the permissions and encrypted password for a user.protected static String
GET_USER_DETAILS
Get details about a user.protected static String
GET_USER_DETAILS_BY_NAME
Get details about a user.protected static String
GET_USER_DETAILS_BY_SUBJECT
Get details about a user.protected static String
GET_USER_ID
Get the ID of a user.protected static String
GET_USER_QUOTA
Get the quota for a user.protected static String
GET_USERS_OF_GROUP
List the members of a group.protected Resource
getAllocationTasks
Get the list of allocation tasks.protected Resource
getConnectedBoards
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
getDeadLinks
Get the links of a machine that have been disabled.protected Resource
getJobsWithChanges
Get jobs on a machine that have changes that can be processed.protected Resource
getPerimeterLinks
Get the links on the perimeter of the allocation to a job.protected Resource
getReportedBoards
Get enabled boards with at least as many reported problems as a given threshold.protected static String
GROUP_SYNC_ADD_GROUPS
Step 3 of group synchronisation: add real missing groups.protected static String
GROUP_SYNC_DROP_TEMP_TABLE
Step 5 of group synchronisation: drop the temporary table.protected static String
GROUP_SYNC_INSERT_TEMP_ROW
Step 2 of group synchronisation: add a desired group to the temp table.protected static String
GROUP_SYNC_MAKE_TEMP_TABLE
Step 1 of group synchronisation: make a temporary table.protected static String
GROUP_SYNC_REMOVE_GROUPS
Step 4 of group synchronisation: remove real groups no longer wanted.protected static String
INSERT_BMP
Insert a BMP.protected static String
INSERT_BOARD
Insert a board.protected static String
INSERT_BOARD_REPORT
Create a board issue report.protected static String
INSERT_JOB
Create a job.protected static String
INSERT_LINK
Insert a link.protected static String
INSERT_MACHINE_SPINN_5
Insert a machine.protected static String
INSERT_REQ_BOARD
Create a request to allocate a specific board.protected static String
INSERT_REQ_N_BOARDS
Create a request to allocate a number of boards.protected static String
INSERT_REQ_SIZE
Create a request to allocate a rectangle of boards.protected static String
INSERT_REQ_SIZE_BOARD
Create a request to allocate triads starting at a particular board.protected static String
INSERT_TAG
Insert a tag.protected static String
IS_BOARD_BLACKLIST_CURRENT
Asks whether the blacklist model for a board is believed to be synchronised to the hardware.protected static String
IS_USER_LOCKED
Test if a user account is locked or disabled.protected Resource
issueChangeForJob
Create a request to change the power status of a board.protected static String
KILL_JOB_ALLOC_TASK
Delete a request to allocate resources for a job.protected static String
LIST_ALL_GROUPS
Get a list of all groups.protected static String
LIST_ALL_GROUPS_OF_TYPE
Get a list of all groups of a given type.protected static String
LIST_ALL_USERS
Get a list of all users.protected static String
LIST_ALL_USERS_OF_TYPE
Get a list of all users.protected static String
LIST_LIVE_JOBS
Gets information about live jobs.protected static String
LIST_MACHINE_NAMES
Get the machine names in alphabetical order.protected static String
LOAD_DIR_INFO
Get descriptions of how to move from a board to its neighbours.protected static String
MARK_BOARD_BLACKLIST_CHANGED
Mark a board as having had its blacklist modified.protected static String
MARK_BOARD_BLACKLIST_SYNCHED
Mark a board as having had its blacklist synchronised with the hardware.protected static String
MARK_CONSOLIDATED
Mark a job as having had its resource usage consolidated.protected static String
MARK_LOGIN_FAILURE
Note the login failure.protected static String
MARK_LOGIN_SUCCESS
Note the login success.protected static String
NOTE_DESTROY_REASON
Record the reason for a job being destroyed.protected static String
READ_HISTORICAL_ALLOCS
Read historical allocations to be written to the historical data DB.protected static String
READ_HISTORICAL_JOBS
Read historical jobs to be written to the historical data DB.protected static String
REMOVE_USER_FROM_GROUP
Removes a user from a group.protected static String
SET_BOARD_POWER_OFF
Set the power state of a board.protected static String
SET_BOARD_POWER_ON
Set the power state of a board.protected static String
SET_BOARD_SERIAL_IDS
Set the BMP and physical serial IDs based on the information actually read off the machine.protected static String
SET_COLLAB_QUOTA
Set a quota.protected static String
SET_FUNCTIONING_FIELD
Set the value of a board'sfunctioning
column.protected static String
SET_JOB_NMPI_JOB
Set the NMPI Job for a Job.protected static String
SET_JOB_SESSION
Set the NMPI session for a Job.protected static String
SET_MACHINE_STATE
Set the in-service flag for a machine.protected static String
SET_MAX_COORDS
Note down the maximum chip coordinates so we can calculate wraparounds correctly.protected static String
SET_STATE_DESTROYED
Set the state destroyed and number of pending changes for a job.protected static String
SET_STATE_PENDING
Set the state for a job.protected static String
SET_USER_DISABLED
Set whether a user is administratively disabled.protected static String
SET_USER_LOCKED
Set whether a user is locked.protected static String
SET_USER_NAME
Set a user's name.protected static String
SET_USER_PASS
Set a user's password.protected static String
SET_USER_TRUST
Set the amount a user is trusted.protected static String
UNLOCK_LOCKED_USERS
Unlock accounts.protected static String
UPDATE_GROUP
Update a single group record's name and quota.protected static String
UPDATE_KEEPALIVE
Update the keepalive timestamp.protected static String
WRITE_HISTORICAL_ALLOCS
Write to the historical allocations database.protected static String
WRITE_HISTORICAL_JOBS
Write to the historical jobs database. -
Constructor Summary
Constructors Constructor Description SQLQueries()
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
BUMP_IMPORTANCE
Increases the importance of a job.- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
GET_BOARD_NUMBERS
Get the boards of a machine that can be used. Excludes disabled boards.- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
MachineStateControl
, Constant Field Values
-
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:
MachineStateControl
, Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
UPDATE_KEEPALIVE
Update the keepalive timestamp.- See Also:
- Constant Field Values
-
DESTROY_JOB
Mark a job as dead.- See Also:
- Constant Field Values
-
NOTE_DESTROY_REASON
Record the reason for a job being destroyed.- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
BoardIssueReport
, Constant Field Values
-
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:
BoardIssueReport
, Constant Field Values
-
DELETE_TASK
Delete an allocation task.- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
COUNT_FUNCTIONING_BOARDS
@Parameter("machine_id") @ResultColumn("c") @SingleRowResult protected static final String COUNT_FUNCTIONING_BOARDSCheck there is a single free board.- See Also:
- Constant Field Values
-
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:
AllocatorTask
, Constant Field Values
-
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:
- Constant Field Values
-
ALLOCATE_BOARDS_BOARD
Tell a board that it is allocated.- See Also:
AllocatorTask
, Constant Field Values
-
DEALLOCATE_BMP_BOARDS_JOB
Tell the boards of a job that they're no longer allocated to the job.- See Also:
BMPController
, Constant Field Values
-
SET_BOARD_POWER_ON
Set the power state of a board.- See Also:
- Constant Field Values
-
SET_BOARD_POWER_OFF
Set the power state of a board.- See Also:
- Constant Field Values
-
FIND_EXPIRED_JOBS
Find jobs that have expired their keepalive interval.- See Also:
AllocatorTask
, Constant Field Values
-
SET_STATE_PENDING
Set the state for a job.- See Also:
AllocatorTask
, Constant Field Values
-
SET_STATE_DESTROYED
Set the state destroyed and number of pending changes for a job.- See Also:
AllocatorTask
, Constant Field Values
-
KILL_JOB_ALLOC_TASK
Delete a request to allocate resources for a job.- See Also:
- Constant Field Values
-
FINISHED_PENDING
Delete a request to change the power of a board. Used once the change has been completed.- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
ERROR_PENDING
Set a request to change the power of a board to an error.- See Also:
- Constant Field Values
-
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:
DirInfo
, Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
INSERT_BMP
@Parameter("machine_id") @Parameter("address") @Parameter("cabinet") @Parameter("frame") @GeneratesID protected static final String INSERT_BMPInsert a BMP.- See Also:
MachineDefinitionLoader
, Constant Field Values
-
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:
MachineDefinitionLoader
, Constant Field Values
-
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:
MachineDefinitionLoader
, Constant Field Values
-
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:
MachineDefinitionLoader
, Constant Field Values
-
INSERT_TAG
Insert a tag. -
DELETE_MACHINE_TAGS
Delete all tags for a machine.- See Also:
MachineStateControl
, Constant Field Values
-
SET_MACHINE_STATE
Set the in-service flag for a machine.- See Also:
MachineStateControl
, Constant Field Values
-
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:
MachineDefinitionLoader
, Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
MachineStateControl
, Constant Field Values
-
SET_FUNCTIONING_FIELD
Set the value of a board'sfunctioning
column. Enables or disables allocation of the board.- See Also:
MachineStateControl
, Constant Field Values
-
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:
Spalloc
, Constant Field Values
-
GET_GROUP_QUOTA
@Parameter("group_id") @ResultColumn("quota") @SingleRowResult protected static final String GET_GROUP_QUOTAGet the quota for a group.- See Also:
QuotaManager
, Constant Field Values
-
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:
QuotaManager
, Constant Field Values
-
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:
QuotaManager
, Constant Field Values
-
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:
QuotaManager
, Constant Field Values
-
DECREMENT_QUOTA
Reduce a group's quota on a machine by a specified amount.- See Also:
QuotaManager
, Constant Field Values
-
MARK_CONSOLIDATED
Mark a job as having had its resource usage consolidated.- See Also:
QuotaManager
, Constant Field Values
-
ADJUST_QUOTA
Add or remove time from a quota. Used when someone's administratively adjusting the quota.- See Also:
QuotaManager
, Constant Field Values
-
SET_COLLAB_QUOTA
Set a quota. Used when the system is aligning quota with NMPI data.- See Also:
QuotaManager
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
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:
Spalloc
, Constant Field Values
-
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:
Spalloc
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
CREATE_GROUP
@Parameter("group_name") @Parameter("quota") @Parameter("group_type") @GeneratesID protected static final String CREATE_GROUPCreate a group record.- See Also:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
REMOVE_USER_FROM_GROUP
Removes a user from a group.- See Also:
UserControl
, Constant Field Values
-
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:
LocalAuthProviderImpl
, Constant Field Values
-
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:
LocalAuthProviderImpl
, Constant Field Values
-
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:
LocalAuthProviderImpl
, Constant Field Values
-
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:
LocalAuthProviderImpl
, Constant Field Values
-
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:
LocalAuthProviderImpl
, Constant Field Values
-
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:
LocalAuthProviderImpl
, Constant Field Values
-
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:
LocalAuthProviderImpl
, Constant Field Values
-
MARK_LOGIN_SUCCESS
Note the login success.- See Also:
LocalAuthProviderImpl
, Constant Field Values
-
MARK_LOGIN_FAILURE
Note the login failure.- See Also:
LocalAuthProviderImpl
, Constant Field Values
-
UNLOCK_LOCKED_USERS
Unlock accounts.- See Also:
LocalAuthProviderImpl
, Constant Field Values
-
DELETE_USER
Delete a user.- See Also:
UserControl
, Constant Field Values
-
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:
Spalloc
,UserControl
, Constant Field Values
-
SET_USER_TRUST
Set the amount a user is trusted.- See Also:
UserControl
, Constant Field Values
-
SET_USER_LOCKED
Set whether a user is locked. Can be used to unlock a user early.- See Also:
UserControl
, Constant Field Values
-
SET_USER_DISABLED
Set whether a user is administratively disabled.- See Also:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
SET_USER_NAME
Set a user's name.- See Also:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
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:
UserControl
, Constant Field Values
-
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:
Spalloc
, Constant Field Values
-
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.- See Also:
AllocatorTask.tombstone()
, Constant Field Values
-
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.- See Also:
AllocatorTask.tombstone()
, Constant Field Values
-
DELETE_NMPI_JOB
Actually delete an NMPI job record. Only called by the data tombstone-r.- See Also:
- Constant Field Values
-
DELETE_NMPI_SESSION
Actually delete an NMPI session record. Only called by the data tombstone-r.- See Also:
- Constant Field Values
-
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:
BlacklistStore
, Constant Field Values
-
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:
BlacklistStore
, Constant Field Values
-
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:
BlacklistStore
, Constant Field Values
-
MARK_BOARD_BLACKLIST_CHANGED
Mark a board as having had its blacklist modified.- See Also:
MachineStateControl
, Constant Field Values
-
MARK_BOARD_BLACKLIST_SYNCHED
Mark a board as having had its blacklist synchronised with the hardware.- See Also:
MachineStateControl
, Constant Field Values
-
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:
MachineStateControl
, Constant Field Values
-
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:
BlacklistStore
, Constant Field Values
-
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:
BlacklistStore
, Constant Field Values
-
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:
BlacklistStore
, Constant Field Values
-
CLEAR_BLACKLISTED_CHIPS
Delete all blacklist entries for chips on a board.- See Also:
BlacklistStore
, Constant Field Values
-
CLEAR_BLACKLISTED_CORES
Delete all blacklist entries for cores on a board.- See Also:
BlacklistStore
, Constant Field Values
-
CLEAR_BLACKLISTED_LINKS
Delete all blacklist entries for links on a board.- See Also:
BlacklistStore
, Constant Field Values
-
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:
BMPController
, Constant Field Values
-
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:
BMPController
, Constant Field Values
-
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:
BMPController
, Constant Field Values
-
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:
BMPController
, Constant Field Values
-
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:
BMPController
, Constant Field Values
-
COMPLETED_BOARD_INFO_READ
Mark a read of a blacklist or ADC data as completed.- See Also:
BMPController
, Constant Field Values
-
COMPLETED_BLACKLIST_WRITE
Mark a write of a blacklist as completed.- See Also:
BMPController
, Constant Field Values
-
COMPLETED_GET_SERIAL_REQ
Mark a read of serial data as completed. (Text same asCOMPLETED_BLACKLIST_WRITE
for now, but logically distinct.)- See Also:
BMPController
, Constant Field Values
-
FAILED_BLACKLIST_OP
Mark a read or write of a blacklist as failed, noting the reason.- See Also:
BMPController
, Constant Field Values
-
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:
MachineStateControl
, Constant Field Values
-
DELETE_BLACKLIST_OP
Delete a blacklist request.- See Also:
MachineStateControl
, Constant Field Values
-
CREATE_BLACKLIST_READ
Insert a request to read a board's blacklist.- See Also:
MachineStateControl
, Constant Field Values
-
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:
MachineStateControl
, Constant Field Values
-
CREATE_SERIAL_READ_REQ
Insert a request to read a board's serial information.- See Also:
MachineStateControl
, Constant Field Values
-
CREATE_TEMP_READ_REQ
Insert a request to read a board's temperature data.- See Also:
MachineStateControl
, Constant Field Values
-
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.- See Also:
AllocatorTask.tombstone()
, Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
AllocatorTask
, Constant Field Values
-
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:
AllocatorTask
, Constant Field Values
-
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:
AllocatorTask
-
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:
AllocatorTask
-
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:
AllocatorTask
-
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:
AllocatorTask
-
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:
AllocatorTask
-
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:
AllocatorTask
-
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:
Spalloc
-
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:
Spalloc
-
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:
Spalloc
-
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:
Spalloc
-
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:
Spalloc
-
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:
AllocatorTask
-
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()
-