Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
c7f7d003
Commit
c7f7d003
authored
Dec 07, 2010
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add wideare_nodeinfo to tables that are cached.
parent
27d6f3c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
1 deletion
+35
-1
db/Node.pm.in
db/Node.pm.in
+35
-1
No files found.
db/Node.pm.in
View file @
c7f7d003
...
...
@@ -135,6 +135,7 @@ sub Lookup($$)
$
self
->{
"TYPEINFO"
}
=
undef
;
$
self
->{
"ATTRS"
}
=
undef
;
$
self
->{
"IFACES"
}
=
undef
;
$
self
->{
"WAROW"
}
=
undef
;
$
self
->{
"HASH"
}
=
{};
bless
($
self
,
$
class
);
...
...
@@ -153,6 +154,7 @@ sub DESTROY {
$
self
->{
"ATTRS"
}
=
undef
;
$
self
->{
"IFACES"
}
=
undef
;
$
self
->{
"HASH"
}
=
undef
;
$
self
->{
"WAROW"
}
=
undef
;
}
#
...
...
@@ -191,6 +193,7 @@ sub MakeFake($$$$)
$
self
->{
"TYPEINFO"
}
=
undef
;
$
self
->{
"ATTRS"
}
=
undef
;
$
self
->{
"IFACES"
}
=
undef
;
$
self
->{
"WAROW"
}
=
undef
;
$
self
->{
"HASH"
}
=
{};
bless
($
self
,
$
class
);
...
...
@@ -236,6 +239,7 @@ sub BulkLookup($$$)
$
node
->{
"TYPEINFO"
}
=
undef
;
$
node
->{
"ATTRS"
}
=
undef
;
$
node
->{
"IFACES"
}
=
undef
;
$
self
->{
"WAROW"
}
=
undef
;
$
node
->{
"HASH"
}
=
{};
$
nodelist
{$
nodeid
}
=
$
node
;
...
...
@@ -540,6 +544,7 @@ sub Refresh($)
$
self
->{
"TYPEINFO"
}
=
undef
;
$
self
->{
"ATTRS"
}
=
undef
;
$
self
->{
"IFACES"
}
=
undef
;
$
self
->{
"WAROW"
}
=
undef
;
return
0
;
}
...
...
@@ -559,6 +564,33 @@ sub FlushAll($)
%
nodes
=
();
}
#
#
Convenience
access
method
for
widearea
info
#
sub
WideAreaInfo
($$)
{
my
($
self
,
$
slot
)
=
@
_
;
my
$
node_id
=
$
self
->
node_id
();
if
(
!defined($self->{'WAROW'})) {
my
$
query_result
=
DBQueryWarn
(
"select * from widearea_nodeinfo "
.
"where node_id='$node_id'"
);
if
(
!$query_result || !$query_result->numrows) {
print
STDERR
"*** $node_id is not a widearea node
\n
"
;
return
undef
;
}
$
self
->{
'WAROW'
}
=
$
query_result
->
fetchrow_hashref
();
}
if
(
!exists($self->{'WAROW'}->{$slot})) {
print
STDERR
"*** Nonexistent slot '$slot' request for widearea node $node_id
\n
"
;
return
undef
;
}
return
$
self
->{
'WAROW'
}->{$
slot
};
}
#
#
Check
permissions
.
Allow
for
either
uid
or
a
user
ref
until
all
code
#
updated
.
...
...
@@ -772,7 +804,7 @@ sub SetAllocState($$)
my $now = time();
my $node_id = $self->node_id();
DBQueryWarn("update nodes set allocstate='
$
state
', " .
" allocstate_timestamp=$now where node_id='
$
node_id
'")
or return -1;
...
...
@@ -1177,6 +1209,8 @@ sub external_resource_index($) {
return L__reservation($_[0], '
external_resource_index
'); }
sub external_resource_id($) {
return L__reservation($_[0], '
external_resource_id
'); }
sub external_resource_key($) {
return L__reservation($_[0], '
external_resource_key
'); }
sub inner_elab_role($) {
return L__reservation($_[0], '
inner_elab_role
'); }
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment