System.out.println("Using worker class: " + props
.getProperty("yarn.worker.main"));
for (int x = 0; x < splits.length; x++) {
ComputableWorker worker = null;
Class<?> worker_clazz;
try {
worker_clazz = Class.forName(props
.getProperty("yarn.worker.main"));
Constructor<?> worker_ctor = worker_clazz
.getConstructor();
worker = (ComputableWorker) worker_ctor.newInstance(); // new
// Object[]
// {
// ctorArgument
// });
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoSuchMethodException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// simulates the conf stuff
worker.setup(this.generateDebugConfigurationObject());
// InputRecordsSplit custom_reader_0 = new InputRecordsSplit(job,
// splits[x]);
TextRecordParser txt_reader = new TextRecordParser();
long len = Integer.parseInt(splits[x].toString().split(":")[2]
.split("\\+")[1]);
txt_reader.setFile(splits[x].toString().split(":")[1], 0, len);
worker.setRecordParser(txt_reader);
workers.add(worker);
System.out.println("> Setup Worker " + x);
} // for