Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
29290692
Commit
29290692
authored
Sep 03, 2010
by
Leo Gordon
Browse files
added analysis_id column to job_message table - it is much more convenient that way
parent
5d6af542
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
3 deletions
+12
-3
modules/Bio/EnsEMBL/Hive/DBSQL/JobMessageAdaptor.pm
modules/Bio/EnsEMBL/Hive/DBSQL/JobMessageAdaptor.pm
+3
-3
sql/patch_2010-09-03.sql
sql/patch_2010-09-03.sql
+7
-0
sql/tables.sql
sql/tables.sql
+2
-0
No files found.
modules/Bio/EnsEMBL/Hive/DBSQL/JobMessageAdaptor.pm
View file @
29290692
...
...
@@ -32,9 +32,9 @@ sub register_message {
# (the timestamp 'moment' column will be set automatically)
my
$sql
=
qq{
REPLACE INTO job_message (analysis_job_id, worker_id, retry_count, status, msg, is_error)
SELECT analysis_job_id, worker_id, retry_count, status, ?, ?
FROM analysis_job WHERE analysis_job_id=?
REPLACE INTO job_message (analysis_job_id, worker_id,
analysis_id,
retry_count, status, msg, is_error)
SELECT analysis_job_id, worker_id,
analysis_id,
retry_count, status, ?, ?
FROM analysis_job WHERE analysis_job_id=?
}
;
my
$sth
=
$self
->
prepare
(
$sql
);
...
...
sql/patch_2010-09-03.sql
0 → 100644
View file @
29290692
##
It
is
indeed
redundant
(
can
be
found
by
joining
),
but
proved
to
be
very
convenient
to
have
:
ALTER
TABLE
job_message
ADD
COLUMN
analysis_id
int
(
10
)
DEFAULT
0
NOT
NULL
AFTER
worker_id
;
UPDATE
job_message
m
,
analysis_job
j
SET
m
.
analysis_id
=
j
.
analysis_id
WHERE
j
.
analysis_job_id
=
m
.
analysis_job_id
;
sql/tables.sql
View file @
29290692
...
...
@@ -157,6 +157,7 @@ CREATE TABLE analysis_job (
-- semantics:
-- analysis_job_id - the id of the job that threw the message
-- worker_id - the worker in charge of the job at the moment
-- analysis_id - analysis_id of both the job and the worker (it is indeed redundant, but very convenient)
-- moment - when the message was thrown
-- retry_count - of the job when the message was thrown
-- status - of the job when the message was thrown
...
...
@@ -166,6 +167,7 @@ CREATE TABLE analysis_job (
CREATE
TABLE
job_message
(
analysis_job_id
int
(
10
)
NOT
NULL
,
worker_id
int
(
10
)
NOT
NULL
,
analysis_id
int
(
10
)
NOT
NULL
,
moment
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
retry_count
int
(
10
)
DEFAULT
0
NOT
NULL
,
status
enum
(
'UNKNOWN'
,
'COMPILATION'
,
'GET_INPUT'
,
'RUN'
,
'WRITE_OUTPUT'
)
DEFAULT
'UNKNOWN'
,
...
...
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