K
- key typeV
- value typeAggregator
on IMap.
For general data processing, it is superseded by Hazelcast Jet.@Deprecated public abstract class KeyValueSource<K,V> extends Object implements Closeable
IMap
and MultiMap
. Custom implementations could
be external files, URLs or any other data source that can be visualized as key-value pairs.Constructor and Description |
---|
KeyValueSource()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
abstract Map.Entry<K,V> |
element()
Deprecated.
Returns the current index element
Calls to this method won't change state.
|
static <V> KeyValueSource<String,V> |
fromList(IList<? extends V> list)
Deprecated.
A helper method to build a KeyValueSource implementation based on the specified
IList .The key returned by this KeyValueSource implementation is ALWAYS the name of the list itself, whereas the value are the entries of the list, one by one. |
static <K,V> KeyValueSource<K,V> |
fromMap(IMap<? super K,? extends V> map)
Deprecated.
A helper method to build a KeyValueSource implementation based on the specified
IMap |
static <K,V> KeyValueSource<K,V> |
fromMultiMap(MultiMap<? super K,? extends V> multiMap)
Deprecated.
A helper method to build a KeyValueSource implementation based on the specified
MultiMap |
static <V> KeyValueSource<String,V> |
fromSet(ISet<? extends V> set)
Deprecated.
A helper method to build a KeyValueSource implementation based on the specified
ISet .The key returned by this KeyValueSource implementation is ALWAYS the name of the set itself, whereas the value are the entries of the set, one by one. |
Collection<K> |
getAllKeys()
Deprecated.
If
isAllKeysSupported() returns true, a call to this method returns
all clusterwide available keys. |
protected Collection<K> |
getAllKeys0()
Deprecated.
This method is meant to be overridden to implement collecting of all clusterwide available keys
and return them from
getAllKeys() . |
abstract boolean |
hasNext()
Deprecated.
Called to request if at least one more key-value pair is available from this
data source.
|
boolean |
isAllKeysSupported()
Deprecated.
If it is possible to collect all clusterwide available keys for this KeyValueSource
implementation then this method returns true.
If true is returned, a call to getAllKeys() must return all available keys
to execute a preselection of interesting partitions / nodes based on returns keys. |
abstract K |
key()
Deprecated.
Returns the current index key for
KeyPredicate analysis. |
abstract boolean |
open(NodeEngine nodeEngine)
Deprecated.
This method is called before accessing the key-value pairs of this KeyValueSource.
|
abstract boolean |
reset()
Deprecated.
This method resets all internal state to be a new instance.
|
public abstract boolean open(NodeEngine nodeEngine)
nodeEngine
- nodeEngine of this cluster nodepublic abstract boolean hasNext()
public abstract K key()
KeyPredicate
analysis. This is called
to prevent a possible deserialization of unneeded values because the key is not
interesting for the running mapreduce algorithm.
Calls to this method won't change state.KeyPredicate
analysispublic abstract Map.Entry<K,V> element()
public abstract boolean reset()
PartitionIdAware
.open(com.hazelcast.spi.NodeEngine)
and Closeable.close()
is called multiple times with the other methods between open(...) and close().public final Collection<K> getAllKeys()
If isAllKeysSupported()
returns true, a call to this method returns
all clusterwide available keys. If there is no chance to precollect all keys due to
partitioning of the data isAllKeysSupported()
, this method returns false.
If this functionality is not available and Job.onKeys(Object[])
,
Job.onKeys(Iterable)
, or Job.keyPredicate(KeyPredicate)
is used, a
preselection of the interesting partitions / nodes is not available and the
overall processing speed my be degraded.
If isAllKeysSupported()
returns false this method throws an
UnsupportedOperationException
.
public boolean isAllKeysSupported()
If it is possible to collect all clusterwide available keys for this KeyValueSource
implementation then this method returns true.
If true is returned, a call to getAllKeys()
must return all available keys
to execute a preselection of interesting partitions / nodes based on returns keys.
If this functionality is not available and Job.onKeys(Object[])
,
Job.onKeys(Iterable)
, or Job.keyPredicate(KeyPredicate)
is used, a
preselection of the interesting partitions / nodes is not available and the
overall processing speed my be degraded.
protected Collection<K> getAllKeys0()
getAllKeys()
.public static <K,V> KeyValueSource<K,V> fromMap(IMap<? super K,? extends V> map)
IMap
K
- key type of the mapV
- value type of the mapmap
- map to build a KeyValueSource implementationpublic static <K,V> KeyValueSource<K,V> fromMultiMap(MultiMap<? super K,? extends V> multiMap)
MultiMap
K
- key type of the multiMapV
- value type of the multiMapmultiMap
- multiMap to build a KeyValueSource implementationpublic static <V> KeyValueSource<String,V> fromList(IList<? extends V> list)
IList
.V
- value type of the listlist
- list to build a KeyValueSource implementationpublic static <V> KeyValueSource<String,V> fromSet(ISet<? extends V> set)
ISet
.V
- value type of the setset
- set to build a KeyValueSource implementationCopyright © 2017 Hazelcast, Inc.. All Rights Reserved.