Class NettyTransport
java.lang.Object
org.infinispan.server.core.transport.NettyTransport
- All Implemented Interfaces:
Transport
@MBean(objectName="Transport",
description="Transport component manages read and write operations to/from server.")
public class NettyTransport
extends Object
implements Transport
A Netty based transport.
- Since:
- 4.1
- Author:
- Galder Zamarreño, wburns
-
Constructor Summary
ConstructorsConstructorDescriptionNettyTransport(InetSocketAddress address, ProtocolServerConfiguration configuration, String threadNamePrefix, EmbeddedCacheManager cacheManager) -
Method Summary
Modifier and TypeMethodDescriptionstatic io.netty.channel.MultithreadEventLoopGroupbuildEventLoop(int nThreads, ThreadFactory threadFactory, String configuration) closeChannels(io.netty.channel.group.ChannelMatcher channelMatcher) io.netty.channel.group.ChannelGroupintintintintintintgetPort()intintbooleanlonglongvoidinitializeHandler(io.netty.channel.ChannelInitializer<io.netty.channel.Channel> handler) booleanvoidstart()voidstop()voidupdateTotalBytesRead(int bytes) voidupdateTotalBytesWritten(int bytes)
-
Constructor Details
-
NettyTransport
public NettyTransport(InetSocketAddress address, ProtocolServerConfiguration configuration, String threadNamePrefix, EmbeddedCacheManager cacheManager)
-
-
Method Details
-
initializeHandler
public void initializeHandler(io.netty.channel.ChannelInitializer<io.netty.channel.Channel> handler) -
start
@ManagedOperation(description="Starts the transport", displayName="Starts the transport", name="start") public void start() -
stop
@ManagedOperation(description="Stops the transport", displayName="Stops the transport", name="stop") public void stop() -
isRunning
@ManagedAttribute(description="Returns whether the transport is running", displayName="Transport running", dataType=TRAIT) public boolean isRunning() -
getTotalBytesWritten
@ManagedAttribute(description="Returns the total number of bytes written by the server back to clients which includes both protocol and user information.", displayName="Number of total number of bytes written", measurementType=TRENDSUP) public long getTotalBytesWritten()- Specified by:
getTotalBytesWrittenin interfaceTransport
-
getTotalBytesRead
@ManagedAttribute(description="Returns the total number of bytes read by the server from clients which includes both protocol and user information.", displayName="Number of total number of bytes read", measurementType=TRENDSUP) public long getTotalBytesRead()- Specified by:
getTotalBytesReadin interfaceTransport
-
getHostName
@ManagedAttribute(description="Returns the host to which the transport binds.", displayName="Host name", dataType=TRAIT) public String getHostName()- Specified by:
getHostNamein interfaceTransport
-
getPort
@ManagedAttribute(description="Returns the port to which the transport binds.", displayName="Port", dataType=TRAIT) public int getPort() -
getNumberIOThreads
@ManagedAttribute(description="Returns the number of I/O threads.", displayName="Number of I/O threads") public int getNumberIOThreads()- Specified by:
getNumberIOThreadsin interfaceTransport
-
getPendingTasks
@ManagedAttribute(description="Returns the number of pending tasks.", displayName="Pending tasks") public int getPendingTasks()- Specified by:
getPendingTasksin interfaceTransport
-
getIdleTimeout
@ManagedAttribute(description="Returns the idle timeout.", displayName="Idle timeout", dataType=TRAIT) public int getIdleTimeout()- Specified by:
getIdleTimeoutin interfaceTransport
-
getTcpNoDelay
@ManagedAttribute(description="Returns whether TCP no delay was configured or not.", displayName="TCP no delay", dataType=TRAIT) public boolean getTcpNoDelay()- Specified by:
getTcpNoDelayin interfaceTransport
-
getSendBufferSize
@ManagedAttribute(description="Returns the send buffer size.", displayName="Send buffer size", dataType=TRAIT) public int getSendBufferSize()- Specified by:
getSendBufferSizein interfaceTransport
-
getReceiveBufferSize
@ManagedAttribute(description="Returns the receive buffer size.", displayName="Receive buffer size", dataType=TRAIT) public int getReceiveBufferSize()- Specified by:
getReceiveBufferSizein interfaceTransport
-
getNumberOfLocalConnections
@ManagedAttribute(description="Returns a count of active connections this server.", displayName="Local active connections") public int getNumberOfLocalConnections()- Specified by:
getNumberOfLocalConnectionsin interfaceTransport
-
getNumberOfGlobalConnections
@ManagedAttribute(description="Returns a count of active connections in the cluster. This operation will make remote calls to aggregate results, so latency might have an impact on the speed of calculation of this attribute.", displayName="Cluster-wide number of active connections", clusterWide=true) public int getNumberOfGlobalConnections()- Specified by:
getNumberOfGlobalConnectionsin interfaceTransport
-
updateTotalBytesWritten
public void updateTotalBytesWritten(int bytes) -
updateTotalBytesRead
public void updateTotalBytesRead(int bytes) -
closeChannels
- Specified by:
closeChannelsin interfaceTransport
-
getAcceptedChannels
public io.netty.channel.group.ChannelGroup getAcceptedChannels()- Specified by:
getAcceptedChannelsin interfaceTransport
-
buildEventLoop
public static io.netty.channel.MultithreadEventLoopGroup buildEventLoop(int nThreads, ThreadFactory threadFactory, String configuration)
-