use of org.goldenorb.conf.OrbConfiguration in project goldenorb by jzachr.
the class TestJobsMonitor method setUpBeforeClass.
@BeforeClass
public static void setUpBeforeClass() throws Exception {
OrbConfiguration orbConf = new OrbConfiguration(true);
orbConf.setOrbZooKeeperQuorum("localhost:21810");
zk = ZookeeperUtils.connect(orbConf.getOrbZooKeeperQuorum());
ZookeeperUtils.tryToCreateNode(zk, "/GoldenOrb");
ZookeeperUtils.tryToCreateNode(zk, "/GoldenOrb/" + orbConf.getOrbClusterName());
ZookeeperUtils.tryToCreateNode(zk, "/GoldenOrb/" + orbConf.getOrbClusterName() + "/JobsInProgress");
ZookeeperUtils.tryToCreateNode(zk, "/GoldenOrb/" + orbConf.getOrbClusterName() + "/JobQueue");
ZookeeperUtils.tryToCreateNode(zk, "/GoldenOrb/" + orbConf.getOrbClusterName() + "/OrbTrackerLeaderGroup");
jobsInProgressPath = "/GoldenOrb/" + orbConf.getOrbClusterName() + "/JobsInProgress";
jobQueuePath = "/GoldenOrb/" + orbConf.getOrbClusterName() + "/JobQueue";
leaderGroupPath = orbConf.getOrbClusterName() + "/OrbTrackerLeaderGroup";
}
use of org.goldenorb.conf.OrbConfiguration in project goldenorb by jzachr.
the class TestLeaderGroupMemberMonitor method setUpBeforeClass.
/**
* Sets up zookeeper and nodes for testing.
*
* @throws Exception
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
OrbConfiguration orbConf = new OrbConfiguration(true);
orbConf.setOrbZooKeeperQuorum("localhost:21810");
zk = ZookeeperUtils.connect(orbConf.getOrbZooKeeperQuorum());
ZookeeperUtils.tryToCreateNode(zk, "/GoldenOrb");
ZookeeperUtils.tryToCreateNode(zk, "/GoldenOrb/Test");
ZookeeperUtils.tryToCreateNode(zk, "/GoldenOrb/Test/OrbTrackerLeaderGroup");
leaderGroupPath = "/GoldenOrb/Test/OrbTrackerLeaderGroup";
}
use of org.goldenorb.conf.OrbConfiguration in project goldenorb by jzachr.
the class TestLeaderGroupMonitor method setUpBeforeClass.
/**
* Sets up zookeeper and nodes for testing.
*
* @throws Exception
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
OrbConfiguration orbConf = new OrbConfiguration(true);
orbConf.setOrbZooKeeperQuorum("localhost:21810");
zk = ZookeeperUtils.connect(orbConf.getOrbZooKeeperQuorum());
ZookeeperUtils.tryToCreateNode(zk, "/GoldenOrb");
ZookeeperUtils.tryToCreateNode(zk, "/GoldenOrb/Test");
ZookeeperUtils.tryToCreateNode(zk, "/GoldenOrb/Test/OrbTrackerLeaderGroup");
leaderGroupPath = "/GoldenOrb/Test/OrbTrackerLeaderGroup";
}
use of org.goldenorb.conf.OrbConfiguration in project goldenorb by jzachr.
the class OrbMaximumValueJob method startJob.
private void startJob(String[] args) {
OrbConfiguration orbConf = new OrbConfiguration(true);
orbConf.setFileInputFormatClass(TextInputFormat.class);
orbConf.setFileOutputFormatClass(TextOutputFormat.class);
orbConf.setVertexClass(MaximumValueVertex.class);
orbConf.setMessageClass(IntMessage.class);
orbConf.setVertexInputFormatClass(MaximumValueVertexReader.class);
orbConf.setVertexOutputFormatClass(MaximumValueVertexWriter.class);
orbConf.setNumberOfMessageHandlers(10);
orbConf.setNumberOfVertexThreads(10);
try {
parseArgs(orbConf, args, ALGORITHM_NAME);
} catch (Exception e) {
printHelpMessage();
System.exit(-1);
}
try {
orbConf.writeXml(System.out);
} catch (IOException e) {
e.printStackTrace();
}
runJob(orbConf);
}
use of org.goldenorb.conf.OrbConfiguration in project goldenorb by jzachr.
the class CommandLineUtils method connectZookeeper.
/**
* Connects to ZooKeeper.
*
* @returns ZooKeeper
*/
public static ZooKeeper connectZookeeper() {
OrbConfiguration orbConf = new OrbConfiguration(true);
ZooKeeper zk = null;
if (connectString == null) {
connectString = orbConf.getOrbZooKeeperQuorum();
}
try {
zk = ZookeeperUtils.connect(connectString);
} catch (IOException e) {
System.err.println("Could not connect : ");
e.printStackTrace();
System.exit(-1);
} catch (InterruptedException e) {
System.err.println("Could not connect : ");
e.printStackTrace();
System.exit(-1);
}
return zk;
}
Aggregations