tomscut commented on a change in pull request #3818:
URL: https://github.com/apache/hadoop/pull/3818#discussion_r773698956



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/ErasureCodeBenchmarkThroughput.java
##########
@@ -383,17 +393,36 @@ private long doPositional(FSDataInputStream inputStream)
       return count;
     }
 
+    private long doRandom(FSDataInputStream inputStream) throws IOException {
+      ThreadLocalRandom random = ThreadLocalRandom.current();
+      long dataSize = dataSizeMB * 1024 * 1024L;
+      long count = 0;
+      long bytesRead;
+      byte buf[] = new byte[BUFFER_SIZE_MB * 1024 * 1024];
+      while (true) {
+        bytesRead = inputStream.read(random.nextLong(dataSize), buf, 0, 
buf.length);
+        count += bytesRead;
+        if (count >= dataSize) {
+          break;
+        }
+      }
+      return count;
+

Review comment:
       Overall looks good to me. Please remove the blank line and fix 
checkstyle warn.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to