-Speed up nodels at scale

-Have nodels report multiple equally valid records for a node when encountered


git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1898 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-07-18 19:25:15 +00:00
parent aa9fdc389f
commit 68671563d7

View File

@ -847,25 +847,34 @@ sub nodels
#print Dumper($tables{$tab});
my $node;
my %labels;
foreach (@{$tables{$tab}})
{
push @cols, $_->[0];
$labels{$_->[0]} = $_->[1];
}
my $removenodecol=1;
if (grep /^node$/,@cols) {
$removenodecol=0;
}
my $rechash=$tabh->getNodesAttribs($nodes,\@cols);
foreach $node (@$nodes)
{
my @cols;
my %labels;
foreach (@{$tables{$tab}})
{
push @cols, $_->[0];
$labels{$_->[0]} = $_->[1];
}
my $rec = $tabh->getNodeAttribs($node, \@cols);
foreach (keys %$rec)
{
my %datseg;
unless ($terse > 0) {
$datseg{data}->[0]->{desc} = [$labels{$_}];
my $recs = $rechash->{$node}; #$tabh->getNodeAttribs($node, \@cols);
foreach my $rec (@$recs) {
foreach (keys %$rec)
{
if ($_ eq "node" and $removenodecol) { next; }
my %datseg;
unless ($terse > 0) {
$datseg{data}->[0]->{desc} = [$labels{$_}];
}
$datseg{data}->[0]->{contents} = [$rec->{$_}];
$datseg{name} = [$node]; #{}->{contents} = [$rec->{$_}];
push @{$noderecs{$node}}, \%datseg;
}
$datseg{data}->[0]->{contents} = [$rec->{$_}];
$datseg{name} = [$node]; #{}->{contents} = [$rec->{$_}];
push @{$noderecs{$node}}, \%datseg;
}
}