hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Mituzas <xietao1...@hotmail.com>
Subject why does not BlockSender use BufferedInputStream?
Date Fri, 18 Dec 2009 02:40:01 GMT

 I checked the DataNode code and found the variable blockIn in BlockSender
(used to read data from disk) is object of class RandomAccessFile. Why not
used BufferedInputStream for performance improvement?


public synchronized InputStream getBlockInputStream(Block b, long
seekOffset) throws IOException {

    File blockFile = getBlockFile(b);
    RandomAccessFile blockInFile = new RandomAccessFile(blockFile, "r");
    if (seekOffset > 0) {
      blockInFile.seek(seekOffset);
    }
    return new FileInputStream(blockInFile.getFD());
  }
-- 
View this message in context: http://old.nabble.com/why-does-not-BlockSender-use-BufferedInputStream--tp26838319p26838319.html
Sent from the Hadoop core-user mailing list archive at Nabble.com.


Mime
View raw message