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 Details

  • 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()
      Specified by:
      start in interface Transport
    • stop

      @ManagedOperation(description="Stops the transport", displayName="Stops the transport", name="stop") public void stop()
      Specified by:
      stop in interface Transport
    • isRunning

      @ManagedAttribute(description="Returns whether the transport is running", displayName="Transport running", dataType=TRAIT) public boolean isRunning()
      Specified by:
      isRunning in interface Transport
    • 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:
      getTotalBytesWritten in interface Transport
    • 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:
      getTotalBytesRead in interface Transport
    • getHostName

      @ManagedAttribute(description="Returns the host to which the transport binds.", displayName="Host name", dataType=TRAIT) public String getHostName()
      Specified by:
      getHostName in interface Transport
    • getPort

      @ManagedAttribute(description="Returns the port to which the transport binds.", displayName="Port", dataType=TRAIT) public int getPort()
      Specified by:
      getPort in interface Transport
    • getNumberIOThreads

      @ManagedAttribute(description="Returns the number of I/O threads.", displayName="Number of I/O threads") public int getNumberIOThreads()
      Specified by:
      getNumberIOThreads in interface Transport
    • getPendingTasks

      @ManagedAttribute(description="Returns the number of pending tasks.", displayName="Pending tasks") public int getPendingTasks()
      Specified by:
      getPendingTasks in interface Transport
    • getIdleTimeout

      @ManagedAttribute(description="Returns the idle timeout.", displayName="Idle timeout", dataType=TRAIT) public int getIdleTimeout()
      Specified by:
      getIdleTimeout in interface Transport
    • getTcpNoDelay

      @ManagedAttribute(description="Returns whether TCP no delay was configured or not.", displayName="TCP no delay", dataType=TRAIT) public boolean getTcpNoDelay()
      Specified by:
      getTcpNoDelay in interface Transport
    • getSendBufferSize

      @ManagedAttribute(description="Returns the send buffer size.", displayName="Send buffer size", dataType=TRAIT) public int getSendBufferSize()
      Specified by:
      getSendBufferSize in interface Transport
    • getReceiveBufferSize

      @ManagedAttribute(description="Returns the receive buffer size.", displayName="Receive buffer size", dataType=TRAIT) public int getReceiveBufferSize()
      Specified by:
      getReceiveBufferSize in interface Transport
    • getNumberOfLocalConnections

      @ManagedAttribute(description="Returns a count of active connections this server.", displayName="Local active connections") public int getNumberOfLocalConnections()
      Specified by:
      getNumberOfLocalConnections in interface Transport
    • 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:
      getNumberOfGlobalConnections in interface Transport
    • updateTotalBytesWritten

      public void updateTotalBytesWritten(int bytes)
    • updateTotalBytesRead

      public void updateTotalBytesRead(int bytes)
    • closeChannels

      public CompletionStage<Void> closeChannels(io.netty.channel.group.ChannelMatcher channelMatcher)
      Specified by:
      closeChannels in interface Transport
    • buildEventLoop

      public static io.netty.channel.MultithreadEventLoopGroup buildEventLoop(int nThreads, ThreadFactory threadFactory, String configuration)