base/frameworks/cluster/pools.bro
-
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.
Detailed Interface
State Variables
-
Cluster::logger_pool
-
{
spec=[topic="", node_type=Cluster::PROXY, 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
-
{
topic="bro/cluster/pool/logger"
node_type=Cluster::LOGGER
max_nodes=<uninitialized>
exclusive=F
}
The specification for Cluster::logger_pool
.
-
Cluster::proxy_pool
-
{
spec=[topic="", node_type=Cluster::PROXY, 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
-
{
topic="bro/cluster/pool/proxy"
node_type=Cluster::PROXY
max_nodes=<uninitialized>
exclusive=F
}
The specification for Cluster::proxy_pool
.
-
Cluster::worker_pool
-
{
spec=[topic="", node_type=Cluster::PROXY, 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
-
{
topic="bro/cluster/pool/worker"
node_type=Cluster::WORKER
max_nodes=<uninitialized>
exclusive=F
}
The specification for Cluster::worker_pool
.
Types
-
Cluster::PoolNode
Type: | record
- name:
string
The node name (e.g. “manager”).
- alias:
string
An alias of name used to prevent hashing collisions when creating
site_id.
- site_id:
count
A 32-bit unique identifier for the pool node, derived from name/alias.
- alive:
bool &default = F &optional
Whether the node is currently alive and can receive work.
|
Store state of a cluster within the context of a work pool.
-
Cluster::PoolNodeTable
-
-
Cluster::PoolSpec
Type: | record
- topic:
string &default = "" &optional
A topic string that can be used to reach all nodes within a pool.
- node_type:
Cluster::NodeType &default = Cluster::PROXY &optional
The type of nodes that are contained within the pool.
- max_nodes:
count &optional
The maximum number of nodes that may belong to the pool.
If not set, then all available nodes will be added to the pool,
else the cluster framework will automatically limit the pool
membership according to the threshhold.
- exclusive:
bool &default = F &optional
Whether the pool requires exclusive access to nodes. If true,
then max_nodes nodes will not be assigned to any other pool.
When using this flag, max_nodes must also be set.
|
A pool specification.
-
Cluster::RoundRobinTable
-
Functions
-
Cluster::hrw_topic
-
Retrieve the topic associated with the node mapped via Rendezvous hash
of an arbitrary key.
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
-
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_topic
if Cluster::enable_round_robin_logging
is enabled.
If no logger nodes are active, then this will return the value
of Broker::default_log_topic
.
-
Cluster::rr_topic
-
Retrieve the topic associated with the node in a round-robin fashion.
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. |