Examples of MRInputLegacy


Examples of org.apache.tez.mapreduce.input.MRInputLegacy

    // Sanity check
    if (!(in instanceof MRInputLegacy)) {
      throw new IOException(new TezException(
          "Only MRInputLegacy supported. Input: " + in.getClass()));
    }
    MRInputLegacy input = (MRInputLegacy)in;
    input.init();
    Configuration incrementalConf = input.getConfigUpdates();
    if (incrementalConf != null) {
      for (Entry<String, String> entry : incrementalConf) {
        jobConf.set(entry.getKey(), entry.getValue());
      }
    }
View Full Code Here

Examples of org.apache.tez.mapreduce.input.MRInputLegacy

    LogicalOutput lo = outputs.values().iterator().next();
    if (! (lo instanceof UnorderedKVOutput)) {
      throw new IllegalStateException("FilterByWordInputProcessor processor can only work with OnFileUnorderedKVOutput");
    }

    MRInputLegacy mrInput = (MRInputLegacy) li;
    mrInput.init();
    UnorderedKVOutput kvOutput = (UnorderedKVOutput) lo;

    Configuration updatedConf = mrInput.getConfigUpdates();
    Text srcFile = new Text();
    srcFile.set("UNKNOWN_FILENAME_IN_PROCESSOR");
    if (updatedConf != null) {
      String fileName = updatedConf.get(MRJobConfig.MAP_INPUT_FILE);
      if (fileName != null) {
        LOG.info("Processing file: " + fileName);
        srcFile.set(fileName);
      }
    }

    KeyValueReader kvReader = mrInput.getReader();
    KeyValueWriter kvWriter = kvOutput.getWriter();

    while (kvReader.next()) {
      Object key = kvReader.getCurrentKey();
      Object val = kvReader.getCurrentValue();
View Full Code Here

Examples of org.apache.tez.mapreduce.input.MRInputLegacy

    // Sanity check
    if (!(in instanceof MRInputLegacy)) {
      throw new IOException(new TezException(
          "Only MRInputLegacy supported. Input: " + in.getClass()));
    }
    MRInputLegacy input = (MRInputLegacy)in;
    input.init();
    Configuration incrementalConf = input.getConfigUpdates();
    if (incrementalConf != null) {
      for (Entry<String, String> entry : incrementalConf) {
        jobConf.set(entry.getKey(), entry.getValue());
      }
    }
View Full Code Here

Examples of org.apache.tez.mapreduce.input.MRInputLegacy

    }

   
   
   
    MRInputLegacy mrInput = (MRInputLegacy) li;
    mrInput.init();
    OnFileUnorderedKVOutput kvOutput = (OnFileUnorderedKVOutput) lo;

    Configuration updatedConf = mrInput.getConfigUpdates();
    Text srcFile = new Text();
    srcFile.set("UNKNOWN_FILENAME_IN_PROCESSOR");
    if (updatedConf != null) {
      String fileName = updatedConf.get(MRJobConfig.MAP_INPUT_FILE);
      if (fileName != null) {
        LOG.info("Processing file: " + fileName);
        srcFile.set(fileName);
      }
    }

    KeyValueReader kvReader = mrInput.getReader();
    KeyValueWriter kvWriter = kvOutput.getWriter();

    while (kvReader.next()) {
      Object key = kvReader.getCurrentKey();
      Object val = kvReader.getCurrentValue();
View Full Code Here

Examples of org.apache.tez.mapreduce.input.MRInputLegacy

    // Sanity check
    if (!(in instanceof MRInputLegacy)) {
      throw new IOException(new TezException(
          "Only Simple Input supported. Input: " + in.getClass()));
    }
    MRInputLegacy input = (MRInputLegacy)in;
    input.init();
    Configuration incrementalConf = input.getConfigUpdates();
    if (incrementalConf != null) {
      for (Entry<String, String> entry : incrementalConf) {
        jobConf.set(entry.getKey(), entry.getValue());
      }
    }
View Full Code Here

Examples of org.apache.tez.mapreduce.input.MRInputLegacy

    }

   
   
   
    MRInputLegacy mrInput = (MRInputLegacy) li;
    mrInput.init();
    OnFileUnorderedKVOutput kvOutput = (OnFileUnorderedKVOutput) lo;

    Configuration updatedConf = mrInput.getConfigUpdates();
    Text srcFile = new Text();
    srcFile.set("UNKNOWN_FILENAME_IN_PROCESSOR");
    if (updatedConf != null) {
      String fileName = updatedConf.get(MRJobConfig.MAP_INPUT_FILE);
      if (fileName != null) {
        LOG.info("Processing file: " + fileName);
        srcFile.set(fileName);
      }
    }

    KeyValueReader kvReader = mrInput.getReader();
    KeyValueWriter kvWriter = kvOutput.getWriter();

    while (kvReader.next()) {
      Object key = kvReader.getCurrentKey();
      Object val = kvReader.getCurrentValue();
View Full Code Here

Examples of org.apache.tez.mapreduce.input.MRInputLegacy

    // Sanity check
    if (!(in instanceof MRInputLegacy)) {
      throw new IOException(new TezException(
          "Only MRInputLegacy supported. Input: " + in.getClass()));
    }
    MRInputLegacy input = (MRInputLegacy)in;
    input.init();
    Configuration incrementalConf = input.getConfigUpdates();
    if (incrementalConf != null) {
      for (Entry<String, String> entry : incrementalConf) {
        jobConf.set(entry.getKey(), entry.getValue());
      }
    }
View Full Code Here

Examples of org.apache.tez.mapreduce.input.MRInputLegacy

     
      LOG.info("Running task: " + processorContext.getUniqueIdentifier());
     
      if (isMap) {
        rproc = new MapRecordProcessor();
        MRInputLegacy mrInput = getMRInput(inputs);
        try {
          mrInput.init();
        } catch (IOException e) {
          throw new RuntimeException("Failed while initializing MRInput", e);
        }
      } else {
        rproc = new ReduceRecordProcessor();
View Full Code Here

Examples of org.apache.tez.mapreduce.input.MRInputLegacy

    }
  }

  static  MRInputLegacy getMRInput(Map<String, LogicalInput> inputs) {
    //there should be only one MRInput
    MRInputLegacy theMRInput = null;
    for(LogicalInput inp : inputs.values()){
      if(inp instanceof MRInputLegacy){
        if(theMRInput != null){
          throw new IllegalArgumentException("Only one MRInput is expected");
        }
View Full Code Here

Examples of org.apache.tez.mapreduce.input.MRInputLegacy

      Map<String, LogicalInput> inputs, Map<String, LogicalOutput> outputs) throws Exception {
    perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.TEZ_INIT_OPERATORS);
    super.init(jconf, processorContext, mrReporter, inputs, outputs);

    //Update JobConf using MRInput, info like filename comes via this
    MRInputLegacy mrInput = TezProcessor.getMRInput(inputs);
    Configuration updatedConf = mrInput.getConfigUpdates();
    if (updatedConf != null) {
      for (Entry<String, String> entry : updatedConf) {
        jconf.set(entry.getKey(), entry.getValue());
      }
    }
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.