public class NettyLumberJackClientRunner extends Object implements Runnable
What it does is to continuously try to connect, and once connected, send the lumberjack frames to the peer.
In case of disconnection, all pending and queued frames are discarded. These frames are also promptly signalled as failed to the caller (through the so called acker). This allows the caller to immediately signal these failed frames to the spout or other equivalent input connector to do what they must do.
Note that such a client is supposed to stay alive forever. If you call stop() it will terminate all threads.
| Constructor and Description |
|---|
NettyLumberJackClientRunner(NettyLumberJackClientImpl client,
NettyDataAcker acker,
org.thales.punch.settings.api.ISettingsMap settings,
NettyLumberjackEncoder encoder,
NettyLumberjackDecoder decoder,
com.codahale.metrics.Counter appSentCounter,
com.codahale.metrics.Histogram roundTripTime)
Ctor
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addItem(NettyLumberjackData item)
Add an item to be written to the peer.
|
void |
onReceive(io.netty.channel.Channel peer,
io.netty.buffer.ByteBuf data) |
void |
run() |
void |
stop() |
public NettyLumberJackClientRunner(NettyLumberJackClientImpl client, NettyDataAcker acker, org.thales.punch.settings.api.ISettingsMap settings, NettyLumberjackEncoder encoder, NettyLumberjackDecoder decoder, com.codahale.metrics.Counter appSentCounter, com.codahale.metrics.Histogram roundTripTime)
client - the owning clientacker - the acker, possibly null if none.settings - the caller settingsencoder - the lumberjack encoder for building new framedecoder - the lumberjack decoder for decoding input (keepalive) framesappSentCounter - the counter of outgoing bytesroundTripTime - a histogram for monitoring the round trip timepublic void onReceive(io.netty.channel.Channel peer,
io.netty.buffer.ByteBuf data)
protected boolean addItem(NettyLumberjackData item)
item - the item to writepublic void stop()
Copyright © 2023. All rights reserved.