Examples of MRExecutor


Examples of com.sap.hadoop.windowing.runtime2.mr.MRExecutor

  public static void setupClass() throws Exception
  {
    setupCluster();
   
    HiveConf hCfg = new HiveConf(conf, conf.getClass());
    wshell = new WindowingShell(hCfg, new Translator(), new MRExecutor());
    //wshell.setHiveQryExec(new ThriftBasedHiveQueryExecutor(conf));
    outPrinter = new QueryOutputPrinter(new TestLogHelper(false));
  }
View Full Code Here

Examples of com.sap.hadoop.windowing.runtime2.mr.MRExecutor

 
  WindowingClient(WindowingHiveCliDriver hiveDriver) throws WindowingException
  {
    this.hiveDriver = hiveDriver;
    setupConf(hiveDriver.getCfg());
    wshell = new WindowingShell( hiveDriver.getCfg(), new Translator(), new MRExecutor());
    wshell.setHiveQryExec(this);
    qryOutPrntr = new QueryOutputPrinter(hiveDriver.getHiveConsole());
    hiveConsole = hiveDriver.getHiveConsole();
  }
View Full Code Here

Examples of org.apache.crunch.impl.mr.exec.MRExecutor

      }
    }
   
    // Finally, construct the jobs from the prototypes and return.
    DotfileWriter dotfileWriter = new DotfileWriter();
    MRExecutor exec = new MRExecutor(conf, jarClass, outputs, toMaterialize);
    for (JobPrototype proto : Sets.newHashSet(assignments.values())) {
      dotfileWriter.addJobPrototype(proto);
      exec.addJob(proto.getCrunchJob(jarClass, conf, pipeline, lastJobID));
    }

    String planDotFile = dotfileWriter.buildDotfile();
    exec.setPlanDotFile(planDotFile);
    conf.set(PlanningParameters.PIPELINE_PLAN_DOTFILE, planDotFile);

    return exec;
  }
View Full Code Here

Examples of org.apache.crunch.impl.mr.exec.MRExecutor

      }
    }
   
    // Finally, construct the jobs from the prototypes and return.
    DotfileWriter dotfileWriter = new DotfileWriter();
    MRExecutor exec = new MRExecutor(jarClass, outputs, toMaterialize);
    for (JobPrototype proto : Sets.newHashSet(assignments.values())) {
      dotfileWriter.addJobPrototype(proto);
      exec.addJob(proto.getCrunchJob(jarClass, conf, pipeline));
    }

    String planDotFile = dotfileWriter.buildDotfile();
    exec.setPlanDotFile(planDotFile);
    conf.set(PlanningParameters.PIPELINE_PLAN_DOTFILE, planDotFile);

    return exec;
  }
View Full Code Here

