TEMERITY

us.temerity.pipeline
Class QueueMgrClient

java.lang.Object
  extended by us.temerity.pipeline.BaseMgrClient
      extended by us.temerity.pipeline.QueueMgrClient

public class QueueMgrClient
extends BaseMgrClient

A connection to the Pipeline queue manager daemon.

This class handles network communication with the Pipeline queue manager daemon plqueuemgr(1).


Field Summary
 
Fields inherited from class us.temerity.pipeline.BaseMgrClient
pHostname, pLongTransactionStart, pPort
 
Constructor Summary
QueueMgrClient()
          Construct a new queue manager client.
QueueMgrClient(boolean forceLongTransactions)
          Construct a new queue manager client.
 
Method Summary
 void addBalanceGroup(String cname)
          Add a new user balance group.
 void addDispatchControl(String cname)
          Add a new dispatch control.
 void addHardwareGroup(String gname)
          Add a new hardware group.
 void addHardwareKey(HardwareKey key)
          Add the given hardware key to the currently defined hardware keys.
 void addHost(String hostname)
          Add a new execution host to the Pipeline queue.
 void addLicenseKey(LicenseKey key)
          Add the given license key to the currently defined license keys.
 void addSelectionGroup(String gname)
          Add a new selection group.
 void addSelectionKey(SelectionKey key)
          Add the given selection key to the currently defined selection keys.
 void addSelectionSchedule(String sname)
          Add a new selection schedule.
 void changeJobReqs(LinkedList<JobReqsDelta> jobReqsChanges)
          Changes the job requirements defined by the deltas.
 void deleteAllJobGroups()
          Delete all of the completed job groups in all working areas.
 void deleteJobGroups(TreeMap<Long,String> groupAuthors)
          Delete the completed job groups.
 void deleteViewJobGroups(String author, String view)
          Delete all of the completed job groups created in the given working area.
 Boolean doJobKeysNeedUpdate()
          Get a boolean which reflects whether key choosers need to be rerun for all jobs in the queue.
 void editBalanceGroup(UserBalanceGroup group)
          Change the user weighting for the given user balance group.
 void editBalanceGroups(Collection<UserBalanceGroup> controls)
          Change the user weighting for the given user balance groups.
 void editDispatchControl(DispatchControl group)
          Change the criteria list for the given dispatch control.
 void editDispatchControls(Collection<DispatchControl> controls)
          Change the criteria list for the given dispatch controls.
 void editHardwareGroup(HardwareGroup group)
          Change the hardware key values for the given hardware group.
 void editHardwareGroups(Collection<HardwareGroup> groups)
          Change the hardware key values for the given hardware groups.
 void editHosts(TreeMap<String,QueueHostMod> changes)
          Change the editable properties of the given hosts.
 void editSelectionGroup(SelectionGroup group)
          Change the selection key biases for the given selection group.
 void editSelectionGroups(Collection<SelectionGroup> groups)
          Change the selection key biases for the given selection groups.
 void editSelectionSchedule(SelectionSchedule schedule)
          Modify the given selection schedule.
 void editSelectionSchedules(Collection<SelectionSchedule> schedules)
          Modify the given selection schedules.
 UserBalanceGroup getBalanceGroup(String groupName)
          Get the current user weighting for a single user balance groups.
 TreeSet<String> getBalanceGroupNames()
          Get the names of all existing user balance groups.
 TreeMap<String,UserBalanceGroup> getBalanceGroups()
          Get the current user weighting for all existing user balance groups.
 DoubleMap<String,String,Double> getBalanceGroupUsage()
          Get the current user usage for all existing balance groups.
 Long getChooserUpdateTime()
          Get the timestamp that reflects the last time a keychoosers or a key that uses a keychooser was updated.
 TreeSet<String> getDispatchControlNames()
          Get the names of all existing dispatch controls.
 TreeMap<String,DispatchControl> getDispatchControls()
          Get the current criteria list for all existing control groups.
 TreeSet<String> getHardwareGroupNames()
          Get the names of all existing hardware groups.
 TreeMap<String,HardwareGroup> getHardwareGroups()
          Get the current hardware key values for all existing hardware groups.
 TreeMap<String,String> getHardwareKeyDescriptions(boolean userChoosableOnly)
          Get a table containing the descriptions of the currently defined hardware keys indexed by hardware key name.
 TreeSet<String> getHardwareKeyNames(boolean userChoosableOnly)
          Get the names of the currently defined hardware keys.
 ArrayList<HardwareKey> getHardwareKeys()
          Get the currently defined hardware keys.
 QueueHostHistograms getHostHistograms(QueueHostHistogramSpecs specs)
          Gets frequency distribution data for significant catagories of information shared by all job server hosts.
 TreeMap<String,ResourceSampleCache> getHostResourceSamples(TreeMap<String,TimeInterval> intervals, boolean runtimeOnly)
          Get the dynamic resource sample history of the given host.
 TreeMap<String,QueueHostInfo> getHosts()
          Get the current state of all hosts participating in the Pipeline queue.
 TreeMap<String,QueueHostInfo> getHosts(QueueHostHistogramSpecs specs)
          Get the current state of the hosts participating in the Pipeline queue filtered by the given histogram specs.
 QueueJob getJob(long jobID)
          Get the job with the given ID.
 QueueJobGroup getJobGroup(long groupID)
          Get the job group with the given ID.
 TreeMap<Long,QueueJobGroup> getJobGroups()
          Get all of the existing job groups.
 TreeMap<Long,QueueJobGroup> getJobGroups(String author, String view)
          Get the job groups which match the following working area pattern.
 QueueJobInfo getJobInfo(long jobID)
          Get information about the current status of a job in the queue.
 Map<Long,QueueJobInfo> getJobInfos(Set<Long> jobIDs)
          Get information about the current status of jobs in the queue.
 Map<Long,QueueJob> getJobs(Set<Long> jobIDs)
          Get the jobs with the given IDs.
 TreeMap<Long,double[]> getJobStateDistribution(TreeSet<Long> groupIDs)
          Get the distribution of job states for the jobs associated with each of the given job group IDs.
 TreeMap<Long,JobStatus> getJobStatus(TreeSet<Long> groupIDs)
          Get the JobStatus of all jobs associated with the given job group IDs.
 TreeMap<String,String> getLicenseKeyDescriptions(boolean userChoosableOnly)
          Get a table containing the descriptions of the currently defined license keys indexed by license key name.
 TreeSet<String> getLicenseKeyNames(boolean userChoosableOnly)
          Get the names of the currently defined license keys.
 ArrayList<LicenseKey> getLicenseKeys()
          Get the currently defined license keys.
 LogControls getLogControls()
          Get the current logging levels.
