Changeset 65
- Timestamp:
- 08/12/04 22:01:22 (4 years ago)
- Files:
-
- trunk/devnotes/sql-data-simple.txt (modified) (1 diff)
- trunk/server/mogilefsd (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/devnotes/sql-data-simple.txt
r14 r65 1 INSERT INTO host SET hostid=1, status='alive', hostname='localhost , hostip='127.0.0.1', remoteroot='/var/mogilefs';1 INSERT INTO host SET hostid=1, status='alive', hostname='localhost', hostip='127.0.0.1', remoteroot='/var/mogilefs'; 2 2 3 3 INSERT INTO device SET devid=1, hostid=1, status='alive'; trunk/server/mogilefsd
r62 r65 538 538 my $dbh = get_dbh() or return 0; 539 539 540 Mgd::check_host_cache(); 541 my $host_ct = keys %Mgd::cache_host; 542 540 543 # find the classes for each domainid (including domains without explict classes) 541 544 my %min; # dmid -> classid -> mindevcount … … 548 551 # classid may be NULL (undef), in which case there are no classes defined 549 552 # and we don't note the mindevcount (yet) 550 $min{$dmid}{$classid} = int($ mct) if defined $classid;553 $min{$dmid}{$classid} = int($host_ct < $mct ? $host_ct : $mct) if defined $classid; 551 554 } 552 555 … … 555 558 # each domain's classid=0, if not defined, has an implied mindevcount of 2, 556 559 # which most people will probably use. 557 $min{$dmid}{0} = 2 unless exists $min{$dmid}{0};560 $min{$dmid}{0} = $host_ct < 2 ? $host_ct : 2 unless exists $min{$dmid}{0}; 558 561 559 562 # iterate through each class, including the implicit class 0
