Ignore:
Timestamp:
2016-12-09T21:24:55+13:00 (7 years ago)
Author:
ak19
Message:

This commit is related to but not specific to the upcoming commit to do with the new oaiinfo db and its directly affected files. This commit: New remove and rename (move) methods in DB package to clean up main db file and any additional db files created by any specific infodbtype. The new methods in dbutil/jdbm.pm are not called, for some reason. Requires more investigation, but committing for now.

Location:
main/trunk/greenstone2/perllib/DBDrivers
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/DBDrivers/BaseDBDriver.pm

    r30517 r31188  
    344344
    345345
     346## @function rename_db_file_to(string, string) => void
     347#
     348sub rename_db_file_to {
     349    my $self = shift(@_);
     350    my ($srcpath, $destpath) = @_;
     351
     352    # rename basic db file
     353    &FileUtils::moveFiles($srcpath, $destpath);
     354
     355    # subclass should rename any additional files that the specific dbtype creates
     356}
     357## rename_db_file_to(string, string) => void ##
     358
     359## @function remove_db_file(string) => void
     360#
     361sub remove_db_file {
     362    my $self = shift(@_);
     363    my ($db_filepath) = @_;
     364   
     365    # remove basic db file
     366    &FileUtils::removeFiles($db_filepath);
     367
     368    # subclass must rename any additional files that the specific dbtype creates (e.g. transaction log files)
     369}
     370## remove_db_file(string, string) => void ##
     371
     372
    346373## @function supportsDatestamp(void) => integer
    347374#
  • main/trunk/greenstone2/perllib/DBDrivers/GDBM.pm

    r30370 r31188  
    7070# Handled by BaseDBDriver
    7171# sub get_infodb_file_path(string, string) => string
     72# sub rename_db_file_to(string, string) => void
     73# sub remove_db_file(string) => void
    7274
    7375# Handled by 70HyphenFormat
  • main/trunk/greenstone2/perllib/DBDrivers/JDBM.pm

    r30517 r31188  
    8383# -----------------------------------------------------------------------------
    8484
    85 # When DBUtil::* is properly structured with inheritence, then
     85# When DBUtil::* is properly structured with inheritance, then
    8686# much of this code (along with GDBM and GDBM-TXT-GZ) can be grouped into
    8787# a shared base class.  Really it is only the the command that needs to
     
    9191# sub get_infodb_file_path {}
    9292
    93 # Handles by 70HyphenFormat
     93# Handled by 70HyphenFormat
    9494# sub open_infodb_write_handle(string, string?) => filehandle
    9595# sub close_infodb_write_handle(filehandle) => void
Note: See TracChangeset for help on using the changeset viewer.