base/frameworks/cluster/pools.zeek
- Cluster
Defines an interface for managing pools of cluster nodes. Pools are a useful way to distribute work or data among nodes within a cluster.
- Namespace:
Cluster
- Imports:
Summary
State Variables
A pool containing all the logger nodes of a cluster. |
|
The specification for |
|
A pool containing all the proxy nodes of a cluster. |
|
The specification for |
|
A pool containing all the worker nodes of a cluster. |
|
The specification for |
Types
Store state of a cluster within the context of a work pool. |
|
A pool specification. |
|
Functions
Retrieve the topic associated with the node mapped via Rendezvous hash of an arbitrary key. |
|
Registers and initializes a pool. |
|
Distributes log message topics among logger nodes via round-robin. |
|
Retrieve the topic associated with the node in a round-robin fashion. |
Detailed Interface
State Variables
- Cluster::logger_pool
- Type:
- Default:
{ spec=[topic=<uninitialized>, node_type=<uninitialized>, max_nodes=<uninitialized>, exclusive=F] nodes={ } node_list=[] hrw_pool=[sites={ }] rr_key_seq={ } alive_count=0 }
A pool containing all the logger nodes of a cluster. The pool’s node membership/availability is automatically maintained by the cluster framework.
- Cluster::logger_pool_spec
- Type:
- Attributes:
- Default:
{ topic="zeek/cluster/pool/logger" node_type=Cluster::LOGGER max_nodes=<uninitialized> exclusive=F }- Redefinition:
from policy/frameworks/cluster/backend/zeromq/main.zeek
=:Cluster::PoolSpec($topic=zeek.cluster.pool.logger, $node_type=Cluster::LOGGER)
The specification for
Cluster::logger_pool.
- Cluster::proxy_pool
- Type:
- Default:
{ spec=[topic=<uninitialized>, node_type=<uninitialized>, max_nodes=<uninitialized>, exclusive=F] nodes={ } node_list=[] hrw_pool=[sites={ }] rr_key_seq={ } alive_count=0 }
A pool containing all the proxy nodes of a cluster. The pool’s node membership/availability is automatically maintained by the cluster framework.
- Cluster::proxy_pool_spec
- Type:
- Attributes:
- Default:
{ topic="zeek/cluster/pool/proxy" node_type=Cluster::PROXY max_nodes=<uninitialized> exclusive=F }- Redefinition:
from policy/frameworks/cluster/backend/zeromq/main.zeek
=:Cluster::PoolSpec($topic=zeek.cluster.pool.proxy, $node_type=Cluster::PROXY)
The specification for
Cluster::proxy_pool.
- Cluster::worker_pool
- Type:
- Default:
{ spec=[topic=<uninitialized>, node_type=<uninitialized>, max_nodes=<uninitialized>, exclusive=F] nodes={ } node_list=[] hrw_pool=[sites={ }] rr_key_seq={ } alive_count=0 }
A pool containing all the worker nodes of a cluster. The pool’s node membership/availability is automatically maintained by the cluster framework.
- Cluster::worker_pool_spec
- Type:
- Attributes:
- Default:
{ topic="zeek/cluster/pool/worker" node_type=Cluster::WORKER max_nodes=<uninitialized> exclusive=F }- Redefinition:
from policy/frameworks/cluster/backend/zeromq/main.zeek
=:Cluster::PoolSpec($topic=zeek.cluster.pool.worker, $node_type=Cluster::WORKER)
The specification for
Cluster::worker_pool.
Types
- Cluster::PoolNode
- Type:
- Fields:
Store state of a cluster within the context of a work pool.
- Cluster::PoolNodeTable
- Type:
table[string] ofCluster::PoolNode
- Cluster::PoolSpec
- Type:
- Fields:
-
-
node_type:
Cluster::NodeType The type of nodes that are contained within the pool.
-
node_type:
A pool specification.
Functions
- Cluster::hrw_topic
- Type:
function(pool:Cluster::Pool, key:any) :string
Retrieve the topic associated with the node mapped via Rendezvous hash of an arbitrary key.
- Parameters:
pool – the pool of nodes to consider.
key – data used for input to the hashing function that will uniformly distribute keys among available nodes.
- Returns:
a topic string associated with a cluster node that is alive or an empty string if nothing is alive.
- Cluster::register_pool
- Type:
function(spec:Cluster::PoolSpec) :Cluster::Pool
Registers and initializes a pool.
- Cluster::rr_log_topic
-
Distributes log message topics among logger nodes via round-robin. This will be automatically assigned to
Broker::log_topicifCluster::enable_round_robin_loggingis enabled. If no logger nodes are active, then this will return the value ofBroker::default_log_topic.
- Cluster::rr_topic
-
Retrieve the topic associated with the node in a round-robin fashion.
- Parameters:
pool – the pool of nodes to consider.
key – an arbitrary string to identify the purpose for which you’re requesting the topic. e.g. consider using a name-spaced key like “Intel::cluster_rr_key” if you need to guarantee that a group of messages get distributed in a well-defined pattern without other messages being interleaved within the round-robin. Usually sharing the default key is fine for load-balancing purposes.
- Returns:
a topic string associated with a cluster node that is alive, or an empty string if nothing is alive.