public static void main(String[] args) throws Throwable {
if (LOG.isDebugEnabled())
LOG.debug("BSPPeerChild starting");
final HamaConfiguration defaultConf = new HamaConfiguration();
// report address
String host = args[0];
int port = Integer.parseInt(args[1]);
InetSocketAddress address = new InetSocketAddress(host, port);
TaskAttemptID taskid = TaskAttemptID.forName(args[2]);
// //////////////////
BSPPeerProtocol umbilical = (BSPPeerProtocol) RPC.getProxy(
BSPPeerProtocol.class, BSPPeerProtocol.versionID, address,
defaultConf);
final BSPTask task = (BSPTask) umbilical.getTask(taskid);
int peerPort = umbilical.getAssignedPortNum(taskid);
defaultConf.addResource(new Path(task.getJobFile()));
BSPJob job = new BSPJob(task.getJobID(), task.getJobFile());
defaultConf.set(Constants.PEER_HOST, args[3]);
if (null != args && 5 == args.length) {
defaultConf.setInt("bsp.checkpoint.port", Integer.parseInt(args[4]));
}
defaultConf.setInt(Constants.PEER_PORT, peerPort);
try {
// use job-specified working directory
FileSystem.get(job.getConf()).setWorkingDirectory(
job.getWorkingDirectory());