public class TechilaConn
extends java.lang.Object
| Constructor and Description |
|---|
TechilaConn() |
| Modifier and Type | Method and Description |
|---|---|
<T> java.util.List<T> |
binaryTreeCat(T data,
int target,
java.lang.String group) |
<T> T |
binaryTreeOperation(Func<T> func,
T data,
int target,
java.lang.String group) |
<T> T |
cloudBc(int jobid,
T data)
Cloud broadcast, send data from given job to all other jobs.
|
<T> java.util.List<T> |
cloudCat(T data)
Catenate/join data from all jobs.
|
<T> java.util.List<T> |
cloudCat(T data,
int target)
Catenate/join data from all jobs.
|
<T> java.util.List<T> |
cloudCat(T data,
int target,
java.lang.String group)
Catenate/join data from all jobs in a given group.
|
<T> T |
cloudOp(Func<T> func,
T data)
Do an operation on the data given.
|
<T> T |
cloudOp(Func<T> func,
T data,
int target)
Do an operation on the data given.
|
<T> T |
cloudOp(Func<T> func,
T data,
int target,
java.lang.String group)
Do an operation on the data given on a given group.
|
java.lang.String |
executeCmd(java.lang.String cmd)
Execute a command.
|
java.util.List<java.lang.Integer> |
getActiveJobs()
Get the number of active jobs in the current project.
|
java.util.List<java.lang.Integer> |
getActiveJobs(int projectId)
Get the number of active jobs in the given project.
|
java.util.List<java.lang.Integer> |
getActiveProjects()
Get a list a active project IDs.
|
int |
getJobCount()
Get the number of jobs in the current project.
|
int |
getJobCount(java.lang.String group)
Get the number of jobs in the given group.
|
int |
getJobId()
Get the current jobs ID.
|
int |
getJobId(java.lang.String group)
Get the currents jobs ID in the given group.
|
JobInfo |
getProjectJobCounts()
Get the the number of jobs in different states in the current project.
|
JobInfo |
getProjectJobCounts(int projectId)
Get the number of jobs in differents stats in the given project.
|
java.lang.String |
getProjectParameter(java.lang.String param)
Get project parameter value.
|
java.lang.String |
getProjectParameter(java.lang.String param,
int projectId)
Get a project parameter value in a given project.
|
void |
initInterconnection(int timeout)
initiate interconnection between the jobs.
|
java.lang.Object |
loadIMData()
Load received intermediate data.
|
java.lang.Object |
loadIMData(long timeout)
Load received intermediate data, wait at maximum timeout ms.
|
<T> T |
receiveDataFromJob(int jobid)
Receive data from a given job.
|
<T> T |
receiveDataFromJob(int jobid,
java.lang.String group)
Receive data from a given job in a given group.
|
void |
registerToGroup(java.lang.String group)
Register the current job to a given group.
|
<T> void |
sendDataToJob(int jobid,
T data)
Send data to the given job.
|
<T> void |
sendDataToJob(int jobid,
T data,
java.lang.String group)
Send data to the given job in a given group.
|
void |
sendIMData(java.lang.Object data)
Send intermediate data (a serializable object) to the end-user.
|
void |
setProjectParameter(java.lang.String param,
java.lang.String value)
Set project parameter.
|
void |
setProjectParameter(java.lang.String param,
java.lang.String value,
int projectId)
Set project parameted in a given project.
|
<T> T |
synchronizeDataFromJob(int jobid,
T data)
Send data from one job to all other jobs.
|
<T> T |
synchronizeDataFromJob(int jobid,
T data,
java.lang.String group)
Send data from one job to all other jobs in the given group.
|
void |
unregisterFromGroup(java.lang.String group)
Unregister the current job from a given group.
|
void |
waitForOthers()
Wait for other jobs to reach the same point in the code.
|
public <T> T receiveDataFromJob(int jobid)
jobid - the job ID of the job to receive data frompublic <T> T receiveDataFromJob(int jobid,
java.lang.String group)
jobid - Job ID to receive fromgroup - group namepublic <T> void sendDataToJob(int jobid,
T data)
jobid - The Job to send todata - the data to be sentpublic <T> void sendDataToJob(int jobid,
T data,
java.lang.String group)
jobid - The Jod to send todata - the data to be sentgroup - the group namepublic void waitForOthers()
throws java.lang.Exception
java.lang.Exceptionpublic <T> T cloudBc(int jobid,
T data)
jobid - the sender job IDdata - the data to send, should be null in the receiving jobspublic <T> T synchronizeDataFromJob(int jobid,
T data)
jobid - the sender job IDdata - the data to send, should be null in the receiving jobspublic <T> T synchronizeDataFromJob(int jobid,
T data,
java.lang.String group)
jobid - the sender job IDdata - the data to send, should be null in the receiving jobsgroup - the group namepublic <T> java.util.List<T> cloudCat(T data)
data - the data from the current jobpublic <T> java.util.List<T> cloudCat(T data,
int target)
data - the data from the current jobtarget - target job to send data topublic <T> java.util.List<T> cloudCat(T data,
int target,
java.lang.String group)
data - the data from the current jobtarget - target job to send data togroup - the group namepublic <T> java.util.List<T> binaryTreeCat(T data,
int target,
java.lang.String group)
public <T> T cloudOp(Func<T> func, T data)
func - The object implementing the opdata - the data to operate onpublic <T> T cloudOp(Func<T> func, T data, int target)
func - The object implementing the opdata - the data to operate ontarget - the target job IDpublic <T> T cloudOp(Func<T> func, T data, int target, java.lang.String group)
func - The object implementing the opdata - the data to operate ontarget - the target job IDgroup - the name of the grouppublic <T> T binaryTreeOperation(Func<T> func, T data, int target, java.lang.String group)
public int getJobCount()
public int getJobCount(java.lang.String group)
group - public int getJobId()
public int getJobId(java.lang.String group)
group - the group namepublic void registerToGroup(java.lang.String group)
group - the group namepublic void unregisterFromGroup(java.lang.String group)
group - the group namepublic java.lang.String executeCmd(java.lang.String cmd)
cmd - the command to executepublic void setProjectParameter(java.lang.String param,
java.lang.String value)
throws java.lang.Exception
param - the parameter namevalue - the parameter valuejava.lang.Exceptionpublic void setProjectParameter(java.lang.String param,
java.lang.String value,
int projectId)
throws java.lang.Exception
param - the parameter namevalue - the parameter valueprojectId - the ID of the projectjava.lang.Exceptionpublic java.lang.String getProjectParameter(java.lang.String param)
throws java.lang.Exception
param - the parameter namejava.lang.Exceptionpublic java.lang.String getProjectParameter(java.lang.String param,
int projectId)
throws java.lang.Exception
param - the parameter nameprojectId - the ID of the projectjava.lang.Exceptionpublic JobInfo getProjectJobCounts() throws java.lang.Exception
java.lang.Exceptionpublic JobInfo getProjectJobCounts(int projectId) throws java.lang.Exception
projectId - the project IDjava.lang.Exceptionpublic java.util.List<java.lang.Integer> getActiveJobs()
throws java.lang.Exception
java.lang.Exceptionpublic java.util.List<java.lang.Integer> getActiveJobs(int projectId)
throws java.lang.Exception
projectId - The project IDjava.lang.Exceptionpublic java.util.List<java.lang.Integer> getActiveProjects()
throws java.lang.Exception
java.lang.Exceptionpublic void initInterconnection(int timeout)
timeout - timeout in ms to wait for other jobs,
if 0 defaults to 30000public void sendIMData(java.lang.Object data)
data - the datapublic java.lang.Object loadIMData()
public java.lang.Object loadIMData(long timeout)
timeout - max time to wait in ms