A Mergeable that sits on top of another mergeable and pre-aggregates before pushing into merge/multiMerge.
A MergeableStore that does the same buffering as BufferingMergeable, but flushes on put/get.
A threadsafe local MergeableStore useful for testing or other local applications
Caveat Emptor! The semigroup on the resulting
ConvertedMergeableStore
will be the bijected semigroup from
Semigroup[V1] => Semigroup[V2].
Caveat Emptor! The semigroup on the resulting
ConvertedMergeableStore
will be the bijected semigroup from
Semigroup[V1] => Semigroup[V2]. This will not necessarily result in the
behavior you'd expect.
Enrichment on the com.twitter.storehaus.algebra.MergeableStore trait.
Enrichment on the com.twitter.storehaus.algebra.MergeableStore trait. Storehaus uses the enrichment pattern instead of adding these methods directly to the trait because many of the functions (mapValues, for example) have different meanings for ReadableStore, Store and MergeableStore.
import MergeableStore.enrich
to get access to these methods.
TODO: in scala 2.10 this should be a value class
Injection that maps values paired with stale values of T => None on inversion.
Main trait to represent objects that are used for aggregation
MergeableStore instance that is backed by a ConcurrentHashMap This class is thread safe with a locking merge operation and thread safe put/get operations provided by the underlying ConcurrentHashMap There is no multi operation optimization so all multi operations use the default Store implementation.
MergeableStore instance that is backed by a ConcurrentHashMap This class is thread safe with a locking merge operation and thread safe put/get operations provided by the underlying ConcurrentHashMap There is no multi operation optimization so all multi operations use the default Store implementation.
This class is ideal for local testing of code that interacts with a MergeableStore[String,Long] such as RedisLongStore without the need to hit a remote database. Can also be used for data processing where you don't care about persistence beyond the running process.
Uses the monoid and filters zeros on put.
Uses the monoid and filters zeros on put. On get, empty is replaced with Monoid.zero. This store never returns Future.None. The design choice of never returning None is to make sure users do not mistake zero for meaning empty. Clearly, we cannot tell the difference, but returning zero is assumed to make it less likely the user thinks the key is absent (which this store can never confirm).
Proxy for Mergeables.
Proxy for Mergeables. Methods not overrided in extensions will be forwared to Proxied self member
Main trait to represent stores that are used for aggregation
Proxy for MergeableStoress.
Proxy for MergeableStoress. Methods not overrided in extensions will be forwared to Proxied self member
Just get, locally merge, then put.
Just get, locally merge, then put. This is only safe if there is only one writer thread per key. Otherwise you need to do some locking or compare-and-swap in the store
This class allows code to depends on the data that a value will be combined with, fulfilling the Promise with the value just before the value is added in.
TODO: REMOVE WHEN NEXT VERSION OF ALGEBIRD IS PUBLISHED https://github.com/twitter/storehaus/issues/157 This Monoid allows code to depend on the result of computation asynchronously.
TODO: REMOVE WHEN NEXT VERSION OF ALGEBIRD IS PUBLISHED https://github.com/twitter/storehaus/issues/157 This Monoid allows code to depend on the result of computation asynchronously. This is a slightly less general version of the TunnelMonoid. See the documentation for TunnelMonoid for general motivation. NOTE: the Promise will be fulfilled with the value just before the PromiseLink is calculated.
Same as a ReadableStoreSemigroup except with a zero that the constant store always returning Monoid.zero[V]
A semigroup that uses the future semigroup to add results of both gets
For any given V, construct a StatefulSummer of Map[K, V]
MergeableStore enrichment which presents a MergeableStore[K, V] over top of a packed MergeableStore[OuterK, Map[InnerK, V]].
Use an injection on V2,V1 to convert a store of values V2.
Use an injection on V2,V1 to convert a store of values V2. If the value stored in the underlying store cannot be converted back to V2, then you will get a Future.exception containing the string "cannot be converted" TODO: we should add a specific exception type here so we can safely filter these cases to Future.None if we so choose.
(Since version 0.3.1) Use com.twitter.storehaus.ConvertedStore instead
import Algebras._ to get Monoid/Semigroup on ReadableStore
Some factory methods and combinators on MergeableStore
Enrichments and modifications to instances of MutableCache.
Enrichments and modifications to instances of MutableCache. Use
these enrichments by importing MutableCacheAlgebra._
.
Enrichments on ReadableStore.
Algebraic Enrichments on Store.
A Mergeable that sits on top of another mergeable and pre-aggregates before pushing into merge/multiMerge. This is very useful for cases where you have some keys that are very hot, or you have a remote mergeable that you don't want to constantly hit.