Description
When the BUFFER_SIZE is configured to be 0, the while loop in BenchmarkThroughput.readFile function hangs endlessly.
This is because when the data.size (i.e., BUFFER_SIZE) is 0, the val will always be 0 by invoking val=in.read(data).
Here is the code snippet.
BUFFER_SIZE = conf.getInt("dfsthroughput.buffer.size", 4 * 1024);//when dfsthroughput.buffer.size is configued to be 0 private void readFile(FileSystem fs, Path f, String name, Configuration conf ) throws IOException { System.out.print("Reading " + name); resetMeasurements(); InputStream in = fs.open(f); byte[] data = new byte[BUFFER_SIZE]; long val = 0; while (val >= 0) { val = in.read(data); } in.close(); printMeasurements(); }
The similar case is HDFS-13514