Package com.couchbase.client.core.msg.kv
Class MutationTokenAggregator
java.lang.Object
com.couchbase.client.core.msg.kv.MutationTokenAggregator
- All Implemented Interfaces:
Iterable<MutationToken>
Helper class that language-specific clients may use to implement
MutationState.
Holds a set of tokens. Guarantees no two tokens are for the same bucket and partition. Knows how to export the tokens for N1QL and FTS queries.
Thread-safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(MutationToken token) Adds the token to the aggregator, unless there's already a token with the same bucket name and partition and a higher sequence number.booleanexport()Exports the tokens into a universal format.Exports the tokens into a format recognized by the FTS search engine.static MutationTokenAggregatorParses the serialized form returned byexport()inthashCode()iterator()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
MutationTokenAggregator
public MutationTokenAggregator()
-
-
Method Details
-
iterator
- Specified by:
iteratorin interfaceIterable<MutationToken>
-
toString
-
add
Adds the token to the aggregator, unless there's already a token with the same bucket name and partition and a higher sequence number. -
export
Exports the tokens into a universal format.The result can be serialized into a N1QL query, or to sent over the network to a different application/SDK to be reconstructed by
from(Map).- Returns:
- A map containing only Strings and boxed primitives.
-
exportForSearch
Exports the tokens into a format recognized by the FTS search engine.- Returns:
- A map containing only Strings and boxed primitives.
-
from
Parses the serialized form returned byexport() -
equals
-
hashCode
public int hashCode()
-