This page last changed on Nov 03, 2008 by amitku.

Getting list of jobs for a project

/get/SchedulerManager.getJobListAndStatus?projectId=40

param value required
projectId integer yes
status one of the following "FINISHED","RUNNING","SUBMITTED", "QUEUED" or "ABORT" no

Notice the <token> element -use that for all other requests.

The lifecycles of the job are:
SUBMITTED->QUEUED
SUBMITTED->QUEUED->RUNNING->FINISHED
SUBMITTED->QUEUED->RUNNING->ABORT
SUBMITTED->QUEUED->ABORT

_There is a possibility that some jobs have "RUNNING" status or no status at all, that's because of
of flows that aborted or were killed before the scheduler was bug free._

Example: http://monk.lis.uiuc.edu:8888/monkmiddleware/get/SchedulerManager.getJobListAndStatus?projectId=40

Scheduling a Flow

Scheduling a flow is the preferred way of calling analytics. Scheduler makes sure that the request to run the flow
is sent to the least busy client and the flow life cycle is followed. This option supports new calls to abort a running
flow, get the location of the log file and get the status of the flow and of the queue at anytime.

Step I

call runAnalysis
/SchedulerManager.runAnalysis?flowId=http://test.org/flow/naivebayes&token=testtoken201&emailAddress=amitku@uiuc.edu&worksetId=71&projectId=40&toolsetId=toolset-search&resultName=Test-33&resultDescription=testing

Send all the parameters to the flow that the flow needs. The token attribute is something that should be randomly generated in javascript;
It can have any numeric and alphabet character. The length of the token should be between 16 and 32 characters, there should not be a "-" character in the token.

The result of this call in the event of success is

The result of failure is as below. The call would fail if you reuse the token value or of the flow is not supported

Step II

call status (Call every 10 seconds)

/SchedulerManager.status?token=testtoken2067

This call will return the current flowStatus. Upon Successful completion the success message looks like as below

The @type attribute can be "FINISH", "STARTED", or "ENQUEUED".
Use the flowInstanceId here to make a call to get the prediction result like you would normally do.

Step III

call abort (Can call anytime the flow is running)

/SchedulerManager.abort?token=testtoken2067

Use the abort call to stop a long running flow that has not yet completed

Upon success the message would look as below

<status>
Abort request sent to the client 7438234ndssr329m
</status>

If the flow has finished, the token is invalid or the flow has already aborted -you will
get an error message as below

<error>
Message...
</error>

After making the abort call -A call to status should be made after 3 seconds to confirm that the flow
did get aborted.

Step IV

call log

The log call returns the location of the log file.

/SchedulerManager.log?token=token2067

Upon success the message will return the location of the log file -accessible through http

Upon failure an error message will be sent; The error message would be sent if the token is invalid
or if the server that has the log file is not running.

Step V

getClientList call

/SchedulerManager.getClientList

The getClientList call will return the detailed information about the available clients. The clients are the analytics servers
that are cooperating with the scheduler and are supporting multiple flow. Currently -there are two analytics servers that act
as client to the scheduler -one is running on brain.lis.uiuc.edu and other on monk.lis.uiuc.edu.

The success message from the getClientList call looks as below

Using SEASR Manager to call analytics

Step I @DEPRECATED

Call doSetup
Use the doSetup command to start the flow http://127.0.0.1:8080/get/SeasrManager.doSetup

<flow>
<weburl>http://127.0.0.1:1737/</weburl>
<instanceId>
http://test.org/flow/testmac/1205219875332/128185752
</instanceId>
</flow>

Step II @DEPRECATED

Call runAnalysis http://127.0.0.1:8080/get/SeasrManager.runAnalysis

You need to identify the flow and the weburl for the flow using following two parametes
weburl=http://127.0.0.1:1715/
instanceId=http://test.org/flow/testmac/1205231794739/1955158892

and then identify the parameters required to do the analysis

worksetId=17 (if you provide worksetId the application looks for the trainingSet,trainingSetRating and documentList from the workset) -Be careful with this the current implementation is not very stable to make sure that the workset has proper trainingset/trainingSetRatings and workList -else it will throw an error.

or all of the below (these are for testing purposes...)
feature=Lemma or Spelling
collection=ncf
workList=ncf-101-2,ncf-0101-2
trainingSet=ncf-0101-2-1-1,ncf-0101-2-1-2,ncf-0101-2-1-3,ncf-0101-2-1-4
trainingSetRatings=sentimental,sentimental,unsentimental,unsentimental

on success

<running error="false" dateStarted="2008-03-11 11:11:09.0"/>

upon error

<error>
Flow has already completed use getPrediction method to get results
</error>

Step III

Call Get Prediction http://127.0.0.1:8080/monkmiddleware/SEASRManager/getPrediction?instanceId=http://test.org/flow/testmac/1205229661381/150094972

on Error

<result>
<instanceId>
http://test.org/flow/testmac/1205231794739/19551588922
</instanceId>
<status>
Flow with flowInstanceID http://test.org/flow/testmac/1205231794739/19551588922 has not yet started
</status>
</result>

on Success

<result>

	<instanceId>
http://test.org/flow/testmac/1205240666245/45300353
</instanceId>
<dateStarted>2008-03-11 08:07:57.0</dateStarted>
<dateEnded>2008-03-11 08:08:04.0</dateEnded>
<status>results follow</status>

	<json>
{"org.seasr.meandre.components.weka.PredictionFlowResult":{"resultSummary":"Some summary of the result Tue Mar 11 08:09:06 CDT 2008","result":{"PredictionResult":[{"docId":"work.1","predictedClass":"0","value":"s","probabilityRatio":{"double":["0.832676564617279","0.8060886582342885"]}},{"docId":"work.2","predictedClass":"0","value":"s","probabilityRatio":{"double":["0.42221846048762735","0.2826080526645438"]}}]},"classList":{"string":["s","e"],"trainingList":{"entry":[{"string":["work.5","s"]},{"string":["work.4","e"]}]}}}}
</json>

	<dataType>
org.seasr.meandre.components.weka.PredictionFlowResult
</dataType>
</result>


error.jpg (image/jpeg)
erro1.jpg (image/jpeg)
finish.jpg (image/jpeg)
log.jpg (image/jpeg)
clientlist.jpg (image/jpeg)
success.jpg (image/jpeg)
jobs.jpg (image/jpeg)
jobs.jpg (image/jpeg)
Document generated by Confluence on Apr 19, 2009 15:04