public class TWSTCPChannel extends java.lang.Object implements TWSChannel
Constructor and Description |
---|
TWSTCPChannel(Config config,
IWorkerController wController)
Create the TCP channel
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the channel
|
java.nio.ByteBuffer |
createBuffer(int capacity)
Create a buffer
|
boolean |
isComplete()
Check weather we have any pending sends
|
void |
progress()
Progress both sends and receives
|
void |
progressReceives(int group)
Progress only receives belonging to a group
|
void |
progressSends()
Progress only the sends
|
boolean |
receiveMessage(int group,
int rank,
int stream,
ChannelListener callback,
java.util.Queue<DataBuffer> receiveBuffers)
Register our interest to receive messages from particular rank using a stream
|
void |
reInit(java.util.List<JobMasterAPI.WorkerInfo> restartedWorkers)
re-initialize the channel with restarted workers
|
void |
releaseBuffers(int workerId,
int e)
Close a worker id with edge
|
boolean |
sendMessage(int id,
ChannelMessage message,
ChannelListener callback)
Send messages to the particular id
|
public TWSTCPChannel(Config config, IWorkerController wController)
config
- configurationwController
- controllerpublic void reInit(java.util.List<JobMasterAPI.WorkerInfo> restartedWorkers)
TWSChannel
reInit
in interface TWSChannel
public boolean sendMessage(int id, ChannelMessage message, ChannelListener callback)
sendMessage
in interface TWSChannel
id
- id to be used for sending messagesmessage
- the messagecallback
- callback for message completionspublic boolean receiveMessage(int group, int rank, int stream, ChannelListener callback, java.util.Queue<DataBuffer> receiveBuffers)
receiveMessage
in interface TWSChannel
rank
- worker idstream
- the graph edge to receive fromcallback
- callback for message completionsreceiveBuffers
- the list of receive bufferspublic void close()
TWSChannel
close
in interface TWSChannel
public boolean isComplete()
TWSChannel
isComplete
in interface TWSChannel
public void progress()
TWSChannel
progress
in interface TWSChannel
public void progressSends()
TWSChannel
progressSends
in interface TWSChannel
public void progressReceives(int group)
TWSChannel
progressReceives
in interface TWSChannel
public java.nio.ByteBuffer createBuffer(int capacity)
TWSChannel
createBuffer
in interface TWSChannel
capacity
- capacitypublic void releaseBuffers(int workerId, int e)
releaseBuffers
in interface TWSChannel
workerId
- worker ide
- edge