Examples of InputSplit


Examples of eu.stratosphere.core.io.InputSplit

     
      // for each assigned input split
      while (!this.taskCanceled && splitIterator.hasNext())
      {
        // get start and end
        final InputSplit split = splitIterator.next();
       
        OT record = serializer.createInstance();
 
        if (LOG.isDebugEnabled()) {
          LOG.debug(getLogString("Opening input split " + split.toString()));
        }
       
        final InputFormat<OT, InputSplit> format = this.format;
     
        // open input format
        format.open(split);
 
        if (LOG.isDebugEnabled()) {
          LOG.debug(getLogString("Starting to read input from split " + split.toString()));
        }
       
        try {
          // ======= special-case the Record, to help the JIT and avoid some casts ======
          if (record.getClass() == Record.class) {
            Record typedRecord = (Record) record;
            @SuppressWarnings("unchecked")
            final InputFormat<Record, InputSplit> inFormat = (InputFormat<Record, InputSplit>) format;
           
            if (this.output instanceof RecordOutputCollector) {
              // Record going directly into network channels
              final RecordOutputCollector output = (RecordOutputCollector) this.output;
              while (!this.taskCanceled && !inFormat.reachedEnd()) {
                // build next pair and ship pair if it is valid
                typedRecord.clear();
                Record returnedRecord = null;
                if ((returnedRecord = inFormat.nextRecord(typedRecord)) != null) {
                  output.collect(returnedRecord);
                }
              }
            } else if (this.output instanceof ChainedCollectorMapDriver) {
              // Record going to a chained map task
              @SuppressWarnings("unchecked")
              final ChainedCollectorMapDriver<Record, ?> output = (ChainedCollectorMapDriver<Record, ?>) this.output;
             
              // as long as there is data to read
              while (!this.taskCanceled && !inFormat.reachedEnd()) {
                // build next pair and ship pair if it is valid
                typedRecord.clear();
                if ((typedRecord = inFormat.nextRecord(typedRecord)) != null) {
                  // This is where map of UDF gets called
                  output.collect(typedRecord);
                }
              }
            } else {
              // Record going to some other chained task
              @SuppressWarnings("unchecked")
              final Collector<Record> output = (Collector<Record>) this.output;
              // as long as there is data to read
              while (!this.taskCanceled && !inFormat.reachedEnd()) {
                // build next pair and ship pair if it is valid
                typedRecord.clear();
                if ((typedRecord = inFormat.nextRecord(typedRecord)) != null){
                  output.collect(typedRecord);
                }
              }
            }
          } else {
            // general types. we make a case distinction here for the common cases, in order to help
            // JIT method inlining
            if (this.output instanceof OutputCollector) {
              final OutputCollector<OT> output = (OutputCollector<OT>) this.output;
              // as long as there is data to read
              while (!this.taskCanceled && !format.reachedEnd()) {
                // build next pair and ship pair if it is valid
                if ((record = format.nextRecord(record)) != null) {
                  output.collect(record);
                }
              }
            } else if (this.output instanceof ChainedCollectorMapDriver) {
              @SuppressWarnings("unchecked")
              final ChainedCollectorMapDriver<OT, ?> output = (ChainedCollectorMapDriver<OT, ?>) this.output;
              // as long as there is data to read
              while (!this.taskCanceled && !format.reachedEnd()) {
                // build next pair and ship pair if it is valid
                if ((record = format.nextRecord(record)) != null) {
                  output.collect(record);
                }
              }
            } else {
              final Collector<OT> output = this.output;
              // as long as there is data to read
              while (!this.taskCanceled && !format.reachedEnd()) {
                // build next pair and ship pair if it is valid
                if ((record = format.nextRecord(record)) != null) {
                  output.collect(record);
                }
              }
            }
          }
         
          if (LOG.isDebugEnabled() && !this.taskCanceled) {
            LOG.debug(getLogString("Closing input split " + split.toString()));
          }
        } finally {
          // close. We close here such that a regular close throwing an exception marks a task as failed.
          format.close();
        }
View Full Code Here

Examples of org.apache.flink.core.io.InputSplit

        splits.add(new LocatableInputSplit(i, hosts[i%3]));
      }
     
      // get all available splits
      LocatableInputSplitAssigner ia = new LocatableInputSplitAssigner(splits);
      InputSplit is = null;
      while ((is = ia.getNextInputSplit(null)) != null) {
        assertTrue(splits.remove(is));
      }
     
      // check we had all
