0);
for (TaskInput entry : job.getInput())
{
String fname = entry.getName();
byte[] fdata = entry.getData();
Fragmentable frag = FormatDetector.getFragmenter(new File(user_dir, fname));
if (frag == null)
throw new Exception("Failed to detect the format of input file:" + fname);
Object[] data;
int num_workers = WorkerManager.getInstance().getWorkerNum();
num_workers = num_workers > 0 ? num_workers : 10;
data = frag.fragment(new ByteArrayInputStream(fdata), num_workers);
t.addInput(new TaskInput(fname, data[0].toString().getBytes()));
}
tasks.add(t);
return tasks;
}