Skip to content

Commit

Permalink
Fix compilation issue for PR opensearch-project#17535 during backport (
Browse files Browse the repository at this point in the history
…opensearch-project#17546)

Signed-off-by: Ashish Singh <ssashish@amazon.com>
  • Loading branch information
ashking94 authored Mar 7, 2025
1 parent c48efd0 commit 6b45972
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,16 @@ public void testDownloadStatsCorrectnessSinglePrimarySingleReplica() throws Exce
// Existing validation logic
List<RemoteStoreStats> primaryStatsList = Arrays.stream(response.getRemoteStoreStats())
.filter(remoteStoreStats -> remoteStoreStats.getShardRouting().primary())
.toList();
.collect(Collectors.toList());
assertEquals(1, primaryStatsList.size());

List<RemoteStoreStats> replicaStatsList = Arrays.stream(response.getRemoteStoreStats())
.filter(remoteStoreStats -> !remoteStoreStats.getShardRouting().primary())
.toList();
.collect(Collectors.toList());
assertEquals(1, replicaStatsList.size());

RemoteSegmentTransferTracker.Stats primaryStats = primaryStatsList.getFirst().getSegmentStats();
RemoteSegmentTransferTracker.Stats replicaStats = replicaStatsList.getFirst().getSegmentStats();
RemoteSegmentTransferTracker.Stats primaryStats = primaryStatsList.get(0).getSegmentStats();
RemoteSegmentTransferTracker.Stats replicaStats = replicaStatsList.get(0).getSegmentStats();

// Existing assertions
assertTrue(primaryStats.totalUploadsStarted > 0);
Expand Down Expand Up @@ -409,7 +409,7 @@ private void validateZeroStateReplicaStats(RemoteStoreStatsResponse zeroStateRes
assertEquals(0, stats.getSegmentStats().directoryFileTransferTrackerStats.transferredBytesSucceeded);
});
} else {
RemoteSegmentTransferTracker.Stats replicaStats = zeroStateReplicaStats.getFirst().getSegmentStats();
RemoteSegmentTransferTracker.Stats replicaStats = zeroStateReplicaStats.get(0).getSegmentStats();
assertEquals(0, replicaStats.directoryFileTransferTrackerStats.transferredBytesStarted);
assertEquals(0, replicaStats.directoryFileTransferTrackerStats.transferredBytesSucceeded);
}
Expand All @@ -434,8 +434,8 @@ private SetOnce<RemoteSegmentTransferTracker.Stats> prepareZeroStateStats(

RemoteSegmentTransferTracker.Stats primaryStats = Arrays.stream(zeroStateResponse.getRemoteStoreStats())
.filter(remoteStoreStats -> remoteStoreStats.getShardRouting().primary())
.toList()
.getFirst()
.collect(Collectors.toList())
.get(0)
.getSegmentStats();

validateZeroStatePrimaryStats(primaryStats);
Expand Down

0 comments on commit 6b45972

Please sign in to comment.