public abstract class NettyTransport extends Object implements Transport
| Modifier and Type | Class and Description |
|---|---|
static class |
NettyTransport.Config |
Transport.Factory<T extends Transport>| Modifier and Type | Field and Description |
|---|---|
static String |
CK_BIND_ADDRESS |
static String |
CK_NUMBER_WORKER_THREADS |
static String |
CK_PORT |
static String |
CK_RECV_BUFFER_SIZE |
protected EventLoopGroupFactory |
eventLoopGroupFactory |
protected com.codahale.metrics.MetricRegistry |
localRegistry |
protected InetSocketAddress |
socketAddress |
protected ThroughputCounter |
throughputCounter |
protected int |
workerThreads |
| Constructor and Description |
|---|
NettyTransport(Configuration configuration,
EventLoopGroupFactory eventLoopGroupFactory,
ThroughputCounter throughputCounter,
LocalMetricRegistry localRegistry) |
| Modifier and Type | Method and Description |
|---|---|
protected CodecAggregator |
getAggregator() |
protected LinkedHashMap<String,Callable<? extends io.netty.channel.ChannelHandler>> |
getChannelHandlers(MessageInput input)
Subclasses can override this to add additional
channel handlers to the
Netty ChannelPipeline to support additional features. |
protected io.netty.channel.ChannelInitializer<? extends io.netty.channel.Channel> |
getChannelInitializer(LinkedHashMap<String,Callable<? extends io.netty.channel.ChannelHandler>> handlerList) |
protected abstract LinkedHashMap<String,Callable<? extends io.netty.channel.ChannelHandler>> |
getChildChannelHandlers(MessageInput input)
Subclasses can override this to modify the
channel handlers for child channels. |
protected LinkedHashMap<String,Callable<? extends io.netty.channel.ChannelHandler>> |
getCustomChildChannelHandlers(MessageInput input)
Subclasses can override this to modify the
channel handlers at the end of the pipeline for child channels. |
abstract SocketAddress |
getLocalAddress()
Get the local socket address this transport is listening on after being launched.
|
com.codahale.metrics.MetricSet |
getMetricSet() |
protected int |
getRecvBufferSize() |
void |
setMessageAggregator(CodecAggregator aggregator) |
public static final String CK_BIND_ADDRESS
public static final String CK_PORT
public static final String CK_RECV_BUFFER_SIZE
public static final String CK_NUMBER_WORKER_THREADS
protected final EventLoopGroupFactory eventLoopGroupFactory
protected final com.codahale.metrics.MetricRegistry localRegistry
protected final InetSocketAddress socketAddress
protected final ThroughputCounter throughputCounter
protected final int workerThreads
public NettyTransport(Configuration configuration, EventLoopGroupFactory eventLoopGroupFactory, ThroughputCounter throughputCounter, LocalMetricRegistry localRegistry)
protected io.netty.channel.ChannelInitializer<? extends io.netty.channel.Channel> getChannelInitializer(LinkedHashMap<String,Callable<? extends io.netty.channel.ChannelHandler>> handlerList)
@Nullable public abstract SocketAddress getLocalAddress()
null if the transport hasn't been launched yet.public void setMessageAggregator(@Nullable CodecAggregator aggregator)
setMessageAggregator in interface Transport@Nullable protected CodecAggregator getAggregator()
protected LinkedHashMap<String,Callable<? extends io.netty.channel.ChannelHandler>> getChannelHandlers(MessageInput input)
channel handlers to the
Netty ChannelPipeline to support additional features.
Some common use cases are to add connection counters or traffic shapers.input - The MessageInput for which these channel handlers are being addedchannel handlers to add to the Netty channel pipelineprotected LinkedHashMap<String,Callable<? extends io.netty.channel.ChannelHandler>> getCustomChildChannelHandlers(MessageInput input)
channel handlers at the end of the pipeline for child channels.input - The MessageInput for which these child channel handlers are being addedchannel handlers to add to the Netty channel pipeline for child channelsprotected abstract LinkedHashMap<String,Callable<? extends io.netty.channel.ChannelHandler>> getChildChannelHandlers(MessageInput input)
channel handlers for child channels.
The default handlers in this group are all channel handlers returned by getCustomChildChannelHandlers(MessageInput),
the optional aggregation handler (e.g. for chunked GELF via UDP) and the RawMessageHandler (in that order).
Usually overriding this method should only be necessary if you have a codec that cannot create a
RawMessage for incoming messages at the end of the pipeline.
A valid use case would be to insert debug handlers in the middle of the list, though.input - The MessageInput for which these child channel handlers are being addedchannel handlers to add to the Netty channel pipeline for child channelsgetCustomChildChannelHandlers(MessageInput)protected int getRecvBufferSize()
public com.codahale.metrics.MetricSet getMetricSet()
getMetricSet in interface TransportCopyright © 2012–2021 Graylog, Inc.. All rights reserved.