Skip to content

Commit c4454dd

Browse files
committed
Apply Spotless PSA
1 parent 6120e0f commit c4454dd

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

server/src/main/java/org/opensearch/gateway/PrimaryShardAllocator.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
import org.opensearch.env.ShardLockObtainFailedException;
5252
import org.opensearch.gateway.AsyncShardFetch.FetchResult;
5353
import org.opensearch.gateway.TransportNodesListGatewayStartedShards.NodeGatewayStartedShards;
54-
import org.opensearch.indices.replication.checkpoint.ReplicationCheckpoint;
5554

5655
import java.util.ArrayList;
5756
import java.util.Collection;
@@ -137,13 +136,11 @@ public AllocateUnassignedDecision makeAllocationDecision(
137136
* @param shardsState {@link FetchResult<NodeGatewayStartedShards>}
138137
* */
139138
private static List<NodeGatewayStartedShards> adaptToNodeShardStates(FetchResult<NodeGatewayStartedShards> shardsState) {
140-
if (!shardsState.hasData()){
139+
if (!shardsState.hasData()) {
141140
return null;
142141
}
143142
List<NodeGatewayStartedShards> nodeShardStates = new ArrayList<>();
144-
shardsState.getData().forEach((node, nodeGatewayStartedShard) -> {
145-
nodeShardStates.add(nodeGatewayStartedShard);
146-
});
143+
shardsState.getData().forEach((node, nodeGatewayStartedShard) -> { nodeShardStates.add(nodeGatewayStartedShard); });
147144
return nodeShardStates;
148145
}
149146

@@ -349,13 +346,13 @@ private static ShardStoreInfo shardStoreInfo(NodeGatewayStartedShards nodeShardS
349346
(NodeGatewayStartedShards state) -> state.storeException() == null
350347
).reversed();
351348
private static final Comparator<NodeGatewayStartedShards> PRIMARY_FIRST_COMPARATOR = Comparator.comparing(
352-
NodeGatewayStartedShards::primary).reversed();
349+
NodeGatewayStartedShards::primary
350+
).reversed();
353351

354-
private static final Comparator<NodeGatewayStartedShards> HIGHEST_REPLICATION_CHECKPOINT_FIRST_COMPARATOR =
355-
Comparator.comparing(
356-
NodeGatewayStartedShards::replicationCheckpoint,
357-
Comparator.nullsLast(Comparator.naturalOrder())
358-
);
352+
private static final Comparator<NodeGatewayStartedShards> HIGHEST_REPLICATION_CHECKPOINT_FIRST_COMPARATOR = Comparator.comparing(
353+
NodeGatewayStartedShards::replicationCheckpoint,
354+
Comparator.nullsLast(Comparator.naturalOrder())
355+
);
359356

360357
/**
361358
* Builds a list of nodes. If matchAnyShard is set to false, only nodes that have an allocation id matching
@@ -437,7 +434,10 @@ protected static NodeShardsResult buildNodeShardsResult(
437434
return new NodeShardsResult(nodeShardStates, numberOfAllocationsFound);
438435
}
439436

440-
private static Comparator<NodeGatewayStartedShards> createActiveShardComparator(boolean matchAnyShard, Set<String> inSyncAllocationIds) {
437+
private static Comparator<NodeGatewayStartedShards> createActiveShardComparator(
438+
boolean matchAnyShard,
439+
Set<String> inSyncAllocationIds
440+
) {
441441
/**
442442
* Orders the active shards copies based on below comparators
443443
* 1. No store exception i.e. shard copy is readable

0 commit comments

Comments
 (0)