public abstract class AbstractParallelOperation extends java.lang.Object implements IParallelOperation
Modifier and Type | Field and Description |
---|---|
protected Communicator |
channel |
protected Config |
config |
protected java.lang.String |
inEdge |
protected LogicalPlan |
logicalPlan |
protected java.util.Map<java.lang.Integer,java.util.concurrent.BlockingQueue<IMessage>> |
outMessages |
protected java.util.Map<java.lang.Integer,ISync> |
syncs |
Constructor and Description |
---|
AbstractParallelOperation(Config config,
Communicator network,
LogicalPlan tPlan,
java.lang.String edge) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the parallel operation
|
void |
finish(int source)
Indicate the end of the operation
|
boolean |
isComplete()
Check weather the operation is complete
|
boolean |
progress()
Progress the parallel operation
|
void |
register(int targetTask,
java.util.concurrent.BlockingQueue<IMessage> queue)
Register a queue for receiving message
|
void |
registerSync(int targetTask,
ISync sink)
Register a callback to notify when a sync happens
|
void |
reset()
Refresh the operation to start from beginning
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOp, send, sendBarrier
protected Config config
protected Communicator channel
protected java.util.Map<java.lang.Integer,java.util.concurrent.BlockingQueue<IMessage>> outMessages
protected java.util.Map<java.lang.Integer,ISync> syncs
protected LogicalPlan logicalPlan
protected java.lang.String inEdge
public AbstractParallelOperation(Config config, Communicator network, LogicalPlan tPlan, java.lang.String edge)
public void registerSync(int targetTask, ISync sink)
IParallelOperation
registerSync
in interface IParallelOperation
targetTask
- the targetsink
- syncpublic void register(int targetTask, java.util.concurrent.BlockingQueue<IMessage> queue)
IParallelOperation
register
in interface IParallelOperation
public void close()
IParallelOperation
close
in interface IParallelOperation
public void reset()
IParallelOperation
reset
in interface IParallelOperation
public boolean isComplete()
IParallelOperation
isComplete
in interface IParallelOperation
public void finish(int source)
IParallelOperation
finish
in interface IParallelOperation
source
- the sourcepublic boolean progress()
IParallelOperation
progress
in interface IParallelOperation