View Full Code Here

Examples of org.apache.hadoop.mapred.InputSplit

    secondOutput = new PartialOutputCollector(total);
    Reporter reporter = Reporter.NULL;
    long slowest = 0; // duration of slowest map

    for (int partition = 0; partition < splits.length; partition++) {
      InputSplit split = splits[partition];
      RecordReader<LongWritable, Text> reader = input.getRecordReader(split,
          job, reporter);

      LongWritable key = reader.createKey();
      Text value = reader.createValue();
View Full Code Here

Examples of org.apache.hadoop.mapred.InputSplit

    Step0OutputCollector collector = new Step0OutputCollector(numMaps);
    Reporter reporter = Reporter.NULL;

    for (int p = 0; p < numMaps; p++) {
      InputSplit split = sorted[p];
      RecordReader<LongWritable, Text> reader = input.getRecordReader(split, job, reporter);

      LongWritable key = reader.createKey();
      Text value = reader.createValue();
View Full Code Here

Examples of org.apache.hadoop.mapred.InputSplit

    Step0Output[] values = new Step0Output[numMaps];
   
    int[] expectedIds = new int[numMaps];
   
    for (int p = 0; p < numMaps; p++) {
      InputSplit split = sorted[p];
      RecordReader<LongWritable, Text> reader = input.getRecordReader(split, job, reporter);

      LongWritable key = reader.createKey();
      Text value = reader.createValue();
View Full Code Here

Examples of org.apache.hadoop.mapred.InputSplit

  }

  @Override
  public RecordReader<LongWritable, Text> getRecordReader(
      InputSplit split, JobConf job, Reporter reporter) throws IOException {
    InputSplit targetSplit = ((SymlinkTextInputSplit)split).getTargetSplit();

    // The target data is in TextInputFormat.
    TextInputFormat inputFormat = new TextInputFormat();
    inputFormat.configure(job);
    return inputFormat.getRecordReader(targetSplit, job, reporter);
View Full Code Here

Examples of org.apache.hadoop.mapred.InputSplit

      } catch (HiveException e) {
        throw new RuntimeException(
            "Unable to get metadata for input table split" + split.getPath());
      }
    }
    InputSplit retA[] = newSplits.toArray((new FileSplit[newSplits.size()]));
    l4j.info("Number of input splits: " + splits.length + " new input splits: "
        + retA.length);
    return retA;
  }
View Full Code Here

Examples of org.apache.hadoop.mapred.InputSplit

  public RecordReader getRecordReader(InputSplit split, JobConf job,
      Reporter reporter) throws IOException {

    HiveInputSplit hsplit = (HiveInputSplit) split;

    InputSplit inputSplit = hsplit.getInputSplit();
    String inputFormatClassName = null;
    Class inputFormatClass = null;
    try {
      inputFormatClassName = hsplit.inputFormatClassName();
      inputFormatClass = job.getClassByName(inputFormatClassName);
View Full Code Here

Examples of org.apache.hadoop.mapred.InputSplit

  public RecordReader getRecordReader(InputSplit split, JobConf job,
      Reporter reporter) throws IOException {

    HiveInputSplit hsplit = (HiveInputSplit)split;

    InputSplit inputSplit = hsplit.getInputSplit();
    String inputFormatClassName = null;
    Class inputFormatClass = null;
    try {
      inputFormatClassName = hsplit.inputFormatClassName();
      inputFormatClass = Class.forName(inputFormatClassName);
View Full Code Here

Examples of org.apache.hadoop.mapred.InputSplit

  public RecordReader getRecordReader(InputSplit split, JobConf job,
      Reporter reporter) throws IOException {

    HiveInputSplit hsplit = (HiveInputSplit) split;

    InputSplit inputSplit = hsplit.getInputSplit();
    String inputFormatClassName = null;
    Class inputFormatClass = null;
    try {
      inputFormatClassName = hsplit.inputFormatClassName();
      inputFormatClass = job.getClassByName(inputFormatClassName);
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.