2017-01-27 17:06:16 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# PROTOCOL COMMAND MINION MODULE
|
|
|
|
####################################################################################################################################
|
2017-05-15 17:12:14 +02:00
|
|
|
package pgBackRest::Protocol::Command::Minion;
|
2017-06-09 23:51:41 +02:00
|
|
|
use parent 'pgBackRest::Protocol::Base::Minion';
|
2017-01-27 17:06:16 +02:00
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings FATAL => qw(all);
|
|
|
|
use Carp qw(confess);
|
|
|
|
use English '-no_match_vars';
|
|
|
|
|
|
|
|
use JSON::PP;
|
|
|
|
|
|
|
|
use pgBackRest::Common::Exception;
|
|
|
|
use pgBackRest::Common::Ini;
|
|
|
|
use pgBackRest::Common::Log;
|
|
|
|
use pgBackRest::Common::String;
|
2017-06-09 23:51:41 +02:00
|
|
|
use pgBackRest::Protocol::Base::Minion;
|
|
|
|
use pgBackRest::Common::Io::Buffered;
|
2017-01-27 17:06:16 +02:00
|
|
|
use pgBackRest::Version;
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# CONSTRUCTOR
|
|
|
|
####################################################################################################################################
|
|
|
|
sub new
|
|
|
|
{
|
|
|
|
my $class = shift; # Class name
|
|
|
|
|
|
|
|
# Assign function parameters, defaults, and log debug info
|
|
|
|
my
|
|
|
|
(
|
|
|
|
$strOperation,
|
|
|
|
$strName, # Name of the protocol
|
|
|
|
$iBufferMax, # Maximum buffer size
|
|
|
|
$iProtocolTimeout, # Protocol timeout
|
|
|
|
) =
|
|
|
|
logDebugParam
|
|
|
|
(
|
|
|
|
__PACKAGE__ . '->new', \@_,
|
|
|
|
{name => 'strName'},
|
|
|
|
{name => 'iBufferMax'},
|
|
|
|
{name => 'iProtocolTimeout'},
|
|
|
|
);
|
|
|
|
|
2017-06-09 23:51:41 +02:00
|
|
|
# Open buffered protocol io
|
|
|
|
my $oIo =
|
|
|
|
new pgBackRest::Common::Io::Buffered(
|
|
|
|
new pgBackRest::Common::Io::Handle('stdio', *STDIN, *STDOUT), $iProtocolTimeout, $iBufferMax);
|
|
|
|
|
2017-01-27 17:06:16 +02:00
|
|
|
# Create the class hash
|
2017-06-09 23:51:41 +02:00
|
|
|
my $self = $class->SUPER::new($strName, $oIo);
|
2017-01-27 17:06:16 +02:00
|
|
|
bless $self, $class;
|
|
|
|
|
|
|
|
# Return from function and log return values if any
|
|
|
|
return logDebugReturn
|
|
|
|
(
|
|
|
|
$strOperation,
|
|
|
|
{name => 'self', value => $self}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|