Package org.apache.storm.messaging
Interface IContext
public interface IContext
This interface needs to be implemented for messaging plugin.
 
Messaging plugin is specified via Storm config parameter, storm.messaging.transport.
A messaging plugin should have a default constructor and implements IContext interface. Upon construction, we will invoke IContext::prepare(topoConf) to enable context to be configured according to storm configuration.
- 
Method SummaryModifier and TypeMethodDescriptionbind(String stormId, int port, IConnectionCallback cb, Supplier<Object> newConnectionResponse) This method establishes a server side connection.connect(String stormId, String host, int port, AtomicBoolean[] remoteBpStatus) This method establish a client side connection to a remote server implementation should return a new connection every call.voidDeprecated.default voidprepare(Map<String, Object> topoConf, StormMetricRegistry metricRegistry) This method is invoked at the startup of messaging plugin.voidterm()This method is invoked when a worker is unloading a messaging plugin.
- 
Method Details- 
prepareDeprecated.This method is invoked at the startup of messaging plugin.- Parameters:
- topoConf- storm configuration
 
- 
prepareThis method is invoked at the startup of messaging plugin.- Parameters:
- topoConf- storm configuration
- metricRegistry- storm metric registry
 
- 
termvoid term()This method is invoked when a worker is unloading a messaging plugin.
- 
bindIConnection bind(String stormId, int port, IConnectionCallback cb, Supplier<Object> newConnectionResponse) This method establishes a server side connection.- Parameters:
- stormId- topology ID
- port- port #
- cb- The callback to deliver received messages to
- newConnectionResponse- Supplier of the initial message to send to new client connections. If authentication is required, the message will be sent after authentication is complete.
- Returns:
- server side connection
 
- 
connectThis method establish a client side connection to a remote server implementation should return a new connection every call.- Parameters:
- stormId- topology ID
- host- remote host
- port- remote port
- remoteBpStatus- array of booleans reflecting Back Pressure status of remote tasks.
- Returns:
- client side connection
 
 
-