Class NodeConfig

java.lang.Object
ru.pathcreator.pyc.rpc.core.NodeConfig

public final class NodeConfig extends Object
Конфигурация корневого RpcNode.

Configuration of the root RpcNode.

Узел владеет Aeron client-ом, optional embedded MediaDriver и optional shared receive poller-ом, который могут использовать каналы, созданные через этот узел.

The node owns the Aeron client, the optional embedded MediaDriver, and the optional shared receive poller used by channels created through that node.

Основные группы настроек / Main groups of settings:

  • Aeron attachment: aeronDir, embeddedDriver
  • Receive architecture: shared receive poller enabled or dedicated RX thread per channel
  • Shared poller tuning: lane count and fragment limit
  • Method Details

    • aeronDir

      public String aeronDir()
      Возвращает Aeron directory.

      Returns the Aeron directory.

      Returns:
      путь к Aeron directory / Aeron directory path
    • embeddedDriver

      public boolean embeddedDriver()
      Возвращает, должен ли узел поднять собственный embedded MediaDriver.

      Returns whether this node should start its own embedded MediaDriver.

      Когда значение равно false, узел подключается к уже запущенному external MediaDriver через aeronDir().

      When false, the node connects to an already running external MediaDriver through aeronDir().

      Returns:
      true, если нужно поднять embedded MediaDriver / true if an embedded MediaDriver should be started
    • sharedReceivePoller

      public boolean sharedReceivePoller()
      Возвращает, должны ли каналы этого узла использовать shared receive poller вместо отдельного RX thread на каждый канал.

      Returns whether channels created by this node should use the shared receive poller instead of one dedicated RX thread per channel.

      Когда режим включен, каналы остаются логически изолированными, но их receive polling multiplex-ится через node-owned poller lanes.

      When enabled, channels stay logically isolated, but their receive polling is multiplexed through node-owned poller lanes.

      Returns:
      true, если включен shared receive polling / true if shared receive polling is enabled
    • sharedReceivePollerThreads

      public int sharedReceivePollerThreads()
      Возвращает число shared receive-poller lanes, создаваемых на каждый IdleStrategyKind.

      Returns the number of shared receive-poller lanes created per IdleStrategyKind.

      Это число polling thread-ов, доступных для каналов с одной и той же idle strategy. Большее число lanes может снизить fan-in на загруженном узле, но слишком большое число lanes способно увеличить CPU contention.

      This is the number of polling threads available for channels that use the same idle strategy. More lanes can reduce fan-in on busy nodes, but too many lanes can also increase CPU contention.

      Returns:
      число lanes на один idle strategy kind / lane count per idle-strategy kind
    • sharedReceivePollerFragmentLimit

      public int sharedReceivePollerFragmentLimit()
      Возвращает fragment limit, который использует каждый shared poller lane за один проход polling loop-а.

      Returns the fragment limit used by each shared poller lane during a single subscription poll pass.

      Большие значения помогают быстрее дренировать загруженные каналы. Меньшие значения могут улучшить fairness между большим числом каналов.

      Higher values can help drain busy channels faster. Lower values can improve fairness across many channels.

      Returns:
      fragment limit на один shared poll cycle / fragment limit per shared poll cycle
    • builder

      public static NodeConfig.Builder builder()
      Создаёт builder конфигурации узла.

      Creates a node configuration builder.

      Returns:
      новый builder / new builder