Examples of readBlock()


Examples of com.facebook.presto.spi.block.VariableWidthBlockEncoding.readBlock()

        Block expectedBlock = expectedBlockBuilder.build();

        DynamicSliceOutput sliceOutput = new DynamicSliceOutput(1024);
        BlockEncoding blockEncoding = new VariableWidthBlockEncoding();
        blockEncoding.writeBlock(sliceOutput, expectedBlock);
        Block actualBlock = blockEncoding.readBlock(sliceOutput.slice().getInput());
        BlockAssertions.assertBlockEquals(VARCHAR, actualBlock, expectedBlock);
    }

    @Test
    public void testCreateBlockWriter()
View Full Code Here

Examples of eu.stratosphere.nephele.services.iomanager.BlockChannelReader.readBlock()

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

Examples of org.apache.flink.runtime.io.disk.iomanager.BlockChannelReader.readBlock()

     
      writer.close();
     
      final BlockChannelReader reader = this.ioManager.createBlockChannelReader(channelID);
      for (int i = 0; i < NUM_IOS; i++) {
        reader.readBlock(memSeg);
        memSeg = reader.getNextReturnedSegment();
       
        for (int pos = 0; pos < memSeg.size(); pos += 4) {
          if (memSeg.getInt(pos) != i) {
            Assert.fail("Read memory segment contains invalid data.");
View Full Code Here

Examples of org.apache.flink.runtime.io.disk.iomanager.BlockChannelReader.readBlock()

        memSegs.add(writer.getNextReturnedSegment());
      }
     
      final BlockChannelReader reader = this.ioManager.createBlockChannelReader(channelID);
      while(!memSegs.isEmpty()) {
        reader.readBlock(memSegs.remove(0));
      }
     
      for (int i = 0; i < NUM_IOS; i++) {
        final MemorySegment memSeg = reader.getNextReturnedSegment();
       
View Full Code Here

Examples of org.apache.flink.runtime.io.disk.iomanager.BlockChannelReader.readBlock()

        for (int pos = 0; pos < memSeg.size(); pos += 4) {
          if (memSeg.getInt(pos) != i) {
            Assert.fail("Read memory segment contains invalid data.");
          }
        }
        reader.readBlock(memSeg);
      }
     
      reader.closeAndDelete();
     
      // get back the memory
View Full Code Here

Examples of org.apache.flink.runtime.io.disk.iomanager.BlockChannelReader.readBlock()

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

Examples of org.apache.hadoop.hbase.io.hfile.HFileReaderV2.readBlock()

        if (prevBlock != null) {
          onDiskSize = prevBlock.getNextBlockOnDiskSizeWithHeader();
        }
        // Flags: don't cache the block, use pread, this is not a compaction.
        // Also, pass null for expected block type to avoid checking it.
        HFileBlock block = reader.readBlock(offset, onDiskSize, false, true,
          false, null);
        BlockCacheKey blockCacheKey = new BlockCacheKey(reader.getName(),
          offset);
        boolean isCached = cache.getBlock(blockCacheKey, true, false) != null;
        boolean shouldBeCached = cowType.shouldBeCached(block.getBlockType());
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.HFileReaderV2.readBlock()

        if (prevBlock != null) {
          onDiskSize = prevBlock.getNextBlockOnDiskSizeWithHeader();
        }
        // Flags: don't cache the block, use pread, this is not a compaction.
        // Also, pass null for expected block type to avoid checking it.
        HFileBlock block = reader.readBlock(offset, onDiskSize, false, true,
          false, null);
        BlockCacheKey blockCacheKey = new BlockCacheKey(reader.getName(),
          offset);
        boolean isCached = cache.getBlock(blockCacheKey, true, false) != null;
        boolean shouldBeCached = cowType.shouldBeCached(block.getBlockType());
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.HFileReaderV2.readBlock()

        if (prevBlock != null) {
          onDiskSize = prevBlock.getNextBlockOnDiskSizeWithHeader();
        }
        // Flags: don't cache the block, use pread, this is not a compaction.
        // Also, pass null for expected block type to avoid checking it.
        HFileBlock block = reader.readBlock(offset, onDiskSize, false, true,
          false, null);
        BlockCacheKey blockCacheKey = new BlockCacheKey(reader.getName(),
          offset);
        boolean isCached = cache.getBlock(blockCacheKey, true, false) != null;
        boolean shouldBeCached = cowType.shouldBeCached(block.getBlockType());
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.HFileReaderV2.readBlock()

        if (prevBlock != null) {
          onDiskSize = prevBlock.getNextBlockOnDiskSizeWithHeader();
        }
        // Flags: don't cache the block, use pread, this is not a compaction.
        // Also, pass null for expected block type to avoid checking it.
        HFileBlock block = reader.readBlock(offset, onDiskSize, false, true,
          false, null);
        BlockCacheKey blockCacheKey = new BlockCacheKey(reader.getName(),
          offset);
        boolean isCached = cache.getBlock(blockCacheKey, true, false) != null;
        boolean shouldBeCached = cowType.shouldBeCached(block.getBlockType());
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.