public class KeySnapshot
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
KeySnapshot.KeyInfo
Class containing information about user keys.
|
static class |
KeySnapshot.KVFilter
Class to filter keys from the snapshot.
|
Modifier and Type | Field and Description |
---|---|
KeySnapshot.KeyInfo[] |
_keyInfos |
long |
timestamp
(local) Time of creation.
|
Modifier and Type | Method and Description |
---|---|
static KeySnapshot |
cache() |
<T extends Iced> |
fetchAll(java.lang.Class<T> c) |
<T extends Iced> |
fetchAll(java.lang.Class<T> c,
boolean exact) |
<T extends Iced> |
fetchAll(java.lang.Class<T> c,
boolean exact,
int offset,
int limit) |
KeySnapshot |
filter(KeySnapshot.KVFilter kvf)
Filter the snapshot providing custom filter.
|
static Key[] |
globalKeysOfClass(java.lang.Class clz)
Return all the keys of the given class.
|
static KeySnapshot |
globalSnapshot() |
static KeySnapshot |
globalSnapshot(long timeTolerance)
Cache-enabled call to get global key snapshot.
|
Key[] |
keys() |
static KeySnapshot |
localSnapshot()
Get the user keys from this node only.
|
static KeySnapshot |
localSnapshot(boolean homeOnly)
Get the user keys from this node only.
|
public final KeySnapshot.KeyInfo[] _keyInfos
public final long timestamp
public static KeySnapshot cache()
public KeySnapshot filter(KeySnapshot.KVFilter kvf)
kvf
- The filterpublic Key[] keys()
public static Key[] globalKeysOfClass(java.lang.Class clz)
clz
- Classpublic <T extends Iced> java.util.Map<java.lang.String,T> fetchAll(java.lang.Class<T> c)
T
- Generic class being fetchedc
- Class objects of which should be instantiatedpublic <T extends Iced> java.util.Map<java.lang.String,T> fetchAll(java.lang.Class<T> c, boolean exact)
T
- Generic class being fetchedc
- Class objects of which should be instantiatedexact
- - subclasses will not be included if set.public <T extends Iced> java.util.Map<java.lang.String,T> fetchAll(java.lang.Class<T> c, boolean exact, int offset, int limit)
T
- Generic class being fetchedc
- Class objects of which should be instantiatedexact
- - subclasses will not be included if set.offset
- - skip first offset values matching the given typelimit
- - produce only up to the limit objects.public static KeySnapshot localSnapshot()
public static KeySnapshot localSnapshot(boolean homeOnly)
homeOnly
- - exclude the non-local (cached) keys if setpublic static KeySnapshot globalSnapshot()
public static KeySnapshot globalSnapshot(long timeTolerance)
timeTolerance
- - tolerated age of the cache in millis.
If the last snapshot is bellow this value, cached version will be returned immediately.
Otherwise new snapshot must be obtained by from all nodes.