From aa7ffba5f0fa6b21f15113d1a4f5900bbc291163 Mon Sep 17 00:00:00 2001 From: Arpit Bandejiya Date: Mon, 25 Mar 2024 12:44:09 +0530 Subject: [PATCH] Fix spotless checks Signed-off-by: Arpit Bandejiya --- .../cluster/routing/allocation/AllocationConstraints.java | 5 +---- .../routing/allocation/BalanceConfigurationTests.java | 8 +++++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/AllocationConstraints.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/AllocationConstraints.java index 1090ff87359d5..fb39ba0053486 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/allocation/AllocationConstraints.java +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/AllocationConstraints.java @@ -32,10 +32,7 @@ public AllocationConstraints() { this.constraints = new HashMap<>(); this.constraints.putIfAbsent(INDEX_SHARD_PER_NODE_BREACH_CONSTRAINT_ID, new Constraint(isIndexShardsPerNodeBreached())); this.constraints.putIfAbsent(INDEX_PRIMARY_SHARD_BALANCE_CONSTRAINT_ID, new Constraint(isPerIndexPrimaryShardsPerNodeBreached())); - this.constraints.putIfAbsent( - CLUSTER_PRIMARY_SHARD_BALANCE_CONSTRAINT_ID, - new Constraint(isPrimaryShardsPerNodeBreached(0.0f)) - ); + this.constraints.putIfAbsent(CLUSTER_PRIMARY_SHARD_BALANCE_CONSTRAINT_ID, new Constraint(isPrimaryShardsPerNodeBreached(0.0f))); } public void updateAllocationConstraint(String constraint, boolean enable) { diff --git a/server/src/test/java/org/opensearch/cluster/routing/allocation/BalanceConfigurationTests.java b/server/src/test/java/org/opensearch/cluster/routing/allocation/BalanceConfigurationTests.java index 05f9650b0a4da..54ec278827b20 100644 --- a/server/src/test/java/org/opensearch/cluster/routing/allocation/BalanceConfigurationTests.java +++ b/server/src/test/java/org/opensearch/cluster/routing/allocation/BalanceConfigurationTests.java @@ -709,7 +709,13 @@ private ClusterState addIndex( return applyAllocationUntilNoChange(clusterState, strategy); } - private ClusterState addIndices(ClusterState clusterState, AllocationService strategy, int numberOfShards, int numberOfReplicas, int numberOfIndices) { + private ClusterState addIndices( + ClusterState clusterState, + AllocationService strategy, + int numberOfShards, + int numberOfReplicas, + int numberOfIndices + ) { Metadata.Builder metadataBuilder = Metadata.builder(clusterState.getMetadata()); RoutingTable.Builder routingTableBuilder = RoutingTable.builder(clusterState.routingTable());