Skip to content
Permalink
Browse files

Remove dead code missed in 1b48684.

This commit removed all Perl references to spool storage but some stuff was left behind.
  • Loading branch information...
dwsteele committed May 8, 2019
1 parent f1eea23 commit cb00030ee38148a99df9d5ddcaef64252b0b50c9
@@ -74,7 +74,7 @@ my $hProtocol = {}; # Global remote hash that is created on first reques
####################################################################################################################################
# isRepoLocal
#
# Is the backup/archive repository local? This does not take into account the spool path.
# Is the backup/archive repository local?
####################################################################################################################################
sub isRepoLocal
{
@@ -23,13 +23,6 @@ use pgBackRest::Version;
use constant STORAGE_LOCAL => '<LOCAL>';
push @EXPORT, qw(STORAGE_LOCAL);

use constant STORAGE_SPOOL => '<SPOOL>';
push @EXPORT, qw(STORAGE_SPOOL);
use constant STORAGE_SPOOL_ARCHIVE_IN => '<SPOOL:ARCHIVE:IN>';
push @EXPORT, qw(STORAGE_SPOOL_ARCHIVE_IN);
use constant STORAGE_SPOOL_ARCHIVE_OUT => '<SPOOL:ARCHIVE:OUT>';
push @EXPORT, qw(STORAGE_SPOOL_ARCHIVE_OUT);

####################################################################################################################################
# Compression extension
####################################################################################################################################
@@ -87,47 +80,4 @@ sub storageLocal

push @EXPORT, qw(storageLocal);

####################################################################################################################################
# storageSpool - get spool storage
####################################################################################################################################
sub storageSpool
{
# Assign function parameters, defaults, and log debug info
my
(
$strOperation,
$strStanza,
) =
logDebugParam
(
__PACKAGE__ . '::storageSpool', \@_,
{name => 'strStanza', default => cfgOption(CFGOPT_STANZA), trace => true},
);

# Create storage if not defined
if (!defined($hStorage->{&STORAGE_SPOOL}{$strStanza}))
{
# Path rules
my $hRule =
{
&STORAGE_SPOOL_ARCHIVE_IN => "archive/${strStanza}/in",
&STORAGE_SPOOL_ARCHIVE_OUT => "archive/${strStanza}/out",
};

# Create local storage
$hStorage->{&STORAGE_SPOOL}{$strStanza} = new pgBackRest::Storage::Local(
cfgOption(CFGOPT_SPOOL_PATH), new pgBackRest::Storage::Posix::Driver(),
{hRule => $hRule, strTempExtension => STORAGE_TEMP_EXT, lBufferMax => cfgOption(CFGOPT_BUFFER_SIZE)});
}

# Return from function and log return values if any
return logDebugReturn
(
$strOperation,
{name => 'oStorageSpool', value => $hStorage->{&STORAGE_SPOOL}{$strStanza}, trace => true},
);
}

push @EXPORT, qw(storageSpool);

1;
@@ -16725,13 +16725,6 @@ static const EmbeddedModule embeddedModule[] =
"\n\n\n\n"
"use constant STORAGE_LOCAL => '<LOCAL>';\n"
"push @EXPORT, qw(STORAGE_LOCAL);\n"
"\n"
"use constant STORAGE_SPOOL => '<SPOOL>';\n"
"push @EXPORT, qw(STORAGE_SPOOL);\n"
"use constant STORAGE_SPOOL_ARCHIVE_IN => '<SPOOL:ARCHIVE:IN>';\n"
"push @EXPORT, qw(STORAGE_SPOOL_ARCHIVE_IN);\n"
"use constant STORAGE_SPOOL_ARCHIVE_OUT => '<SPOOL:ARCHIVE:OUT>';\n"
"push @EXPORT, qw(STORAGE_SPOOL_ARCHIVE_OUT);\n"
"\n\n\n\n"
"use constant COMPRESS_EXT => 'gz';\n"
"push @EXPORT, qw(COMPRESS_EXT);\n"
@@ -16772,43 +16765,6 @@ static const EmbeddedModule embeddedModule[] =
"}\n"
"\n"
"push @EXPORT, qw(storageLocal);\n"
"\n\n\n\n"
"sub storageSpool\n"
"{\n"
"\n"
"my\n"
"(\n"
"$strOperation,\n"
"$strStanza,\n"
") =\n"
"logDebugParam\n"
"(\n"
"__PACKAGE__ . '::storageSpool', \\@_,\n"
"{name => 'strStanza', default => cfgOption(CFGOPT_STANZA), trace => true},\n"
");\n"
"\n\n"
"if (!defined($hStorage->{&STORAGE_SPOOL}{$strStanza}))\n"
"{\n"
"\n"
"my $hRule =\n"
"{\n"
"&STORAGE_SPOOL_ARCHIVE_IN => \"archive/${strStanza}/in\",\n"
"&STORAGE_SPOOL_ARCHIVE_OUT => \"archive/${strStanza}/out\",\n"
"};\n"
"\n\n"
"$hStorage->{&STORAGE_SPOOL}{$strStanza} = new pgBackRest::Storage::Local(\n"
"cfgOption(CFGOPT_SPOOL_PATH), new pgBackRest::Storage::Posix::Driver(),\n"
"{hRule => $hRule, strTempExtension => STORAGE_TEMP_EXT, lBufferMax => cfgOption(CFGOPT_BUFFER_SIZE)});\n"
"}\n"
"\n\n"
"return logDebugReturn\n"
"(\n"
"$strOperation,\n"
"{name => 'oStorageSpool', value => $hStorage->{&STORAGE_SPOOL}{$strStanza}, trace => true},\n"
");\n"
"}\n"
"\n"
"push @EXPORT, qw(storageSpool);\n"
"\n"
"1;\n"
},
@@ -494,7 +494,7 @@ unit:

# ----------------------------------------------------------------------------------------------------------------------------
- name: helper-perl
total: 5
total: 4

coverage:
Storage/Helper: partial
@@ -120,21 +120,6 @@ sub run
$self->testException(sub {storageRepo()->pathGet('<BOGUS>')}, ERROR_ASSERT, 'invalid <REPO> storage rule <BOGUS>');
}

#-------------------------------------------------------------------------------------------------------------------------------
if ($self->begin("storageSpool()"))
{
$self->testResult(sub {storageSpool()->put($strFile, $strFileContent)}, $iFileSize, 'put');
$self->testResult(sub {${storageTest()->get("spool/${strFile}")}}, $strFileContent, ' check put');

$self->testResult(sub {storageSpool()->put($strFileCopy, $strFileContent)}, $iFileSize, 'put cached storage');
$self->testResult(sub {${storageTest()->get("spool/${strFileCopy}")}}, $strFileContent, ' check put');

#---------------------------------------------------------------------------------------------------------------------------
$self->testResult(
sub {storageSpool()->pathGet(STORAGE_SPOOL_ARCHIVE_OUT)}, $self->testPath() . '/spool/archive/db/out',
'check archive out path');
}

#-------------------------------------------------------------------------------------------------------------------------------
if ($self->begin("storageRepo() encryption"))
{

0 comments on commit cb00030

Please sign in to comment.
You can’t perform that action at this time.