K
- type of the key of the IMapV
- type of the value of the IMappublic class MapKeyValueSource<K,V> extends KeyValueSource<K,V> implements IdentifiedDataSerializable, PartitionIdAware
KeyValueSource
implementation is used in
KeyValueSource.fromMap(com.hazelcast.core.IMap)
to generate a default
implementation based on a Hazelcast IMap
.Constructor and Description |
---|
MapKeyValueSource(String mapName) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
Map.Entry<K,V> |
element()
Returns the current index' element
|
int |
getFactoryId() |
int |
getId() |
boolean |
hasNext()
Called to request if at least one more key-value pair is available from this
data source.
|
K |
key()
Returns the current index' key for
KeyPredicate analysis. |
boolean |
open(NodeEngine nodeEngine)
This method is called before accessing the key-value pairs of this KeyValueSource
|
void |
readData(ObjectDataInput in) |
boolean |
reset()
This method need to reset all internal state as it would be a new instance at all.
|
void |
setPartitionId(int partitionId)
Sets the partition id the implementing instance is executed against
|
void |
writeData(ObjectDataOutput out) |
fromList, fromMap, fromMultiMap, fromSet, getAllKeys, getAllKeys0, isAllKeysSupported
public MapKeyValueSource(String mapName)
public boolean open(NodeEngine nodeEngine)
KeyValueSource
open
in class KeyValueSource<K,V>
nodeEngine
- nodeEngine of this cluster nodepublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public boolean hasNext()
KeyValueSource
hasNext
in class KeyValueSource<K,V>
public K key()
KeyValueSource
KeyPredicate
analysis. This is called
to prevent a possible deserialization of unneeded values because the key is not
interesting for the running mapreduce algorithm.key
in class KeyValueSource<K,V>
public Map.Entry<K,V> element()
KeyValueSource
element
in class KeyValueSource<K,V>
public boolean reset()
KeyValueSource
PartitionIdAware
.KeyValueSource.reset()
, KeyValueSource.open(com.hazelcast.spi.NodeEngine)
and Closeable.close()
is called multiple times with the other methods between open(...) and close().reset
in class KeyValueSource<K,V>
public void setPartitionId(int partitionId)
PartitionIdAware
setPartitionId
in interface PartitionIdAware
partitionId
- current partitionIdpublic void writeData(ObjectDataOutput out) throws IOException
writeData
in interface DataSerializable
IOException
public void readData(ObjectDataInput in) throws IOException
readData
in interface DataSerializable
IOException
public int getFactoryId()
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
getId
in interface IdentifiedDataSerializable
Copyright © 2014 Hazelcast, Inc.. All rights reserved.