Package com.cloudera.iterativereduce.yarn

Examples of com.cloudera.iterativereduce.yarn.CompoundAdditionWorker


    master = pool.submit(masterService);
  }

  private void setUpWorker(String name) {
    TextRecordParser<UpdateableInt> parser = new TextRecordParser<UpdateableInt>();
    ComputableWorker<UpdateableInt> computableWorker = new CompoundAdditionWorker();
    final ApplicationWorkerService<UpdateableInt> workerService = new ApplicationWorkerService<UpdateableInt>(
        name, masterAddress, parser, computableWorker, UpdateableInt.class);

    Future<Integer> worker = pool.submit(new Callable<Integer>() {
      public Integer call() {
View Full Code Here


  }

  @Test
  public void testWorkerService() throws Exception {
    TextRecordParser<UpdateableInt> parser = new TextRecordParser<UpdateableInt>();
    computableWorker = new CompoundAdditionWorker();
    workerService = new ApplicationWorkerService<UpdateableInt>(
        "worker1", masterAddress, parser, computableWorker, UpdateableInt.class);

    assertEquals(0, workerService.run());
    assertEquals(Integer.valueOf(0), master.get());
View Full Code Here

  }
 
  @Test
  public void testApplicationWorker() throws Exception {
    TextRecordParser<UpdateableInt> parser = new TextRecordParser<UpdateableInt>();
    CompoundAdditionWorker worker = new CompoundAdditionWorker();
    ApplicationWorker<UpdateableInt> aw = new ApplicationWorker<UpdateableInt>(parser, worker, UpdateableInt.class);
    String[] args = { "--master-addr", "localhost:9999", "--worker-id", "worker1" };

    aw.run(args);
  }
View Full Code Here

  }
 
  // Also used for the Client test
  public static void main(String[] args) throws Exception {
    TextRecordParser<UpdateableInt> parser = new TextRecordParser<UpdateableInt>();
    CompoundAdditionWorker worker = new CompoundAdditionWorker();
    ApplicationWorker<UpdateableInt> aw = new ApplicationWorker<UpdateableInt>(parser, worker, UpdateableInt.class);
   
    ToolRunner.run(aw, args);
  }
View Full Code Here

TOP

Related Classes of com.cloudera.iterativereduce.yarn.CompoundAdditionWorker

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.