Skip to content

Commit 41a70ba

Browse files
committed
merge conflicts in elasticsearch
2 parents 86f66bc + eacb67a commit 41a70ba

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -893,25 +893,15 @@ public IndexMetadata withInSyncAllocationIds(int shardId, Set<String> inSyncSet)
893893
* @return updated instance with incremented primary term
894894
*/
895895
public IndexMetadata withIncrementedPrimaryTerm(int shardId) {
896-
return withSetPrimaryTerm(shardId, this.primaryTerms[shardId] + 1);
897-
}
898-
899-
/**
900-
* Creates a copy of this instance that has the primary term for the given shard id set to the value provided.
901-
* @param shardId shard id to set primary term for
902-
* @param primaryTerm primary term to set
903-
* @return updated instance with set primary term
904-
*/
905-
public IndexMetadata withSetPrimaryTerm(int shardId, long primaryTerm) {
906-
final long[] newPrimaryTerms = this.primaryTerms.clone();
907-
newPrimaryTerms[shardId] = primaryTerm;
896+
final long[] incremented = this.primaryTerms.clone();
897+
incremented[shardId]++;
908898
return new IndexMetadata(
909899
this.index,
910900
this.version,
911901
this.mappingVersion,
912902
this.settingsVersion,
913903
this.aliasesVersion,
914-
newPrimaryTerms,
904+
incremented,
915905
this.state,
916906
this.numberOfShards,
917907
this.numberOfReplicas,

0 commit comments

Comments
 (0)