protected  ObjectInput getObjectInput(InputStream in)
          Get the object input given a socket input stream.
 QueueExtensionConfig getQueueExtensionConfig(String name)
          Get the current queue extension configurations.
 TreeMap<String,QueueExtensionConfig> getQueueExtensionConfigs()
          Get the current queue extension configurations.
 TreeMap<Long,QueueJobInfo> getRunningJobInfo()
          Get information about the currently running jobs.
 TreeMap<Long,JobStatus> getRunningJobStatus()
          Get the JobStatus of all currently running jobs.
 QueueControls getRuntimeControls()
          Get the current runtime performance controls.
 TreeSet<String> getSelectionGroupNames()
          Get the names of all existing selection groups.
 TreeMap<String,SelectionGroup> getSelectionGroups()
          Get the current selection biases for all existing selection groups.
 TreeMap<String,String> getSelectionKeyDescriptions(boolean userChoosableOnly)
          Get a table containing the descriptions of the currently defined selection keys indexed by selection key name.
 TreeSet<String> getSelectionKeyNames(boolean userChoosableOnly)
          Get the names of the currently defined selection keys.
 ArrayList<SelectionKey> getSelectionKeys()
          Get the currently defined selection keys.
 SelectionScheduleMatrix getSelectionScheduleMatrix()
           
 TreeSet<String> getSelectionScheduleNames()
          Get the names of all existing selection schedules.
 TreeMap<String,SelectionSchedule> getSelectionSchedules()
          Get the existing selection schedules.
protected  String getServerDownMessage()
          Get the error message to be shown when the server cannot be contacted.
 void invalidateAllJobKeys()
          Set the Key State in every non-executed job to Stale, prompting users to rerun the key choosers on the jobs.
 void killJobs(NodeID nodeID)
          Kill all jobs associated with the given working version.
 void killJobs(String author, TreeSet<Long> jobIDs)
          Deprecated. The author argument is no longer neccessary and is now ignored by this method. Please use the other form of this method which does not take an author in future code.
 void killJobs(TreeSet<Long> jobIDs)
          Kill the jobs with the given IDs.
 void pauseJobs(NodeID nodeID)
          Pause all jobs associated with the given working version.
 void pauseJobs(String author, TreeSet<Long> jobIDs)
          Deprecated. The author argument is no longer neccessary and is now ignored by this method. Please use the other form of this method which does not take an author in future code.
 void pauseJobs(TreeSet<Long> jobIDs)
          Pause the jobs with the given IDs.
 void preemptJobs(NodeID nodeID)
          Kill and requeue all jobs associated with the given working version.
 void preemptJobs(String author, TreeSet<Long> jobIDs)
          Deprecated. The author argument is no longer neccessary and is now ignored by this method. Please use the other form of this method which does not take an author in future code.
 void preemptJobs(TreeSet<Long> jobIDs)
          Kill and requeue the jobs with the given IDs.
 void removeBalanceGroup(String cname)
          Remove the given existing user balance control.
 void removeDispatchControl(String cname)
          Remove the given existing dispatch control.
 void removeDispatchControls(TreeSet<String> cnames)
          Remove the given existing dispatch controls.
 void removeHardwareGroup(String gname)
          Remove the given existing hardware group.
 void removeHardwareGroups(TreeSet<String> gnames)
          Remove the given existing hardware groups.
 void removeHardwareKey(String kname)
          Remove the hardware key with the given name from currently defined hardware keys.
 void removeHosts(TreeSet<String> hostnames)
          Remove the given existing execution hosts from the Pipeline queue.
 void removeLicenseKey(String kname)
          Remove the license key with the given name from currently defined license keys.
 void removeQueueExtensionConfig(String name)
          Remove an existing the queue extension configuration.
 void removeSelectionGroup(String gname)
          Remove the given existing selection group.
 void removeSelectionGroups(TreeSet<String> gnames)
          Remove the given existing selection groups.
 void removeSelectionKey(String kname)
          Remove the selection key with the given name from currently defined selection keys.
 void removeSelectionSchedule(String sname)
          Remove the given existing selection schedule.
 void removeSelectionSchedules(TreeSet<String> snames)
          Remove the given existing selection schedules.
 void removeUserBalanceGroups(TreeSet<String> cnames)
          Remove the given existing user balance groups.
 void resumeJobs(NodeID nodeID)
          Resume execution of all paused jobs associated with the given working version.
 void resumeJobs(String author, TreeSet<Long> jobIDs)
          Deprecated. The author argument is no longer neccessary and is now ignored by this method. Please use the other form of this method which does not take an author in future code.
 void resumeJobs(TreeSet<Long> jobIDs)
          Resume execution of the paused jobs with the given IDs.
 void setLogControls(LogControls controls)
          Set the current logging levels.
 void setMaxLicenses(String kname, LicenseScheme scheme, Integer maxSlots, Integer maxHosts, Integer maxHostSlots)
          Set the licensing scheme and maximum number of licenses associated with a license key.
 void setQueueExtensionConfig(QueueExtensionConfig extension)
          Add or modify an existing the queue extension configuration.
 void setRuntimeControls(QueueControls controls)
          Set the current runtime performance controls.
 void updateAllJobKeys()
          Updates the generated keys for all jobs in the queue.
 void updateJobKeys(TreeSet<Long> jobIDs)
          Updates the generated keys for the jobs with the given IDs.
 
