SocketServer

SocketServer is a NIO socket server.

SocketServer is created exclusively when KafkaServer is started.

SocketServer startup.png
Figure 1. SocketServer’s Startup
Table 1. SocketServer’s Metrics (in kafka.network group)
Name Description

NetworkProcessorAvgIdlePercent

MemoryPoolAvailable

MemoryPoolUsed

Table 2. SocketServer’s Internal Properties (e.g. Registries and Counters) (in alphabetical order)
Name Description

acceptors

Acceptor threads per EndPoint

connectionQuotas

ConnectionQuotas

endpoints

EndPoints (aka listeners) per name (as configured using listeners Kafka property)

maxQueuedRequests

maxConnectionsPerIp

maxConnectionsPerIpOverrides

memoryPool

numProcessorThreads

The number of processors per endpoint (as configured using num.network.threads Kafka property)

processors

Processor threads (initially totalProcessorThreads)

requestChannel

totalProcessorThreads

Total number of processors, i.e. numProcessorThreads for every endpoint

Creating Processor — newProcessor Internal Method

Caution
FIXME

Starting Up (and Auxiliary Services) — startup Method

startup(): Unit

Internally, startup creates the ConnectionQuotas (with maxConnectionsPerIp and maxConnectionsPerIpOverrides).

For every endpoint (in endpoints registry) startup does the following:

  1. Creates up to numProcessorThreads number of Processors (for ConnectionQuotas and MemoryPool)

  2. Creates a Acceptor for the endpoint and processors

  3. Records the Acceptor in acceptors internal registry

  4. Starts a non-daemon thread for the Acceptor with the name as kafka-socket-acceptor-[listenerName]-[securityProtocol]-[port] (e.g. kafka-socket-acceptor-ListenerName(PLAINTEXT)-PLAINTEXT-9092) and waits until it has started fully

startup then registers metrics.

In the end, startup prints out the following INFO message to the logs:

INFO [SocketServer brokerId=[brokerID]] Started [number] acceptor threads
Note
startup is used exclusively when KafkaServer starts up.

Creating SocketServer Instance

SocketServer takes the following when created:

SocketServer initializes the internal registries and counters.

results matching ""

    No results matching ""