Package org.apache.storm.messaging.netty
Class Client
java.lang.Object
org.apache.storm.messaging.ConnectionWithStatus
org.apache.storm.messaging.netty.Client
- All Implemented Interfaces:
- AutoCloseable,- IConnection,- ISaslClient
A Netty client for sending task messages to a remote destination (Netty server).
 
Implementation details:
Sending messages, i.e. writing to the channel, is performed asynchronously. Messages are sent in batches to optimize for network throughput at the expense of network latency. The message batch size is configurable. Connecting and reconnecting are performed asynchronously. Note: The current implementation drops any messages that are being enqueued for sending if the connection to the remote destination is currently unavailable.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.storm.messaging.ConnectionWithStatusConnectionWithStatus.Status
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionvoidchannelReady(org.apache.storm.shade.io.netty.channel.Channel channel) voidclose()Gracefully close this client.getLoad(Collection<Integer> tasks) Get the current load for the given tasks.intgetPort()Get the port for this connection.name()voidsend(Iterator<TaskMessage> msgs) Enqueue task messages to be sent to the remote destination (cf.voidsendBackPressureStatus(BackPressureStatus bpStatus) Sends the back pressure metrics to all downstream connections.voidsendLoadMetrics(Map<Integer, Double> taskToLoad) Send load metrics to all downstream connections.status()Note: Storm will check via this method whether a worker can be activated safely during the initial startup of a topology.toString()
- 
Field Details- 
dstAddressPrefixedName
 
- 
- 
Method Details- 
statusNote: Storm will check via this method whether a worker can be activated safely during the initial startup of a topology. The worker will only be activated once all of the its connections are ready.- Specified by:
- statusin class- ConnectionWithStatus
 
- 
sendLoadMetricsDescription copied from interface:IConnectionSend load metrics to all downstream connections.- Specified by:
- sendLoadMetricsin interface- IConnection
- Parameters:
- taskToLoad- a map from the task id to the load for that task.
 
- 
sendBackPressureStatusDescription copied from interface:IConnectionSends the back pressure metrics to all downstream connections.- Specified by:
- sendBackPressureStatusin interface- IConnection
 
- 
sendEnqueue task messages to be sent to the remote destination (cf. `host` and `port`).- Specified by:
- sendin interface- IConnection
 
- 
getDstAddress
- 
getPortpublic int getPort()Description copied from interface:IConnectionGet the port for this connection.- Specified by:
- getPortin interface- IConnection
- Returns:
- The port this connection is using
 
- 
closepublic void close()Gracefully close this client.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- IConnection
 
- 
getLoadDescription copied from interface:IConnectionGet the current load for the given tasks.- Specified by:
- getLoadin interface- IConnection
- Parameters:
- tasks- the tasks to look for.
- Returns:
- a Load for each of the tasks it knows about.
 
- 
getConfig
- 
channelReadypublic void channelReady(org.apache.storm.shade.io.netty.channel.Channel channel) - Specified by:
- channelReadyin interface- ISaslClient
 
- 
name- Specified by:
- namein interface- ISaslClient
 
- 
secretKey- Specified by:
- secretKeyin interface- ISaslClient
 
- 
toString
 
-