Methods inherited from class us.temerity.pipeline.BaseMgrClient
abortOnTimeout, disconnect, getForceLongTransactions, getHostname, getPort, handleFailure, handleSimpleResponse, performLongTransaction, performTransaction, performTransaction, ping, ping, setForceLongTransactions, shutdown, shutdownTransaction, verifyConnection, waitForConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueMgrClient

public QueueMgrClient()
Construct a new queue manager client.


QueueMgrClient

public QueueMgrClient(boolean forceLongTransactions)
Construct a new queue manager client.

Parameters:
forceLongTransactions - Whether to treat all uses of BaseMgrClient.performTransaction(java.lang.Object, java.lang.Object) like BaseMgrClient.performLongTransaction(java.lang.Object, java.lang.Object, int, int) with an infinite request timeout and a 60-second response retry interval with infinite retries.
Method Detail

getLogControls

public LogControls getLogControls()
                           throws PipelineException
Get the current logging levels.

Throws:
PipelineException

setLogControls

public void setLogControls(LogControls controls)
                    throws PipelineException
Set the current logging levels.

Throws:
PipelineException

getRuntimeControls

public QueueControls getRuntimeControls()
                                 throws PipelineException
Get the current runtime performance controls.

Throws:
PipelineException

setRuntimeControls

public void setRuntimeControls(QueueControls controls)
                        throws PipelineException
Set the current runtime performance controls.

Throws:
PipelineException

getLicenseKeyNames

public TreeSet<String> getLicenseKeyNames(boolean userChoosableOnly)
                                   throws PipelineException
Get the names of the currently defined license keys.

Parameters:
userChoosableOnly - Whether to exclude the names of the license keys currently controlled by a KeyChooser plugin.
Throws:
PipelineException - If unable to retrieve the names of the license keys.

getLicenseKeyDescriptions

public TreeMap<String,String> getLicenseKeyDescriptions(boolean userChoosableOnly)
                                                 throws PipelineException
Get a table containing the descriptions of the currently defined license keys indexed by license key name.

Parameters:
userChoosableOnly - Whether to exclude the names of the license keys currently controlled by a KeyChooser plugin.
Throws:
PipelineException - If unable to retrieve the names of the license keys.

getLicenseKeys

public ArrayList<LicenseKey> getLicenseKeys()
                                     throws PipelineException
Get the currently defined license keys.

Throws:
PipelineException - If unable to retrieve the license keys.

addLicenseKey

public void addLicenseKey(LicenseKey key)
                   throws PipelineException
Add the given license key to the currently defined license keys.

If a license key already exists which has the same name as the given key, it will be silently overridden by this operation.

This method will fail if the current user does not have privileged access status.

Parameters:
key - The license key to add.
Throws:
PipelineException - If unable to add the license key.

removeLicenseKey

public void removeLicenseKey(String kname)
                      throws PipelineException
Remove the license key with the given name from currently defined license keys.

This method will fail if the current user does not have privileged access status.

Parameters:
kname - The name of the license key to remove.
Throws:
PipelineException - If unable to remove the license key.

setMaxLicenses

public void setMaxLicenses(String kname,
                           LicenseScheme scheme,
                           Integer maxSlots,
                           Integer maxHosts,
                           Integer maxHostSlots)
                    throws PipelineException
Set the licensing scheme and maximum number of licenses associated with a license key.

This method will fail if the current user does not have privileged access status.

Parameters:
kname - The name of the license key.
scheme - The scheme used to determine the number of available licenses.
maxSlots - The maximum number of slots running a job which requires the license key or null if the license scheme is not PerSlot.
maxHosts - The maximum number of hosts which may run a job which requires the license key or null if the license scheme is PerSlot.
maxHostSlots - The maximum number of slots which may run a job requiring the license key on a single host or null if the license scheme is not PerHostSlot.
Throws:
PipelineException - If unable to set the maximum licenses for the given license key.

getSelectionKeyNames

public TreeSet<String> getSelectionKeyNames(boolean userChoosableOnly)
                                     throws PipelineException
Get the names of the currently defined selection keys.

Parameters:
userChoosableOnly - Whether to exclude the names of the selection keys currently controlled by a KeyChooser plugin.
Throws:
PipelineException - If unable to retrieve the names of the selection keys.

getSelectionKeyDescriptions

public TreeMap<String,String> getSelectionKeyDescriptions(boolean userChoosableOnly)
                                                   throws PipelineException
Get a table containing the descriptions of the currently defined selection keys indexed by selection key name.

Parameters:
userChoosableOnly - Whether to exclude the names of the selection keys currently controlled by a KeyChooser plugin.
Throws:
PipelineException - If unable to retrieve the names of the selection keys.

getSelectionKeys

public ArrayList<SelectionKey> getSelectionKeys()
                                         throws PipelineException
Get the currently defined selection keys.

Throws:
PipelineException - If unable to retrieve the selection keys.

addSelectionKey

public void addSelectionKey(SelectionKey key)
                     throws PipelineException
Add the given selection key to the currently defined selection keys.

If a selection key already exists which has the same name as the given key, it will be silently overridden by this operation.

This method will fail if the current user does not have privileged access status.

Parameters:
key - The selection key to add.
Throws:
PipelineException - If unable to add the selection key.

