-
Notifications
You must be signed in to change notification settings - Fork 0
/
CommandServer.pm
48 lines (39 loc) · 1.01 KB
/
CommandServer.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package CommandServer;
# This class runs on the command line node, to manage communications with the Server nodes.
# There will be an instance of this class for each Server.
use strict;
use warnings;
use parent 'Correspondent';
use Class::Tiny qw(
status_group
),
{
}
;
sub BUILD {
my $self = shift;
$self->{peer_type}='Server';
}
sub receive {
my $self = shift;
my @parms = @{$_[0]};
my $verb = shift @parms;
if ($verb eq 'db_status_report') {
$self->db_status_report(\@parms);
}
}
sub db_status_report {
my $self=shift;
my @parms = @{$_[0]};
$self->send("ack");
my $wsrep_cluster_name = shift @parms;
print "Cluster name is $wsrep_cluster_name \n";
my $wsrep_node_name = shift @parms;
print "Node name is $wsrep_node_name \n";
$self->{status_running} = shift @parms;
$self->{status_serving} = shift @parms;
$self->{status_primary} = shift @parms;
$self->{status_group} = shift @parms;
print "We heard from peer_id $self->{peer_id}\n";
}
1;