|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hazelcast.mapreduce.KeyValueSource<K,V>
com.hazelcast.mapreduce.impl.MapKeyValueSource<K,V>
K - type of the key of the IMapV - type of the value of the IMappublic class MapKeyValueSource<K,V>
This KeyValueSource implementation is used in
KeyValueSource.fromMap(com.hazelcast.core.IMap) to generate a default
implementation based on a Hazelcast IMap.
| Constructor Summary | |
|---|---|
MapKeyValueSource(String mapName)
|
|
| Method Summary | |
|---|---|
void |
close()
|
Map.Entry<K,V> |
element()
Returns the current index' element Calls to this method won't change state. |
int |
getFactoryId()
Returns DataSerializableFactory factory id for this class. |
int |
getId()
Returns type identifier for this class. |
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)
Reads fields from the input stream |
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)
Writes object fields to output stream |
| Methods inherited from class com.hazelcast.mapreduce.KeyValueSource |
|---|
fromList, fromMap, fromMultiMap, fromSet, getAllKeys, getAllKeys0, isAllKeysSupported |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MapKeyValueSource(String mapName)
| Method Detail |
|---|
public boolean open(NodeEngine nodeEngine)
KeyValueSource
open in class KeyValueSource<K,V>nodeEngine - nodeEngine of this cluster node
public void close()
throws IOException
close in interface CloseableIOExceptionpublic boolean hasNext()
KeyValueSource
hasNext in class KeyValueSource<K,V>public K key()
KeyValueSourceKeyPredicate 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.
key in class KeyValueSource<K,V>KeyPredicate analysispublic Map.Entry<K,V> element()
KeyValueSource
element in class KeyValueSource<K,V>public boolean reset()
KeyValueSourcePartitionIdAware.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 PartitionIdAwarepartitionId - current partitionId
public void writeData(ObjectDataOutput out)
throws IOException
DataSerializable
writeData in interface DataSerializableout - output
IOException
public void readData(ObjectDataInput in)
throws IOException
DataSerializable
readData in interface DataSerializablein - input
IOExceptionpublic int getFactoryId()
IdentifiedDataSerializable
getFactoryId in interface IdentifiedDataSerializablepublic int getId()
IdentifiedDataSerializable
getId in interface IdentifiedDataSerializable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||