removeSelectionKey

public void removeSelectionKey(String kname)
                        throws PipelineException
Remove the selection key with the given name from currently defined selection keys.

This method will fail if the current user does not have privileged access status.

Parameters:
kname - The name of the selection key to remove.
Throws:
PipelineException - If unable to remove the selection key.

getSelectionGroupNames

public TreeSet<String> getSelectionGroupNames()
                                       throws PipelineException
Get the names of all existing selection groups.

Returns:
The selection group names.
Throws:
PipelineException - If unable to retrieve the information.

getSelectionGroups

public TreeMap<String,SelectionGroup> getSelectionGroups()
                                                  throws PipelineException
Get the current selection biases for all existing selection groups.

Returns:
The selection groups indexed by group name.
Throws:
PipelineException - If unable to retrieve the information.

addSelectionGroup

public void addSelectionGroup(String gname)
                       throws PipelineException
Add a new selection group.

Parameters:
gname - The name of the new selection group.
Throws:
PipelineException - If a selection group already exists with the given name.

removeSelectionGroup

public void removeSelectionGroup(String gname)
                          throws PipelineException
Remove the given existing selection group.

Parameters:
gname - The name of the selection group.
Throws:
PipelineException - If unable to remove the selection group.

removeSelectionGroups

public void removeSelectionGroups(TreeSet<String> gnames)
                           throws PipelineException
Remove the given existing selection groups.

Parameters:
gnames - The names of the selection groups.
Throws:
PipelineException - If unable to remove the selection groups.

editSelectionGroup

public void editSelectionGroup(SelectionGroup group)
                        throws PipelineException
Change the selection key biases for the given selection group.

For an detailed explanation of how selection keys are used to determine the assignment of jobs to hosts, see JobReqs.

Parameters:
group - The selection group to modify.
Throws:
PipelineException

editSelectionGroups

public void editSelectionGroups(Collection<SelectionGroup> groups)
                         throws PipelineException
Change the selection key biases for the given selection groups.

For an detailed explanation of how selection keys are used to determine the assignment of jobs to hosts, see JobReqs.

Parameters:
groups - The selection groups to modify.
Throws:
PipelineException

getSelectionScheduleNames

public TreeSet<String> getSelectionScheduleNames()
                                          throws PipelineException
Get the names of all existing selection schedules.

Returns:
The selection schedule names.
Throws:
PipelineException - If unable to retrieve the information.

getSelectionSchedules

public TreeMap<String,SelectionSchedule> getSelectionSchedules()
                                                        throws PipelineException
Get the existing selection schedules.

Returns:
The selection schedules indexed by schedule name.
Throws:
PipelineException - If unable to retrieve the information.

getSelectionScheduleMatrix

public SelectionScheduleMatrix getSelectionScheduleMatrix()
                                                   throws PipelineException
Throws:
PipelineException

addSelectionSchedule

public void addSelectionSchedule(String sname)
                          throws PipelineException
Add a new selection schedule.

Parameters:
sname - The name of the new selection schedule.
Throws:
PipelineException - If a selection schedule already exists with the given name.

removeSelectionSchedule

public void removeSelectionSchedule(String sname)
                             throws PipelineException
Remove the given existing selection schedule.

Parameters:
sname - The name of the selection schedule.
Throws:
PipelineException - If unable to remove the selection schedule.

removeSelectionSchedules

public void removeSelectionSchedules(TreeSet<String> snames)
                              throws PipelineException
Remove the given existing selection schedules.

Parameters:
snames - The names of the selection schedules.
Throws:
PipelineException - If unable to remove the selection schedules.

editSelectionSchedule

public void editSelectionSchedule(SelectionSchedule schedule)
                           throws PipelineException
Modify the given selection schedule.

Parameters:
schedule - The selection schedule to modify.
Throws:
PipelineException

editSelectionSchedules

public void editSelectionSchedules(Collection<SelectionSchedule> schedules)
                            throws PipelineException
Modify the given selection schedules.

Parameters:
schedules - The selection schedules to modify.
Throws:
PipelineException

getHardwareKeyNames

public TreeSet<String> getHardwareKeyNames(boolean userChoosableOnly)
                                    throws PipelineException
Get the names of the currently defined hardware keys.

Parameters:
userChoosableOnly - Whether to exclude the names of the hardware keys currently controlled by a KeyChooser plugin.
Throws:
PipelineException - If unable to retrieve the names of the hardware keys.

getHardwareKeyDescriptions

public TreeMap<String,String> getHardwareKeyDescriptions(boolean userChoosableOnly)
                                                  throws PipelineException
Get a table containing the descriptions of the currently defined hardware keys indexed by hardware key name.

Parameters:
userChoosableOnly - Whether to exclude the names of the hardware keys currently controlled by a KeyChooser plugin.
Throws:
PipelineException - If unable to retrieve the names of the hardware keys.

getHardwareKeys

public ArrayList<HardwareKey> getHardwareKeys()
                                       throws PipelineException
Get the currently defined hardware keys.

Throws:
PipelineException - If unable to retrieve the hardware keys.

addHardwareKey

public void addHardwareKey(HardwareKey key)
                    throws PipelineException
Add the given hardware key to the currently defined hardware keys.

If a hardware key already exists which has the same name as the given key, it will be silently overridden by this operation.

This method will fail if the current user does not have privileged access status.

Parameters:
key - The hardware key to add.
Throws:
PipelineException - If unable to add the hardware key.

removeHardwareKey

public void removeHardwareKey(String kname)
                       throws PipelineException
Remove the hardware key with the given name from currently defined hardware keys.

This method will fail if the current user does not have privileged access status.

Parameters:
kname - The name of the hardware key to remove.
Throws:
PipelineException - If unable to remove the hardware key.

getHardwareGroupNames

