So lets say I create a compute task extending compute-task-split-adapter and
I write my code inside split and reduce methods. After that is it enough
just to package my file as jar and place in libs folder of ignite
installation , for the rest api to recognize.
Ex :
/
public class MyComputeTask extends ComputeTaskSplitAdapter<T, R> {
@IgniteInstanceResource
private Ignite ignite;
@Override
public R reduce(List<ComputeJobResult> results) throws
IgniteException {
****some code***
return R;
}
@Override
protected Collection<? extends ComputeJob> split(int gridSize,
String arg) throws IgniteException {
String[] words = arg.split(" ");
List<ComputeJob> jobs = new ArrayList<>(words.length);
for (final String word : words) {
jobs.add(new ComputeJobAdapter() {
@Override
public Object execute() {
**call my service here and do my
computation**
MyService svc=
ignite.services().serviceProxy(...,...,...);
**use this svc to add some data to
cache***
return Object;
}
});
}
return jobs;
}
}
/
Now this class I will keep as a jar inside my libs folder.
*
localhost:8080/ignite?cmd=exe&name=MyComputeTask*
Should this REST call successfully work?
I am getting an error. That failed to auto-deploy. So what should I do so
that REST api can recognise my task.
Regards
Zaheer.
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/