Examples of org.apache.crunch.impl.mr.exec.MRExecutor

          break;
        }
      }
      if (!hasInputs) {
        LOG.warn("No input sources for pipeline, nothing to do...");
        return new MRExecutor(conf, jarClass, outputs, toMaterialize);
      }

      // Create a new graph that splits up up dependent GBK nodes.
      Graph graph = prepareFinalGraph(baseGraph);
     
      // Break the graph up into connected components.
      List<List<Vertex>> components = graph.connectedComponents();
     
      // For each component, we will create one or more job prototypes,
      // depending on its profile.
      // For dependency handling, we only need to care about which
      // job prototype a particular GBK is assigned to.
      Multimap<Vertex, JobPrototype> newAssignments = HashMultimap.create();
      for (List<Vertex> component : components) {
        newAssignments.putAll(constructJobPrototypes(component, components.size()));
      }

      // Add in the job dependency information here.
      for (Map.Entry<Vertex, JobPrototype> e : newAssignments.entries()) {
        JobPrototype current = e.getValue();
        List<Vertex> parents = graph.getParents(e.getKey());
        for (Vertex parent : parents) {
          for (JobPrototype parentJobProto : newAssignments.get(parent)) {
            current.addDependency(parentJobProto);
          }
        }
      }

      ImmutableMultimap<Target, JobPrototype> previousStages = ImmutableMultimap.copyOf(assignments);
      for (Map.Entry<Vertex, JobPrototype> e : newAssignments.entries()) {
        if (e.getKey().isOutput()) {
          PCollectionImpl<?> pcollect = e.getKey().getPCollection();
          JobPrototype current = e.getValue();

          // Add in implicit dependencies via SourceTargets that are read into memory
          for (Target pt : pcollect.getTargetDependencies()) {
            for (JobPrototype parentJobProto : assignments.get(pt)) {
              current.addDependency(parentJobProto);
            }
          }

          // Add this to the set of output assignments
          for (Target t : outputs.get(pcollect)) {
            assignments.put(t, e.getValue());
          }
        } else {
          Source source = e.getKey().getSource();
          if (source != null && source instanceof Target) {
            JobPrototype current = e.getValue();
            Collection<JobPrototype> parentJobPrototypes = previousStages.get((Target) source);
            if (parentJobPrototypes != null) {
              for (JobPrototype parentJobProto : parentJobPrototypes) {
                current.addDependency(parentJobProto);
              }
            }
          }
        }
      }

      // Remove completed outputs and mark materialized output locations
      // for subsequent job processing.
      for (PCollectionImpl<?> output : currentStage) {
        if (toMaterialize.containsKey(output)) {
          MaterializableIterable mi = toMaterialize.get(output);
          if (mi.isSourceTarget()) {
            output.materializeAt((SourceTarget) mi.getSource());
          }
        }
        targetDeps.remove(output);
      }
    }
   
    // Finally, construct the jobs from the prototypes and return.
    DotfileWriter dotfileWriter = new DotfileWriter();
    MRExecutor exec = new MRExecutor(conf, jarClass, outputs, toMaterialize);
    for (JobPrototype proto : Sets.newHashSet(assignments.values())) {
      dotfileWriter.addJobPrototype(proto);
      exec.addJob(proto.getCrunchJob(jarClass, conf, pipeline, lastJobID));
    }

    String planDotFile = dotfileWriter.buildDotfile();
    exec.setPlanDotFile(planDotFile);
    conf.set(PlanningParameters.PIPELINE_PLAN_DOTFILE, planDotFile);

    return exec;
  }
View Full Code Here

Examples of org.apache.crunch.impl.mr.exec.MRExecutor

      }
    }
   
    // Finally, construct the jobs from the prototypes and return.
    DotfileWriter dotfileWriter = new DotfileWriter();
    MRExecutor exec = new MRExecutor(jarClass, outputs, toMaterialize);
    for (JobPrototype proto : Sets.newHashSet(assignments.values())) {
      dotfileWriter.addJobPrototype(proto);
      exec.addJob(proto.getCrunchJob(jarClass, conf, pipeline));
    }

    String planDotFile = dotfileWriter.buildDotfile();
    exec.setPlanDotFile(planDotFile);
    conf.set(PlanningParameters.PIPELINE_PLAN_DOTFILE, planDotFile);

    return exec;
  }
View Full Code Here

Examples of org.apache.crunch.impl.mr.exec.MRExecutor

    final PGroupedTable<String, String> pGrpTable3 = pTable4.groupByKey();

    // Write values
    pGrpTable3.ungroup().write(To.textFile(out2));

    MRExecutor exec = pipeline.plan();
    // Count the number of map processing steps in this pipeline
    int mapsCount = 0;
    for (String line : exec.getPlanDotFile().split("\n")) {
      if (line.contains(" subgraph ") && line.contains("-map\" {")) {
        mapsCount++;
      }
    }
    assertEquals(breakpoint ? 1 : 2, mapsCount);
View Full Code Here

Examples of org.apache.crunch.impl.mr.exec.MRExecutor

    }
  }
 
  @Override
  public MRPipelineExecution runAsync() {
    MRExecutor mrExecutor = plan();
    writePlanDotFile(mrExecutor.getPlanDotFile());
    MRPipelineExecution res = mrExecutor.execute();
    outputTargets.clear();
    return res;
  }
View Full Code Here

