* @param int partitionID
* @param boolean standby
* @param int partitionBasePort
*/
public OrbPartition(String jobNumber, int partitionID, boolean standby, int partitionBasePort) {
this.setOrbConf(new OrbConfiguration(true));
this.standby = standby;
interpartitionCommunicationPort = partitionBasePort;
trackerTetherCommunicationPort = partitionBasePort + 100;
jobPath = "/GoldenOrb/" + getOrbConf().getOrbClusterName() + "/JobQueue/" + jobNumber;
jobInProgressPath = "/GoldenOrb/" + getOrbConf().getOrbClusterName() + "/JobsInProgress/" + jobNumber;
setPartitionID(partitionID);
LOG.debug("Constructed partition {}, basePort {}", partitionID, partitionBasePort);
LOG.debug("Starting for job {}", jobInProgressPath);
inputSplitHandlerExecutor = Executors.newFixedThreadPool(getOrbConf().getInputSplitHandlerThreads());
messageHandlerExecutor = Executors.newFixedThreadPool(getOrbConf().getMessageHandlerThreads());
computeExecutor = Executors.newFixedThreadPool(getOrbConf().getComputeThreads());
verticesLoaderHandlerExecutor = Executors.newFixedThreadPool(getOrbConf()
.getVerticesLoaderHandlerThreads());
try {
zk = ZookeeperUtils.connect(getOrbConf().getOrbZooKeeperQuorum());
} catch (Exception e) {
LOG.error("Unable to establish a connection with ZooKeeper" + getOrbConf().getOrbZooKeeperQuorum(), e);
System.exit(-1);
}
OrbConfiguration jobConf = null;
try {
jobConf = (OrbConfiguration) ZookeeperUtils.getNodeWritable(zk, jobPath, OrbConfiguration.class,
getOrbConf());
} catch (OrbZKFailure e) {
LOG.error("Unable to retrieve job from ZooKeeper: " + jobPath, e);
System.exit(-1);
}
if (jobConf != null) {
setOrbConf(jobConf);
getOrbConf().setJobNumber(jobNumber);
LOG.debug("setOrbConf with requested {}, reserved {}", jobConf.getOrbRequestedPartitions(),
jobConf.getOrbReservedPartitions());
}
setSuperStep(0);
setNumberOfVertices(0);
setMessagesSent(0);
setPercentComplete(0.0F);