primaryTerm
primaryTerm record component.- Returns:
- the value of the
primaryTermrecord component
A container for seq_no and primary_term values. When an entity class contains a field of this type, it will be automatically filled with SeqNoPrimaryTerm instance on read operations (like get or search), and also, when the SeqNoPrimaryTerm is not null and filled with seq_no and primary_term, they will be sent to Elasticsearch when indexing such an entity.
This allows to implement optimistic locking pattern for full-update scenario, when an entity is first read from
Elasticsearch and then gets reindexed with new _content. Index operations will throw an
OptimisticLockingFailureException if the seq_no + primary_term pair already has
different values for the given document. See Elasticsearch documentation for more information:
https://www.elastic.co/guide/en/elasticsearch/reference/current/optimistic-concurrency-control.html
A property of this type is implicitly @Transient and never gets included
into a mapping at Elasticsearch side.
A SeqNoPrimaryTerm instance cannot contain an invalid or unassigned seq_no or primary_term.
SeqNoPrimaryTerm(long sequenceNumber,
long primaryTerm) final booleanfinal inthashCode()longprimaryTerm record component.longsequenceNumber record component.toString()sequenceNumber - seq_no, must not be negativeprimaryTerm - primary_term, must be positiveIllegalArgumentException - if seq_no or primary_term is not validcompare method from their corresponding wrapper classes.sequenceNumber record component.sequenceNumber record componentprimaryTerm record component.primaryTerm record component