[LON-CAPA-cvs] cvs: loncom(store_expirement) / lond

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 09 Feb 2006 20:23:29 -0000


albertel		Thu Feb  9 15:23:29 2006 EDT

  Modified files:              (Branch: store_expirement)
    /loncom	lond 
  Log:
  - an expiremental change to lond to reduce space consumed by store/restore hashes
  
  
Index: loncom/lond
diff -u loncom/lond:1.318 loncom/lond:1.318.2.1
--- loncom/lond:1.318	Tue Feb  7 11:20:39 2006
+++ loncom/lond	Thu Feb  9 15:23:28 2006
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.318 2006/02/07 16:20:39 albertel Exp $
+# $Id: lond,v 1.318.2.1 2006/02/09 20:23:28 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -61,7 +61,7 @@
 my $lastlog='';
 my $lond_max_wait_time = 13;
 
-my $VERSION='$Revision: 1.318 $'; #' stupid emacs
+my $VERSION='$Revision: 1.318.2.1 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -3068,10 +3068,11 @@
 	    my $version=$hashref->{"version:$rid"};
 	    my $allkeys=''; 
 	    foreach my $pair (@pairs) {
-		my ($key,$value)=split(/=/,$pair);
+		my ($key)=split(/=/,$pair);
 		$allkeys.=$key.':';
-		$hashref->{"$version:$rid:$key"}=$value;
 	    }
+	    $hashref->{"$version:$rid"}=$what;
+
 	    $hashref->{"$version:$rid:timestamp"}=$now;
 	    $allkeys.='timestamp';
 	    $hashref->{"$version:keys:$rid"}=$allkeys;
@@ -3138,9 +3139,17 @@
 	    my @keys=split(/:/,$vkeys);
 	    my $key;
 	    $qresult.="$scope:keys=$vkeys&";
-	    foreach $key (@keys) {
-		$qresult.="$scope:$key=".$hashref->{"$scope:$rid:$key"}."&";
-	    }                                  
+	    if (exists($hashref->{"$scope:$rid"})) {
+		my $what=$hashref->{"$scope:$rid"};
+		foreach my $pair (split(/\&/,$hashref->{"$scope:$rid"})) {
+		    my ($key,$value)=split(/=/,$pair);
+		    $qresult.="$scope:".$pair."&";
+		}
+	    } else {
+		foreach $key (@keys) {
+		    $qresult.="$scope:$key=".$hashref->{"$scope:$rid:$key"}."&";
+		}
+	    }
 	}
 	if (&untie_user_hash($hashref)) {
 	    $qresult=~s/\&$//;