Examples of org.apache.crunch.impl.mr.exec.MRExecutor

          break;
        }
      }
      if (!hasInputs) {
        LOG.warn("No input sources for pipeline, nothing to do...");
        return new MRExecutor(conf, jarClass, outputs, toMaterialize, pipelineCallables);
      }

      // Create a new graph that splits up up dependent GBK nodes.
      Graph graph = prepareFinalGraph(baseGraph);
     
      // Break the graph up into connected components.
      List<List<Vertex>> components = graph.connectedComponents();
     
      // For each component, we will create one or more job prototypes,
      // depending on its profile.
      // For dependency handling, we only need to care about which
      // job prototype a particular GBK is assigned to.
      Multimap<Vertex, JobPrototype> newAssignments = HashMultimap.create();
      for (List<Vertex> component : components) {
        newAssignments.putAll(constructJobPrototypes(component));
      }

      // Add in the job dependency information here.
      for (Map.Entry<Vertex, JobPrototype> e : newAssignments.entries()) {
        JobPrototype current = e.getValue();
        for (Vertex parent : graph.getParents(e.getKey())) {
          for (JobPrototype parentJobProto : newAssignments.get(parent)) {
            current.addDependency(parentJobProto);
          }
        }
      }

      ImmutableMultimap<Target, JobPrototype> previousStages = ImmutableMultimap.copyOf(assignments);
      for (Map.Entry<Vertex, JobPrototype> e : newAssignments.entries()) {
        if (e.getKey().isOutput()) {
          PCollectionImpl<?> pcollect = e.getKey().getPCollection();
          JobPrototype current = e.getValue();

          // Add in implicit dependencies via SourceTargets that are read into memory
          for (Target pt : pcollect.getTargetDependencies()) {
            for (JobPrototype parentJobProto : assignments.get(pt)) {
              current.addDependency(parentJobProto);
            }
          }

          // Add this to the set of output assignments
          for (Target t : outputs.get(pcollect)) {
            assignments.put(t, e.getValue());
          }
        } else {
          Source source = e.getKey().getSource();
          if (source != null && source instanceof Target) {
            JobPrototype current = e.getValue();
            Collection<JobPrototype> parentJobPrototypes = previousStages.get((Target) source);
            if (parentJobPrototypes != null) {
              for (JobPrototype parentJobProto : parentJobPrototypes) {
                current.addDependency(parentJobProto);
              }
            }
          }
        }
      }

      // Remove completed outputs and mark materialized output locations
      // for subsequent job processing.
      for (PCollectionImpl<?> output : currentStage) {
        if (toMaterialize.containsKey(output)) {
          MaterializableIterable mi = toMaterialize.get(output);
          if (mi.isSourceTarget()) {
            output.materializeAt((SourceTarget) mi.getSource());
          }
        }
        targetDeps.remove(output);
      }
    }
   
    // Finally, construct the jobs from the prototypes and return.
    DotfileWriter dotfileWriter = new DotfileWriter();
    MRExecutor exec = new MRExecutor(conf, jarClass, outputs, toMaterialize, pipelineCallables);
    for (JobPrototype proto : Sets.newHashSet(assignments.values())) {
      dotfileWriter.addJobPrototype(proto);
      exec.addJob(proto.getCrunchJob(jarClass, conf, pipeline, lastJobID));
    }

    String planDotFile = dotfileWriter.buildDotfile();
    exec.setPlanDotFile(planDotFile);
    conf.set(PlanningParameters.PIPELINE_PLAN_DOTFILE, planDotFile);

    return exec;
  }
View Full Code Here

Examples of org.apache.crunch.impl.mr.exec.MRExecutor

      }
    }
   
    // Finally, construct the jobs from the prototypes and return.
    DotfileWriter dotfileWriter = new DotfileWriter();
    MRExecutor exec = new MRExecutor(jarClass, outputs, toMaterialize);
    for (JobPrototype proto : Sets.newHashSet(assignments.values())) {
      dotfileWriter.addJobPrototype(proto);
      exec.addJob(proto.getCrunchJob(jarClass, conf, pipeline, lastJobID));
    }

    String planDotFile = dotfileWriter.buildDotfile();
    exec.setPlanDotFile(planDotFile);
    conf.set(PlanningParameters.PIPELINE_PLAN_DOTFILE, planDotFile);

    return exec;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.