public interface IContext
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.
Modifier and Type | Method and Description |
---|---|
IConnection |
bind(String stormId,
int port,
IConnectionCallback cb,
Supplier<Object> newConnectionResponse)
This method establishes a server side connection.
|
IConnection |
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.
|
void |
prepare(Map<String,Object> topoConf)
Deprecated.
|
default void |
prepare(Map<String,Object> topoConf,
StormMetricRegistry metricRegistry)
This method is invoked at the startup of messaging plugin.
|
void |
term()
This method is invoked when a worker is unloading a messaging plugin.
|
@Deprecated void prepare(Map<String,Object> topoConf)
topoConf
- storm configurationdefault void prepare(Map<String,Object> topoConf, StormMetricRegistry metricRegistry)
topoConf
- storm configurationmetricRegistry
- storm metric registryvoid term()
IConnection bind(String stormId, int port, IConnectionCallback cb, Supplier<Object> newConnectionResponse)
stormId
- topology IDport
- port #cb
- The callback to deliver received messages tonewConnectionResponse
- Supplier of the initial message to send to new client connections. If authentication
is required, the message will be sent after authentication is complete.IConnection connect(String stormId, String host, int port, AtomicBoolean[] remoteBpStatus)
stormId
- topology IDhost
- remote hostport
- remote portremoteBpStatus
- array of booleans reflecting Back Pressure status of remote tasks.Copyright © 2023 The Apache Software Foundation. All rights reserved.