public TreeSet<String> getHardwareGroupNames()
                                      throws PipelineException
Get the names of all existing hardware groups.

Returns:
The hardware group names.
Throws:
PipelineException - If unable to retrieve the information.

getHardwareGroups

public TreeMap<String,HardwareGroup> getHardwareGroups()
                                                throws PipelineException
Get the current hardware key values for all existing hardware groups.

Returns:
The hardware groups indexed by group name.
Throws:
PipelineException - If unable to retrieve the information.

addHardwareGroup

public void addHardwareGroup(String gname)
                      throws PipelineException
Add a new hardware group.

Parameters:
gname - The name of the new hardware group.
Throws:
PipelineException - If a hardware group already exists with the given name.

removeHardwareGroup

public void removeHardwareGroup(String gname)
                         throws PipelineException
Remove the given existing hardware group.

Parameters:
gname - The name of the hardware group.
Throws:
PipelineException - If unable to remove the hardware group.

removeHardwareGroups

public void removeHardwareGroups(TreeSet<String> gnames)
                          throws PipelineException
Remove the given existing hardware groups.

Parameters:
gnames - The names of the hardware groups.
Throws:
PipelineException - If unable to remove the hardware groups.

editHardwareGroup

public void editHardwareGroup(HardwareGroup group)
                       throws PipelineException
Change the hardware key values for the given hardware group.

For an detailed explanation of how hardware keys are used to determine the assignment of jobs to hosts, see JobReqs.

Parameters:
group - The hardware group to modify.
Throws:
PipelineException

editHardwareGroups

public void editHardwareGroups(Collection<HardwareGroup> groups)
                        throws PipelineException
Change the hardware key values for the given hardware groups.

For an detailed explanation of how hardware keys are used to determine the assignment of jobs to hosts, see JobReqs.

Parameters:
groups - The hardware groups to modify.
Throws:
PipelineException

getDispatchControlNames

public TreeSet<String> getDispatchControlNames()
                                        throws PipelineException
Get the names of all existing dispatch controls.

Returns:
The dispatch control names.
Throws:
PipelineException - If unable to retrieve the information.

getDispatchControls

public TreeMap<String,DispatchControl> getDispatchControls()
                                                    throws PipelineException
Get the current criteria list for all existing control groups.

Returns:
The dispatch controls indexed by group name.
Throws:
PipelineException - If unable to retrieve the information.

addDispatchControl

public void addDispatchControl(String cname)
                        throws PipelineException
Add a new dispatch control.

Parameters:
cname - The name of the new dispatch control.
Throws:
PipelineException - If a dispatch control already exists with the given name.

removeDispatchControl

public void removeDispatchControl(String cname)
                           throws PipelineException
Remove the given existing dispatch control.

Parameters:
cname - The name of the dispatch control.
Throws:
PipelineException - If unable to remove the dispatch control.

removeDispatchControls

public void removeDispatchControls(TreeSet<String> cnames)
                            throws PipelineException
Remove the given existing dispatch controls.

Parameters:
cnames - The names of the dispatch controls.
Throws:
PipelineException - If unable to remove the dispatch controls.

editDispatchControl

public void editDispatchControl(DispatchControl group)
                         throws PipelineException
Change the criteria list for the given dispatch control.

For an detailed explanation of how dispatch controls are used to determine the assignment of jobs to hosts, see JobReqs.

Parameters:
group - The dispatch controls to modify.
Throws:
PipelineException

editDispatchControls

public void editDispatchControls(Collection<DispatchControl> controls)
                          throws PipelineException
Change the criteria list for the given dispatch controls.

For an detailed explanation of how dispatch controls are used to determine the assignment of jobs to hosts, see JobReqs.

Parameters:
controls - The dispatch controls to modify.
Throws:
PipelineException

getBalanceGroupNames

public TreeSet<String> getBalanceGroupNames()
                                     throws PipelineException
Get the names of all existing user balance groups.

Returns:
The user balance group names.
Throws:
PipelineException - If unable to retrieve the information.

getBalanceGroups

public TreeMap<String,UserBalanceGroup> getBalanceGroups()
                                                  throws PipelineException
Get the current user weighting for all existing user balance groups.

Returns:
The groups indexed by group name.
Throws:
PipelineException - If unable to retrieve the information.

getBalanceGroup

public UserBalanceGroup getBalanceGroup(String groupName)
                                 throws PipelineException
Get the current user weighting for a single user balance groups.

Parameters:
groupName - The name of the group.
Returns:
The user balance group.
Throws:
PipelineException - If no group with that name exists.

addBalanceGroup

public void addBalanceGroup(String cname)
                     throws PipelineException
Add a new user balance group.

Parameters:
cname - The name of the new group.
Throws:
PipelineException - If a group already exists with the given name.

removeBalanceGroup

public void removeBalanceGroup(String cname)
                        throws PipelineException
Remove the given existing user balance control.

Parameters:
cname - The name of the group.
Throws:
PipelineException - If unable to remove the user balance group.

removeUserBalanceGroups

public void removeUserBalanceGroups(TreeSet<String> cnames)
                             throws PipelineException
Remove the given existing user balance groups.

Parameters:
cnames - The names of the groups.
Throws:
PipelineException - If unable to remove the user balance groups.

editBalanceGroup

public void editBalanceGroup(UserBalanceGroup group)
                      throws PipelineException
Change the user weighting for the given user balance group.

Parameters:
group - The user balance group to modify.
Throws:
PipelineException

editBalanceGroups

public void editBalanceGroups(Collection<UserBalanceGroup> controls)
                       throws PipelineException
Change the user weighting for the given user balance groups.

Parameters:
controls - The groups to modify.
Throws:
PipelineException

getBalanceGroupUsage

public DoubleMap<String,String,Double> getBalanceGroupUsage()
                                                     throws PipelineException
