From cb00030ee38148a99df9d5ddcaef64252b0b50c9 Mon Sep 17 00:00:00 2001 From: David Steele Date: Wed, 8 May 2019 18:58:07 -0400 Subject: [PATCH] Remove dead code missed in 1b486847. This commit removed all Perl references to spool storage but some stuff was left behind. --- lib/pgBackRest/Protocol/Helper.pm | 2 +- lib/pgBackRest/Storage/Helper.pm | 50 ------------------- src/perl/embed.auto.c | 44 ---------------- test/define.yaml | 2 +- .../Module/Storage/StorageHelperPerlTest.pm | 15 ------ 5 files changed, 2 insertions(+), 111 deletions(-) diff --git a/lib/pgBackRest/Protocol/Helper.pm b/lib/pgBackRest/Protocol/Helper.pm index 1527224d4..1d72c41ac 100644 --- a/lib/pgBackRest/Protocol/Helper.pm +++ b/lib/pgBackRest/Protocol/Helper.pm @@ -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 { diff --git a/lib/pgBackRest/Storage/Helper.pm b/lib/pgBackRest/Storage/Helper.pm index 7a12d377f..7ae2fcf92 100644 --- a/lib/pgBackRest/Storage/Helper.pm +++ b/lib/pgBackRest/Storage/Helper.pm @@ -23,13 +23,6 @@ use pgBackRest::Version; use constant STORAGE_LOCAL => ''; push @EXPORT, qw(STORAGE_LOCAL); -use constant STORAGE_SPOOL => ''; - push @EXPORT, qw(STORAGE_SPOOL); -use constant STORAGE_SPOOL_ARCHIVE_IN => ''; - push @EXPORT, qw(STORAGE_SPOOL_ARCHIVE_IN); -use constant STORAGE_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; diff --git a/src/perl/embed.auto.c b/src/perl/embed.auto.c index f81984501..ebe8a3ab7 100644 --- a/src/perl/embed.auto.c +++ b/src/perl/embed.auto.c @@ -16725,13 +16725,6 @@ static const EmbeddedModule embeddedModule[] = "\n\n\n\n" "use constant STORAGE_LOCAL => '';\n" "push @EXPORT, qw(STORAGE_LOCAL);\n" - "\n" - "use constant STORAGE_SPOOL => '';\n" - "push @EXPORT, qw(STORAGE_SPOOL);\n" - "use constant STORAGE_SPOOL_ARCHIVE_IN => '';\n" - "push @EXPORT, qw(STORAGE_SPOOL_ARCHIVE_IN);\n" - "use constant STORAGE_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" }, diff --git a/test/define.yaml b/test/define.yaml index daaaa537f..c73415a49 100644 --- a/test/define.yaml +++ b/test/define.yaml @@ -494,7 +494,7 @@ unit: # ---------------------------------------------------------------------------------------------------------------------------- - name: helper-perl - total: 5 + total: 4 coverage: Storage/Helper: partial diff --git a/test/lib/pgBackRestTest/Module/Storage/StorageHelperPerlTest.pm b/test/lib/pgBackRestTest/Module/Storage/StorageHelperPerlTest.pm index e02ca68bb..f0990b089 100644 --- a/test/lib/pgBackRestTest/Module/Storage/StorageHelperPerlTest.pm +++ b/test/lib/pgBackRestTest/Module/Storage/StorageHelperPerlTest.pm @@ -120,21 +120,6 @@ sub run $self->testException(sub {storageRepo()->pathGet('')}, ERROR_ASSERT, 'invalid storage rule '); } - #------------------------------------------------------------------------------------------------------------------------------- - 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")) {