Package com.cloudera.iterativereduce.yarn.avro.generated

Examples of com.cloudera.iterativereduce.yarn.avro.generated.FileSplit


  for ( InputSplit split : splits) {
   

   
    FileSplit convertedToMetronomeSplit = new FileSplit();
   
    org.apache.hadoop.mapred.FileSplit hadoopFileSplit = (org.apache.hadoop.mapred.FileSplit)split;

    if (hadoopFileSplit.getLength() - hadoopFileSplit.getStart() > 0) {
     
      convertedToMetronomeSplit.length = hadoopFileSplit.getLength();
      convertedToMetronomeSplit.offset = hadoopFileSplit.getStart();
      convertedToMetronomeSplit.path = hadoopFileSplit.getPath().toString();
     
        StartupConfiguration config = StartupConfiguration.newBuilder()
              .setBatchSize(batchSize).setIterations(iterationCount)
              .setOther(appConfig).setSplit( convertedToMetronomeSplit ).build();
             
        String wid = "worker-" + workerId;
        ConfigurationTuple tuple = new ConfigurationTuple( split.getLocations()[ 0 ], wid, config );
     
        configTuples.add(tuple);
        workerId++; 
       
        System.out.println( "IR_AM_worker: " + wid + " added split: " + convertedToMetronomeSplit.toString() );
       
    } else {
      System.out.println( "IR_AM: Culled out 0 length Split: " + convertedToMetronomeSplit.toString() );
    }
   
   
   
  }
View Full Code Here


      BlockLocation[] bl = fs.getFileBlockLocations(p, 0, f.getLen());
      Set<ConfigurationTuple> configTuples = new HashSet<ConfigurationTuple>();
      int workerId = 0;

      for (BlockLocation b : bl) {
        FileSplit split = FileSplit.newBuilder().setPath(p.toString())
            .setOffset(b.getOffset()).setLength(b.getLength()).build();

        StartupConfiguration config = StartupConfiguration.newBuilder()
            .setBatchSize(batchSize).setIterations(iterationCount)
            .setOther(appConfig).setSplit(split).build();
View Full Code Here

    writer.write("10\n20\n30\n40\n50\n60\n70\n80\n90\n100");
    writer.close();
  }

  public void setUpMaster() throws Exception {
    FileSplit split = FileSplit.newBuilder()
        .setPath("testData/testWorkerService.txt").setOffset(0).setLength(200)
        .build();

    StartupConfiguration conf = StartupConfiguration.newBuilder()
        .setSplit(split).setBatchSize(2).setIterations(1).setOther(null)
View Full Code Here

  public void cleanup() {
    pool.shutdown();
  }

  public void setUpMaster() throws Exception {
    FileSplit split = FileSplit.newBuilder()
        .setPath("testData/testWorkerService.txt").setOffset(0).setLength(200)
        .build();

    StartupConfiguration conf = StartupConfiguration.newBuilder()
        .setSplit(split).setBatchSize(200).setIterations(1).setOther(null)
View Full Code Here

    master.get();
    pool.shutdown();
  }

  public void setUpMaster() throws Exception {
    FileSplit split = FileSplit.newBuilder()
        .setPath("testData/testWorkerService.txt").setOffset(0).setLength(200)
        .build();

    StartupConfiguration conf = StartupConfiguration.newBuilder()
        .setSplit(split).setBatchSize(200).setIterations(1).setOther(null)
View Full Code Here

          System.out.println( "\t\t\tfound blocks: " + bl.length );
 
          for (BlockLocation b : bl) {
//            FileSplit split = FileSplit.newBuilder().setPath(p.toString())
//                .setOffset(b.getOffset()).setLength(b.getLength()).build();
          FileSplit split = FileSplit.newBuilder().setPath(child_fst.getPath().toString())
          .setOffset(b.getOffset()).setLength(b.getLength()).build();
         
          splits.add( split );
 
            System.out.println( "\t\t\tsplit: " + split.toString() );

          } // for
         
         
        }
View Full Code Here

              BlockLocation[] bl = localFs.getFileBlockLocations(p, 0, f.getLen());
             
              System.out.println( "\tfound blocks: " + bl.length );
     
              for (BlockLocation b : bl) {
                FileSplit split = FileSplit.newBuilder().setPath(p.toString())
                    .setOffset(b.getOffset()).setLength(b.getLength()).build();
     
                System.out.println( "\tsplit: " + split.toString() );
               
      //          StartupConfiguration config = StartupConfiguration.newBuilder()
      //              .setBatchSize(batchSize).setIterations(iterationCount)
      //              .setOther(appConfig).setSplit(split).build();
     
                String wid = "worker-" + workerId;
                ConfigurationTuple tuple = null; //new ConfigurationTuple(b.getHosts()[0], wid, config);
     
                configTuples.add(tuple);
               
              } // for
             
             
            }
           
          }
         
        } else if (f.isFile()) {
         
          //System.out.println( "Is a file: " + found_paths[x] );
         
          BlockLocation[] bl = localFs.getFileBlockLocations(p, 0, f.getLen());
         
          System.out.println( "\tfound blocks: " + bl.length );
 
          for (BlockLocation b : bl) {
            FileSplit split = FileSplit.newBuilder().setPath(p.toString())
                .setOffset(b.getOffset()).setLength(b.getLength()).build();
 
            System.out.println( "\tsplit: " + split.toString() );
           
  //          StartupConfiguration config = StartupConfiguration.newBuilder()
  //              .setBatchSize(batchSize).setIterations(iterationCount)
  //              .setOther(appConfig).setSplit(split).build();
 
View Full Code Here

  }
 
  @Test
  public void testMasterRPC() throws Exception {

    FileSplit split = FileSplit.newBuilder()
        .setPath("/foo/bar")
        .setOffset(100)
        .setLength(200)
        .build();
   
View Full Code Here

  private ApplicationMasterService<UpdateableInt> masterService;
 
  @Before
  public void setUp() throws Exception {
    FileSplit split = FileSplit.newBuilder().setPath("/foo/bar").setOffset(100)
        .setLength(200).build();

    StartupConfiguration conf = StartupConfiguration.newBuilder()
        .setSplit(split).setBatchSize(2).setIterations(1).setOther(null)
        .build();
View Full Code Here

TOP

Related Classes of com.cloudera.iterativereduce.yarn.avro.generated.FileSplit

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.