Get the current user usage for all existing balance groups.

Returns:
The percentage of the balance group used, indexed by balance group name and then user name.
Throws:
PipelineException - If unable to retrieve the information.

getQueueExtensionConfig

public QueueExtensionConfig getQueueExtensionConfig(String name)
                                             throws PipelineException
Get the current queue extension configurations.

Parameters:
name - The name of the queue extension configuration.
Returns:
The extension configuration or null if no extension with the given name exists.
Throws:
PipelineException - If unable to determine the extensions.

getQueueExtensionConfigs

public TreeMap<String,QueueExtensionConfig> getQueueExtensionConfigs()
                                                              throws PipelineException
Get the current queue extension configurations.

Returns:
The extension configurations indexed by configuration name.
Throws:
PipelineException - If unable to determine the extensions.

removeQueueExtensionConfig

public void removeQueueExtensionConfig(String name)
                                throws PipelineException
Remove an existing the queue extension configuration.

Parameters:
name - The name of the queue extension configuration to remove.
Throws:
PipelineException - If unable to remove the extension.

setQueueExtensionConfig

public void setQueueExtensionConfig(QueueExtensionConfig extension)
                             throws PipelineException
Add or modify an existing the queue extension configuration.

Parameters:
extension - The queue extension configuration to add (or modify).
Throws:
PipelineException - If unable to set the extension.

getHosts

public TreeMap<String,QueueHostInfo> getHosts(QueueHostHistogramSpecs specs)
                                       throws PipelineException
Get the current state of the hosts participating in the Pipeline queue filtered by the given histogram specs.

In order to be considered a match, the individual histogram spec for each host property with any included categories must include the category (see HistogramSpec.isIncluded(int)) which contains the host property.

Parameters:
specs - The set of histogram specifications to match.
Returns:
The per-host information indexed by fully resolved host name.
Throws:
PipelineException - If unable to retrieve the host information.

getHosts

public TreeMap<String,QueueHostInfo> getHosts()
                                       throws PipelineException
Get the current state of all hosts participating in the Pipeline queue.

In other words, the hosts which run the pljobmgr(1) daemon.

Returns:
The per-host information indexed by fully resolved host name.
Throws:
PipelineException - If unable to retrieve the host information.

addHost

public void addHost(String hostname)
             throws PipelineException
Add a new execution host to the Pipeline queue.

The host will be added in a Shutdown state, unreserved and with no selection key biases. If a host already exists with the given name, an exception will be thrown instead.

This method will fail if the current user does not have privileged access status.

Parameters:
hostname - The fully resolved name of the host.
Throws:
PipelineException - If unable to add the host.

removeHosts

public void removeHosts(TreeSet<String> hostnames)
                 throws PipelineException
Remove the given existing execution hosts from the Pipeline queue.

The hosts must be in a Shutdown state before they can be removed.

This method will fail if the current user does not have privileged access status.

Parameters:
hostnames - The fully resolved names of the hosts.
Throws:
PipelineException - If unable to remove the hosts.

editHosts

public void editHosts(TreeMap<String,QueueHostMod> changes)
               throws PipelineException
Change the editable properties of the given hosts.

A pljobmgr(1) daemon must first be running on a host before a change can be made to its status.

This method will fail if the current user does not have privileged access status.

Parameters:
changes - The changes in host properties indexed by fully resolved names of the hosts.
Throws:
PipelineException - If unable to change the status of the hosts.

getHostResourceSamples

public TreeMap<String,ResourceSampleCache> getHostResourceSamples(TreeMap<String,TimeInterval> intervals,
                                                                  boolean runtimeOnly)
                                                           throws PipelineException
Get the dynamic resource sample history of the given host.

If the runtimeOnly argument is true then only samples already stored in the 30-minute runtime cache for the selected hosts will be returned. Note that this is much faster for cases wanting only recent samples since no resource sample cache files need to be read by the server. If runtimeOnly is false and the interval specified for a host overlaps the time period stored in an existing resource sample file, this file will be loaded every time this method is called. Since these files can be quite large, care should be taken calling this method for large numbers of hosts using large sample intervals.

The intended usage is to call this method only once using a large sample interval and then to update a local ResourceSampleCache using a small interval spanning the time since the last update until now for all subsequent calls. This will minimize both the load on the server and the amount of data which must be transmitted over the network.

If you only want to know the most recent resource sample collected for a host, it is much more efficient to use the getHosts method to obtain the current job server host information and then accessing the last collected resource sample using the QueueHostInfo.getLatestSample method.

Parameters:
intervals - The sample intervals to retrieve indexed by fully resolved hostnames.
runtimeOnly - Whether to only read samples from the runtime cache ignoring any saved samples on disk.
Returns:
The requested samples indexed by fully resolved hostname.
Throws:
PipelineException - If unable to lookup the resource usage.

getHostHistograms

public QueueHostHistograms getHostHistograms(QueueHostHistogramSpecs specs)
                                      throws PipelineException
Gets frequency distribution data for significant catagories of information shared by all job server hosts.

Parameters:
specs - The histogram catagory specifications.
Returns:
The histograms which fulfill the given specifications.
Throws:
PipelineException - If unable to lookup the host information.

getJobStateDistribution

public TreeMap<Long,double[]> getJobStateDistribution(TreeSet<Long> groupIDs)
                                               throws PipelineException
Get the distribution of job states for the jobs associated with each of the given job group IDs.

Parameters:
groupIDs - The unique job group IDs.
Returns:
The normalized frequency distribution of each JobState index by job group ID.
Throws:
PipelineException - If unable to determine the job states.

getJobStatus

public TreeMap<Long,JobStatus> getJobStatus(TreeSet<Long> groupIDs)
                                     throws PipelineException
Get the JobStatus of all jobs associated with the given job group IDs.

