Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
656cead5
Commit
656cead5
authored
Jul 02, 2013
by
Leo Gordon
Browse files
start using procedures.pgsql with two main views ("progress" and "msg")
parent
d14eca7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletion
+45
-1
modules/Bio/EnsEMBL/Hive/PipeConfig/HiveGeneric_conf.pm
modules/Bio/EnsEMBL/Hive/PipeConfig/HiveGeneric_conf.pm
+2
-1
sql/procedures.pgsql
sql/procedures.pgsql
+43
-0
No files found.
modules/Bio/EnsEMBL/Hive/PipeConfig/HiveGeneric_conf.pm
View file @
656cead5
...
...
@@ -135,9 +135,10 @@ sub pipeline_create_commands {
$self
->
o
('
hive_force_init
')
?
(
$self
->
db_execute_command
(
$db_conn
,
'
DROP DATABASE IF EXISTS
'
.
$self
->
o
(
$db_conn
,
'
-dbname
'),
0
)
)
:
(),
$self
->
db_execute_command
(
$db_conn
,
'
CREATE DATABASE
'
.
$self
->
o
(
$db_conn
,
'
-dbname
'),
0
),
# standard eHive tables,
triggers,
foreign_keys and procedures:
# standard eHive tables, foreign_keys and procedures:
$self
->
db_connect_command
(
$db_conn
)
.
'
<
'
.
$self
->
o
('
hive_root_dir
')
.
'
/sql/tables.pgsql
',
$self
->
db_connect_command
(
$db_conn
)
.
'
<
'
.
$self
->
o
('
hive_root_dir
')
.
'
/sql/foreign_keys.sql
',
$self
->
db_connect_command
(
$db_conn
)
.
'
<
'
.
$self
->
o
('
hive_root_dir
')
.
'
/sql/procedures.pgsql
',
],
}
->
{
$self
->
o
(
$db_conn
,
'
-driver
')
};
...
...
sql/procedures.pgsql
0 → 100644
View file @
656cead5
-- ------------------------------------------------------------------------
--
-- Some stored functions, views and procedures used in hive:
--
-- show hive progress for analyses (turned into a view to give extra flexibility) ----------------
--
-- Thanks to Greg Jordan for the idea and the original version
--
-- Usage:
-- select * from progress; # the whole table (may take ages to generate, depending on the size of your pipeline)
-- select * from progress where logic_name like 'family_blast%'; # only show family_blast-related analyses
-- select * from progress where retry_count>1; # only show jobs that have been tried more than once
CREATE OR REPLACE VIEW progress AS
SELECT a.logic_name || '(' || a.analysis_id || ')' analysis_name_and_id,
MIN(rc.name) resource_class,
j.status,
j.retry_count,
CASE WHEN j.status IS NULL THEN 0 ELSE count(*) END cnt,
MIN(job_id) example_job_id
FROM analysis_base a
LEFT JOIN job j USING (analysis_id)
LEFT JOIN resource_class rc ON (a.resource_class_id=rc.resource_class_id)
GROUP BY a.analysis_id, j.status, j.retry_count
ORDER BY a.analysis_id, j.status;
-- a convenient view that also incorporates (otherwise redundant) analysis_id and logic_name ------------
--
-- Usage:
-- select * from msg;
-- select * from msg where analysis_id=18;
-- select * from msg where logic_name like 'family_blast%';
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 job j ON (j.job_id=m.job_id)
LEFT JOIN analysis_base a ON (a.analysis_id=j.analysis_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