Skip to content

Commit 44c9c4f

Browse files
committed
merge conflicts in elasticsearch
1 parent 41a70ba commit 44c9c4f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,16 @@ 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) {
896906
final long[] incremented = this.primaryTerms.clone();
897907
incremented[shardId]++;
898908
return new IndexMetadata(

0 commit comments

Comments
 (0)