Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
4528e30c
Commit
4528e30c
authored
Sep 19, 2006
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small bug fixes.
parent
a17b24d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
db/Experiment.pm.in
db/Experiment.pm.in
+9
-4
No files found.
db/Experiment.pm.in
View file @
4528e30c
...
...
@@ -98,6 +98,7 @@ sub Lookup($$$)
}
#
accessors
sub
field
($$)
{
return
((
! ref($_[0])) ? -1 : $_[0]->{'EXPT'}->{$_[1]}); }
sub
stats
($$)
{
return
((
! ref($_[0])) ? -1 : $_[0]->{'STATS'}->{$_[1]}); }
sub
pid
($)
{
return
field
($
_
[
0
],
'pid'
);
}
sub
gid
($)
{
return
field
($
_
[
0
],
'gid'
);
}
...
...
@@ -107,7 +108,7 @@ sub path($) { return field($_[0], 'path'); }
sub
state
($)
{
return
field
($
_
[
0
],
'state'
);
}
sub
batchstate
($)
{
return
field
($
_
[
0
],
'batchstate'
);
}
sub
batchmode
($)
{
return
field
($
_
[
0
],
'batchmode'
);
}
sub
rsrcidx
($)
{
return
field
($
_
[
0
],
'rsrcidx'
);
}
sub
rsrcidx
($)
{
return
stats
($
_
[
0
],
'rsrcidx'
);
}
sub
creator
($)
{
return
field
($
_
[
0
],
'expt_head_uid'
);}
sub
canceled
($)
{
return
field
($
_
[
0
],
'canceled'
);
}
sub
locked
($)
{
return
field
($
_
[
0
],
'expt_locked'
);
}
...
...
@@ -125,6 +126,7 @@ sub autoswap_timeout($) { return field($_[0], 'autoswap_timeout');}
sub
prerender_pid
($)
{
return
field
($
_
[
0
],
'prerender_pid'
);}
sub
dpdb
($)
{
return
field
($
_
[
0
],
'dpdb'
);}
sub
dpdbname
($)
{
return
field
($
_
[
0
],
'dpdbname'
);}
sub
instance_idx
($)
{
return
field
($
_
[
0
],
'instance_idx'
);
}
#
#
Lookup
an
experiment
given
an
experiment
index
.
...
...
@@ -188,6 +190,7 @@ sub Create($$$$)
{
my
($
class
,
$
pid
,
$
eid
,
$
argref
)
=
@
_
;
my
$
exptidx
;
my
$
now
=
time
();
return
undef
if
(
ref
($
class
));
...
...
@@ -303,7 +306,8 @@ sub Create($$$$)
join
(
","
,
map
(
"$_='"
.
$
argref
->{$
_
}
.
"'"
,
keys
(%{$
argref
})));
#
Append
the
rest
$
query
.=
",expt_created=now(),expt_locked=now(),pid='$pid',eid='$eid'"
;
$
query
.=
",expt_created=FROM_UNIXTIME('$now')"
;
$
query
.=
",expt_locked=now(),pid='$pid',eid='$eid'"
;
$
query
.=
",expt_name=$description"
;
$
query
.=
",noswap_reason=$noswap_reason"
;
$
query
.=
",noidleswap_reason=$noidleswap_reason"
;
...
...
@@ -320,7 +324,7 @@ sub Create($$$$)
#
$
query_result
=
DBQueryWarn
(
"insert into experiment_resources (tstamp, exptidx) "
.
"values (now
(
), $exptidx)"
);
"values (
FROM_UNIXTIME('$
now
'
), $exptidx)"
);
if
(
!$query_result) {
DBQueryWarn
(
"delete from experiments where pid='$pid' and eid='$eid'"
);
...
...
@@ -339,7 +343,8 @@ sub Create($$$$)
if
(
! DBQueryWarn("insert into experiment_stats ".
"(eid, pid, creator, gid, created, "
.
" batch, exptidx, rsrcidx) "
.
"values('$eid', '$pid', '$creator', '$gid', now(), "
.
"values('$eid', '$pid', '$creator', '$gid', "
.
"FROM_UNIXTIME('$now'), "
.
"$batchmode, $exptidx, $rsrcidx)"
))
{
DBQueryWarn
(
"delete from experiments where pid='$pid' and eid='$eid'"
);
DBQueryWarn
(
"delete from experiment_resources where idx=$rsrcidx"
);
...
...
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