Parameters:
groupIDs - The unique job group IDs.
Throws:
PipelineException - If unable to determine the job status.

getRunningJobStatus

public TreeMap<Long,JobStatus> getRunningJobStatus()
                                            throws PipelineException
Get the JobStatus of all currently running jobs.

Throws:
PipelineException - If unable to determine the job status.

getJob

public QueueJob getJob(long jobID)
                throws PipelineException
Get the job with the given ID.

Parameters:
jobID - The unique job identifier.
Throws:
PipelineException - If no job exists with the given ID.

getJobs

public Map<Long,QueueJob> getJobs(Set<Long> jobIDs)
                           throws PipelineException
Get the jobs with the given IDs.

Parameters:
jobIDs - The set of unique job identifiers.
Throws:
PipelineException - If no jobs exists with the given IDs or if the set of jobIDs is empty or null.

getJobInfo

public QueueJobInfo getJobInfo(long jobID)
                        throws PipelineException
Get information about the current status of a job in the queue.

Parameters:
jobID - The unique job identifier.
Throws:
PipelineException - If no job exists with the given ID.

getJobInfos

public Map<Long,QueueJobInfo> getJobInfos(Set<Long> jobIDs)
                                   throws PipelineException
Get information about the current status of jobs in the queue.

Parameters:
jobIDs - The unique job identifiers.
Throws:
PipelineException - If no jobs exists with the given IDs.

getRunningJobInfo

public TreeMap<Long,QueueJobInfo> getRunningJobInfo()
                                             throws PipelineException
Get information about the currently running jobs.

Returns:
The information about running jobs indexed by job ID.
Throws:
PipelineException - If unable to retrieve the job information.

preemptJobs

public void preemptJobs(TreeSet<Long> jobIDs)
                 throws PipelineException
Kill and requeue the jobs with the given IDs.

If successful, the jobs will be killed but instead of failing, the jobs will be automatically requeued and will be rerun at the next available opportunity.

If the owner of the jobs are different than the current user, this method will fail unless the current user has QueueAdmin privileges.

Parameters:
jobIDs - The unique job identifiers.
Throws:
PipelineException - If unable to preempt the jobs.

killJobs

public void killJobs(TreeSet<Long> jobIDs)
              throws PipelineException
Kill the jobs with the given IDs.

If the owner of the jobs are different than the current user, this method will fail unless the current user has QueueAdmin privileges.

Parameters:
jobIDs - The unique job identifiers.
Throws:
PipelineException - If unable to kill the jobs.

pauseJobs

public void pauseJobs(TreeSet<Long> jobIDs)
               throws PipelineException
Pause the jobs with the given IDs.

If the owner of the jobs are different than the current user, this method will fail unless the current user has QueueAdmin privileges.

Parameters:
jobIDs - The unique job identifiers.
Throws:
PipelineException - If unable to pause the jobs.

resumeJobs

public void resumeJobs(TreeSet<Long> jobIDs)
                throws PipelineException
Resume execution of the paused jobs with the given IDs.

If the owner of the jobs are different than the current user, this method will fail unless the current user has QueueAdmin privileges.

Parameters:
jobIDs - The unique job identifiers.
Throws:
PipelineException - If unable to resume the jobs.

changeJobReqs

public void changeJobReqs(LinkedList<JobReqsDelta> jobReqsChanges)
                   throws PipelineException
Changes the job requirements defined by the deltas.

If the owner of the jobs is different than the current user, this method will fail unless the current user has QueueAdmin privileges.

Parameters:
jobReqsChanges - The job requirements indexed by unique job identifiers
Throws:
PipelineException - If unable to change the job requirements for the jobs.

updateJobKeys

public void updateJobKeys(TreeSet<Long> jobIDs)
                   throws PipelineException
Updates the generated keys for the jobs with the given IDs.

If the owner of the jobs are different than the current user, this method will fail unless the current user has QueueAdmin privileges.

Parameters:
jobIDs - The unique job identifiers.
Throws:
PipelineException - If unable to update the jobs keys.

doJobKeysNeedUpdate

public Boolean doJobKeysNeedUpdate()
                            throws PipelineException
Get a boolean which reflects whether key choosers need to be rerun for all jobs in the queue.

Throws:
PipelineException - If unable to get the boolean value.

getChooserUpdateTime

public Long getChooserUpdateTime()
                          throws PipelineException
Get the timestamp that reflects the last time a keychoosers or a key that uses a keychooser was updated.

This value can then be compared against the value saved in jobs to determine if the job needs to have its keys re-evaluated.

Throws:
PipelineException - If unable to get the long value.

updateAllJobKeys

public void updateAllJobKeys()
                      throws PipelineException
Updates the generated keys for all jobs in the queue.

This method will fail unless the current user has QueueAdmin privileges.

This method will return before it updates any of the jobs, so it does not cause the client to have to wait while all the jobs in the queue are processed. Any errors which occur will be written into the QueueMgr log, but not be returned.

Throws:
PipelineException - If the user does not have permission to update the keys.

invalidateAllJobKeys

public void invalidateAllJobKeys()
                          throws PipelineException
Set the Key State in every non-executed job to Stale, prompting users to rerun the key choosers on the jobs.

This method will fail unless the current user has QueueAdmin privileges.

Throws:
PipelineException - If the user does not have permission to update the keys.

preemptJobs

public void preemptJobs(NodeID nodeID)
                 throws PipelineException
Kill and requeue all jobs associated with the given working version.

If successful, the jobs will be killed but instead of failing, the jobs will be automatically requeued and will be rerun at the next available opportunity.

If the owner of the jobs are different than the current user, this method will fail unless the current user has QueueAdmin privileges.

Parameters:
nodeID - The unique working version identifier.
Throws:
PipelineException - If unable to preempt the jobs.

