public interface GridStreamerIndex<E,K,V> extends Iterable<GridStreamerIndexEntry<E,K,V>>
Streamer index can be accessed from GridStreamerWindow via any of the following methods:
Indexes are created and provided for streamer windows by GridStreamerIndexProvider which is
specified in streamer configuration.
| Modifier and Type | Method and Description |
|---|---|
Collection<GridStreamerIndexEntry<E,K,V>> |
entries(int cnt)
Gets read-only collection of entries in the index.
|
GridStreamerIndexEntry<E,K,V> |
entry(K key)
Gets index entry for given key.
|
Set<GridStreamerIndexEntry<E,K,V>> |
entrySet(boolean asc,
V fromVal,
boolean fromIncl,
V toVal,
boolean toIncl)
Gets read-only set of index entries within given value range.
|
Set<GridStreamerIndexEntry<E,K,V>> |
entrySet(V val)
Gets read-only set of index entries with given value.
|
Collection<E> |
events(boolean asc,
V fromVal,
boolean fromIncl,
V toVal,
boolean toIncl)
Gets read-only collection of index events.
|
Collection<E> |
events(int cnt)
Gets read-only collection of index events.
|
Collection<E> |
events(V val)
Gets read-only collection of index events.
|
GridStreamerIndexEntry<E,K,V> |
firstEntry()
Gets first entry in the index.
|
Set<K> |
keySet(boolean asc,
V fromVal,
boolean fromIncl,
V toVal,
boolean toIncl)
Gets read-only set of index keys within given value range.
|
Set<K> |
keySet(int cnt)
Gets read-only set of index keys.
|
Set<K> |
keySet(V val)
Gets read-only set of index keys with given value.
|
GridStreamerIndexEntry<E,K,V> |
lastEntry()
Gets last entry in the index.
|
String |
name()
Index name.
|
GridStreamerIndexPolicy |
policy()
Gets index policy.
|
int |
size() |
boolean |
sorted()
Returns
true if index supports sorting and therefore can perform range operations. |
boolean |
unique()
Gets index unique flag.
|
Collection<V> |
values(boolean asc,
V fromVal,
boolean fromIncl,
V toVal,
boolean toIncl)
Gets read-only collection of index values within given value range.
|
Collection<V> |
values(int cnt)
Gets read-only collection of index values.
|
@Nullable String name()
boolean unique()
boolean sorted()
true if index supports sorting and therefore can perform range operations.
Note that sorting happens by value and not by key.
GridStreamerIndexPolicy policy()
int size()
@Nullable GridStreamerIndexEntry<E,K,V> entry(K key)
key - Key for which to retrieve entry.null if one could not be found.Collection<GridStreamerIndexEntry<E,K,V>> entries(int cnt)
Returned collection is ordered for sorted indexes.
cnt - If 0 then all entries are returned,
if positive, then returned collection contains up to cnt elements
(in ascending order for sorted indexes),
if negative, then returned collection contains up to |cnt| elements
(in descending order for sorted indexes and not supported for unsorted indexes).Set<K> keySet(int cnt)
Returned collection is ordered for sorted indexes.
cnt - If 0 then all keys are returned,
if positive, then returned collection contains up to cnt elements
(in ascending order for sorted indexes),
if negative, then returned collection contains up to |cnt| elements
(in descending order for sorted indexes and not supported for unsorted indexes).Collection<V> values(int cnt)
Returned collection is ordered for sorted indexes.
cnt - If 0 then all values are returned,
if positive, then returned collection contains up to cnt elements
(in ascending order for sorted indexes),
if negative, then returned collection contains up to |cnt| elements
(in descending order for sorted indexes and not supported for unsorted indexes).Collection<E> events(int cnt)
For sorted indexes events are guaranteed to be grouped by corresponding values, however the order of the events corresponding to the same value is not defined.
cnt - If 0 then all values are returned,
if positive, then returned collection contains up to cnt elements
(in ascending order of values for sorted indexes),
if negative, then returned collection contains up to |cnt| elements
(in descending order of values for sorted indexes and not supported for unsorted indexes).IllegalStateException - If index is not configured to track events.GridStreamerIndexPolicySet<GridStreamerIndexEntry<E,K,V>> entrySet(V val)
This operation is only available for sorted indexes.
val - Value.Set<GridStreamerIndexEntry<E,K,V>> entrySet(boolean asc, @Nullable V fromVal, boolean fromIncl, @Nullable V toVal, boolean toIncl)
This operation is only available for sorted indexes.
asc - True for ascending set.fromVal - From value, if null, then start from beginning.toVal - To value, if null then include all entries until the end.fromIncl - Whether or not left value is inclusive (ignored if minVal is null).toIncl - Whether or not right value is inclusive (ignored if maxVal is null).Set<K> keySet(V val)
This operation is only available for sorted indexes.
val - Value.Set<K> keySet(boolean asc, @Nullable V fromVal, boolean fromIncl, @Nullable V toVal, boolean toIncl)
This operation is only available for sorted indexes.
asc - True for ascending set.fromVal - From value, if null, then start from beginning.toVal - To value, if null then include all entries until the end.fromIncl - Whether or not left value is inclusive (ignored if minVal is null).toIncl - Whether or not right value is inclusive (ignored if maxVal is null).Collection<V> values(boolean asc, @Nullable V fromVal, boolean fromIncl, @Nullable V toVal, boolean toIncl)
This operation is only available for sorted indexes.
asc - True for ascending set.fromVal - From value, if null, then start from beginning.toVal - To value, if null then include all entries until the end.fromIncl - Whether or not left value is inclusive (ignored if minVal is null).toIncl - Whether or not right value is inclusive (ignored if maxVal is null).Collection<E> events(@Nullable V val)
This operation is only available for sorted indexes.
val - From value, if null, then start from beginning.Collection<E> events(boolean asc, @Nullable V fromVal, boolean fromIncl, @Nullable V toVal, boolean toIncl)
Events are guaranteed to be sorted by corresponding values, however the order of the events corresponding to the same value is not defined.
This operation is only available for sorted indexes.
asc - True for ascending set.fromVal - From value, if null, then start from beginning.toVal - To value, if null then include all entries until the end.fromIncl - Whether or not left value is inclusive (ignored if minVal is null).toIncl - Whether or not right value is inclusive (ignored if maxVal is null).@Nullable GridStreamerIndexEntry<E,K,V> firstEntry()
This operation is only available for sorted indexes.
null if index is empty.@Nullable GridStreamerIndexEntry<E,K,V> lastEntry()
This operation is only available for sorted indexes.
null if index is empty.
Core Products
:
Data Grid ver. 6.0.2,
Streaming ver. 6.0.2
Accelerators
:
Hadoop Accelerator ver. 6.0.2
Release Date
:
March 24 2014