public interface Store
Bin, which are pairs of
indices and counters.| Modifier and Type | Method and Description |
|---|---|
default void |
add(Bin bin)
Updates the counter at the specified index.
|
default void |
add(int index)
Increments the counter at the specified index.
|
void |
add(int index,
double count)
Updates the counter at the specified index.
|
default void |
add(int index,
long count)
Updates the counter at the specified index.
|
Store |
copy() |
static <S extends Store> |
fromProto(java.util.function.Supplier<? extends S> storeSupplier,
com.datadoghq.sketch.ddsketch.proto.Store proto)
Builds a new instance of
Store based on the provided protobuf representation. |
java.util.Iterator<Bin> |
getAscendingIterator() |
default java.util.stream.Stream<Bin> |
getAscendingStream() |
java.util.Iterator<Bin> |
getDescendingIterator() |
default java.util.stream.Stream<Bin> |
getDescendingStream() |
default int |
getMaxIndex() |
default int |
getMinIndex() |
default java.util.stream.Stream<Bin> |
getStream() |
default double |
getTotalCount() |
default boolean |
isEmpty() |
default void |
mergeWith(Store store)
Merges another store into this one.
|
default com.datadoghq.sketch.ddsketch.proto.Store |
toProto()
Generates a protobuf representation of this
Store. |
default void add(int index)
index - the index of the counter to be incrementeddefault void add(int index,
long count)
index - the index of the counter to be updatedcount - a non-negative integer valuejava.lang.IllegalArgumentException - if count is negativevoid add(int index,
double count)
index - the index of the counter to be updatedcount - a non-negative valuejava.lang.IllegalArgumentException - if count is negativedefault void add(Bin bin)
bin - the bin to be used for updating the counterdefault void mergeWith(Store store)
add operations that have
been run on the other store on this one.store - the store to be merged into this oneStore copy()
default boolean isEmpty()
true iff the Store does not contain any non-zero counterdefault double getTotalCount()
default int getMinIndex()
java.util.NoSuchElementException - if the store is emptydefault int getMaxIndex()
java.util.NoSuchElementException - if the store is emptydefault java.util.stream.Stream<Bin> getStream()
default java.util.stream.Stream<Bin> getAscendingStream()
default java.util.stream.Stream<Bin> getDescendingStream()
java.util.Iterator<Bin> getAscendingIterator()
java.util.Iterator<Bin> getDescendingIterator()
default com.datadoghq.sketch.ddsketch.proto.Store toProto()
Store.Storestatic <S extends Store> S fromProto(java.util.function.Supplier<? extends S> storeSupplier, com.datadoghq.sketch.ddsketch.proto.Store proto)
Store based on the provided protobuf representation.S - the type of the Store to buildstoreSupplier - the constructor of the Store of type S implementationproto - the protobuf representation of a StoreStore of type S that matches the protobuf representation