public final class Caches
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Caches.ClearableCache<K,V>
A cache that tracks keys that have been inserted into the cache and supports clearing them.
|
| Constructor and Description |
|---|
Caches() |
| Modifier and Type | Method and Description |
|---|---|
static <K,V> Cache<K,V> |
eternal()
A cache that never evicts any values.
|
static <K,V> Cache<K,V> |
fromOptions(org.apache.beam.sdk.options.PipelineOptions options)
Uses the specified
PipelineOptions to configure and return a cache instance based upon
parameters within SdkHarnessOptions. |
static <K,V> Cache<K,V> |
noop()
A cache that never stores any values.
|
static <K,V> Cache<K,V> |
subCache(Cache<?,?> cache,
java.lang.Object keyPrefix,
java.lang.Object... additionalKeyPrefix)
Returns a view of a cache that operates on keys with a specified key prefix.
|
static long |
weigh(java.lang.Object o) |
public static long weigh(java.lang.Object o)
public static <K,V> Cache<K,V> noop()
public static <K,V> Cache<K,V> eternal()
public static <K,V> Cache<K,V> fromOptions(org.apache.beam.sdk.options.PipelineOptions options)
PipelineOptions to configure and return a cache instance based upon
parameters within SdkHarnessOptions.public static <K,V> Cache<K,V> subCache(Cache<?,?> cache, java.lang.Object keyPrefix, java.lang.Object... additionalKeyPrefix)
All lookups, insertions, and removals into the parent Cache will be prefixed by the
specified prefixes.