Package org.apache.hadoop.io

Examples of org.apache.hadoop.io.ReadOptions


    Path p = new Path(fileName);
    for (int pri = 0; pri < 8; pri++) {
      createFile(p, pri);

      ioprioClass = ioprioData = 0;
      ReadOptions options = new ReadOptions();
      options.setIoprio(NativeIO.IOPRIO_CLASS_BE, pri);
      FSDataInputStream in = fs.open(p, 4096, options);

      byte[] buffer = new byte[BLOCK_SIZE];
      in.readFully(buffer);
      if (NativeIO.isAvailable()) {
View Full Code Here


    Path p = new Path(fileName);
    for (int pri = 0; pri < 8; pri++) {
      createFile(p, pri);

      ioprioClass = ioprioData = 0;
      ReadOptions options = new ReadOptions();
      options.setIoprio(NativeIO.IOPRIO_CLASS_BE, pri);
      FSDataInputStream in = fs.open(p, 4096, options);

      byte[] buffer = new byte[BLOCK_SIZE * 2];
      in.read(BLOCK_SIZE / 2, buffer, 0, BLOCK_SIZE / 2);

View Full Code Here

      ioprioClass = ioprioData = 0;
      DFSDataInputStream in = (DFSDataInputStream) fs.open(p);

      byte[] buffer = new byte[BLOCK_SIZE * 2];
      ReadOptions options = new ReadOptions();
      options.setIoprio(NativeIO.IOPRIO_CLASS_BE, pri);
      in.read(BLOCK_SIZE / 2, buffer, 0, BLOCK_SIZE / 2, options);

      if (NativeIO.isAvailable()) {
        assertTrue(NativeIO.isIoprioPossible());
        assertEquals(NativeIO.IOPRIO_CLASS_BE, ioprioClass);
View Full Code Here

        isMetaInfoSuppoted(namenodeProtocolProxy));
  }

  public DFSInputStream open(String src) throws IOException {
    return open(src, conf.getInt("io.file.buffer.size", 4096), true, null,
        false, new ReadOptions());
  }
View Full Code Here

    long startTime = System.currentTimeMillis();
   
    ReadBlockHeader header = new ReadBlockHeader(versionAndOpcode);
    header.readFields(in);
   
    ReadOptions options = header.getReadOptions();
    boolean ioprioEnabled = !options.isIoprioDisabled();
    if (ioprioEnabled) {
      NativeIO.ioprioSetIfPossible(options.getIoprioClass(),
          options.getIoprioData());
    }

    int namespaceId = header.getNamespaceId();
    long blockId = header.getBlockId();
    Block block = new Block( blockId, 0 , header.getGenStamp());
View Full Code Here

  public void clearOsBuffer(boolean clearOsBuffer) {
    this.clearOsBuffer = clearOsBuffer;
  }

  public FSDataInputStream open(Path f, int bufferSize) throws IOException {
    return open(f, bufferSize, new ReadOptions());
  }
View Full Code Here

    return newBlockReader(dataTransferVersion, namespaceId,
                          sock, file, blockId, genStamp,
                          startOffset,
                          len, bufferSize, verifyChecksum, "",
                          Long.MAX_VALUE, -1, false, null,
                          new ReadOptions());
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.io.ReadOptions

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.