public class MapCombineCommand<KIn,VIn,KOut,VOut> extends BaseRpcCommand implements CancellableCommand
Mapper and Reducer which is a
combiner to a remote Infinispan node where it will get executed and return the result to an
invoking/master node.| Modifier and Type | Field and Description |
|---|---|
static int |
COMMAND_ID |
cacheName| Constructor and Description |
|---|
MapCombineCommand() |
MapCombineCommand(String cacheName) |
MapCombineCommand(String taskId,
Mapper<KIn,VIn,KOut,VOut> mapper,
Reducer<KOut,VOut> combiner,
String cacheName,
Collection<KIn> inputKeys) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canBlock()
If true, the command is processed asynchronously in a thread provided by an Infinispan thread pool.
|
boolean |
equals(Object obj) |
Reducer<KOut,VOut> |
getCombiner() |
byte |
getCommandId()
Used by marshallers to convert this command into an id for streaming.
|
String |
getIntermediateCacheName() |
Set<KIn> |
getKeys() |
Mapper<KIn,VIn,KOut,VOut> |
getMapper() |
int |
getMaxCollectorSize() |
String |
getTaskId() |
UUID |
getUUID()
Returns UUID of a command
|
boolean |
hasCombiner() |
int |
hashCode() |
void |
init(MapReduceManager mrManager) |
boolean |
isReducePhaseDistributed() |
boolean |
isReturnValueExpected()
If true, a return value will be provided when performed remotely.
|
boolean |
isUseIntermediateSharedCache() |
Object |
perform(InvocationContext context)
Performs invocation of mapping phase and local combine phase on assigned Infinispan node
|
void |
readFrom(ObjectInput input)
Reads this instance from the stream written by
ReplicableCommand.writeTo(ObjectOutput). |
void |
setIntermediateCacheName(String intermediateCacheName) |
void |
setMaxCollectorSize(int size)
Limits Mapper's Collector
|
void |
setReducePhaseDistributed(boolean reducePhaseDistributed) |
void |
setUseIntermediateSharedCache(boolean useSharedTmpCache) |
String |
toString() |
void |
writeTo(ObjectOutput output)
Writes this instance to the
ObjectOutput. |
getCacheName, getOrigin, setOriginclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetCacheName, getOrigin, setOrigingetParameters, setParameterspublic static final int COMMAND_ID
public MapCombineCommand()
public MapCombineCommand(String cacheName)
public void init(MapReduceManager mrManager)
public Object perform(InvocationContext context) throws Throwable
perform in interface ReplicableCommandcontext - invocation contextThrowable - in the event of problems.public boolean isUseIntermediateSharedCache()
public void setUseIntermediateSharedCache(boolean useSharedTmpCache)
public boolean isReducePhaseDistributed()
public void setReducePhaseDistributed(boolean reducePhaseDistributed)
public void setIntermediateCacheName(String intermediateCacheName)
public void setMaxCollectorSize(int size)
During execution of map/combine phase, number of intermediate keys/values collected in Collector could potentially become very large. By limiting size of collector intermediate key/values are transferred to intermediate cache in batches before reduce phase is executed.
The default value for max collector size is 1024.
size - the number of key/value pairs for one batch transferMapper.map(Object, Object, Collector)public int getMaxCollectorSize()
public boolean hasCombiner()
public String getTaskId()
public String getIntermediateCacheName()
public byte getCommandId()
ReplicableCommandgetCommandId in interface ReplicableCommandpublic UUID getUUID()
CancellableCommandgetUUID in interface CancellableCommandpublic void writeTo(ObjectOutput output) throws IOException
ReplicableCommandObjectOutput.writeTo in interface ReplicableCommandoutput - the stream.IOException - if an error occurred during the I/O.public void readFrom(ObjectInput input) throws IOException, ClassNotFoundException
ReplicableCommandReplicableCommand.writeTo(ObjectOutput).readFrom in interface ReplicableCommandinput - the stream to read.IOException - if an error occurred during the I/O.ClassNotFoundException - if it tries to load an undefined class.public boolean isReturnValueExpected()
ReplicableCommandResponseGenerator
may choose to simply return null to save on marshalling costs.isReturnValueExpected in interface ReplicableCommandpublic boolean canBlock()
ReplicableCommandcanBlock in interface ReplicableCommandcanBlock in class BaseRpcCommandtrue if the command can block/wait, false otherwisepublic String toString()
toString in class BaseRpcCommandCopyright © 2025 JBoss, a division of Red Hat. All rights reserved.