Commit 5015bb99 authored by Jonathon Duerig's avatar Jonathon Duerig

Checkpoint. Local nodes 80% implemented. Features implemented.

Still remaining: widearea nodes, links, osids, single-node mode.
parent d006ea1b
This diff is collapsed.
...@@ -11,19 +11,15 @@ ...@@ -11,19 +11,15 @@
use strict; use strict;
use English; use English;
use Getopt::Std; use Getopt::Std;
use Math::BigInt; #use Math::BigInt;
use List::Util 'shuffle'; #use List::Util 'shuffle';
#use lib "@prefix@/lib"; #use lib "@prefix@/lib";
use lib "/usr/testbed/lib"; use lib "/usr/testbed/lib";
use lib "."; use lib ".";
use libdb; use libdb;
use libadminctrl; #use libadminctrl;
use libptopnew; use libptopnew;
use Experiment;
use Lan;
use Node;
use NodeType;
use GeniXML; use GeniXML;
sub processArgs(); sub processArgs();
...@@ -31,17 +27,15 @@ sub consultDatabase(); ...@@ -31,17 +27,15 @@ sub consultDatabase();
sub process(); sub process();
sub printResults(); sub printResults();
libptopnew::Init();
# #
# Turn off line buffering on output # Turn off line buffering on output
# #
$| = 1; $| = 1;
my $print_xml = 0; my $print_xml = 0;
my $print_format = "CRAPPY";
my $print_ns = $GeniXML::RSPEC_2_NS; my $print_ns = $GeniXML::RSPEC_2_NS;
# Initialize permissions table for the current project
processArgs(); processArgs();
consultDatabase(); consultDatabase();
printResults(); printResults();
...@@ -59,15 +53,29 @@ sub consultDatabase() ...@@ -59,15 +53,29 @@ sub consultDatabase()
while ($row = $dbresult->fetchrow_hashref()) { while ($row = $dbresult->fetchrow_hashref()) {
libptopnew::CreateNode($row); libptopnew::CreateNode($row);
} }
# Bulk lookup on reserved table # Bulk lookup on reserved table
$dbresult = DBQueryFatal("select * from reserved"); $dbresult = DBQueryFatal("select * from reserved");
while ($row = $dbresult->fetchrow_hashref()) { while ($row = $dbresult->fetchrow_hashref()) {
libptopnew::Nodes()->{$row->{"node_id"}}->node()->SetReservedRow($row); libptopnew::Nodes()->{$row->{"node_id"}}->node()->SetReservedRow($row);
} }
# Bulk lookup of permissions table for project
libptopnew::LookupPermissions();
# Bulk lookup of global usage counts for shared nodes
libptopnew::LookupGlobalCounts();
# Bulk lookup of node and node_type auxtypes
libptopnew::LookupAuxtypes();
# Bulk lookup of node and node_type features
libptopnew::LookupFeatures();
# Process each node adding ptypes and features # Process each node adding ptypes and features
foreach my $current (values(%{ libptopnew::Nodes() })) { foreach my $current (values(%{ libptopnew::Nodes() })) {
if ($current->willPrint()) { if ($current->willPrint()) {
$current->processTypeFeatures();
$current->processSwitch(); $current->processSwitch();
$current->processLocal(); $current->processLocal();
$current->processWidearea(); $current->processWidearea();
......
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