[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at dev.open-bio.org
Tue Apr 15 00:26:29 UTC 2008


mwilkinson
Mon Apr 14 20:26:29 EDT 2008
Update of /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY
In directory dev.open-bio.org:/tmp/cvs-serv30446

Modified Files:
	Config.pm 
Log Message:
trying to reduce number of file accesses to read the config file.  Should speed-up MOBY considerably
moby-live/Perl/MOBY-Server/lib/MOBY Config.pm,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Config.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Config.pm	2008/04/11 23:35:34	1.3
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Config.pm	2008/04/15 00:26:29	1.4
@@ -45,21 +45,45 @@
 @EXPORT = ('$CONFIG');
 {
 
-	#Encapsulated class data
-	#___________________________________________________________
-	#ATTRIBUTES
 	my %_attr_data =    #         DEFAULT    	ACCESSIBILITY
 	  (
-		mobycentral      => [ {}, 'read/write' ],
-		mobyobject       => [ {}, 'read/write' ],
-		mobynamespace    => [ {}, 'read/write' ],
-		mobyservice      => [ {}, 'read/write' ],
-		mobyrelationship => [ {}, 'read/write' ],
+		mobycentral      => [ undef, 'read/write' ],
+		mobyobject       => [ undef, 'read/write' ],
+		mobynamespace    => [ undef, 'read/write' ],
+		mobyservice      => [ undef, 'read/write' ],
+		mobyrelationship => [ undef, 'read/write' ],
 		valid_secondary_datatypes => [["String", "Integer", "DateTime", "Float", "Boolean"],  'read'],
 		primitive_datatypes => [["String", "Integer", "DateTime", "Float", "Boolean"], 'read'],
 
 	  );
 
+	my $file = $ENV{MOBY_CENTRAL_CONFIG};
+	( -e $file ) || die "MOBY Configuration file $file doesn't exist $!\n";
+	chomp $file;
+	if ( ( -e $file ) && ( !( -d $file ) ) ) {
+	    open IN, $file
+		or die
+		"can't open MOBY Configuration file $file for unknown reasons: $!\n";
+	}
+	my @sections = split /(\[\s*\S+\s*\][^\[]*)/s, join "", <IN>;
+
+	#print STDERR "split into @sections\n";
+	foreach my $section (@sections) {
+
+		#print STDERR "calling MOBY::dbConfig\n";
+		my $dbConfig =
+		  MOBY::dbConfig->new( section => $section )
+		  ; # this is an object full of strings, no actual connections.  It represents the information in the config file
+		next unless $dbConfig;
+		my $dbname = $dbConfig->section_title;
+		next unless $dbname;
+		$_attr_data{$dbname} = [$dbConfig, 'read'];  # something like $_attr_data{mobycentral} = [$config, 'read']
+	}
+
+	#Encapsulated class data
+	#___________________________________________________________
+	#ATTRIBUTES
+
 	#_____________________________________________________________
 	# METHODS, to operate on encapsulated class data
 	# Is a specified object attribute accessible in a given mode
@@ -99,31 +123,8 @@
 			$self->{$attrname} = $self->_default_for($attrname);
 		}
 	}
-	return $self if $self->mobycentral->{'dbname'};  # if it has been set, then just return it
-	my $file = $ENV{MOBY_CENTRAL_CONFIG};
-	( -e $file ) || die "MOBY Configuration file $file doesn't exist $!\n";
-	chomp $file;
-	if ( ( -e $file ) && ( !( -d $file ) ) ) {
-	    open IN, $file
-		or die
-		"can't open MOBY Configuration file $file for unknown reasons: $!\n";
-	}
-	my @sections = split /(\[\s*\S+\s*\][^\[]*)/s, join "", <IN>;
-
-	#print STDERR "split into @sections\n";
-	foreach my $section (@sections) {
-
-		#print STDERR "calling MOBY::dbConfig\n";
-		my $dbConfig =
-		  MOBY::dbConfig->new( section => $section )
-		  ; # this is an object full of strings, no actual connections.  It represents the information in the config file
-		next unless $dbConfig;
-		my $dbname = $dbConfig->section_title;
-		next unless $dbname;
-
+#	return $self if $self->mobycentral->{'dbname'};  # if it has been set, then just return it
 #print STDERR "setting the COnfig dbConfig for the title $dbname with object $dbConfig\n\n";
-		$self->{$dbname} = $dbConfig;
-	}
 	$CONFIG = $self;
 	return $self;
 }




More information about the MOBY-guts mailing list