5b4ba54a2d
I'm just gonna paste the description Jarrod sent to the group via email: So if getAttribs ever returns more than one result, then getNodeAttribs will have it's output multiplied by that factor. I'll draw out a table with changes Chris started adding while he was also trying to flatten the recursion. Let's say 'n1' is in groups 'g1,g2,g3', and that we request columns 'c1,c2,c3,c4' Let's also assume the primary key is not simply 'node', allowing the node column to contain duplicates (as in switch table). I don't expect anyone to actually construct something this convoluted in practice, but: node |c1 |c2 |c3 |c4 n1 |v1 | | | g2 | |V2+= | | g2 | |v3 |v4 | g3 | |v5 | |v6 g3 | |v7 |v8 |v9 First, we get n1s record: [ { node => 'n1', c1 => 'v1',} ] We see that c2-c4 are still unsatisfiad, then we check g1, see there is no record, so no action takes place, then getAttribs node=>'g2' returns two records. As a result, we clone our results so far and independently populate them: [ { node => 'n1', c1=> 'v1', c2 => 'v2+=' }, { node => 'n1', c1 => 'v1', c2=> 'v3', c3 => 'v4'}, ] Now, in the first record, we are still looking to fill in c3, c4, and we are also still looking at c2 to complete the '+=' operation. In the second record, we only need c4 now, no other columns will be checked for that record. Then we hit g3. We also get two results back (two was easier, but arbitrarily many are possible, btw). Since both records are still looking to be completed, the two become 4 records (if one of the two records were satisfied before this point, the two would have become three instead): [ { node => 'n1', c1=> 'v1', c2 => 'v2v5',c4=>'v6' }, { node => 'n1', c1 => 'v1', c2=> 'v3', c3 => 'v4',c4=>'v6'}, { node => 'n1', c1=> 'v1', c2 => 'v2v7',c3=>v8,c4=>'v9' }, { node => 'n1', c1 => 'v1', c2=> 'v3', c3 => 'v4',c4=>'v9'}, ] And that would be what getNodesAttribs would return in this case. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7131 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd |
||
---|---|---|
.. | ||
data | ||
Client.pm | ||
Common.pm | ||
DBobjUtils.pm | ||
DSHCLI.pm | ||
DSHContext.pm | ||
DSHCore.pm | ||
DSHRemoteShell.pm | ||
ExtTab.pm | ||
FSPboot.pm | ||
FSPcfg.pm | ||
FSPconn.pm | ||
FSPflash.pm | ||
FSPinv.pm | ||
FSPmac.pm | ||
FSPpower.pm | ||
FSPscan.pm | ||
FSPUtils.pm | ||
FSPvitals.pm | ||
GlobalDef.pm | ||
hpoa.pm | ||
InstUtils.pm | ||
MacMap.pm | ||
MsgUtils.pm | ||
NameRange.pm | ||
NetworkUtils.pm | ||
NodeRange.pm | ||
NotifHandler.pm | ||
PPCboot.pm | ||
PPCcfg.pm | ||
PPCcli.pm | ||
PPCconn.pm | ||
PPCdb.pm | ||
PPCenergy.pm | ||
PPCfsp.pm | ||
PPCinv.pm | ||
PPClog.pm | ||
PPCmac.pm | ||
PPCpower.pm | ||
PPCrflash.pm | ||
PPCscan.pm | ||
PPCvitals.pm | ||
PPCvm.pm | ||
RSH.pm | ||
RSYNC.pm | ||
Schema.pm | ||
Scope.pm | ||
SINV.pm | ||
SPD.pm | ||
SSH.pm | ||
Table.pm | ||
Usage.pm | ||
Utils.pm | ||
vboxService.pm | ||
VMCommon.pm | ||
Yum.pm | ||
zvmCPUtils.pm | ||
zvmUtils.pm |