Class NcsMessageEnvironment
- java.lang.Object
-
- org.apache.nemo.runtime.common.message.ncs.NcsMessageEnvironment
-
- All Implemented Interfaces:
MessageEnvironment
public final class NcsMessageEnvironment extends java.lang.Object implements MessageEnvironment
Message environment for NCS.
-
-
Field Summary
-
Fields inherited from interface org.apache.nemo.runtime.common.message.MessageEnvironment
BLOCK_MANAGER_MASTER_MESSAGE_LISTENER_ID, EXECUTOR_MESSAGE_LISTENER_ID, MASTER_COMMUNICATION_ID, PIPE_MANAGER_MASTER_MESSAGE_LISTENER_ID, RUNTIME_MASTER_MESSAGE_LISTENER_ID
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> java.util.concurrent.Future<MessageSender<T>>
asyncConnect(java.lang.String receiverId, java.lang.String listenerId)
Asynchronously connect to the node calledreceiverId
and return a future ofMessageSender
that sends messages to the listener withlistenerId
.void
close()
Close this message environment.java.lang.String
getId()
void
removeListener(java.lang.String listenerId)
Remove theMessageListener
bound to a specific listener ID.<T> void
setupListener(java.lang.String listenerId, MessageListener<T> listener)
Set up aMessageListener
with a listener id.
-
-
-
Method Detail
-
setupListener
public <T> void setupListener(java.lang.String listenerId, MessageListener<T> listener)
Description copied from interface:MessageEnvironment
Set up aMessageListener
with a listener id.- Specified by:
setupListener
in interfaceMessageEnvironment
- Type Parameters:
T
- The type of the message to be sent in the environment- Parameters:
listenerId
- an identifier of the message listenerlistener
- a message listener
-
removeListener
public void removeListener(java.lang.String listenerId)
Description copied from interface:MessageEnvironment
Remove theMessageListener
bound to a specific listener ID.- Specified by:
removeListener
in interfaceMessageEnvironment
- Parameters:
listenerId
- the ID of the listener to remove.
-
asyncConnect
public <T> java.util.concurrent.Future<MessageSender<T>> asyncConnect(java.lang.String receiverId, java.lang.String listenerId)
Description copied from interface:MessageEnvironment
Asynchronously connect to the node calledreceiverId
and return a future ofMessageSender
that sends messages to the listener withlistenerId
.- Specified by:
asyncConnect
in interfaceMessageEnvironment
- Type Parameters:
T
- The type of the message to be sent in the environment- Parameters:
receiverId
- a receiver idlistenerId
- an identifier of the message listener- Returns:
- a message sender
-
getId
public java.lang.String getId()
- Specified by:
getId
in interfaceMessageEnvironment
- Returns:
- identifier for this node
-
close
public void close() throws java.lang.Exception
Description copied from interface:MessageEnvironment
Close this message environment.- Specified by:
close
in interfaceMessageEnvironment
- Throws:
java.lang.Exception
- while closing
-
-