Search in sources :

Example 11 with OrbConfiguration

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";
}
Also used : OrbConfiguration(org.goldenorb.conf.OrbConfiguration) BeforeClass(org.junit.BeforeClass)

Example 12 with OrbConfiguration

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";
}
Also used : OrbConfiguration(org.goldenorb.conf.OrbConfiguration) BeforeClass(org.junit.BeforeClass)

Example 13 with OrbConfiguration

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";
}
Also used : OrbConfiguration(org.goldenorb.conf.OrbConfiguration) BeforeClass(org.junit.BeforeClass)

Example 14 with OrbConfiguration

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);
}
Also used : OrbConfiguration(org.goldenorb.conf.OrbConfiguration) IOException(java.io.IOException) IOException(java.io.IOException)

Example 15 with OrbConfiguration

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;
}
Also used : ZooKeeper(org.apache.zookeeper.ZooKeeper) OrbConfiguration(org.goldenorb.conf.OrbConfiguration) IOException(java.io.IOException)

Aggregations

OrbConfiguration (org.goldenorb.conf.OrbConfiguration)26 Test (org.junit.Test)9 ArrayList (java.util.ArrayList)7 BeforeClass (org.junit.BeforeClass)6 InvalidJobConfException (org.apache.hadoop.mapred.InvalidJobConfException)4 OrbTracker (org.goldenorb.OrbTracker)4 IOException (java.io.IOException)3 Path (org.apache.hadoop.fs.Path)3 List (java.util.List)2 FloatWritable (org.apache.hadoop.io.FloatWritable)2 IntWritable (org.apache.hadoop.io.IntWritable)2 LongWritable (org.apache.hadoop.io.LongWritable)2 Text (org.apache.hadoop.io.Text)2 ZooKeeper (org.apache.zookeeper.ZooKeeper)2 InputSplitAllocator (org.goldenorb.io.InputSplitAllocator)2 RawSplit (org.goldenorb.io.input.RawSplit)2 OrbPartitionMember (org.goldenorb.jet.OrbPartitionMember)2 OrbZKFailure (org.goldenorb.zookeeper.OrbZKFailure)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1