Package com.cloudera.iterativereduce

Examples of com.cloudera.iterativereduce.ComputableWorker


    System.out.println("Using worker class: " + props
        .getProperty("yarn.worker.main"));
   
    for (int x = 0; x < splits.length; x++) {

      ComputableWorker worker = null;
      Class<?> worker_clazz;
      try {
        worker_clazz = Class.forName(props
            .getProperty("yarn.worker.main"));
        Constructor<?> worker_ctor = worker_clazz
            .getConstructor();
        worker = (ComputableWorker) worker_ctor.newInstance(); // new
                                    // Object[]
                                    // {
                                    // ctorArgument
                                    // });

      } catch (ClassNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (SecurityException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (NoSuchMethodException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (IllegalArgumentException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (InstantiationException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (IllegalAccessException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (InvocationTargetException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }

      // simulates the conf stuff
      worker.setup(this.generateDebugConfigurationObject());

      // InputRecordsSplit custom_reader_0 = new InputRecordsSplit(job,
      // splits[x]);
      TextRecordParser txt_reader = new TextRecordParser();

      long len = Integer.parseInt(splits[x].toString().split(":")[2]
          .split("\\+")[1]);

      txt_reader.setFile(splits[x].toString().split(":")[1], 0, len);

      worker.setRecordParser(txt_reader);

      workers.add(worker);

      System.out.println("> Setup Worker " + x);
    } // for
View Full Code Here


   
    for (int x = 0; x < splits.length; x++) {
     
      System.out.println( "IRUnit > Split > " + splits[x].toString() );

      ComputableWorker worker = null;
      Class<?> worker_clazz;
      try {
        worker_clazz = Class.forName(props
            .getProperty("yarn.worker.main"));
        Constructor<?> worker_ctor = worker_clazz
            .getConstructor();
        worker = (ComputableWorker) worker_ctor.newInstance(); // new
                                    // Object[]
                                    // {
                                    // ctorArgument
                                    // });

      } catch (ClassNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (SecurityException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (NoSuchMethodException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (IllegalArgumentException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (InstantiationException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (IllegalAccessException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (InvocationTargetException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }

      // simulates the conf stuff
      worker.setup(this.generateDebugConfigurationObject());

      // InputRecordsSplit custom_reader_0 = new InputRecordsSplit(job,
      // splits[x]);
      TextRecordParser txt_reader = new TextRecordParser();

      long len = Integer.parseInt(splits[x].toString().split(":")[2]
          .split("\\+")[1]);

      txt_reader.setFile(splits[x].toString().split(":")[1], 0, len);

      worker.setRecordParser(txt_reader);

      workers.add(worker);

      System.out.println("> Setup Worker " + x);
    } // for
View Full Code Here

TOP

Related Classes of com.cloudera.iterativereduce.ComputableWorker

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.