Class ChannelConfig.Builder
- Enclosing class:
ChannelConfig
ChannelConfig.
Builder used to create ChannelConfig instances.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionЗадает политику обработки backpressure.build()Проверяет настройки и создает неизменяемую конфигурацию канала.Задает таймаут RPC-вызова по умолчанию.Задает интервал heartbeat.heartbeatMissedLimit(int v) Задает допустимое число пропущенных heartbeat-интервалов.Adds an optional listener for channel events.Задает локальный endpoint канала.maxMessageSize(int v) Задает максимальный размер сообщения.mtuLength(int v) Задает MTU канала.Задает таймаут ожидания отправки при backpressure.offloadCopyBufferSize(int v) Задает размер одного буфера копирования для offload.offloadCopyPoolSize(int v) Задает размер пула буферов копирования для offload.Sets how many additional offload execution states are created when the retained pool is temporarily exhausted.offloadExecutionStatePoolingEnabled(boolean v) Enables or disables pooled reusable execution state for offloaded handler execution.Sets the number of reusable offload execution states retained per channel in the steady state.Задает executor для offload-обработчиков.offloadTaskPoolSize(int v) Задает размер пула offload-задач.pendingPoolCapacity(int v) Задает емкость пула ожидающих вызовов.protocolCapabilities(long v) Sets the local capability bitmask advertised by this channel.protocolHandshakeEnabled(boolean v) Enables or disables the optional protocol compatibility handshake.Sets the timeout used by the optional protocol handshake.protocolVersion(int v) Sets the local protocol version advertised by this channel.Sets how the channel should behave when a call begins or a publish attempt occurs while the underlying transport is not connected.registryInitialCapacity(int v) Задает начальную емкость реестра ожидающих вызовов.Задает удаленный endpoint канала.requiredRemoteCapabilities(long v) Sets the capability bitmask that must be present on the remote side when the optional protocol handshake is enabled.Задает idle-стратегию rx-потока.sessionId(int v) Задает Aeron session id.socketRcvBuf(int v) Задает размер socket receive buffer.socketSndBuf(int v) Задает размер socket send buffer.streamId(int v) Задает Aeron stream id.termLength(int v) Задает длину term buffer.
-
Constructor Details
-
Builder
public Builder()Создает builder с настройками по умолчанию.Creates a builder with default settings.
-
-
Method Details
-
localEndpoint
Задает локальный endpoint канала.Sets the local channel endpoint.
- Parameters:
v- локальный endpoint / local endpoint- Returns:
- этот builder / this builder
-
remoteEndpoint
Задает удаленный endpoint канала.Sets the remote channel endpoint.
- Parameters:
v- удаленный endpoint / remote endpoint- Returns:
- этот builder / this builder
-
streamId
Задает Aeron stream id.Sets the Aeron stream id.
- Parameters:
v- stream id / stream id- Returns:
- этот builder / this builder
-
sessionId
Задает Aeron session id.Sets the Aeron session id.
- Parameters:
v- session id;0позволяет Aeron выбрать значение / session id;0lets Aeron choose the value- Returns:
- этот builder / this builder
-
mtuLength
Задает MTU канала.Sets the channel MTU length.
- Parameters:
v- MTU в байтах / MTU length in bytes- Returns:
- этот builder / this builder
-
termLength
Задает длину term buffer.Sets the term buffer length.
- Parameters:
v- длина term buffer в байтах / term buffer length in bytes- Returns:
- этот builder / this builder
-
socketSndBuf
Задает размер socket send buffer.Sets the socket send buffer size.
- Parameters:
v- размер send buffer в байтах / send buffer size in bytes- Returns:
- этот builder / this builder
-
socketRcvBuf
Задает размер socket receive buffer.Sets the socket receive buffer size.
- Parameters:
v- размер receive buffer в байтах / receive buffer size in bytes- Returns:
- этот builder / this builder
-
defaultTimeout
Задает таймаут RPC-вызова по умолчанию.Sets the default RPC call timeout.
- Parameters:
v- таймаут вызова / call timeout- Returns:
- этот builder / this builder
-
offerTimeout
Задает таймаут ожидания отправки при backpressure.Sets the offer timeout used while handling backpressure.
- Parameters:
v- таймаут offer / offer timeout- Returns:
- этот builder / this builder
-
heartbeatInterval
Задает интервал heartbeat.Sets the heartbeat interval.
- Parameters:
v- интервал heartbeat / heartbeat interval- Returns:
- этот builder / this builder
-
heartbeatMissedLimit
Задает допустимое число пропущенных heartbeat-интервалов.Sets the allowed number of missed heartbeat intervals.
- Parameters:
v- лимит пропущенных heartbeat / missed heartbeat limit- Returns:
- этот builder / this builder
-
maxMessageSize
Задает максимальный размер сообщения.Sets the maximum message size.
- Parameters:
v- максимальный размер сообщения в байтах / maximum message size in bytes- Returns:
- этот builder / this builder
-
backpressurePolicy
Задает политику обработки backpressure.Sets the backpressure handling policy.
- Parameters:
v- политика backpressure / backpressure policy- Returns:
- этот builder / this builder
-
reconnectStrategy
Sets how the channel should behave when a call begins or a publish attempt occurs while the underlying transport is not connected.Use
ReconnectStrategy.FAIL_FASTwhen the caller should immediately trigger fallback logic. UseReconnectStrategy.WAIT_FOR_CONNECTIONwhen short reconnect windows are acceptable and the request should wait for the current Aeron path to recover.- Parameters:
v- reconnect strategy- Returns:
- this builder
-
protocolHandshakeEnabled
Enables or disables the optional protocol compatibility handshake.When enabled, the first outbound call performs one control-plane handshake with the peer and verifies version/capabilities before user traffic proceeds. This adds cost only to the first contact and remains disabled by default.
- Parameters:
v-trueto enable the protocol handshake- Returns:
- this builder
-
protocolVersion
Sets the local protocol version advertised by this channel.- Parameters:
v- local protocol version- Returns:
- this builder
-
protocolCapabilities
Sets the local capability bitmask advertised by this channel.- Parameters:
v- local capability bitmask- Returns:
- this builder
-
requiredRemoteCapabilities
Sets the capability bitmask that must be present on the remote side when the optional protocol handshake is enabled.- Parameters:
v- required remote capabilities- Returns:
- this builder
-
protocolHandshakeTimeout
Sets the timeout used by the optional protocol handshake.- Parameters:
v- handshake timeout- Returns:
- this builder
-
listener
Adds an optional listener for channel events.Listeners are opt-in. When none are configured, the fast path remains unchanged except for a single empty-array check before dispatching events.
- Parameters:
v- listener to add- Returns:
- this builder
-
rxIdleStrategy
Задает idle-стратегию rx-потока.Sets the receive thread idle strategy.
- Parameters:
v- idle-стратегия / idle strategy- Returns:
- этот builder / this builder
-
pendingPoolCapacity
Задает емкость пула ожидающих вызовов.Sets the pending call pool capacity.
- Parameters:
v- емкость pending-пула / pending pool capacity- Returns:
- этот builder / this builder
-
registryInitialCapacity
Задает начальную емкость реестра ожидающих вызовов.Sets the initial capacity of the pending call registry.
- Parameters:
v- начальная емкость реестра / registry initial capacity- Returns:
- этот builder / this builder
-
offloadExecutor
Задает executor для offload-обработчиков.Sets the executor used for offloaded handlers.
- Parameters:
v- executor;nullозначает node-default executor / executor;nullmeans the node-default executor- Returns:
- этот builder / this builder
-
offloadTaskPoolSize
Задает размер пула offload-задач.Sets the offload task pool size.
- Parameters:
v- размер пула задач / task pool size- Returns:
- этот builder / this builder
-
offloadCopyPoolSize
Задает размер пула буферов копирования для offload.Sets the offload copy buffer pool size.
- Parameters:
v- размер пула copy-буферов / copy buffer pool size- Returns:
- этот builder / this builder
-
offloadCopyBufferSize
Задает размер одного буфера копирования для offload.Sets the size of one offload copy buffer.
- Parameters:
v- размер copy-буфера в байтах / copy buffer size in bytes- Returns:
- этот builder / this builder
-
offloadExecutionStatePoolingEnabled
Enables or disables pooled reusable execution state for offloaded handler execution.- Parameters:
v-trueto enable execution-state pooling- Returns:
- this builder
-
offloadExecutionStatePoolSize
Sets the number of reusable offload execution states retained per channel in the steady state.- Parameters:
v- retained offload execution state pool size- Returns:
- this builder
-
offloadExecutionStatePoolGrowthChunk
Sets how many additional offload execution states are created when the retained pool is temporarily exhausted.- Parameters:
v- temporary growth chunk for the offload execution state pool- Returns:
- this builder
-
build
Проверяет настройки и создает неизменяемую конфигурацию канала.Validates settings and builds an immutable channel configuration.
- Returns:
- конфигурация канала / channel configuration
-