Changeset 28654


Ignore:
Timestamp:
11/20/13 13:00:09 (7 years ago)
Author:
jmt12
Message:

Removed recordEarliestDatestamp() function as that no lurks in the dynamically loaded infodb drivers (this is to allow the xmlstdout infodb driver needed for full Hadoop support)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs2-extensions/parallel-building/trunk/src/perllib/parallelbuildinginexport.pm

    r28001 r28654  
    312312
    313313
    314 ## @function recordEarliestDatestamp()
    315 #
    316 # Check for existence of the file that's to contain earliestDateStamp in
    317 # archivesdir Do nothing if the file already exists (file exists on incremental
    318 # build).  If the file doesn't exist, as happens on full build, create it and
    319 # write out the current datestamp into it In buildcol, read the file's contents
    320 # and set the earliestdateStamp in GS2's build.cfg / GS3's buildconfig.xml In
    321 # doc.pm have set_oaiLastModified similar to set_lastmodified, and create the
    322 # doc fields oailastmodified and oailastmodifieddate
    323 #
    324 sub recordEarliestDatestamp
    325 {
    326   my $self = shift(@_);
    327   my ($infodbtype, $archivedir) = @_;
    328   my $current_time_in_seconds = time; # in seconds
    329   # We use the infodb to store this information if it supports it
    330   if (defined(&dbutil::supportsDatestamp) && &dbutil::supportsDatestamp($infodbtype))
    331   {
    332     my $datestamp_db = &dbutil::get_infodb_file_path($infodbtype, 'datestamp', $archivedir);
    333     my $datestamp_db_fh = &dbutil::open_infodb_write_handle($infodbtype, $datestamp_db, 'append');
    334     &dbutil::write_infodb_rawentry($infodbtype, $datestamp_db_fh, 'earliest', $current_time_in_seconds);
    335     &dbutil::close_infodb_write_handle($infodbtype, $datestamp_db_fh);
    336   }
    337   else
    338   {
    339     my $earliestDatestampFile = &FileUtils::filenameConcatenate($archivedir, "earliestDatestamp");
    340     if (!&FileUtils::fileExists($earliestDatestampFile) && &FileUtils::directoryExists($archivedir))
    341     {
    342       my $datestamp_fh;
    343       if(&FileUtils::openFileHandle($earliestDatestampFile, 'w', \$datestamp_fh))
    344       {
    345         print $datestamp_fh $current_time_in_seconds;
    346         &FileUtils::closeFileHandle($earliestDatestampFile, \$datestamp_fh);
    347       }
    348       else
    349       {
    350         &gsprintf(STDERR, "{import.cannot_write_earliestdatestamp}\n", $earliestDatestampFile);
    351       }
    352     }
    353   }
    354 }
    355 ## recordEarliestDatestamp() ##
    356 
    3573141;
Note: See TracChangeset for help on using the changeset viewer.