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
7a293d7e
Commit
7a293d7e
authored
Nov 29, 2012
by
Leo Gordon
Browse files
renamed 'job_message' table to 'log_message' and JobMessageAdaptor to LogMessageAdaptor everywhere
parent
2a3982de
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
57 additions
and
30 deletions
+57
-30
modules/Bio/EnsEMBL/Hive/AnalysisJob.pm
modules/Bio/EnsEMBL/Hive/AnalysisJob.pm
+2
-2
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm
+1
-1
modules/Bio/EnsEMBL/Hive/DBSQL/DBAdaptor.pm
modules/Bio/EnsEMBL/Hive/DBSQL/DBAdaptor.pm
+1
-1
modules/Bio/EnsEMBL/Hive/DBSQL/LogMessageAdaptor.pm
modules/Bio/EnsEMBL/Hive/DBSQL/LogMessageAdaptor.pm
+5
-5
modules/Bio/EnsEMBL/Hive/RunnableDB/DatabaseDumper.pm
modules/Bio/EnsEMBL/Hive/RunnableDB/DatabaseDumper.pm
+1
-1
modules/Bio/EnsEMBL/Hive/RunnableDB/LongMult/Start.pm
modules/Bio/EnsEMBL/Hive/RunnableDB/LongMult/Start.pm
+1
-1
modules/Bio/EnsEMBL/Hive/Worker.pm
modules/Bio/EnsEMBL/Hive/Worker.pm
+3
-3
sql/foreign_keys.mysql
sql/foreign_keys.mysql
+2
-2
sql/patch_2012-11-29.sql
sql/patch_2012-11-29.sql
+27
-0
sql/procedures.mysql
sql/procedures.mysql
+2
-2
sql/procedures.sqlite
sql/procedures.sqlite
+1
-1
sql/tables.sql
sql/tables.sql
+5
-5
sql/tables.sqlite
sql/tables.sqlite
+6
-6
No files found.
modules/Bio/EnsEMBL/Hive/AnalysisJob.pm
View file @
7a293d7e
...
...
@@ -212,7 +212,7 @@ sub incomplete { # Job should set this to 0 prior to throwing if the
=head2 warning
Description: records a non-error message in '
job
_message' table linked to the current job
Description: records a non-error message in '
log
_message' table linked to the current job
=cut
...
...
@@ -220,7 +220,7 @@ sub warning {
my
(
$self
,
$msg
)
=
@_
;
if
(
my
$job_adaptor
=
$self
->
adaptor
)
{
$job_adaptor
->
db
->
get_
Job
MessageAdaptor
()
->
store_job_message
(
$self
->
dbID
,
$msg
,
0
);
$job_adaptor
->
db
->
get_
Log
MessageAdaptor
()
->
store_job_message
(
$self
->
dbID
,
$msg
,
0
);
}
else
{
print
STDERR
"
Warning:
$msg
\n
";
}
...
...
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm
View file @
7a293d7e
...
...
@@ -622,7 +622,7 @@ sub release_undone_jobs_from_worker {
}
}
$self
->
db
()
->
get_
Job
MessageAdaptor
()
->
store_job_message
(
$job_id
,
$msg
,
not
$passed_on
);
$self
->
db
()
->
get_
Log
MessageAdaptor
()
->
store_job_message
(
$job_id
,
$msg
,
not
$passed_on
);
unless
(
$passed_on
)
{
$self
->
release_and_age_job
(
$job_id
,
$max_retry_count
,
not
$resource_overusage
);
...
...
modules/Bio/EnsEMBL/Hive/DBSQL/DBAdaptor.pm
View file @
7a293d7e
...
...
@@ -63,7 +63,7 @@ sub get_available_adaptors {
'
DataflowRule
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::DataflowRuleAdaptor
',
'
ResourceDescription
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::ResourceDescriptionAdaptor
',
'
ResourceClass
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::ResourceClassAdaptor
',
'
Job
Message
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::
Job
MessageAdaptor
',
'
Log
Message
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::
Log
MessageAdaptor
',
'
NakedTable
'
=>
'
Bio::EnsEMBL::Hive::DBSQL::NakedTableAdaptor
',
# "old" Hive adaptors (having their own fetching/storing code) :
...
...
modules/Bio/EnsEMBL/Hive/DBSQL/
Job
MessageAdaptor.pm
→
modules/Bio/EnsEMBL/Hive/DBSQL/
Log
MessageAdaptor.pm
View file @
7a293d7e
...
...
@@ -2,13 +2,13 @@
=head1 NAME
Bio::EnsEMBL::Hive::DBSQL::
Job
MessageAdaptor
Bio::EnsEMBL::Hive::DBSQL::
Log
MessageAdaptor
=head1 SYNOPSIS
$dba->get_
Job
MessageAdaptor->store_job_message($job_id, $msg, $is_error);
$dba->get_
Log
MessageAdaptor->store_job_message($job_id, $msg, $is_error);
$dba->get_
Job
MessageAdaptor->store_worker_message($worker_id, $msg, $is_error);
$dba->get_
Log
MessageAdaptor->store_worker_message($worker_id, $msg, $is_error);
=head1 DESCRIPTION
...
...
@@ -21,7 +21,7 @@
=cut
package
Bio::EnsEMBL::Hive::DBSQL::
Job
MessageAdaptor
;
package
Bio::EnsEMBL::Hive::DBSQL::
Log
MessageAdaptor
;
use
strict
;
...
...
@@ -29,7 +29,7 @@ use base ('Bio::EnsEMBL::Hive::DBSQL::NakedTableAdaptor');
sub
default_table_name
{
return
'
job
_message
';
return
'
log
_message
';
}
...
...
modules/Bio/EnsEMBL/Hive/RunnableDB/DatabaseDumper.pm
View file @
7a293d7e
...
...
@@ -63,7 +63,7 @@ sub fetch_input {
$self
->
param
('
ignores
',
\
@ignores
);
# Would be good to have this from eHive
my
@ehive_tables
=
qw(worker dataflow_rule analysis_base analysis_ctrl_rule job
job
_message job_file analysis_data resource_description analysis_stats analysis_stats_monitor monitor msg progress resource_class)
;
my
@ehive_tables
=
qw(worker dataflow_rule analysis_base analysis_ctrl_rule job
log
_message job_file analysis_data resource_description analysis_stats analysis_stats_monitor monitor msg progress resource_class)
;
$self
->
param
('
nb_ehive_tables
',
scalar
(
@ehive_tables
));
# Connection parameters
...
...
modules/Bio/EnsEMBL/Hive/RunnableDB/LongMult/Start.pm
View file @
7a293d7e
...
...
@@ -91,7 +91,7 @@ sub write_output { # nothing to write out, but some dataflow to perform:
# "fan out" into branch#2 first
$self
->
dataflow_output_id
(
$output_ids
,
2
);
$self
->
warning
(
scalar
(
@$output_ids
)
.
'
multiplication jobs have been created
');
# warning messages get recorded into '
job
_message' table
$self
->
warning
(
scalar
(
@$output_ids
)
.
'
multiplication jobs have been created
');
# warning messages get recorded into '
log
_message' table
# then flow into the branch#1 funnel; input_id would flow into branch#1 by default anyway, but we request it here explicitly:
$self
->
dataflow_output_id
(
$self
->
input_id
,
1
);
...
...
modules/Bio/EnsEMBL/Hive/Worker.pm
View file @
7a293d7e
...
...
@@ -510,7 +510,7 @@ sub run {
}
or
do
{
my
$msg
=
$@
;
warn
"
Could not specialize worker:
\n\t
$msg
\n
";
$self
->
adaptor
->
db
->
get_
Job
MessageAdaptor
()
->
store_worker_message
(
$self
->
dbID
,
$msg
,
1
);
$self
->
adaptor
->
db
->
get_
Log
MessageAdaptor
()
->
store_worker_message
(
$self
->
dbID
,
$msg
,
1
);
$self
->
cause_of_death
('
SEE_MSG
')
unless
(
$self
->
cause_of_death
());
# some specific causes could have been set prior to die "...";
};
...
...
@@ -532,7 +532,7 @@ sub run {
}
or
do
{
my
$msg
=
"
Could not compile Runnable '
"
.
$self
->
analysis
->
module
.
"
' :
\n\t
"
.
$@
;
warn
"
$msg
\n
";
$self
->
adaptor
->
db
->
get_
Job
MessageAdaptor
()
->
store_worker_message
(
$self
->
dbID
,
$msg
,
1
);
$self
->
adaptor
->
db
->
get_
Log
MessageAdaptor
()
->
store_worker_message
(
$self
->
dbID
,
$msg
,
1
);
$self
->
cause_of_death
('
SEE_MSG
');
};
...
...
@@ -677,7 +677,7 @@ sub run_one_batch {
my
$job_status_at_the_moment
=
$job
->
status
();
my
$action
=
$job
->
incomplete
?
'
died
'
:
'
exited
';
$job_completion_line
=
"
\n
job
$job_id
:
$action
in status '
$job_status_at_the_moment
' for the following reason:
$msg_thrown
\n
";
$self
->
adaptor
->
db
->
get_
Job
MessageAdaptor
()
->
store_job_message
(
$job_id
,
$msg_thrown
,
$job
->
incomplete
);
$self
->
adaptor
->
db
->
get_
Log
MessageAdaptor
()
->
store_job_message
(
$job_id
,
$msg_thrown
,
$job
->
incomplete
);
}
print
STDERR
$job_completion_line
if
(
$self
->
log_dir
and
(
$self
->
debug
or
$job
->
incomplete
));
# one copy goes to the job's STDERR
...
...
sql/foreign_keys.mysql
View file @
7a293d7e
...
...
@@ -8,12 +8,12 @@ ALTER TABLE analysis_stats ADD FOREIGN KEY (analysis_id)
ALTER TABLE analysis_stats_monitor ADD FOREIGN KEY (analysis_id) REFERENCES analysis_base(analysis_id);
ALTER TABLE job ADD FOREIGN KEY (worker_id) REFERENCES worker(worker_id);
ALTER TABLE
job
_message ADD FOREIGN KEY (worker_id) REFERENCES worker(worker_id);
ALTER TABLE
log
_message ADD FOREIGN KEY (worker_id) REFERENCES worker(worker_id);
ALTER TABLE job_file ADD FOREIGN KEY (worker_id) REFERENCES worker(worker_id);
ALTER TABLE job ADD FOREIGN KEY (prev_job_id) REFERENCES job(job_id);
ALTER TABLE job ADD FOREIGN KEY (semaphored_job_id) REFERENCES job(job_id);
ALTER TABLE
job
_message ADD FOREIGN KEY (job_id) REFERENCES job(job_id);
ALTER TABLE
log
_message ADD FOREIGN KEY (job_id) REFERENCES job(job_id);
ALTER TABLE job_file ADD FOREIGN KEY (job_id) REFERENCES job(job_id);
ALTER TABLE resource_description ADD FOREIGN KEY (resource_class_id) REFERENCES resource_class(resource_class_id);
...
...
sql/patch_2012-11-29.sql
0 → 100644
View file @
7a293d7e
#
renaming
job_message
into
a
more
generic
log_message
:
CREATE
TABLE
log_message
(
log_message_id
int
(
10
)
NOT
NULL
AUTO_INCREMENT
,
job_id
int
(
10
)
DEFAULT
NULL
,
worker_id
int
(
10
)
unsigned
NOT
NULL
,
time
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
retry
int
(
10
)
DEFAULT
NULL
,
status
enum
(
'UNKNOWN'
,
'SPECIALIZATION'
,
'COMPILATION'
,
'READY'
,
'PRE_CLEANUP'
,
'FETCH_INPUT'
,
'RUN'
,
'WRITE_OUTPUT'
,
'POST_CLEANUP'
,
'PASSED_ON'
)
DEFAULT
'UNKNOWN'
,
msg
text
,
is_error
TINYINT
,
PRIMARY
KEY
(
log_message_id
),
INDEX
worker_id
(
worker_id
),
INDEX
job_id
(
job_id
)
)
COLLATE
=
latin1_swedish_ci
ENGINE
=
InnoDB
;
INSERT
INTO
log_message
(
log_message_id
,
job_id
,
worker_id
,
time
,
retry
,
status
,
msg
,
is_error
)
SELECT
*
from
job_message
;
CREATE
OR
REPLACE
VIEW
msg
AS
SELECT
a
.
analysis_id
,
a
.
logic_name
,
m
.
*
FROM
log_message
m
JOIN
worker
w
USING
(
worker_id
)
LEFT
JOIN
analysis_base
a
ON
(
a
.
analysis_id
=
w
.
analysis_id
)
LEFT
JOIN
job
j
ON
(
j
.
job_id
=
m
.
job_id
);
sql/procedures.mysql
View file @
7a293d7e
...
...
@@ -33,7 +33,7 @@ CREATE OR REPLACE VIEW progress AS
CREATE OR REPLACE VIEW msg AS
SELECT a.analysis_id, a.logic_name, m.*
FROM
job
_message m
FROM
log
_message m
JOIN worker w USING (worker_id)
LEFT JOIN analysis_base a ON (a.analysis_id=w.analysis_id)
LEFT JOIN job j ON (j.job_id=m.job_id);
...
...
@@ -105,7 +105,7 @@ CREATE PROCEDURE drop_hive_tables()
MODIFIES SQL DATA
BEGIN
DROP VIEW IF EXISTS msg, progress;
DROP TABLE IF EXISTS monitor, analysis_stats_monitor, resource_description, resource_class, analysis_data, job_file, dataflow_rule, analysis_ctrl_rule, analysis_stats,
job
_message, job, worker;
DROP TABLE IF EXISTS monitor, analysis_stats_monitor, resource_description, resource_class, analysis_data, job_file, dataflow_rule, analysis_ctrl_rule, analysis_stats,
log
_message, job, worker;
END; //
DELIMITER ;
sql/procedures.sqlite
View file @
7a293d7e
...
...
@@ -33,7 +33,7 @@ CREATE VIEW IF NOT EXISTS progress AS
CREATE VIEW IF NOT EXISTS msg AS
SELECT a.analysis_id, a.logic_name, m.*
FROM
job
_message m
FROM
log
_message m
JOIN worker w USING (worker_id)
LEFT JOIN analysis_base a ON (a.analysis_id=w.analysis_id)
LEFT JOIN job j ON (j.job_id=m.job_id);
...
...
sql/tables.sql
View file @
7a293d7e
...
...
@@ -215,14 +215,14 @@ CREATE TABLE job (
-- ---------------------------------------------------------------------------------
--
-- Table structure for table '
job
_message'
-- Table structure for table '
log
_message'
--
-- overview:
-- In case a job throws a message (via die/throw), this message is registered in this table.
-- It may or may not indicate that the job was unsuccessful via is_error flag.
--
-- semantics:
--
job
_message_id - an autoincremented primary id of the message
--
log
_message_id - an autoincremented primary id of the message
-- job_id - the id of the job that threw the message (or NULL if it was outside of a message)
-- worker_id - the 'current' worker
-- time - when the message was thrown
...
...
@@ -231,8 +231,8 @@ CREATE TABLE job (
-- msg - string that contains the message
-- is_error - binary flag
CREATE
TABLE
job
_message
(
job
_message_id
int
(
10
)
NOT
NULL
AUTO_INCREMENT
,
CREATE
TABLE
log
_message
(
log
_message_id
int
(
10
)
NOT
NULL
AUTO_INCREMENT
,
job_id
int
(
10
)
DEFAULT
NULL
,
worker_id
int
(
10
)
unsigned
NOT
NULL
,
time
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
...
...
@@ -241,7 +241,7 @@ CREATE TABLE job_message (
msg
text
,
is_error
TINYINT
,
PRIMARY
KEY
(
job
_message_id
),
PRIMARY
KEY
(
log
_message_id
),
INDEX
worker_id
(
worker_id
),
INDEX
job_id
(
job_id
)
...
...
sql/tables.sqlite
View file @
7a293d7e
...
...
@@ -199,14 +199,14 @@ CREATE INDEX IF NOT EXISTS worker_idx ON job (worker_id);
-- ---------------------------------------------------------------------------------
--
-- Table structure for table '
job
_message'
-- Table structure for table '
log
_message'
--
-- overview:
-- In case a job throws a message (via die/throw), this message is registered in this table.
-- It may or may not indicate that the job was unsuccessful via is_error flag.
--
-- semantics:
--
job
_message_id - an autoincremented primary id of the message
--
log
_message_id - an autoincremented primary id of the message
-- job_id - the id of the job that threw the message (or NULL if it was outside of a message)
-- worker_id - the 'current' worker
-- time - when the message was thrown
...
...
@@ -215,8 +215,8 @@ CREATE INDEX IF NOT EXISTS worker_idx ON job (worker_id);
-- msg - string that contains the message
-- is_error - binary flag
CREATE TABLE
job
_message (
job
_message_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
CREATE TABLE
log
_message (
log
_message_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
job_id INTEGER DEFAULT NULL,
worker_id INTEGER NOT NULL,
time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
...
...
@@ -225,8 +225,8 @@ CREATE TABLE job_message (
msg TEXT,
is_error BOOLEAN
);
CREATE INDEX IF NOT EXISTS worker_idx ON
job
_message (worker_id);
CREATE INDEX IF NOT EXISTS job_idx ON
job
_message (job_id);
CREATE INDEX IF NOT EXISTS worker_idx ON
log
_message (worker_id);
CREATE INDEX IF NOT EXISTS job_idx ON
log
_message (job_id);
-- ---------------------------------------------------------------------------------
...
...
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