From aa7f2889c6ecf04acada160332d52a56a6973e0d Mon Sep 17 00:00:00 2001 From: Shivansh Arora Date: Tue, 19 Mar 2024 23:00:14 +0530 Subject: [PATCH] remove null check Signed-off-by: Shivansh Arora --- .../org/opensearch/gateway/ReplicaShardBatchAllocator.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/server/src/main/java/org/opensearch/gateway/ReplicaShardBatchAllocator.java b/server/src/main/java/org/opensearch/gateway/ReplicaShardBatchAllocator.java index ba46525683b46..53d523e89f3ae 100644 --- a/server/src/main/java/org/opensearch/gateway/ReplicaShardBatchAllocator.java +++ b/server/src/main/java/org/opensearch/gateway/ReplicaShardBatchAllocator.java @@ -10,7 +10,6 @@ import org.apache.logging.log4j.Logger; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.cluster.routing.RoutingNodes; import org.opensearch.cluster.routing.ShardRouting; import org.opensearch.cluster.routing.UnassignedInfo; import org.opensearch.cluster.routing.allocation.AllocateUnassignedDecision; @@ -47,7 +46,6 @@ public abstract class ReplicaShardBatchAllocator extends ReplicaShardAllocator { * @param shardBatches a list of shard batches to check for existing recoveries */ public void processExistingRecoveries(RoutingAllocation allocation, List> shardBatches) { - RoutingNodes routingNodes = allocation.routingNodes(); List shardCancellationActions = new ArrayList<>(); // iterate through the batches, each batch needs to be processed together as fetch call should be made for shards from same batch for (List shardBatch : shardBatches) { @@ -180,9 +178,7 @@ private Map convertToNodeStoreFilesMetadataMa data.getData().forEach((key, value) -> { Map batch = value.getNodeStoreFilesMetadataBatch(); NodeStoreFilesMetadata metadata = batch.get(unassignedShard.shardId()); - if (metadata != null && metadata.getStoreFileFetchException() == null) { - map.put(key, metadata.storeFilesMetadata()); - } + map.put(key, metadata.storeFilesMetadata()); }); return map;