Skip to content

Commit

Permalink
Added in-flight fetches for batch mode
Browse files Browse the repository at this point in the history
Signed-off-by: Shivansh Arora <[email protected]>
  • Loading branch information
shiv0408 committed Oct 17, 2023
1 parent d5a95b8 commit f65ed4d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ protected GatewayAllocator() {
@Override
public int getNumberOfInFlightFetches() {
int count = 0;
// If fetching is done in non batched-mode then maps to maintain batches will be empty and vice versa for batch-mode
for (ShardsBatch batch : batchIdToStartedShardBatch.values()) {
count += (batch.getNumberOfInFlightFetches() * batch.getBatchedShards().size());
}
for (ShardsBatch batch : batchIdToStoreShardBatch.values()) {
count += (batch.getNumberOfInFlightFetches() * batch.getBatchedShards().size());
}

for (AsyncShardFetch<TransportNodesListGatewayStartedShards.NodeGatewayStartedShards> fetch : asyncFetchStarted.values()) {
count += fetch.getNumberOfInFlightFetches();
}
Expand Down

0 comments on commit f65ed4d

Please sign in to comment.