Package org.goldenorb.conf

Examples of org.goldenorb.conf.OrbConfiguration


   
    runJob(orbConf);
   
    List<String> jobList = ZK.getChildren("/GoldenOrb/" + orbConf.getOrbClusterName() + "/JobQueue", false);
    for (String jobName : jobList) {
      OrbConfiguration compareOrbConf = (OrbConfiguration) ZookeeperUtils
          .getNodeWritable(ZK, "/GoldenOrb/" + orbConf.getOrbClusterName() + "/JobQueue/" + jobName,
            OrbConfiguration.class, orbConf);
      assertEquals(compareOrbConf.getOrbClusterName(), orbConf.getOrbClusterName());
    }
  }
View Full Code Here


    }
  }
 
  @Test
  public void testDistributeFiles() throws IOException, KeeperException, InterruptedException, OrbZKFailure {
    OrbConfiguration orbConf = new OrbConfiguration(true);
    orbConf.setOrbClusterName("TestOrbCluster");
    orbConf.setOrbZooKeeperQuorum("localhost:21810");
    orbConf.set("fs.default.name", "hdfs://localhost:" + cluster.getNameNodePort());
    orbConf.addFileToDistribute("src/test/resources/distributeTest1.txt");
    orbConf.addFileToDistribute("src/test/resources/distributeTest2.txt");
    orbConf.addFileToDistribute("src/test/resources/HelloWorld.jar");
    runJob(orbConf);
    FileSystem fs = cluster.getFileSystem();
    //Files were copied from local to HDFS
    assertTrue(fs.exists(new Path("/DistributeFiles/distributeTest1.txt")));
    assertTrue(fs.exists(new Path("/DistributeFiles/distributeTest2.txt")));
    assertTrue(fs.exists(new Path("/DistributeFiles/HelloWorld.jar")));
    // Check Paths are set in orbConfiguration
    Path[] localFiles = orbConf.getHDFSdistributedFiles();
    for (Path path : localFiles) {
      System.out.println(path.toString());
    }
    assertEquals(3, localFiles.length);
   
    List<String> jobList = ZK.getChildren("/GoldenOrb/" + orbConf.getOrbClusterName() + "/JobQueue", false);
    for (String jobName : jobList) {
      OrbConfiguration compareOrbConf = (OrbConfiguration) ZookeeperUtils
          .getNodeWritable(ZK, "/GoldenOrb/" + orbConf.getOrbClusterName() + "/JobQueue/" + jobName,
            OrbConfiguration.class, orbConf);
      assertEquals(compareOrbConf.getHDFSdistributedFiles(), orbConf.getHDFSdistributedFiles());
    }
  }
View Full Code Here

    partitionRequest = new PartitionRequest();
    partitionRequest.setReservedPartitions(INT_RESERVEDPARTITIONS_VALUE);
    partitionRequest.setActivePartitions(INT_ACTIVEPARTITIONS_VALUE);
    partitionRequest.setJobID(STRING_JOBID_VALUE);
    partitionRequest.setBasePartitionID(INT_BASEPARTITIONID_VALUE);
    partitionRequest.setJobConf(new OrbConfiguration(true));
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutput out = new DataOutputStream(baos);
    partitionRequest.write(out);
    DataInput in = new DataInputStream(new ByteArrayInputStream(baos.toByteArray()));
    partitionRequestOut = new PartitionRequest();
View Full Code Here

 
  private static MiniDFSCluster cluster;
 
  @BeforeClass
  public static void setUp() throws IOException{
    OrbConfiguration orbConf = new OrbConfiguration(true);
    cluster = new MiniDFSCluster(orbConf, 3, true, null);
  }
View Full Code Here

    ZookeeperUtils.tryToCreateNode(zk, "/GoldenOrb/OrbCluster");   
    CountDownLatch joinLeaderGroup = new CountDownLatch(NUM_OF_MEMBERS); //everyone join?
    CountDownLatch exit = new CountDownLatch(NUM_OF_MEMBERS); //everyone ready to exit?
    CountDownLatch jobCreated = new CountDownLatch(1);
    CountDownLatch newLeader = new CountDownLatch(1);
    OrbConfiguration orbConf = new OrbConfiguration();
    orbConf.setOrbClusterName("OrbCluster");
    orbConf.setJobHeartbeatTimeout(1000);
    orbConf.setMaximumJobTries(3);
    System.out.println(orbConf.getJobHeartbeatTimeout());
    // Create all of the test Trackers
    for (int i = 0; i < NUM_OF_MEMBERS; i++) {
      TJTracker tracker = new TJTracker(zk, joinLeaderGroup, exit, orbConf, i, "/GoldenOrb/OrbCluster");
      trackers.add(tracker);
      threads.add(new Thread(tracker));
      threads.get(i).start();
    }
    joinLeaderGroup.await();
    orbConf.setOrbZooKeeperQuorum("localhost:21810");
    orbConf.set("fs.default.name", "hdfs://localhost:" + cluster.getNameNodePort());
    orbConf.addFileToDistribute("src/test/resources/distributeTest1.txt");
    orbConf.addFileToDistribute("src/test/resources/HelloWorld.jar");
   
    String path1 = runJob(orbConf);
    String path2 = runJob(orbConf);
    System.out.println(path1+" "+path2);
    new Thread(new HeartbeatUpdater(getJobInProgressPath(path1))).start();
View Full Code Here

    OrbSingleSourceShortestPathJob job =  new OrbSingleSourceShortestPathJob();
    job.startJob(args);
  }

  public void startJob(String[] args) {
    OrbConfiguration orbConf = new OrbConfiguration(true);

    orbConf.setFileInputFormatClass(TextInputFormat.class);
    orbConf.setFileOutputFormatClass(TextOutputFormat.class);
    orbConf.setVertexClass(SingleSourceShortestPathVertex.class);
    orbConf.setMessageClass(PathMessage.class);
    orbConf.setVertexInputFormatClass(SingleSourceShortestPathReader.class);
    orbConf.setVertexOutputFormatClass(SingleSourceShortestPathWriter.class);
    orbConf.setNumberOfMessageHandlers(10);
    orbConf.setNumberOfVertexThreads(10);

    try {
      parseArgs(orbConf, args, ALGORITHM_NAME);   
    } catch (Exception e) {
      printHelpMessage();
View Full Code Here

  private static ZooKeeper ZK;
  private static OrbConfiguration orbConf;

  @BeforeClass
  public static void setUpTest() throws IOException, InterruptedException, OrbZKFailure {
    orbConf = new OrbConfiguration(true);
    orbConf.setOrbZooKeeperQuorum("localhost:21810");
    ZK = ZookeeperUtils.connect(orbConf.getOrbZooKeeperQuorum());
  }
View Full Code Here

*
* @param  String[] args
*/
  public static void main(String[] args) {
    OrbRunner runner = new OrbRunner();
    runner.runJob(new OrbConfiguration(true));
  }
View Full Code Here

TOP

Related Classes of org.goldenorb.conf.OrbConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.