Package org.apache.flink.runtime.operators.shipping

Examples of org.apache.flink.runtime.operators.shipping.RecordOutputCollector


    IntValue inputKey = new IntValue();
    Record rec = new Record();
    rec.setField(0, inputKey);
    rec.setField(1, input);
   
    Collector<Record> collector = new RecordOutputCollector(writerList);
   
    StringValue returnFlag = new StringValue(RETURN_FLAG);
   
    out.map(rec, collector);
   
View Full Code Here


    IntValue inputKey = new IntValue();
    Record rec = new Record();
    rec.setField(0, inputKey);
    rec.setField(1, input);
   
    Collector<Record> collector = new RecordOutputCollector(writerList);
   
    out.map(rec, collector);
    verifyNoMoreInteractions(recordWriterMock);
  }
View Full Code Here

    Record rec = new Record();
    rec.setField(0, inputKey);
    rec.setField(1, input);
   
   
    Collector<Record> collector = new RecordOutputCollector(writerList);
   
    out.map(rec, collector);
    verifyNoMoreInteractions(recordWriterMock);
  }
View Full Code Here

    IntValue inputKey = new IntValue();
    Record rec = new Record();
    rec.setField(0, inputKey);
    rec.setField(1, input);
   
    Collector<Record> collector = new RecordOutputCollector(writerList);
   
    out.map(rec, collector);
    verifyNoMoreInteractions(recordWriterMock);
  }
View Full Code Here

    IntValue inputKey = new IntValue();
    Record rec = new Record();
    rec.setField(0, inputKey);
    rec.setField(1, input);
   
    Collector<Record> collector = new RecordOutputCollector(writerList);
   
    out.map(rec, collector);
    verifyNoMoreInteractions(recordWriterMock);
  }
View Full Code Here

            @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);
                }
              }
            }
          }
         
View Full Code Here

      if (eventualOutputs != null) {
        eventualOutputs.addAll(writers);
      }

      @SuppressWarnings("unchecked")
      final Collector<T> outColl = (Collector<T>) new RecordOutputCollector(writers);
      return outColl;
    }
    else {
      // generic case
      final List<RecordWriter<SerializationDelegate<T>>> writers = new ArrayList<RecordWriter<SerializationDelegate<T>>>(numOutputs);
View Full Code Here

TOP

Related Classes of org.apache.flink.runtime.operators.shipping.RecordOutputCollector

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.