mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Whitespace tweaks in cluster controller and agent scripts
This commit is contained in:
parent
e9bdaebc70
commit
aceb05099a
6 changed files with 16 additions and 16 deletions
|
@ -4,7 +4,7 @@ module ClusterAgent;
|
|||
|
||||
export {
|
||||
# The name this agent uses to represent the cluster instance
|
||||
# it manages. When the environment variable isn't set and there's,
|
||||
# it manages. When the environment variable isn't set and there's,
|
||||
# no redef, this falls back to "agent-<hostname>".
|
||||
const name = getenv("ZEEK_AGENT_NAME") &redef;
|
||||
|
||||
|
@ -33,7 +33,7 @@ export {
|
|||
$address="0.0.0.0", $bound_port=0/unknown] &redef;
|
||||
|
||||
# Agent and controller currently log only, not via the data cluster's
|
||||
# logger. (This might get added later.) For now, this means that
|
||||
# logger. (This might get added later.) For now, this means that
|
||||
# if both write to the same log file, it gets garbled. The following
|
||||
# lets you specify the working directory specifically for the agent.
|
||||
const directory = "" &redef;
|
||||
|
@ -53,8 +53,8 @@ function instance(): ClusterController::Types::Instance
|
|||
{
|
||||
local epi = endpoint_info();
|
||||
return ClusterController::Types::Instance($name=epi$id,
|
||||
$host=to_addr(epi$network$address),
|
||||
$listen_port=epi$network$bound_port);
|
||||
$host=to_addr(epi$network$address),
|
||||
$listen_port=epi$network$bound_port);
|
||||
}
|
||||
|
||||
function endpoint_info(): Broker::EndpointInfo
|
||||
|
|
|
@ -185,7 +185,7 @@ event zeek_init()
|
|||
Broker::peer(supervisor_addr, Broker::default_port, Broker::default_listen_retry);
|
||||
|
||||
# Agents need receive communication targeted at it, and any responses
|
||||
# from the supervisor.
|
||||
# from the supervisor.
|
||||
Broker::subscribe(agent_topic);
|
||||
Broker::subscribe(SupervisorControl::topic_prefix);
|
||||
|
||||
|
@ -210,8 +210,8 @@ event zeek_init()
|
|||
{
|
||||
# We connect to the controller.
|
||||
Broker::peer(ClusterAgent::controller$address,
|
||||
ClusterAgent::controller$bound_port,
|
||||
ClusterController::connect_retry);
|
||||
ClusterAgent::controller$bound_port,
|
||||
ClusterController::connect_retry);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -40,7 +40,7 @@ export {
|
|||
const role = ClusterController::Types::NONE &redef;
|
||||
|
||||
# Agent and controller currently log only, not via the data cluster's
|
||||
# logger. (This might get added later.) For now, this means that
|
||||
# logger. (This might get added later.) For now, this means that
|
||||
# if both write to the same log file, it gets garbled. The following
|
||||
# lets you specify the working directory specifically for the agent.
|
||||
const directory = "" &redef;
|
||||
|
|
|
@ -53,8 +53,8 @@ event ClusterAgent::API::notify_agent_hello(instance: string, host: addr, api_ve
|
|||
|
||||
|
||||
event ClusterAgent::API::notify_change(instance: string, n: ClusterController::Types::Node,
|
||||
old: ClusterController::Types::State,
|
||||
new: ClusterController::Types::State)
|
||||
old: ClusterController::Types::State,
|
||||
new: ClusterController::Types::State)
|
||||
{
|
||||
# XXX TODO
|
||||
}
|
||||
|
@ -96,10 +96,10 @@ event ClusterAgent::API::set_configuration_response(reqid: string, result: Clust
|
|||
return;
|
||||
|
||||
# All set_configuration requests to instances are done, so respond
|
||||
# back to client. We need to compose the result, aggregating
|
||||
# the results we got from the requests to the agents. In the
|
||||
# end we have one Result per instance requested in the
|
||||
# original set_configuration_request.
|
||||
# back to client. We need to compose the result, aggregating
|
||||
# the results we got from the requests to the agents. In the
|
||||
# end we have one Result per instance requested in the
|
||||
# original set_configuration_request.
|
||||
#
|
||||
# XXX we can likely generalize result aggregation in the request module.
|
||||
for ( i in req$set_configuration_state$requests )
|
||||
|
|
|
@ -27,7 +27,7 @@ export {
|
|||
};
|
||||
|
||||
# The redef is a workaround so we can use the Request type
|
||||
# while it is still being defined
|
||||
# while it is still being defined
|
||||
redef record Request += {
|
||||
results: ClusterController::Types::ResultVec &default=vector();
|
||||
finished: bool &default=F;
|
||||
|
|
|
@ -37,7 +37,7 @@ export {
|
|||
Stopped, # Explicitly stopped
|
||||
Failed, # Failed to start; and permanently halted
|
||||
Crashed, # Crashed, will be restarted,
|
||||
Unknown, # State not known currently (e.g., because of lost connectivity)
|
||||
Unknown, # State not known currently (e.g., because of lost connectivity)
|
||||
};
|
||||
|
||||
## Configuration describing a Cluster Node process.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue