Package org.apache.flink.runtime.io.disk.iomanager

Examples of org.apache.flink.runtime.io.disk.iomanager.BlockChannelReader


        numBuffersSpilled += toSpill;
      }

      // now close the writer and create the reader
      currentWriter.close();
      final BlockChannelReader reader = ioManager.createBlockChannelReader(currentWriter.getChannelID());

      // gather some memory segments to circulate while reading back the data
      final ArrayList<MemorySegment> readSegments = new ArrayList<MemorySegment>();
      try {
        while (readSegments.size() < minBuffersForSpilledReadEnd) {
          readSegments.add(emptyBuffers.take());
        }

        // read the first segment
        MemorySegment firstSeg = readSegments.remove(readSegments.size() - 1);
        reader.readBlock(firstSeg);
        firstSeg = reader.getReturnQueue().take();

        // create the read end reading one less buffer, because the first buffer is already read back
        readEnd = new ReadEnd(firstSeg, emptyBuffers, fullBuffers, reader, readSegments, segmentSize,
          numBuffersSpilled - 1);
      } catch (InterruptedException e) {
View Full Code Here


      // recollect memory from a previous view
      if (this.externalInView != null) {
        this.externalInView.close();
      }
     
      final BlockChannelReader reader = this.ioManager.createBlockChannelReader(this.writer.getChannelID());
      this.externalInView = new HeaderlessChannelReaderInputView(reader, this.fullSegments, this.blockCount, this.numBytesInLastSegment, false);
      return this.externalInView;
    }
  }
View Full Code Here

      // first set up the reader with some memory.
      final List<MemorySegment> segments = new ArrayList<MemorySegment>(2);
      segments.add(getNextBuffer());
      segments.add(getNextBuffer());
     
      final BlockChannelReader inReader = this.ioManager.createBlockChannelReader(p.getBuildSideChannel().getChannelID());
      final ChannelReaderInputView inView = new HeaderlessChannelReaderInputView(inReader, segments,
            p.getBuildSideBlockCount(), p.getLastSegmentLimit(), false);
      final ChannelReaderInputViewIterator<BT> inIter = new ChannelReaderInputViewIterator<BT>(inView,
          this.availableMemory, this.buildSideSerializer);
      final TypeComparator<BT> btComparator = this.buildSideComparator;
View Full Code Here

TOP

Related Classes of org.apache.flink.runtime.io.disk.iomanager.BlockChannelReader

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.