waitinfuture commented on code in PR #2362:
URL:
https://github.com/apache/incubator-celeborn/pull/2362#discussion_r1518459323
##########
client/src/main/java/org/apache/celeborn/client/read/CelebornInputStream.java:
##########
@@ -242,36 +248,37 @@ private boolean skipLocation(int startMapIndex, int
endMapIndex, PartitionLocati
return true;
}
- private PartitionLocation nextReadableLocation() {
- int locationCount = locations.length;
+ private Tuple2<PartitionLocation, PbStreamHandler> nextReadableLocation() {
+ int locationCount = locations.size();
if (fileIndex >= locationCount) {
return null;
}
- PartitionLocation currentLocation = locations[fileIndex];
+ PartitionLocation currentLocation = locations.get(fileIndex);
while (skipLocation(startMapIndex, endMapIndex, currentLocation)) {
skipCount.increment();
fileIndex++;
if (fileIndex == locationCount) {
return null;
}
- currentLocation = locations[fileIndex];
+ currentLocation = locations.get(fileIndex);
}
fetchChunkRetryCnt = 0;
- return currentLocation;
+ return new Tuple2(
+ currentLocation, streamHandlers == null ? null :
streamHandlers.get(fileIndex));
Review Comment:
Actually we can't remove because `streamHandlers` is ArrayList and the
elements in each position matches the element in `locations`, and we use
`fileIndex` to index into the array.
--
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]