Commit 928c8fba authored by Robert Ricci's avatar Robert Ricci
Browse files

Add a new table, node_auxtypes - this table contains additional types

that should be associated with a node when it is put into the ptop
file.
parent 5676012c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
-- --
-- Host: localhost Database: tbdb -- Host: localhost Database: tbdb
--------------------------------------------------------- ---------------------------------------------------------
-- Server version 3.23.54-log -- Server version 3.23.52-log
-- --
-- Table structure for table 'cdroms' -- Table structure for table 'cdroms'
...@@ -656,6 +656,17 @@ CREATE TABLE node_activity ( ...@@ -656,6 +656,17 @@ CREATE TABLE node_activity (
PRIMARY KEY (node_id) PRIMARY KEY (node_id)
) TYPE=MyISAM; ) TYPE=MyISAM;
--
-- Table structure for table 'node_auxtypes'
--
CREATE TABLE node_auxtypes (
node_id varchar(10) NOT NULL default '',
type varchar(30) NOT NULL default '',
count int(11) default '1',
PRIMARY KEY (node_id,type)
) TYPE=MyISAM;
-- --
-- Table structure for table 'node_idlestats' -- Table structure for table 'node_idlestats'
-- --
......
...@@ -919,3 +919,8 @@ last_net_act,last_cpu_act,last_ext_act); ...@@ -919,3 +919,8 @@ last_net_act,last_cpu_act,last_ext_act);
alter table users add notes text after wideareajailroot; alter table users add notes text after wideareajailroot;
1.178: Add a table to contain auxiliary types for nodes.
create table node_auxtypes (node_id varchar(10) not null, type \
varchar(30) not null, count int default 1, primary \
key(node_id,type));
...@@ -114,6 +114,17 @@ while (my ($type, $feature, $weight) = $result->fetchrow()) { ...@@ -114,6 +114,17 @@ while (my ($type, $feature, $weight) = $result->fetchrow()) {
$features{$type} .= " $feature:$weight"; $features{$type} .= " $feature:$weight";
} }
#
# Read in the node_auxtypes table for each node.
#
$result = DBQueryFatal("select node_id, type, count from node_auxtypes");
while (my ($node_id, $type, $count) = $result->fetchrow()) {
if (! defined($auxtypes{$node_id})) {
$auxtypes{$node_id} = ["$type:$count"];
next;
}
push @{$auxtypes{$type}}, " $type:$count";
}
# #
# Read the permission table if given a pid. If there is an entry in # Read the permission table if given a pid. If there is an entry in
# the table for a type/class, then permission is granted only if there # the table for a type/class, then permission is granted only if there
...@@ -239,6 +250,13 @@ foreach $node (keys(%nodes)) { ...@@ -239,6 +250,13 @@ foreach $node (keys(%nodes)) {
push @types, "sim:100000"; push @types, "sim:100000";
} }
#
# Add any auxiliary types
#
if ($auxtypes{$node}) {
push @types, @{$auxtypes{$node}};
}
if ($virtstuff && $virtnode_capacity > 0) { if ($virtstuff && $virtnode_capacity > 0) {
# #
# Ditto for jailed nodes # Ditto for jailed nodes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment