Skip to content

Commit

Permalink
Add comments for the optional null check.
Browse files Browse the repository at this point in the history
Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>
  • Loading branch information
Rishikesh1159 committed Dec 3, 2022
1 parent ae55b27 commit bdcefdb
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ public void testCoordinatingPrimaryThreadedUpdateToShardLimitsAndRejections() th

nodeStats = shardIndexingPressure.stats();
IndexingPressurePerShardStats shardStoreStats = shardIndexingPressure.shardStats().getIndexingPressureShardStats(shardId1);
// If rejection count equals NUM_THREADS that means rejections happened until the last request, then we'll get shardStoreStats which
// was updated on the last request. In other cases, the shardStoreStats simply moves to the cold store and null is returned.
if (rejectionCount.get() == NUM_THREADS) {
assertEquals(10, shardStoreStats.getCurrentPrimaryAndCoordinatingLimits());
} else {
Expand Down Expand Up @@ -335,6 +337,8 @@ public void testReplicaThreadedUpdateToShardLimitsAndRejections() throws Excepti
assertEquals(0, nodeStats.getCurrentReplicaBytes());

IndexingPressurePerShardStats shardStoreStats = shardIndexingPressure.shardStats().getIndexingPressureShardStats(shardId1);
// If rejection count equals NUM_THREADS that means rejections happened until the last request, then we'll get shardStoreStats which
// was updated on the last request. In other cases, the shardStoreStats simply moves to the cold store and null is returned.
if (rejectionCount.get() == NUM_THREADS) {
assertEquals(15, shardStoreStats.getCurrentReplicaLimits());
} else {
Expand Down

0 comments on commit bdcefdb

Please sign in to comment.