|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.xtreemos.xati.API.XJobMng
public class XJobMng
Field Summary | |
---|---|
static java.lang.String |
servicename
|
Constructor Summary | |
---|---|
XJobMng()
|
Method Summary | |
---|---|
static void |
addDependence(java.lang.String __FromJobId,
java.lang.String __toJobId,
java.lang.String __TAG,
java.security.cert.X509Certificate __userCtx)
This function adds a new job dependence. |
static java.lang.Integer |
addJobMetric(java.lang.String __jobId,
eu.xtreemos.xosd.utilities.metrics.MetricsDesc __metric,
java.security.cert.X509Certificate __userCtx)
Adds a new user defined metric to the job. |
static void |
chgUID(java.lang.String __jobId,
java.security.cert.X509Certificate __oldUserCtx,
java.security.cert.X509Certificate __newUserCtx)
Changes the UID associated to a jobId |
static java.lang.String |
createJob(java.lang.String __jsdlFile,
java.lang.Boolean __startJob,
java.lang.String __reservationID,
java.security.cert.X509Certificate __userCtx)
Creates a job in the AEM based on the JSDL description. |
static java.lang.Integer |
createProcess(java.lang.String __jobId,
java.lang.String __JSDL,
java.lang.String __reservationId,
CommunicationAddress __resource,
java.security.cert.X509Certificate __userCtx)
Creates a new Process inside the specified JobID In order to increase performance, user can specify the ReservationID. |
static void |
deleteDependence(java.lang.String __FromJobId,
java.lang.String __ToJobId,
java.lang.String __TAG,
java.security.cert.X509Certificate __userCtx)
Deletes an existing dependence between two specific jobs |
static void |
exitJob(java.lang.String __jobId,
java.lang.Integer __exitValue,
java.security.cert.X509Certificate __userCtx)
The job identified by the jobId is finished immediately (all the processes of the job) with the exit code provided. |
static java.lang.String |
getJobId(CommunicationAddress __resourceId,
java.lang.Integer __pid,
java.security.cert.X509Certificate __userCtx)
Returns the jobID corresponding to a |
static java.lang.String |
getJobInfo(java.lang.String __jobId,
java.lang.Integer __flags,
java.lang.Integer __infoLevel,
java.util.ArrayList<java.lang.String> __metricsList,
java.security.cert.X509Certificate __userCtx)
TODO: To be eventually deprecated. |
static java.util.ArrayList<eu.xtreemos.xosd.utilities.metrics.MetricsDesc> |
getJobMetrics(java.lang.String __jobId,
java.security.cert.X509Certificate __userCtx)
Returns the list of available metrics for a specific job, both system and user defined. |
static java.lang.String |
getJobsInfo(java.util.ArrayList<java.lang.String> __jobIds,
java.lang.Integer __flags,
java.lang.Integer __infoLevel,
java.util.ArrayList<java.lang.String> __metrics,
java.security.cert.X509Certificate __userCtx)
Returns the monitoring information of the requested jobs. |
static java.util.ArrayList<java.lang.String> |
getJobsUser(java.lang.String __userId,
java.security.cert.X509Certificate __userCtx)
Returns all the jobIDs of the jobs belonging to the given user |
static java.util.ArrayList<java.lang.String> |
getListOfDependences(java.lang.String __jobID,
java.lang.String __tag,
java.lang.Integer __levels,
java.lang.Integer __direction,
java.security.cert.X509Certificate __userCtx)
Returns the list of jobs that have a dependence FROM jobID or TO jobID. |
static void |
identifyJobManagers(java.util.ArrayList<java.lang.String> __dependentJobs,
java.lang.String __initialJobId,
java.lang.String __strategy,
java.lang.String __options,
java.lang.String __mode,
java.security.cert.X509Certificate __cert)
identify job manager address of each job |
static void |
jobControl(java.lang.String __jobId,
java.lang.Integer __ctrOp,
java.security.cert.X509Certificate __userCtx)
Apply the operation Control to the specific jobId |
static void |
jobMonitoringControl(java.lang.String __jobId,
java.lang.Integer __op,
java.lang.String __level,
java.security.cert.X509Certificate __userCtx)
Update the characteristics of the monitorization of a job. |
static java.lang.Integer |
jobWait(java.lang.String __jobId,
java.security.cert.X509Certificate __userCtx)
Blocks the calling process until the job indicated finishes |
static void |
lockCheckpoint(java.lang.String __jobId,
java.lang.String __initialJobId,
java.security.cert.X509Certificate __userCert,
CommunicationAddress __jobCpAddr,
CommunicationAddress __superJobCpAddr,
java.lang.String __strategy,
java.lang.String __options,
java.lang.String __mode,
java.util.ArrayList<java.lang.String> __dependentJobs)
lock a checkpoint action - private member jobslist needed piggyback jsdl file and executable name |
static void |
recreateJob(java.lang.String __jobId,
java.lang.String __initialJobId,
java.lang.String __jsdlFileContent,
java.lang.String __checkpointVersion,
CommunicationAddress __superJobCpAddr,
java.util.ArrayList<CommunicationAddress> __jobResourceList,
java.security.cert.X509Certificate __userCert)
set up structures that represent a job in AEM at restart |
static java.lang.Integer |
removeJobMetric(java.lang.String __jobId,
java.lang.String __metricName,
java.security.cert.X509Certificate __userCtx)
Removes a user defined metric from the job. |
static java.lang.Integer |
runJob(java.lang.String __jobId,
java.lang.String __reservationID,
java.security.cert.X509Certificate __userCtx)
Starts the scheduling process of a previously created job. |
static java.lang.Integer |
runJobRes(java.lang.String __jobId,
java.lang.String __reservationID,
CommunicationAddress __resourceID,
java.security.cert.X509Certificate __userCtx)
Starts the scheduling process of a previously created job. |
static void |
sendEvent(java.lang.String __jobId,
java.lang.Integer __signal,
java.lang.Integer __operation,
java.util.ArrayList<java.lang.String> __list,
java.security.cert.X509Certificate __userCtx)
Sends an event to a job |
static java.lang.Integer |
setMetricValue(java.lang.String __jobId,
java.lang.String __metricName,
CommunicationAddress __resourceID,
java.lang.Integer __pid,
java.lang.String __value,
java.security.cert.X509Certificate __userCtx)
Sets the value of a Metric. |
static java.lang.Integer |
setMonitorBuffering(java.lang.String __jobId,
java.lang.String __metricName,
CommunicationAddress __resourceID,
java.lang.Integer __pid,
java.lang.Integer __flags,
java.security.cert.X509Certificate __userCtx)
Switches on and off buffering for the specified metric. |
static void |
unlockCheckpoint(java.lang.String __jobId)
|
static void |
unlockRestart(java.lang.String __jobId)
|
static void |
updateJobHints(java.lang.String __jobId,
java.lang.Integer __operation,
java.lang.String __requirements,
java.lang.Boolean __wait,
java.security.cert.X509Certificate __userCtx)
Modifies the hints passed in createJob function |
static void |
updateJobMetric(java.lang.String __jobId,
eu.xtreemos.xosd.utilities.metrics.MetricsDesc __metric,
java.security.cert.X509Certificate __userCtx)
Not defined yet |
static void |
updateJobRequirements(java.lang.String __jobId,
java.lang.Integer __operation,
java.lang.String __requirements,
java.lang.Boolean __wait,
java.security.cert.X509Certificate __userCtx)
Modifies the requirements passed in createJob function. |
static void |
waitForEvent(java.lang.String __jobId,
java.lang.Integer __event,
java.security.cert.X509Certificate __userCtx)
Blocks the calling process until "event" is received. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String servicename
Constructor Detail |
---|
public XJobMng()
Method Detail |
---|
public static java.lang.String createJob(java.lang.String __jsdlFile, java.lang.Boolean __startJob, java.lang.String __reservationID, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jsdlFile
- is the job description of the job to be created in JSDL format (content not path to jsdl file)startJob
- true if we want to run job now, false just to create it without runningreservationID
- The previously created reservation were the job will runuserCtx
- the user certificate.
java.lang.Exception
public static java.lang.Integer runJob(java.lang.String __jobId, java.lang.String __reservationID, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- of the job to be startedreservationID
- The previously created reservation were the job will runuserCtx
- the user certificate.
java.lang.Exception
public static java.lang.Integer runJobRes(java.lang.String __jobId, java.lang.String __reservationID, CommunicationAddress __resourceID, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- of the job to be startedreservationID
- The previously created reservation were the job will runresourceID
- of the resource that will run the job (if possible)userCtx
- the user certificate.
java.lang.Exception
public static void jobControl(java.lang.String __jobId, java.lang.Integer __ctrOp, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- of the job to apply the operationctrOp
- possible values:
0: SUSPENDJOB
1: RESUMEJOB
2: CANCEL JOBuserCtx
- the user certificate
java.lang.Exception
public static void exitJob(java.lang.String __jobId, java.lang.Integer __exitValue, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- identifying the job to exitexitValue
- the exit code the job will finish withuserCtx
- the user certificate
java.lang.Exception
public static java.lang.String getJobsInfo(java.util.ArrayList<java.lang.String> __jobIds, java.lang.Integer __flags, java.lang.Integer __infoLevel, java.util.ArrayList<java.lang.String> __metrics, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- an ArrayList of String which is the list of requested jobs.flags
- an Integer used as a mask to define the metrics to return.
TypeOfInfo enum class has the values of each type. P.e.
TypeOfInfo.BASIC.val(). Several flags might be combined as logical
OR operands. Values and description:
BASIC: Job identification, status and times
JOB_DEFINITION: The JSDL
RESOURCES_ALLOCATED: ReservationIDs
RESOURCES_CONSUMED: Extended information about resources (to be implemented)
USER_METRICS: Metrics added by the user with the addJobMetric method
infoLevel
- an Integer defining the sources of information allowed
in the operation. InfoLevel enum class should be used
to get the right values. P.e. InfoLevel.PROCESS.val().
Values and description:
JOB: it communicates only with the jobMng.
PROCESS: it communicates both with jobMng and exec- or resMng.
KERNEL: it communicates with every needed service and also considers special kernel metrics (to be implemented)
metrics
- a list of metrics to obtain, additional to the flagsuserCtx
- the X509Certificate Object with the user certificate
java.lang.Exception
- if
1) Incorrect jobId
2) Invalid User in the Certificate
3) Incorrect list of metrics
4) Not a valid XtreemOS certificatepublic static java.lang.String getJobInfo(java.lang.String __jobId, java.lang.Integer __flags, java.lang.Integer __infoLevel, java.util.ArrayList<java.lang.String> __metricsList, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- flags
- infoLevel
- metricsList
- userCtx
-
java.lang.Exception
getJobsInfo(ArrayList, Integer, Integer, ArrayList, X509Certificate)
public static java.lang.String getJobId(CommunicationAddress __resourceId, java.lang.Integer __pid, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
resourceId
- the CommunicationAddress of the resource where the process is assignedpid
- an Integer with the process identifier local to that resourceuserCtx
- an X509Certificate object with the user certificate
java.lang.Exception
- when either of these happens:
1) Not a valid XtreemOS certificate
2) Invalid User in the Certificate
3) No jobID associated with the public static java.util.ArrayList<java.lang.String> getJobsUser(java.lang.String __userId, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
userId
- a String identifying the user we want to obtain the jobs fromuserCtx
- a X509Certificate object with the user certificate
java.lang.Exception
- if
1) Not a valid XtreemOS certificatepublic static void sendEvent(java.lang.String __jobId, java.lang.Integer __signal, java.lang.Integer __operation, java.util.ArrayList<java.lang.String> __list, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
signal
- number to be sentoperation
- can be:
0: ALL
1: MASTER
2: SPECIFYED in list
3: EXCEPT in listjobId
- identifying the job we are going to send the signal tolist
- userCtx
- the user certificate
TODO: Now we send always the signal to all the processes of the job, use the operation and list parameters
java.lang.Exception
public static java.lang.Integer jobWait(java.lang.String __jobId, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- identifying the job the calling process is waiting for
java.lang.Exception
public static java.lang.Integer createProcess(java.lang.String __jobId, java.lang.String __JSDL, java.lang.String __reservationId, CommunicationAddress __resource, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- JSDL,
- JSDL contentreservationId
- resource
- userCtx
-
java.lang.Exception
public static void addDependence(java.lang.String __FromJobId, java.lang.String __toJobId, java.lang.String __TAG, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
FromJobId
- the job from which tojobId dependstoJobId
- the job that depends on fromJobIdTAG
- is a name to identify a set of dependencies.userCtx
- the user certificate
java.lang.Exception
public static void deleteDependence(java.lang.String __FromJobId, java.lang.String __ToJobId, java.lang.String __TAG, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
FromJobId
- the job from which tojobId dependstoJobId
- the job that depends on fromJobIdTAG
- is a name to identify a set of dependencies.userCtx
- the user certificate
java.lang.Exception
public static java.util.ArrayList<java.lang.String> getListOfDependences(java.lang.String __jobID, java.lang.String __tag, java.lang.Integer __levels, java.lang.Integer __direction, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobID
- the starting job to get the related jobstag
- is a name to identify a set of dependencies.levels
- 1 or ALL (0) (TBD)direction
- can be:
0: FROM (up)
1: TO (down)userCtx
- the user certificate
java.lang.Exception
public static void updateJobHints(java.lang.String __jobId, java.lang.Integer __operation, java.lang.String __requirements, java.lang.Boolean __wait, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- identifying the job to change the requirements ofoperation
- can be:
0: MIGRATION_REQ
1: SCHEDULING_REQrequirements
- identifying the job to change the requirements ofwait
- if the call is synchronous or asynchronoususerCtx
- the user certificate
java.lang.Exception
public static java.util.ArrayList<eu.xtreemos.xosd.utilities.metrics.MetricsDesc> getJobMetrics(java.lang.String __jobId, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- a String identifying the job to get the metrics from,
if the jobId is null the generic list of metrics is returneduserCtx
- a X509Certificate object with the user certificate
java.lang.Exception
- if
1) Not a valid XtreemOS certificate
2) Invalid User in the Certificate
3) Incorrect jobIdpublic static java.lang.Integer setMetricValue(java.lang.String __jobId, java.lang.String __metricName, CommunicationAddress __resourceID, java.lang.Integer __pid, java.lang.String __value, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- a String identifying the job, the metric is associated to.metricName
- is a String with the name of the metric to be set.value
- a String with the value to be set to the metric. It's a string, but it will be parsed
according to the metric type. If it's time type, the string must be in jiffies format.
java.lang.Exception
- if
1) Incorrect jobId
2) Invalid User in the Certificate
3) Not a valid XtreemOS certificate
4) Metric doesn't exist
5) Trying to set value on a system metricpublic static java.lang.Integer setMonitorBuffering(java.lang.String __jobId, java.lang.String __metricName, CommunicationAddress __resourceID, java.lang.Integer __pid, java.lang.Integer __flags, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- a String identifying the job whose metric is about to get buffered. Its worth
noticing that buffering is not applied to the whole job but to the smallest part of it
according to the scope.metricName
- a String with the name of the metric.resourceID
- the CommunicationAddress of the resource where the buffering is to
be applied. Used only if the scope of the metric is resource, jobUnit or process.pid
- Integer with the process ID of the process where the buffering is to
be applied. Used only if the scope of the metric is process.flags
- an Integer mask with options to aggregate several metrics, tag buffers and
enable or disable buffering.
Use flags |= TypeOfInfo.ENABLE.val() to enable buffering
flags |= ~TypeOfInfo.ENABLE.val() to disable buffering
TODO: add support for metric aggregations, if required.userCtx
- a X509Certificate object with the user certificate.
java.lang.Exception
- if
1) Incorrect jobId
2) Invalid User in the Certificate
3) Not a valid XtreemOS certificate
4) Metric doesn't exist
5) Metric cannot provide buffering capabilitiespublic static java.lang.Integer addJobMetric(java.lang.String __jobId, eu.xtreemos.xosd.utilities.metrics.MetricsDesc __metric, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- a String identifying the job to add the metric tometric
- a MetricsDesc object with the metric to be addeduserCtx
- a X509Certificate object with the user certificate
java.lang.Exception
- if
1) Incorrect jobId
2) Invalid User in the Certificate
3) Not a valid XtreemOS certificate
4) Metric already exists
5) Incorrect metric descriptionpublic static void updateJobMetric(java.lang.String __jobId, eu.xtreemos.xosd.utilities.metrics.MetricsDesc __metric, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
java.lang.Exception
public static java.lang.Integer removeJobMetric(java.lang.String __jobId, java.lang.String __metricName, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- a String identifying the job to remove the metric frommetricName
- a String with the name of the metric to be removeduserCtx
- a X509Certificate object with the user certificate
java.lang.Exception
- if
1) Incorrect jobId
2) Invalid User in the Certificate
3) Not a valid XtreemOS certificate
4) Metric doesn't exist
5) Trying to remove a system metricpublic static void chgUID(java.lang.String __jobId, java.security.cert.X509Certificate __oldUserCtx, java.security.cert.X509Certificate __newUserCtx) throws java.lang.Exception
jobId
- identifying the job whose user will changeoldUserCtx
- the certificate of the current usernewUserCtx
- the new certificate to be used
java.lang.Exception
public static void updateJobRequirements(java.lang.String __jobId, java.lang.Integer __operation, java.lang.String __requirements, java.lang.Boolean __wait, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- identifying the job to change the requirements ofoperation
- can be:
0: ADD_RESOURCES
1: RELEASE_RESOURCES
2: EXTEND_RESOURCESrequirements
- in a JSDL format specifying the new requirementswait
- if the call is synchronous or asynchronoususerCtx
- the user certificate
java.lang.Exception
public static void jobMonitoringControl(java.lang.String __jobId, java.lang.Integer __op, java.lang.String __level, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- op
- can be:
0:START
1:STOP
2:CHANGE_LEVELlevel
- the new monitoring level in case op is set to CHANGE.
Can be: High, medium or LowuserCtx
- the user certificate
java.lang.Exception
public static void waitForEvent(java.lang.String __jobId, java.lang.Integer __event, java.security.cert.X509Certificate __userCtx) throws java.lang.Exception
jobId
- event
- the event the process is waiting foruserCtx
- the user certificate
java.lang.Exception
public static void identifyJobManagers(java.util.ArrayList<java.lang.String> __dependentJobs, java.lang.String __initialJobId, java.lang.String __strategy, java.lang.String __options, java.lang.String __mode, java.security.cert.X509Certificate __cert) throws java.lang.Exception
java.lang.Exception
public static void lockCheckpoint(java.lang.String __jobId, java.lang.String __initialJobId, java.security.cert.X509Certificate __userCert, CommunicationAddress __jobCpAddr, CommunicationAddress __superJobCpAddr, java.lang.String __strategy, java.lang.String __options, java.lang.String __mode, java.util.ArrayList<java.lang.String> __dependentJobs) throws java.lang.Exception
java.lang.Exception
public static void unlockCheckpoint(java.lang.String __jobId) throws java.lang.Exception
java.lang.Exception
public static void unlockRestart(java.lang.String __jobId) throws java.lang.Exception
java.lang.Exception
public static void recreateJob(java.lang.String __jobId, java.lang.String __initialJobId, java.lang.String __jsdlFileContent, java.lang.String __checkpointVersion, CommunicationAddress __superJobCpAddr, java.util.ArrayList<CommunicationAddress> __jobResourceList, java.security.cert.X509Certificate __userCert) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |