|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cliftonsnyder.clutch.Agent com.cliftonsnyder.clutch.mr.Mapper
public class Mapper
a mobile agent representing a mapper
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.cliftonsnyder.clutch.Agent |
---|
Agent.State |
Field Summary | |
---|---|
protected boolean |
newAgent
|
Fields inherited from class com.cliftonsnyder.clutch.Agent |
---|
agentState, ancestorList, children, id, level, maxPeers, parent, state |
Constructor Summary | |
---|---|
Mapper()
an empty, parameterless constructor; this is necessary if the Mapper object is to "play nice" with ProActive |
|
Mapper(ClutchState state)
constructs a new Mapper object, with maxPeers maximum peers |
Method Summary | |
---|---|
void |
addNewReducer(Reducer r)
|
Mapper |
createAgent(Node newAgentNode,
Node newDataNode)
method to be implemented by subclasses of Agent; this is where the interesting organization of a Clutch network will take place |
MapTask |
createMapTask(long offset,
long length)
|
MapTask |
getMapTask(long offset,
long length)
|
MapTask |
getMapTask(java.lang.String id)
|
ReduceTask |
getReduceTask(long offset,
long length)
|
boolean |
hasReducer()
|
boolean |
isNew()
determines whether or not the Agent is newly created or is a current member of a Clutch network |
static void |
main(java.lang.String[] args)
|
void |
run()
|
void |
setInputFactory(MapTaskFactory input)
|
void |
setNew(boolean newAgent)
|
void |
setReducer(Reducer reducer)
|
void |
setState(ClutchState state)
sets the state information for the Agent |
void |
shutdown()
shut down the Agent |
java.lang.String |
status()
gives a String representation of the current status of the Agent |
int |
test(int test)
|
Methods inherited from class com.cliftonsnyder.clutch.Agent |
---|
addChild, getAgentState, getAncestorList, getChildren, getHostName, getID, getLevel, getParent, getRef, isRoot, removeChild, removeChild, setAgentState, setAncestorList, setID, setLevel, setMaxPeers, setParent, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean newAgent
Constructor Detail |
---|
public Mapper()
public Mapper(ClutchState state)
maxPeers
- the maximum number of peers that the Mapper will be allowedMethod Detail |
---|
public static void main(java.lang.String[] args)
args
- This main method optionally takes the location of the Mapper's
configuration file as a parameter. If the parameter is not
supplied, the default location of '$PWD/etc/clutch.properties'
is used. If no configuration file exists at that location, the
Mapper will fail since it won't have any way of knowing what
class to use for it's tasks.public void addNewReducer(Reducer r)
public Mapper createAgent(Node newAgentNode, Node newDataNode)
Agent
createAgent
in class Agent
public MapTask createMapTask(long offset, long length) throws java.io.IOException
java.io.IOException
public MapTask getMapTask(long offset, long length) throws java.io.IOException
java.io.IOException
public MapTask getMapTask(java.lang.String id) throws java.io.IOException
java.io.IOException
public ReduceTask getReduceTask(long offset, long length) throws java.io.IOException
java.io.IOException
public boolean hasReducer()
public boolean isNew()
Agent
isNew
in class Agent
public void run()
public void setInputFactory(MapTaskFactory input)
public void setNew(boolean newAgent)
public void setReducer(Reducer reducer)
public void setState(ClutchState state)
Agent
setState
in class Agent
state
- a ClutchState object with local state information about the
Agentpublic void shutdown()
Agent
shutdown
in class Agent
public java.lang.String status()
Agent
status
in class Agent
public int test(int test)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |