/usr/share/perl5/MHA/BinlogPosFinderElp.pm is in mha4mysql-node 0.54-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | #!/usr/bin/env perl
# Copyright (C) 2011 DeNA Co.,Ltd.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
package MHA::BinlogPosFinderElp;
use strict;
use warnings FATAL => 'all';
use MHA::NodeConst;
use MHA::NodeUtil;
use MHA::BinlogHeaderParser;
use MHA::BinlogManager;
use base 'MHA::BinlogPosFinder';
sub get_starting_master_pos($$) {
my $self = shift;
my $parser = shift;
return $parser->get_starting_mlp();
}
sub find_starting_relay_pos($$) {
my $self = shift;
my $relay_file = shift;
my $start_rlp = 0;
my $found = 0;
my %status = ();
my $relay_dir = $self->{relay_dir};
my $parser = new MHA::BinlogHeaderParser(
dir => $relay_dir,
file => $relay_file,
self_server_id => $self->{server_id},
target_rmlp => $self->{target_rmlp},
debug => $self->{debug},
);
$parser->open_binlog();
( $found, $start_rlp ) = $parser->find_target_relay_pos();
$parser->close_binlog();
if ($found) {
$status{status} = 0;
$status{start_rlf} = $relay_file;
$status{start_rlp} = $start_rlp;
if ( $start_rlp == $parser->{binlog_size} ) {
if ( $relay_file eq $self->{end_log} ) {
$status{status} = $MHA::NodeConst::Target_Has_Received_All_Relay_Logs;
}
else {
$status{start_rlf} = MHA::BinlogManager::get_post_file($relay_file);
$status{start_rlp} = 4;
}
}
return %status;
}
else {
print "Target pos NOT found!\n";
$status{status} = $MHA::NodeConst::Relay_Pos_Not_Found;
return %status;
}
}
1;
|