From 6a158c171a5ebd00f3a41c99d292e6f1d73538bc Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 11 Jul 2008 19:12:05 +0000 Subject: [PATCH] -Check in a stub setNodesAttribs. It's as slow as setNodeAttribs, but the intent is to have it speed up with some attention later git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1869 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Table.pm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index 7b898ade1..250c3708b 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -871,6 +871,32 @@ sub setAttribsWhere } +#-------------------------------------------------------------------------- +=head3 setNodesAttribs + + Description: Unconditionally assigns the requested values to tables for a list of nodes + + Arguments: + 'self' (implicit in OO style call) + Reference to a list of nodes (no noderanges, just nodes) + A hash of attributes to set, like in 'setNodeAttribs' + + Returns: +=cut +#-------------------------------------------------------------------------- +sub setNodesAttribs { +#This is currently a stub to be filled out with at scale enhancements. It will be a touch more complex than getNodesAttribs, due to the notification +#The three steps should be: +#-Query table and divide nodes into list to update and list to insert +#-Update intelligently with respect to scale +#-Insert intelligently with respect to scale +#Intelligently in this case means folding them to some degree. Update where clauses will be longer, but must be capped to avoid exceeding SQL statement length restrictions on some DBs. Restricting even all the way down to 256 could provide better than an order of magnitude better performance though + my $self = shift; + my $nodelist = shift + foreach (@$nodelist) { + $self->setNodeAttribs($_,@_); + } +} #--------------------------------------------------------------------------