zy-jordan commented on code in PR #993:
URL:
https://github.com/apache/incubator-celeborn/pull/993#discussion_r1032036926
##########
client/src/main/java/org/apache/celeborn/client/write/PushState.java:
##########
@@ -88,4 +97,22 @@ public boolean addBatchData(String addressPair,
PartitionLocation loc, int batch
public DataBatches takeDataBatches(String addressPair) {
return batchesMap.remove(addressPair);
}
+
+ public void addFlightBatches(int batchId, PartitionLocation loc) {
+ String addressPair = loc.hostAndPushPort();
+ Set<Integer> batchIdSetPerPair =
+ batchIdPerAddressPair.computeIfAbsent(addressPair, id -> new
HashSet<>());
+ batchIdSetPerPair.add(batchId);
+ }
+
+ public void removeFlightBatches(int batchId, PartitionLocation loc) {
+ String hostAndPushPort = loc.hostAndPushPort();
+ Set<Integer> batchIdSetPerPair =
batchIdPerAddressPair.get(hostAndPushPort);
+ if (Objects.nonNull(batchIdSetPerPair)) {
Review Comment:
Technically, the loc will not be null, it's just my coding habits.
--
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]