Package org.goldenorb.conf

Examples of org.goldenorb.conf.OrbConfiguration


  @Test
  public void testCheckpointInput() throws Exception {
   
    int superStep = 0;
    int partition = 0;
    OrbConfiguration orbConf = new OrbConfiguration();
    orbConf.set("fs.default.name", "hdfs://localhost:" + cluster.getNameNodePort());
    orbConf.setJobNumber("0");
    orbConf.setFileOutputPath("test");
   
    CheckPointDataInput checkpointInput = new CheckPointDataInput(orbConf, superStep, partition);
   
    // Data is read on a FIFO basis
   
View Full Code Here


  public void readFields(DataInput in) throws IOException {
    reservedPartitions = in.readInt();
    activePartitions = in.readInt();
    jobID = Text.readString(in);
    basePartitionID = in.readInt();
    jobConf = new OrbConfiguration();
    jobConf.readFields(in);
  }
View Full Code Here

   
    List<String> paths = null;
    ZooKeeper zk = ZookeeperUtils.connect(conf.getOrbZooKeeperQuorum());
    String zkPath = "/GoldenOrb/" + conf.getOrbClusterName() + "/JobQueue/" + jobNumber;
    logger.info("Getting node " + zkPath + " from ZooKeeper");
    OrbConfiguration orbConf = (OrbConfiguration) ZookeeperUtils.getNodeWritable(zk, zkPath,
      OrbConfiguration.class, conf);
    if (orbConf != null) {
      Path[] tempPaths = orbConf.getHDFSdistributedFiles();
      if (tempPaths != null) {
        paths = new ArrayList<String>();
        for (Path path : tempPaths) {
          String[] name = path.toString().split("/");
          // files are always put in /<temp directory>/GoldenOrb/<jobNumber>/<file name>
          paths.add(System.getProperty("java.io.tmpdir") + "/GoldenOrb/" + orbConf.getOrbClusterName() + "/"
                    + jobNumber + "/" + name[name.length - 1]);
        }
      }
    }
    zk.close();
View Full Code Here

    OrbMaximumValueJob maxValueJob = new OrbMaximumValueJob();
    maxValueJob.startJob(args);
  }
 
  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);
View Full Code Here

  Logger logger = LoggerFactory.getLogger(this.getClass());
 
  @Test
  public void testEnoughCapacityWithPPM() {
    List<OrbTracker> orbTrackers = new ArrayList<OrbTracker>();
    OrbConfiguration conf = new OrbConfiguration(true);
    conf.setOrbRequestedPartitions(6);
    conf.setOrbReservedPartitions(2);
    // the "PPM" part
    conf.setNumberOfPartitionsPerMachine(2);
   
    for(int i = 0; i < 4; i++) {
      OrbTracker ot = new OrbTracker(conf);
      ot.setAvailablePartitions(3);
      ot.setReservedPartitions(1);
View Full Code Here

  }
 
  @Test
  public void testEnoughCapacity() {
    List<OrbTracker> orbTrackers = new ArrayList<OrbTracker>();
    OrbConfiguration conf = new OrbConfiguration(true);
    conf.setOrbRequestedPartitions(6);
    conf.setOrbReservedPartitions(2);
    conf.setNumberOfPartitionsPerMachine(0);
   
    for(int i = 0; i < 4; i++) {
      OrbTracker ot = new OrbTracker(conf);
      ot.setAvailablePartitions(3);
      ot.setReservedPartitions(1);
View Full Code Here

  }
 
  @Test
  public void testUnbalancedAssignment() {
    List<OrbTracker> orbTrackers = new ArrayList<OrbTracker>();
    OrbConfiguration conf = new OrbConfiguration(true);
    conf.setOrbRequestedPartitions(6);
    conf.setOrbReservedPartitions(2);
    conf.setNumberOfPartitionsPerMachine(0);
   
    for(int i = 0; i < 4; i++) {
      OrbTracker ot = new OrbTracker(conf);
      ot.setAvailablePartitions(3);
      ot.setReservedPartitions(1);
View Full Code Here

*
*/
  @Test
  public void insufficientCapacity() {
    List<OrbTracker> orbTrackers = new ArrayList<OrbTracker>();
    OrbConfiguration conf = new OrbConfiguration(true);
    conf.setOrbRequestedPartitions(6);
    conf.setOrbReservedPartitions(2);
    conf.setNumberOfPartitionsPerMachine(0);
   
    for(int i = 0; i < 4; i++) {
      OrbTracker ot = new OrbTracker(conf);
      ot.setAvailablePartitions(1);
      ot.setReservedPartitions(1);
View Full Code Here

/**
*
* @param  String[] args
*/
  public static void main(String[] args) {
    new Thread(new OrbTracker(new OrbConfiguration(true))).start();
  }
View Full Code Here

    LOG = LoggerFactory.getLogger(TestInputSplitAllocatorDFS.class);
   
    fs.copyFromLocalFile(new Path("src/test/resources/InputSplitAllocatorDFSTestData.txt"), new Path(
        "test/inpath"));
   
    OrbConfiguration orbConf = new OrbConfiguration(true);
    orbConf.set("fs.default.name", "hdfs://localhost:" + cluster.getNameNodePort());
    orbConf.setJobNumber("0");
    orbConf.setFileInputPath("test/inpath");
    orbConf.setNameNode("hdfs://localhost:" + cluster.getNameNodePort());
   
    String hostname = OrbDNS.getDefaultHost(orbConf);
    if (hostname.endsWith(".")) {
      hostname = hostname.substring(0, hostname.length() - 1);
    }
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.