Skip to content

Commit

Permalink
remove null check
Browse files Browse the repository at this point in the history
Signed-off-by: Shivansh Arora <[email protected]>
  • Loading branch information
shiv0408 committed Mar 19, 2024
1 parent 6e99e18 commit aa7f288
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<List<ShardRouting>> shardBatches) {
RoutingNodes routingNodes = allocation.routingNodes();
List<Runnable> 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<ShardRouting> shardBatch : shardBatches) {
Expand Down Expand Up @@ -180,9 +178,7 @@ private Map<DiscoveryNode, StoreFilesMetadata> convertToNodeStoreFilesMetadataMa
data.getData().forEach((key, value) -> {
Map<ShardId, NodeStoreFilesMetadata> 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;
Expand Down

0 comments on commit aa7f288

Please sign in to comment.