public class MapReduceCommand extends BaseRpcCommand
| Modifier and Type | Field and Description |
|---|---|
static int |
COMMAND_ID |
protected DistributionManager |
dm |
protected InvocationContextContainer |
icc |
protected Set<Object> |
keys |
protected Address |
localAddress |
cacheName| Constructor and Description |
|---|
MapReduceCommand(Mapper m,
Reducer r,
String cacheName,
Collection<Object> inputKeys) |
MapReduceCommand(Mapper m,
Reducer r,
String cacheName,
Object... inputKeys) |
MapReduceCommand(String cacheName) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
byte |
getCommandId()
Used by marshallers to convert this command into an id for streaming.
|
Object[] |
getParameters()
Used by marshallers to stream this command across a network
|
int |
hashCode() |
void |
init(CommandsFactory factory,
InterceptorChain invoker,
InvocationContextContainer icc,
DistributionManager dm,
Address localAddress) |
boolean |
isReturnValueExpected()
If true, a return value will be provided when performed remotely.
|
Object |
perform(InvocationContext context)
Performs invocation of mapping phase and local reduce phase before returning result to master node
|
void |
setParameters(int commandId,
Object[] args)
Used by the
CommandsFactory to create a command from raw data read off a stream. |
String |
toString() |
getCacheName, getOrigin, setOriginpublic static final int COMMAND_ID
protected InvocationContextContainer icc
protected DistributionManager dm
protected Address localAddress
public MapReduceCommand(String cacheName)
public MapReduceCommand(Mapper m, Reducer r, String cacheName, Object... inputKeys)
public MapReduceCommand(Mapper m, Reducer r, String cacheName, Collection<Object> inputKeys)
public void init(CommandsFactory factory, InterceptorChain invoker, InvocationContextContainer icc, DistributionManager dm, Address localAddress)
public Object perform(InvocationContext context) throws Throwable
context - invocation contextThrowable - in the event of problems.public byte getCommandId()
ReplicableCommandpublic Object[] getParameters()
ReplicableCommandpublic void setParameters(int commandId,
Object[] args)
ReplicableCommandCommandsFactory to create a command from raw data read off a stream.commandId - command id to set. This is usually unused but *could* be used in the event of a command having
multiple IDs, such as PutKeyValueCommand.args - object array of argspublic String toString()
toString in class BaseRpcCommandpublic boolean isReturnValueExpected()
ReplicableCommandResponseGenerator
may choose to simply return null to save on marshalling costs.Copyright © 2012 JBoss by Red Hat. All Rights Reserved.