Changeset 16959

Show
Ignore:
Timestamp:
21.08.2008 16:54:55 (11 years ago)
Author:
mdewsnip
Message:

Removed the "oid_to_clids" crap that was allegedly added for incremental building, as it is never used. As well as wasting time during the classifier output, this can use up a substantial amount of memory if the collection is large or the classifiers are done at section level. With dynamic classifiers a key component of true incremental building there will be no requirement for this information tobe stored.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/classify.pm

    r15725 r16959  
    4141} 
    4242 
    43  
    44 my $oid_to_clids = {}; 
    4543 
    4644sub load_classifier_for_info { 
     
    364362    $first = 0; 
    365363     
    366     if (defined ($tempinfo->{'classifyOID'})) { 
    367         if ($tempinfo->{'classifyOID'} ne "oai") { 
     364    if (defined ($tempinfo->{'classifyOID'})) 
     365    { 
     366        if ($tempinfo->{'classifyOID'} ne "oai") 
     367        { 
    368368        $contains_text .= $tempinfo->{'classifyOID'}; 
    369369        } 
    370370 
    371             # Extra code for incremental building. 
    372             # We need to store a listing of the classifiers each DOI is in 
    373             my $clids = []; 
    374             #rint STDERR "==1. Recording reverse lookup for " . $tempinfo->{'classifyOID'} . "==\n"; 
    375             if(defined($oid_to_clids->{$tempinfo->{'classifyOID'}})) { 
    376               #rint STDERR "Found existing array!\n"; 
    377               $clids = $oid_to_clids->{$tempinfo->{'classifyOID'}}; 
    378             } 
    379             #rint STDERR "Appended $OID to \"" . join(";", @{$clids}) . "\"\n"; 
    380             push(@{$clids}, $OID); 
    381             $oid_to_clids->{$tempinfo->{'classifyOID'}} = $clids; 
    382             #rint STDERR "Result: \"" . join(";", @{$clids}) . "\"\n"; 
    383              
    384371        &print_classify_info ($infodb_type, $infodb_handle, $tempinfo, $tempinfo->{'classifyOID'}, 
    385372                  $remove_empty_classifications); 
    386     } elsif (defined ($tempinfo->{'OID'})) { 
     373    } 
     374    elsif (defined ($tempinfo->{'OID'})) 
     375    { 
    387376        $contains_text .= $tempinfo->{'OID'}; 
    388377        $mdoffset_text .= $tempinfo->{'offset'} if (defined ($tempinfo->{'offset'})); 
    389  
    390              
    391               # note: we don't want to print the contents of the books 
    392               # Extra code for incremental building. 
    393               # We need to store a listing of the classifiers each DOI is in 
    394               my $clids = []; 
    395               #rint STDERR "==2. Recording reverse lookup for " . $tempinfo->{'OID'} . "==\n"; 
    396               if(defined($oid_to_clids->{$tempinfo->{'OID'}})) { 
    397                 #rint STDERR "Found existing array!\n"; 
    398                 $clids = $oid_to_clids->{$tempinfo->{'OID'}}; 
    399               } 
    400               #rint STDERR "Appended $OID to \"" . join(";", @{$clids}) . "\"\n"; 
    401               push(@{$clids}, $OID); 
    402               $oid_to_clids->{$tempinfo->{'OID'}} = $clids; 
    403               #rint STDERR "Result: \"" . join(";", @{$clids}) . "\"\n"; 
    404  
    405  
    406         } else { 
    407          
    408         # Supress having top-level node in Collage classifier 
    409         # so no bookshelf icon appears, top-level, along with the 
    410         # applet 
    411          
    412         if (!defined ($tempinfo->{'Title'}) || $tempinfo->{'Title'} ne "Collage") { 
    413             $contains_text .= "\".$next_subOID";  
    414         } 
    415  
    416                 # Extra code for incremental building. 
    417                 # We need to store a listing of the classifiers each DOI is in 
    418                 my $clids = []; 
    419                 #rint STDERR "==3. Recording reverse lookup for $OID.$next_subOID==\n"; 
    420                 if(defined($oid_to_clids->{$OID . "." . $next_subOID})) { 
    421                   #rint STDERR "Found existing array!\n"; 
    422                   $clids = $oid_to_clids->{$OID . "." . $next_subOID}; 
    423                 } 
    424                 #rint STDERR "Appended $OID to \"" . join(";", @{$clids}) . "\"\n"; 
    425                 push(@{$clids}, $OID); 
    426                 $oid_to_clids->{$OID . "." . $next_subOID} = $clids; 
    427                 #rint STDERR "Result: \"" . join(";", @{$clids}) . "\"\n"; 
    428          
    429         &print_classify_info ($infodb_type, $infodb_handle, $tempinfo, "$OID.$next_subOID", 
    430                       $remove_empty_classifications); 
    431         $next_subOID++; 
     378    } 
     379    else 
     380    { 
     381        # Supress having top-level node in Collage classifier 
     382        # so no bookshelf icon appears, top-level, along with the 
     383        # applet 
     384        if (!defined ($tempinfo->{'Title'}) || $tempinfo->{'Title'} ne "Collage") 
     385        { 
     386        $contains_text .= "\".$next_subOID";  
    432387        } 
     388 
     389        &print_classify_info ($infodb_type, $infodb_handle, $tempinfo, "$OID.$next_subOID", 
     390                  $remove_empty_classifications); 
     391        $next_subOID++; 
     392    } 
    433393    } 
    434394