hanishakoneru commented on a change in pull request #804: HDDS-1496. Support 
partial chunk reads and checksum verification
URL: https://github.com/apache/hadoop/pull/804#discussion_r291364624
 
 

 ##########
 File path: 
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockInputStream.java
 ##########
 @@ -115,8 +116,13 @@ public BlockInputStream(BlockID blockId, long blockLen, 
Pipeline pipeline,
    */
   public synchronized void initialize() throws IOException {
 
-    List<ChunkInfo> chunks = getChunkInfos();
+    // Pre-check that the stream has not been intialized already
+    if (initialized) {
+      return;
+    }
+    Preconditions.checkArgument(chunkOffsets == null);
 
 Review comment:
   Just extra precaution so that if new methods are implemented then the stream 
is not initialized twice. It is not necessary for now though. Removed it.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to