reswqa commented on code in PR #23863:
URL: https://github.com/apache/flink/pull/23863#discussion_r1414966335


##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/tiered/tier/disk/DiskTierProducerAgent.java:
##########
@@ -223,9 +228,16 @@ private void releaseResources() {
         }
     }
 
-    private Integer retrieveFirstBufferIndexInSegment(int subpartitionId, int 
bufferIndex) {
-        return firstBufferIndexInSegment.size() > subpartitionId
-                ? 
firstBufferIndexInSegment.get(subpartitionId).get(bufferIndex)
-                : null;
+    private Integer getSegmentIdByIndexOfFirstBufferInSegment(int 
subpartitionId, int bufferIndex) {
+        Integer segmentId;
+        try {
+            segmentId = 
firstBufferIndexInSegment.get(subpartitionId).get(bufferIndex);

Review Comment:
   This name(`firstBufferIndexInSegment `) is a bit confuse, It looks like we 
will get the first buffer index instead of the segment id. I propose rename 
this to `firstBufferIndexToSegmentId`.



##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/tiered/tier/disk/DiskTierProducerAgent.java:
##########
@@ -223,9 +228,16 @@ private void releaseResources() {
         }
     }
 
-    private Integer retrieveFirstBufferIndexInSegment(int subpartitionId, int 
bufferIndex) {
-        return firstBufferIndexInSegment.size() > subpartitionId
-                ? 
firstBufferIndexInSegment.get(subpartitionId).get(bufferIndex)
-                : null;
+    private Integer getSegmentIdByIndexOfFirstBufferInSegment(int 
subpartitionId, int bufferIndex) {
+        Integer segmentId;
+        try {
+            segmentId = 
firstBufferIndexInSegment.get(subpartitionId).get(bufferIndex);

Review Comment:
   This name(`firstBufferIndexInSegment`) is a bit confuse, It looks like we 
will get the first buffer index instead of the segment id. I propose rename 
this to `firstBufferIndexToSegmentId`.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to