@Stability.Internal public class MutationTokenAggregator extends Object implements Iterable<MutationToken>
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 and Description |
---|
MutationTokenAggregator() |
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
equals(Object o) |
Map<String,?> |
export()
Exports the tokens into a universal format.
|
Map<String,?> |
exportForSearch()
Exports the tokens into a format recognized by the FTS search engine.
|
static MutationTokenAggregator |
from(Map<String,?> source)
Parses the serialized form returned by
export() |
int |
hashCode() |
Iterator<MutationToken> |
iterator() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public Iterator<MutationToken> iterator()
iterator
in interface Iterable<MutationToken>
public void add(MutationToken token)
public Map<String,?> export()
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)
.
public Map<String,?> exportForSearch()
public static MutationTokenAggregator from(Map<String,?> source)
export()
Copyright © 2021 Couchbase, Inc.. All rights reserved.