bharatviswa504 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_r287052394
 
 

 ##########
 File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/KeyInputStream.java
 ##########
 @@ -53,58 +46,77 @@
 
   private static final int EOF = -1;
 
-  private final ArrayList<ChunkInputStreamEntry> streamEntries;
-  // streamOffset[i] stores the offset at which blockInputStream i stores
-  // data in the key
-  private long[] streamOffset = null;
-  private int currentStreamIndex;
+  private String key;
   private long length = 0;
   private boolean closed = false;
-  private String key;
 
-  public KeyInputStream() {
-    streamEntries = new ArrayList<>();
-    currentStreamIndex = 0;
-  }
+  // List of BlockInputStreams, one for each block in the key
+  private final List<BlockInputStream> blockStreams;
 
-  @VisibleForTesting
-  public synchronized int getCurrentStreamIndex() {
-    return currentStreamIndex;
-  }
+  // blockOffsets[i] stores the index of the first data byte in
+  // blockStream i w.r.t the key data.
+  // For example, let’s say the block size is 200 bytes and block[0] stores
+  // data from indices 0 - 199, block[1] from indices 200 - 399 and so on.
 
 Review comment:
   NIT: blockStream[1]

----------------------------------------------------------------
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