killJobs

public void killJobs(NodeID nodeID)
              throws PipelineException
Kill all jobs associated with the given working version.

If the owner of the jobs are different than the current user, this method will fail unless the current user has QueueAdmin privileges.

Parameters:
nodeID - The unique working version identifier.
Throws:
PipelineException - If unable to kill the jobs.

pauseJobs

public void pauseJobs(NodeID nodeID)
               throws PipelineException
Pause all jobs associated with the given working version.

If the owner of the jobs are different than the current user, this method will fail unless the current user has QueueAdmin privileges.

Parameters:
nodeID - The unique working version identifier.
Throws:
PipelineException - If unable to pause the jobs.

resumeJobs

public void resumeJobs(NodeID nodeID)
                throws PipelineException
Resume execution of all paused jobs associated with the given working version.

If the owner of the jobs are different than the current user, this method will fail unless the current user has QueueAdmin privileges.

Parameters:
nodeID - The unique working version identifier.
Throws:
PipelineException - If unable to resume the jobs.

preemptJobs

@Deprecated
public void preemptJobs(String author,
                                   TreeSet<Long> jobIDs)
                 throws PipelineException
Deprecated. The author argument is no longer neccessary and is now ignored by this method. Please use the other form of this method which does not take an author in future code.

Kill and requeue the jobs with the given IDs.

If successful, the jobs will be killed but instead of failing, the jobs will be automatically requeued and will be rerun at the next available opportunity.

The author argument must match the user who submitted the jobs.

If the author argument is different than the current user, this method will fail unless the current user has QueueAdmin privileges.

Parameters:
author - The name of the user which owns the jobs.
jobIDs - The unique job identifiers.
Throws:
PipelineException - If unable to preempt the jobs.

killJobs

@Deprecated
public void killJobs(String author,
                                TreeSet<Long> jobIDs)
              throws PipelineException
Deprecated. The author argument is no longer neccessary and is now ignored by this method. Please use the other form of this method which does not take an author in future code.

Kill the jobs with the given IDs.

The author argument must match the user who submitted the jobs.

If the author argument is different than the current user, this method will fail unless the current user has QueueAdmin privileges.

Parameters:
author - The name of the user which owns the jobs.
jobIDs - The unique job identifiers.
Throws:
PipelineException - If unable to kill the jobs.

pauseJobs

@Deprecated
public void pauseJobs(String author,
                                 TreeSet<Long> jobIDs)
               throws PipelineException
Deprecated. The author argument is no longer neccessary and is now ignored by this method. Please use the other form of this method which does not take an author in future code.

Pause the jobs with the given IDs.

The author argument must match the user who submitted the jobs.

If the author argument is different than the current user, this method will fail unless the current user has QueueAdmin privileges.

Parameters:
author - The name of the user which owns the jobs.
jobIDs - The unique job identifiers.
Throws:
PipelineException - If unable to pause the jobs.

resumeJobs

@Deprecated
public void resumeJobs(String author,
                                  TreeSet<Long> jobIDs)
                throws PipelineException
Deprecated. The author argument is no longer neccessary and is now ignored by this method. Please use the other form of this method which does not take an author in future code.

Resume execution of the paused jobs with the given IDs.

The author argument must match the user who submitted the jobs.

If the author argument is different than the current user, this method will fail unless the current user has QueueAdmin privileges.

Parameters:
author - The name of the user which owns the jobs.
jobIDs - The unique job identifiers.
Throws:
PipelineException - If unable to resume the jobs.

getJobGroup

public QueueJobGroup getJobGroup(long groupID)
                          throws PipelineException
Get the job group with the given ID.

Parameters:
groupID - The unique job group identifier.
Throws:
PipelineException - If no job group exists with the given ID.

getJobGroups

public TreeMap<Long,QueueJobGroup> getJobGroups()
                                         throws PipelineException
Get all of the existing job groups.

Throws:
PipelineException - If no job groups exist.

getJobGroups

public TreeMap<Long,QueueJobGroup> getJobGroups(String author,
                                                String view)
                                         throws PipelineException
Get the job groups which match the following working area pattern.

Parameters:
author - The name of the user owning the job groups or null to match all users.
view - The name of the working area view owning the job groups or null to match all working areas.
Throws:
PipelineException - If no job groups exist.

deleteJobGroups

public void deleteJobGroups(TreeMap<Long,String> groupAuthors)
                     throws PipelineException
Delete the completed job groups.

The authors specified by the groupAuthors argument must match the user who submitted the groups.

If any of the authors specified by the groupAuthors argument are different than the current user, this method will fail unless the current user has privileged access status.

Parameters:
groupAuthors - The name of the user which submitted the group indexed by job group ID.
Throws:
PipelineException - If no job group exists with the given ID or if the job group is not completed.

deleteViewJobGroups

public void deleteViewJobGroups(String author,
                                String view)
                         throws PipelineException
Delete all of the completed job groups created in the given working area.

If the author argument is different than the current user, this method will fail unless the current user has privileged access status.

Parameters:
author - The name of the user which owns the job groups.
view - The name of the user's working area view.
Throws:
PipelineException - If unable to delete the job groups.

deleteAllJobGroups

public void deleteAllJobGroups()
                        throws PipelineException
Delete all of the completed job groups in all working areas.

This method will fail unless the current user has privileged access status.

Throws:
PipelineException - If unable to delete the job groups.

getObjectInput

protected ObjectInput getObjectInput(InputStream in)
                              throws IOException
Get the object input given a socket input stream.

Overrides:
getObjectInput in class BaseMgrClient
Throws:
IOException

getServerDownMessage

protected String getServerDownMessage()
Get the error message to be shown when the server cannot be contacted.

Overrides:
getServerDownMessage in class BaseMgrClient

TEMERITY