Class MutationTokenAggregator

  • All Implemented Interfaces:
    Iterable<MutationToken>

    @Internal
    public class MutationTokenAggregator
    extends Object
    implements 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 Detail

      • MutationTokenAggregator

        public MutationTokenAggregator()
    • Method Detail

      • add

        public void add​(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.
      • export

        public Map<String,​?> 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

        public Map<String,​?> exportForSearch()
        Exports the tokens into a format recognized by the FTS search engine.
        Returns:
        A map containing only Strings and boxed primitives.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object