Ensembl/ensembl-hive

View on GitHub
docs/hive_schema.html

Summary

Maintainability
Test Coverage

<html>
<head>

<link rel="stylesheet" type="text/css" media="all" href="ehive_doc.css" />
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>

<title>Schema Documentation</title>
<meta name="order" content="2" />

<script language="Javascript" type="text/javascript">
  var img_plus   = '<img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/>';
  var img_minus  = '<img src="http://www.ensembl.org/i/16/minus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="hide"/>';

  // Function to show/hide the columns table
  function show_hide (param, a_text) {
  
    // Schema tables
    if (a_text === 'columns') {
      div_id   = '#div_'+param;
      alink_id = '#a_'+param;
    }  
    // Species list
    else if (a_text === 'species') {
      div_id   = '#sp_'+param;
      alink_id = '#s_'+param;
    }
    // Example tables
    else {
      div_id   = '#ex_'+param;
      alink_id = '#e_'+param;
    }
    
    if ($(div_id).is(':visible')) {
      $(alink_id).html(img_plus+' Show '+a_text);
    }
    else if ($(div_id).is(':hidden')) {
      $(alink_id).html(img_minus+' Hide '+a_text);
    }
    $(div_id).slideToggle( 300 );
  }
  
  // Function to show/hide all the tables
  function show_hide_all (link_text) {
    expand_div = '#expand';
    div_prefix = 'div_';
    $("div[id^='"+div_prefix+"']").each(function() {
      param = $(this).attr('id').substring(div_prefix.length);
      div_id   = '#'+$(this).attr('id');
      alink_id = '#a_'+param;
      
      if ($(alink_id)) {
        if ($(expand_div).value=='0') {
          $(alink_id).html(img_minus+' Hide '+link_text);
        }
        else {
          $(alink_id).html(img_plus+' Show '+link_text);
        }
      }
      $(div_id).slideToggle( 500 );
    });
    if ($(expand_div).value=='0') {
      $(expand_div).value='1';
    }
    else {
      $(expand_div).value='0';
    }
  }
</script>
</head>
<body>


<h1>Ensembl Hive Schema Documentation</h1>

<P>
This document describes the tables that make up the Hive schema. Tables are grouped into categories, and the purpose of each table is explained.<BR>
You can toggle the display of individual columns using [Show/Hide columns] buttons.
</P>
<P>
<A HREF="hive_schema.png">Hive schema diagram</A> links the tables together.
</P>



<h3 id="top">List of the tables:</h3>
<div>

  <div style="background-color:#F4F4F4;border-left:1px dotted #BBB;border-right:1px dotted #BBB;border-bottom:1px dotted #BBB;margin-bottom:15px;float:left;margin-right:20px;min-width:200px">
    <div style="padding:2px 5px;background-color:#FFF;border-top:2px solid #C70C09;border-bottom:1px solid #C70C09">
      <div style="background-color:#C70C09;box-shadow:1px 1px 2px #888;padding:0px 8px;display:inline;vertical-align:middle"></div>
      <h2 style="margin-left:8px;display:inline;color:#000;vertical-align:middle">Pipeline structure</h2>
    </div>
      <ul style="padding:0px 4px 0px 22px;margin-bottom:2px">
        <li style="margin-right:0px"><a href="#hive_meta" style="text-decoration:none;font-weight:bold">hive_meta</a></li>
        <li style="margin-right:0px"><a href="#pipeline_wide_parameters" style="text-decoration:none;font-weight:bold">pipeline_wide_parameters</a></li>
        <li style="margin-right:0px"><a href="#analysis_base" style="text-decoration:none;font-weight:bold">analysis_base</a></li>
        <li style="margin-right:0px"><a href="#analysis_stats" style="text-decoration:none;font-weight:bold">analysis_stats</a></li>
        <li style="margin-right:0px"><a href="#dataflow_rule" style="text-decoration:none;font-weight:bold">dataflow_rule</a></li>
        <li style="margin-right:0px"><a href="#dataflow_target" style="text-decoration:none;font-weight:bold">dataflow_target</a></li>
        <li style="margin-right:0px"><a href="#analysis_ctrl_rule" style="text-decoration:none;font-weight:bold">analysis_ctrl_rule</a></li>

      </ul>
    </div>

  <div style="background-color:#F4F4F4;border-left:1px dotted #BBB;border-right:1px dotted #BBB;border-bottom:1px dotted #BBB;margin-bottom:15px;float:left;margin-right:20px;min-width:200px">
    <div style="padding:2px 5px;background-color:#FFF;border-top:2px solid #FF7504;border-bottom:1px solid #FF7504">
      <div style="background-color:#FF7504;box-shadow:1px 1px 2px #888;padding:0px 8px;display:inline;vertical-align:middle"></div>
      <h2 style="margin-left:8px;display:inline;color:#000;vertical-align:middle">Resources</h2>
    </div>
      <ul style="padding:0px 4px 0px 22px;margin-bottom:2px">
        <li style="margin-right:0px"><a href="#resource_class" style="text-decoration:none;font-weight:bold">resource_class</a></li>
        <li style="margin-right:0px"><a href="#resource_description" style="text-decoration:none;font-weight:bold">resource_description</a></li>

      </ul>
    </div>

  <div style="background-color:#F4F4F4;border-left:1px dotted #BBB;border-right:1px dotted #BBB;border-bottom:1px dotted #BBB;margin-bottom:15px;float:left;margin-right:20px;min-width:200px">
    <div style="padding:2px 5px;background-color:#FFF;border-top:2px solid #1D73DA;border-bottom:1px solid #1D73DA">
      <div style="background-color:#1D73DA;box-shadow:1px 1px 2px #888;padding:0px 8px;display:inline;vertical-align:middle"></div>
      <h2 style="margin-left:8px;display:inline;color:#000;vertical-align:middle">Job-related</h2>
    </div>
      <ul style="padding:0px 4px 0px 22px;margin-bottom:2px">
        <li style="margin-right:0px"><a href="#job" style="text-decoration:none;font-weight:bold">job</a></li>
        <li style="margin-right:0px"><a href="#job_file" style="text-decoration:none;font-weight:bold">job_file</a></li>
        <li style="margin-right:0px"><a href="#accu" style="text-decoration:none;font-weight:bold">accu</a></li>
        <li style="margin-right:0px"><a href="#analysis_data" style="text-decoration:none;font-weight:bold">analysis_data</a></li>

      </ul>
    </div>

  <div style="background-color:#F4F4F4;border-left:1px dotted #BBB;border-right:1px dotted #BBB;border-bottom:1px dotted #BBB;margin-bottom:15px;float:left;margin-right:20px;min-width:200px">
    <div style="padding:2px 5px;background-color:#FFF;border-top:2px solid #24DA06;border-bottom:1px solid #24DA06">
      <div style="background-color:#24DA06;box-shadow:1px 1px 2px #888;padding:0px 8px;display:inline;vertical-align:middle"></div>
      <h2 style="margin-left:8px;display:inline;color:#000;vertical-align:middle">execution tables</h2>
    </div>
      <ul style="padding:0px 4px 0px 22px;margin-bottom:2px">
        <li style="margin-right:0px"><a href="#worker" style="text-decoration:none;font-weight:bold">worker</a></li>
        <li style="margin-right:0px"><a href="#role" style="text-decoration:none;font-weight:bold">role</a></li>

      </ul>
    </div>
  <div style="clear:both" />
</div>

<div>
  <div style="background-color:#F4F4F4;border-left:1px dotted #BBB;border-right:1px dotted #BBB;border-bottom:1px dotted #BBB;margin-bottom:15px;float:left;margin-right:20px;min-width:200px">
    <div style="padding:2px 5px;background-color:#FFF;border-top:2px solid #F4D20C;border-bottom:1px solid #F4D20C">
      <div style="background-color:#F4D20C;box-shadow:1px 1px 2px #888;padding:0px 8px;display:inline;vertical-align:middle"></div>
      <h2 style="margin-left:8px;display:inline;color:#000;vertical-align:middle">Logging and monitoring</h2>
    </div>
      <ul style="padding:0px 4px 0px 22px;margin-bottom:2px">
        <li style="margin-right:0px"><a href="#worker_resource_usage" style="text-decoration:none;font-weight:bold">worker_resource_usage</a></li>
        <li style="margin-right:0px"><a href="#log_message" style="text-decoration:none;font-weight:bold">log_message</a></li>
        <li style="margin-right:0px"><a href="#analysis_stats_monitor" style="text-decoration:none;font-weight:bold">analysis_stats_monitor</a></li>

      </ul>
    </div>

  <div style="clear:both" />
</div>
  <input type="button" onclick="show_hide_all('columns')" class="fbutton" value="Show/hide all"/>
  <input type="hidden" id="expand" value="0" />
  

<div style="background-color:#F4F4F4;padding:5px 4px;margin:75px 0px 5px;border-top:2px solid #C70C09;border-bottom:1px solid #C70C09">
  <div id="1" style="background-color:#C70C09;box-shadow:1px 1px 2px #888;padding:0px 8px;display:inline;vertical-align:top"></div>
  <h2 id="1" style="display:inline;color:#000;padding-top:0px;margin-left:6px">Pipeline structure</h2>
</div>

  <div id="hive_meta" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #C70C09">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#C70C09;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>hive_meta</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_hive_meta" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('hive_meta','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">This table keeps several important hive-specific pipeline-wide key-value pairs such as hive_sql_schema_version, hive_use_triggers and hive_pipeline_name.</p>

  <div id="div_hive_meta" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>meta_key</b></td><td>VARCHAR(255)</td><td>-</td><td>the KEY of KEY-VALUE pairs (primary key)</td><td></td></tr>
      <tr class="bg2"><td><b>meta_value</b></td><td>MEDIUMTEXT</td><td>NULL</td><td>the VALUE of KEY-VALUE pairs</td><td></td></tr>
    </table>
  </div>

  <div id="pipeline_wide_parameters" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #C70C09">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#C70C09;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>pipeline_wide_parameters</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_pipeline_wide_parameters" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('pipeline_wide_parameters','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">This table contains a simple hash between pipeline_wide_parameter names and their values. The same data used to live in 'meta' table until both the schema and the API were finally separated from Ensembl Core.</p>

  <div id="div_pipeline_wide_parameters" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>param_name</b></td><td>VARCHAR(255)</td><td>-</td><td>the KEY of KEY-VALUE pairs (primary key)</td><td>key: value_idx</td></tr>
      <tr class="bg2"><td><b>param_value</b></td><td>MEDIUMTEXT</td><td>NULL</td><td>the VALUE of KEY-VALUE pairs</td><td></td></tr>
    </table>
  </div>

  <div id="analysis_base" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #C70C09">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#C70C09;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>analysis_base</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_analysis_base" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('analysis_base','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">Each Analysis is a node of the pipeline diagram. It acts both as a "class" to which Jobs belong (and inherit from it certain properties) and as a "container" for them (Jobs of an Analysis can be blocking all Jobs of another Analysis).</p>

  <div id="div_analysis_base" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>analysis_id</b></td><td>INTEGER</td><td>-</td><td>a unique ID that is also a foreign key to most of the other tables</td><td></td></tr>
      <tr class="bg2"><td><b>logic_name</b></td><td>VARCHAR(255)</td><td>-</td><td>the name of the Analysis object</td><td>unique  key: logic_name_idx</td></tr>
      <tr class="bg1"><td><b>module</b></td><td>VARCHAR(255)</td><td>-</td><td>the name of the module / package that runs this Analysis</td><td></td></tr>
      <tr class="bg2"><td><b>language</b></td><td>VARCHAR(255)</td><td>NULL</td><td>the language of the module, if not Perl</td><td></td></tr>
      <tr class="bg1"><td><b>parameters</b></td><td>MEDIUMTEXT</td><td>NULL</td><td>a stingified hash of parameters common to all jobs of the Analysis</td><td></td></tr>
      <tr class="bg2"><td><b>resource_class_id</b></td><td>INTEGER</td><td>-</td><td>link to the resource_class table</td><td></td></tr>
      <tr class="bg1"><td><b>failed_job_tolerance</b></td><td>INTEGER</td><td>0</td><td>% of tolerated failed Jobs</td><td></td></tr>
      <tr class="bg2"><td><b>max_retry_count</b></td><td>INTEGER</td><td>3</td><td>how many times a job of this Analysis will be retried (unless there is no point)</td><td></td></tr>
      <tr class="bg1"><td><b>can_be_empty</b></td><td>SMALLINT</td><td>0</td><td>if TRUE, this Analysis will not be blocking if/while it doesn't have any jobs</td><td></td></tr>
      <tr class="bg2"><td><b>priority</b></td><td>SMALLINT</td><td>0</td><td>an Analysis with higher priority will be more likely chosen on Worker's specialization</td><td></td></tr>
      <tr class="bg1"><td><b>meadow_type</b></td><td>VARCHAR(255)</td><td>NULL</td><td>if defined, forces this Analysis to be run only on the given Meadow</td><td></td></tr>
      <tr class="bg2"><td><b>analysis_capacity</b></td><td>INTEGER</td><td>NULL</td><td>if defined, limits the number of Workers of this particular Analysis that are allowed to run in parallel</td><td></td></tr>
    </table>
  </div>

  <div id="analysis_stats" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #C70C09">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#C70C09;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>analysis_stats</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_analysis_stats" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('analysis_stats','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">Parallel table to analysis_base which provides high level statistics on the state of an analysis and it's jobs.  Used to provide a fast overview, and to provide final approval of 'DONE' which is used by the blocking rules to determine when to unblock other analyses.  Also provides</p>

  <div id="div_analysis_stats" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>analysis_id</b></td><td>INTEGER</td><td>-</td><td>foreign-keyed to the corresponding analysis_base entry</td><td>primary key</td></tr>
      <tr class="bg2"><td><b>batch_size</b></td><td>INTEGER</td><td>1</td><td>how many jobs are claimed in one claiming operation before Worker starts executing them</td><td></td></tr>
      <tr class="bg1"><td><b>hive_capacity</b></td><td>INTEGER</td><td>NULL</td><td>a reciprocal limiter on the number of Workers running at the same time (dependent on Workers of other Analyses)</td><td></td></tr>
      <tr class="bg2"><td><b>status</b></td><td>ENUM('BLOCKED', 'LOADING', 'SYNCHING', 'EMPTY', 'READY', 'WORKING', 'ALL_CLAIMED', 'DONE', 'FAILED')</td><td>'EMPTY'</td><td>cached state of the Analysis</td><td></td></tr>
      <tr class="bg1"><td><b>total_job_count</b></td><td>INTEGER</td><td>0</td><td>total number of Jobs of this Analysis</td><td></td></tr>
      <tr class="bg2"><td><b>semaphored_job_count</b></td><td>INTEGER</td><td>0</td><td>number of Jobs of this Analysis that are in SEMAPHORED state</td><td></td></tr>
      <tr class="bg1"><td><b>ready_job_count</b></td><td>INTEGER</td><td>0</td><td>number of Jobs of this Analysis that are in READY state</td><td></td></tr>
      <tr class="bg2"><td><b>done_job_count</b></td><td>INTEGER</td><td>0</td><td>number of Jobs of this Analysis that are in DONE state</td><td></td></tr>
      <tr class="bg1"><td><b>failed_job_count</b></td><td>INTEGER</td><td>0</td><td>number of Jobs of this Analysis that are in FAILED state</td><td></td></tr>
      <tr class="bg2"><td><b>num_running_workers</b></td><td>INTEGER</td><td>0</td><td>number of running Workers of this Analysis</td><td></td></tr>
      <tr class="bg1"><td><b>behaviour</b></td><td>ENUM('STATIC', 'DYNAMIC')</td><td>'STATIC'</td><td>whether hive_capacity is set or is dynamically calculated based on timers</td><td></td></tr>
      <tr class="bg2"><td><b>input_capacity</b></td><td>INTEGER</td><td>4</td><td>used to compute hive_capacity in DYNAMIC mode</td><td></td></tr>
      <tr class="bg1"><td><b>output_capacity</b></td><td>INTEGER</td><td>4</td><td>used to compute hive_capacity in DYNAMIC mode</td><td></td></tr>
      <tr class="bg2"><td><b>avg_msec_per_job</b></td><td>INTEGER</td><td>NULL</td><td>weighted average used to compute DYNAMIC hive_capacity</td><td></td></tr>
      <tr class="bg1"><td><b>avg_input_msec_per_job</b></td><td>INTEGER</td><td>NULL</td><td>weighted average used to compute DYNAMIC hive_capacity</td><td></td></tr>
      <tr class="bg2"><td><b>avg_run_msec_per_job</b></td><td>INTEGER</td><td>NULL</td><td>weighted average used to compute DYNAMIC hive_capacity</td><td></td></tr>
      <tr class="bg1"><td><b>avg_output_msec_per_job</b></td><td>INTEGER</td><td>NULL</td><td>weighted average used to compute DYNAMIC hive_capacity</td><td></td></tr>
      <tr class="bg2"><td><b>when_updated</b></td><td>TIMESTAMP</td><td>NULL</td><td>when this entry was last updated</td><td></td></tr>
      <tr class="bg1"><td><b>sync_lock</b></td><td>SMALLINT</td><td>0</td><td>a binary lock flag to prevent simultaneous updates</td><td></td></tr>
    </table>
  </div>

  <div id="dataflow_rule" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #C70C09">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#C70C09;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>dataflow_rule</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_dataflow_rule" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('dataflow_rule','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">Each entry of this table defines a starting point for dataflow (via from_analysis_id and branch_code) to which point a group of dataflow_target entries can be linked. This grouping is used in two ways: (1) dataflow_target entries that link into the same dataflow_rule share the same from_analysis, branch_code and funnel_dataflow_rule (2) to define the conditions for DEFAULT or ELSE case (via excluding all conditions explicitly listed in the group)</p>

  <div id="div_dataflow_rule" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>dataflow_rule_id</b></td><td>INTEGER</td><td>-</td><td>internal ID</td><td></td></tr>
      <tr class="bg2"><td><b>from_analysis_id</b></td><td>INTEGER</td><td>-</td><td>foreign key to analysis table analysis_id</td><td></td></tr>
      <tr class="bg1"><td><b>branch_code</b></td><td>INTEGER</td><td>1</td><td>branch_code of the fan</td><td></td></tr>
      <tr class="bg2"><td><b>funnel_dataflow_rule_id</b></td><td>INTEGER</td><td>NULL</td><td>dataflow_rule_id of the semaphored funnel (is NULL by default, which means dataflow is not semaphored)</td><td></td></tr>
    </table>
  </div>

  <div id="dataflow_target" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #C70C09">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#C70C09;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>dataflow_target</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_dataflow_target" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('dataflow_target','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">This table links specific conditions with the target object (Analysis/Table/Accu) and optional input_id_template.</p>

  <div id="div_dataflow_target" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>dataflow_target_id</b></td><td>INTEGER</td><td>-</td><td>internal ID</td><td></td></tr>
      <tr class="bg2"><td><b>source_dataflow_rule_id</b></td><td>INTEGER</td><td>-</td><td>foreign key to the dataflow_rule object that defines grouping (see description of dataflow_rule table)</td><td>unique: key</td></tr>
      <tr class="bg1"><td><b>on_condition</b></td><td>VARCHAR(255)</td><td>NULL</td><td>param-substitutable string evaluated at the moment of dataflow event that defines whether or not this case produces any dataflow; NULL means DEFAULT or ELSE</td><td>unique: key</td></tr>
      <tr class="bg2"><td><b>input_id_template</b></td><td>MEDIUMTEXT</td><td>NULL</td><td>a template for generating a new input_id (not necessarily a hashref) in this dataflow; if undefined is kept original</td><td>unique: key</td></tr>
      <tr class="bg1"><td><b>extend_param_stack</b></td><td>SMALLINT</td><td>0</td><td>the boolean value defines whether the newly created jobs will inherit both the parameters and the accu of the prev_job</td><td></td></tr>
      <tr class="bg2"><td><b>to_analysis_url</b></td><td>VARCHAR(255)</td><td>''</td><td>the URL of the dataflow target object (Analysis/Table/Accu)</td><td>unique: key</td></tr>
    </table>
  </div>

  <div id="analysis_ctrl_rule" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #C70C09">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#C70C09;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>analysis_ctrl_rule</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_analysis_ctrl_rule" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('analysis_ctrl_rule','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">These rules define a higher level of control. These rules are used to turn whole anlysis nodes on/off (READY/BLOCKED). If any of the condition_analyses are not 'DONE' the ctrled_analysis is set to BLOCKED. When all conditions become 'DONE' then ctrled_analysis is set to READY The workers switch the analysis.status to 'WORKING' and 'DONE'. But any moment if a condition goes false, the analysis is reset to BLOCKED.</p>

  <div id="div_analysis_ctrl_rule" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>analysis_ctrl_rule_id</b></td><td>INTEGER</td><td>-</td><td>internal ID</td><td></td></tr>
      <tr class="bg2"><td><b>condition_analysis_url</b></td><td>VARCHAR(255)</td><td>''</td><td>foreign key to net distributed analysis reference</td><td>unique: key</td></tr>
      <tr class="bg1"><td><b>ctrled_analysis_id</b></td><td>INTEGER</td><td>-</td><td>foreign key to analysis table analysis_id</td><td>unique: key</td></tr>
    </table>
  </div>


<div style="background-color:#F4F4F4;padding:5px 4px;margin:75px 0px 5px;border-top:2px solid #FF7504;border-bottom:1px solid #FF7504">
  <div id="2" style="background-color:#FF7504;box-shadow:1px 1px 2px #888;padding:0px 8px;display:inline;vertical-align:top"></div>
  <h2 id="2" style="display:inline;color:#000;padding-top:0px;margin-left:6px">Resources</h2>
</div>

  <div id="resource_class" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #FF7504">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#FF7504;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>resource_class</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_resource_class" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('resource_class','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">Maps between resource_class numeric IDs and unique names.</p>

  <div id="div_resource_class" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>resource_class_id</b></td><td>INTEGER</td><td>-</td><td>unique ID of the ResourceClass</td><td></td></tr>
      <tr class="bg2"><td><b>name</b></td><td>VARCHAR(255)</td><td>-</td><td>unique name of the ResourceClass</td><td>unique: key</td></tr>
    </table>
  </div>

  <div id="resource_description" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #FF7504">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#FF7504;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>resource_description</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_resource_description" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('resource_description','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">Maps (ResourceClass, MeadowType) pair to Meadow-specific resource lines.</p>

  <div id="div_resource_description" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>resource_class_id</b></td><td>INTEGER</td><td>-</td><td>foreign-keyed to the ResourceClass entry</td><td>primary key</td></tr>
      <tr class="bg2"><td><b>meadow_type</b></td><td>VARCHAR(255)</td><td>-</td><td>if the Worker is about to be executed on the given Meadow...</td><td>primary key</td></tr>
      <tr class="bg1"><td><b>submission_cmd_args</b></td><td>VARCHAR(255)</td><td>''</td><td>... these are the resource arguments (queue, memory,...) to give to the submission command</td><td></td></tr>
      <tr class="bg2"><td><b>worker_cmd_args</b></td><td>VARCHAR(255)</td><td>''</td><td>... and these are the arguments that are given to the worker command being submitted</td><td></td></tr>
    </table>
  </div>


<div style="background-color:#F4F4F4;padding:5px 4px;margin:75px 0px 5px;border-top:2px solid #1D73DA;border-bottom:1px solid #1D73DA">
  <div id="3" style="background-color:#1D73DA;box-shadow:1px 1px 2px #888;padding:0px 8px;display:inline;vertical-align:top"></div>
  <h2 id="3" style="display:inline;color:#000;padding-top:0px;margin-left:6px">Job-related</h2>
</div>

  <div id="job" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #1D73DA">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#1D73DA;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>job</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_job" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('job','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">The job is the heart of this system.  It is the kiosk or blackboard where workers find things to do and then post work for other works to do. These jobs are created prior to work being done, are claimed by workers, are updated as the work is done, with a final update on completion.</p>

  <div id="div_job" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>job_id</b></td><td>INTEGER</td><td>-</td><td>autoincrement id</td><td></td></tr>
      <tr class="bg2"><td><b>prev_job_id</b></td><td>INTEGER</td><td>NULL</td><td>previous job which created this one</td><td></td></tr>
      <tr class="bg1"><td><b>analysis_id</b></td><td>INTEGER</td><td>-</td><td>the analysis_id needed to accomplish this job.</td><td>unique  key: input_id_stacks_analysis<br />key: analysis_status_retry</td></tr>
      <tr class="bg2"><td><b>input_id</b></td><td>CHAR(255)</td><td>-</td><td>input data passed into Analysis:RunnableDB to control the work</td><td>unique  key: input_id_stacks_analysis</td></tr>
      <tr class="bg1"><td><b>param_id_stack</b></td><td>CHAR(64)</td><td>''</td><td>a CSV of job_ids whose input_ids contribute to the stack of local variables for the job</td><td>unique  key: input_id_stacks_analysis</td></tr>
      <tr class="bg2"><td><b>accu_id_stack</b></td><td>CHAR(64)</td><td>''</td><td>a CSV of job_ids whose accu's contribute to the stack of local variables for the job</td><td>unique  key: input_id_stacks_analysis</td></tr>
      <tr class="bg1"><td><b>role_id</b></td><td>INTEGER</td><td>NULL</td><td>links to the Role that claimed this job (NULL means it has never been claimed)</td><td>key: role_status</td></tr>
      <tr class="bg2"><td><b>status</b></td><td>ENUM('SEMAPHORED','READY','CLAIMED','COMPILATION','PRE_CLEANUP','FETCH_INPUT','RUN','WRITE_OUTPUT','POST_HEALTHCHECK','POST_CLEANUP','DONE','FAILED','PASSED_ON')</td><td>'READY'</td><td>state the job is in</td><td>key: analysis_status_retry<br />key: role_status</td></tr>
      <tr class="bg1"><td><b>retry_count</b></td><td>INTEGER</td><td>0</td><td>number times job had to be reset when worker failed to run it</td><td>key: analysis_status_retry</td></tr>
      <tr class="bg2"><td><b>when_completed</b></td><td>TIMESTAMP</td><td>NULL</td><td>when the job was completed</td><td></td></tr>
      <tr class="bg1"><td><b>runtime_msec</b></td><td>INTEGER</td><td>NULL</td><td>how long did it take to execute the job (or until the moment it failed)</td><td></td></tr>
      <tr class="bg2"><td><b>query_count</b></td><td>INTEGER</td><td>NULL</td><td>how many SQL queries were run during this job</td><td></td></tr>
      <tr class="bg1"><td><b>semaphore_count</b></td><td>INTEGER</td><td>0</td><td>if this count is >0, the job is conditionally blocked (until this count drops to 0 or below). Default=0 means "nothing is blocking me by default".</td><td></td></tr>
      <tr class="bg2"><td><b>semaphored_job_id</b></td><td>INTEGER</td><td>NULL</td><td>the job_id of job S that is waiting for this job to decrease S's semaphore_count. Default=NULL means "I'm not blocking anything by default".</td><td></td></tr>
    </table>
  </div>

  <div id="job_file" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #1D73DA">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#1D73DA;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>job_file</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_job_file" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('job_file','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">For testing/debugging purposes both STDOUT and STDERR streams of each Job can be redirected into a separate log file. This table holds filesystem paths to one or both of those files. There is max one entry per job_id and retry.</p>

  <div id="div_job_file" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>job_id</b></td><td>INTEGER</td><td>-</td><td>foreign key</td><td>primary key</td></tr>
      <tr class="bg2"><td><b>retry</b></td><td>INTEGER</td><td>-</td><td>copy of retry_count of job as it was run</td><td>primary key</td></tr>
      <tr class="bg1"><td><b>role_id</b></td><td>INTEGER</td><td>-</td><td>links to the Role that claimed this job</td><td>key: role</td></tr>
      <tr class="bg2"><td><b>stdout_file</b></td><td>VARCHAR(255)</td><td>NULL</td><td>path to the job's STDOUT log</td><td></td></tr>
      <tr class="bg1"><td><b>stderr_file</b></td><td>VARCHAR(255)</td><td>NULL</td><td>path to the job's STDERR log</td><td></td></tr>
    </table>
  </div>

  <div id="accu" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #1D73DA">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#1D73DA;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>accu</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_accu" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('accu','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">Accumulator for funneled dataflow.</p>

  <div id="div_accu" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>sending_job_id</b></td><td>INTEGER</td><td>NULL</td><td>semaphoring job in the "box"</td><td>key: accu_sending_idx</td></tr>
      <tr class="bg2"><td><b>receiving_job_id</b></td><td>INTEGER</td><td>-</td><td>semaphored job outside the "box"</td><td>key: accu_receiving_idx</td></tr>
      <tr class="bg1"><td><b>struct_name</b></td><td>VARCHAR(255)</td><td>-</td><td>name of the structured parameter</td><td></td></tr>
      <tr class="bg2"><td><b>key_signature</b></td><td>VARCHAR(255)</td><td>-</td><td>locates the part of the structured parameter</td><td></td></tr>
      <tr class="bg1"><td><b>value</b></td><td>MEDIUMTEXT</td><td>NULL</td><td>value of the part</td><td></td></tr>
    </table>
  </div>

  <div id="analysis_data" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #1D73DA">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#1D73DA;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>analysis_data</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_analysis_data" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('analysis_data','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">A generic blob-storage hash. Currently the only legitimate use of this table is "overflow" of job.input_ids: when they grow longer than 254 characters the real data is stored in analysis_data instead, and the input_id contains the corresponding analysis_data_id.</p>

  <div id="div_analysis_data" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>analysis_data_id</b></td><td>INTEGER</td><td>-</td><td>primary id</td><td></td></tr>
      <tr class="bg2"><td><b>md5sum</b></td><td>CHAR(32)</td><td>-</td><td>checksum over the data to quickly detect (potential) collisions</td><td>key: md5sum</td></tr>
      <tr class="bg1"><td><b>data</b></td><td>MEDIUMTEXT</td><td>-</td><td>text blob which holds the data</td><td></td></tr>
    </table>
  </div>


<div style="background-color:#F4F4F4;padding:5px 4px;margin:75px 0px 5px;border-top:2px solid #24DA06;border-bottom:1px solid #24DA06">
  <div id="4" style="background-color:#24DA06;box-shadow:1px 1px 2px #888;padding:0px 8px;display:inline;vertical-align:top"></div>
  <h2 id="4" style="display:inline;color:#000;padding-top:0px;margin-left:6px">execution tables</h2>
</div>

  <div id="worker" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #24DA06">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#24DA06;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>worker</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_worker" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('worker','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">Entries of this table correspond to Worker objects of the API. Workers are created by inserting into this table so that there is only one instance of a Worker object in the database. As Workers live and do work, they update this table, and when they die they update again.</p>

  <div id="div_worker" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>worker_id</b></td><td>INTEGER</td><td>-</td><td>unique ID of the Worker</td><td></td></tr>
      <tr class="bg2"><td><b>meadow_type</b></td><td>VARCHAR(255)</td><td>-</td><td>type of the Meadow it is running on</td><td>key: meadow_process</td></tr>
      <tr class="bg1"><td><b>meadow_name</b></td><td>VARCHAR(255)</td><td>-</td><td>name of the Meadow it is running on (for meadow_type=='LOCAL' it is the same as meadow_host)</td><td>key: meadow_process</td></tr>
      <tr class="bg2"><td><b>meadow_host</b></td><td>VARCHAR(255)</td><td>-</td><td>execution host name</td><td></td></tr>
      <tr class="bg1"><td><b>meadow_user</b></td><td>VARCHAR(255)</td><td>NULL</td><td>scheduling/execution user name (within the Meadow)</td><td></td></tr>
      <tr class="bg2"><td><b>process_id</b></td><td>VARCHAR(255)</td><td>-</td><td>identifies the Worker process on the Meadow (for 'LOCAL' is the OS PID)</td><td>key: meadow_process</td></tr>
      <tr class="bg1"><td><b>resource_class_id</b></td><td>INTEGER</td><td>NULL</td><td>links to Worker's resource class</td><td></td></tr>
      <tr class="bg2"><td><b>work_done</b></td><td>INTEGER</td><td>0</td><td>how many jobs the Worker has completed successfully</td><td></td></tr>
      <tr class="bg1"><td><b>status</b></td><td>VARCHAR(255)</td><td>'READY'</td><td>current status of the Worker</td><td></td></tr>
      <tr class="bg2"><td><b>when_born</b></td><td>TIMESTAMP</td><td>CURRENT_TIMESTAMP</td><td>when the Worker process was started</td><td></td></tr>
      <tr class="bg1"><td><b>when_checked_in</b></td><td>TIMESTAMP</td><td>NULL</td><td>when the Worker last checked into the database</td><td></td></tr>
      <tr class="bg2"><td><b>when_seen</b></td><td>TIMESTAMP</td><td>NULL</td><td>when the Worker was last seen by the Meadow</td><td></td></tr>
      <tr class="bg1"><td><b>when_died</b></td><td>TIMESTAMP</td><td>NULL</td><td>if defined, when the Worker died (or its premature death was first detected by GC)</td><td></td></tr>
      <tr class="bg2"><td><b>cause_of_death</b></td><td>ENUM('NO_ROLE', 'NO_WORK', 'JOB_LIMIT', 'HIVE_OVERLOAD', 'LIFESPAN', 'CONTAMINATED', 'RELOCATED', 'KILLED_BY_USER', 'MEMLIMIT', 'RUNLIMIT', 'SEE_MSG', 'UNKNOWN')</td><td>NULL</td><td>if defined, why did the Worker exit (or why it was killed)</td><td></td></tr>
      <tr class="bg1"><td><b>log_dir</b></td><td>VARCHAR(255)</td><td>NULL</td><td>if defined, a filesystem directory where this Worker's output is logged</td><td></td></tr>
    </table>
  </div>

  <div id="role" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #24DA06">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#24DA06;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>role</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_role" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('role','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">Entries of this table correspond to Role objects of the API. When a Worker specializes, it acquires a Role, which is a temporary link between the Worker and a resource-compatible Analysis.</p>

  <div id="div_role" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>role_id</b></td><td>INTEGER</td><td>-</td><td>unique ID of the Role</td><td></td></tr>
      <tr class="bg2"><td><b>worker_id</b></td><td>INTEGER</td><td>-</td><td>the specialized Worker</td><td>key: worker</td></tr>
      <tr class="bg1"><td><b>analysis_id</b></td><td>INTEGER</td><td>-</td><td>the Analysis into which the Worker specialized</td><td>key: analysis</td></tr>
      <tr class="bg2"><td><b>when_started</b></td><td>TIMESTAMP</td><td>CURRENT_TIMESTAMP</td><td>when this Role started</td><td></td></tr>
      <tr class="bg1"><td><b>when_finished</b></td><td>TIMESTAMP</td><td>NULL</td><td>when this Role finished. NULL may either indicate it is still running or was killed by an external force.</td><td></td></tr>
      <tr class="bg2"><td><b>attempted_jobs</b></td><td>INTEGER</td><td>0</td><td>counter of the number of attempts</td><td></td></tr>
      <tr class="bg1"><td><b>done_jobs</b></td><td>INTEGER</td><td>0</td><td>counter of the number of successful attempts</td><td></td></tr>
    </table>
  </div>


<div style="background-color:#F4F4F4;padding:5px 4px;margin:75px 0px 5px;border-top:2px solid #F4D20C;border-bottom:1px solid #F4D20C">
  <div id="5" style="background-color:#F4D20C;box-shadow:1px 1px 2px #888;padding:0px 8px;display:inline;vertical-align:top"></div>
  <h2 id="5" style="display:inline;color:#000;padding-top:0px;margin-left:6px">Logging and monitoring</h2>
</div>

  <div id="worker_resource_usage" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #F4D20C">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#F4D20C;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>worker_resource_usage</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_worker_resource_usage" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('worker_resource_usage','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">A table with post-mortem resource usage statistics of a Worker. This table is not automatically populated: you first need to run load_resource_usage.pl. Note that some meadows (like LOCAL) do not support post-mortem inspection of resource usage</p>

  <div id="div_worker_resource_usage" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>worker_id</b></td><td>INTEGER</td><td>-</td><td>links to the worker table</td><td>primary key</td></tr>
      <tr class="bg2"><td><b>exit_status</b></td><td>VARCHAR(255)</td><td>NULL</td><td>meadow-dependent, in case of LSF it's usually 'done' (normal) or 'exit' (abnormal)</td><td></td></tr>
      <tr class="bg1"><td><b>mem_megs</b></td><td>FLOAT</td><td>NULL</td><td>how much memory the Worker process used</td><td></td></tr>
      <tr class="bg2"><td><b>swap_megs</b></td><td>FLOAT</td><td>NULL</td><td>how much swap the Worker process used</td><td></td></tr>
      <tr class="bg1"><td><b>pending_sec</b></td><td>FLOAT</td><td>NULL</td><td>time spent by the process in the queue before it became a Worker</td><td></td></tr>
      <tr class="bg2"><td><b>cpu_sec</b></td><td>FLOAT</td><td>NULL</td><td>cpu time (in seconds) used by the Worker process. It is often lower than the walltime because of time spent in I/O waits, but it can also be higher if the process is multi-threaded</td><td></td></tr>
      <tr class="bg1"><td><b>lifespan_sec</b></td><td>FLOAT</td><td>NULL</td><td>walltime (in seconds) used by the Worker process. It is often higher than the sum of its jobs' "runtime_msec" because of the overhead from the Worker itself</td><td></td></tr>
      <tr class="bg2"><td><b>exception_status</b></td><td>VARCHAR(255)</td><td>NULL</td><td>meadow-specific flags, in case of LSF it can be 'underrun', 'overrun' or 'idle'</td><td></td></tr>
    </table>
  </div>

  <div id="log_message" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #F4D20C">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#F4D20C;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>log_message</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_log_message" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('log_message','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">When a Job or a job-less Worker (job_id=NULL) throws a "die" message for any reason, the message is recorded in this table. It may or may not indicate that the job was unsuccessful via is_error flag. Also $self->warning("...") messages are recorded with is_error=0.</p>

  <div id="div_log_message" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>log_message_id</b></td><td>INTEGER</td><td>-</td><td>an autoincremented primary id of the message</td><td></td></tr>
      <tr class="bg2"><td><b>job_id</b></td><td>INTEGER</td><td>NULL</td><td>the id of the job that threw the message (or NULL if it was outside of a message)</td><td>key: job_id</td></tr>
      <tr class="bg1"><td><b>role_id</b></td><td>INTEGER</td><td>NULL</td><td>the 'current' role</td><td></td></tr>
      <tr class="bg2"><td><b>worker_id</b></td><td>INTEGER</td><td>NULL</td><td>the 'current' worker</td><td>key: worker_id</td></tr>
      <tr class="bg1"><td><b>when_logged</b></td><td>TIMESTAMP</td><td>CURRENT_TIMESTAMP</td><td>when the message was thrown</td><td></td></tr>
      <tr class="bg2"><td><b>retry</b></td><td>INTEGER</td><td>NULL</td><td>retry_count of the job when the message was thrown (or NULL if no job)</td><td></td></tr>
      <tr class="bg1"><td><b>status</b></td><td>VARCHAR(255)</td><td>'UNKNOWN'</td><td>of the job or worker when the message was thrown</td><td></td></tr>
      <tr class="bg2"><td><b>msg</b></td><td>MEDIUMTEXT</td><td>NULL</td><td>string that contains the message</td><td></td></tr>
      <tr class="bg1"><td><b>is_error</b></td><td>SMALLINT</td><td>NULL</td><td>binary flag</td><td></td></tr>
    </table>
  </div>

  <div id="analysis_stats_monitor" style="width:850px;background-color:#F4F4F4;border-bottom:1px solid #BBB;margin-top:60px;margin-bottom:2px;padding:4px;border-top:1px solid #F4D20C">
 
    <div style="float:left;text-align:left;font-size:11pt;font-weight:bold;color:#000;padding:2px 1px">
      <span style="display:inline-block;height:10px;width:10px;border-radius:5px;margin-right:5px;background-color:#F4D20C;box-shadow:1px 1px 2px #888;vertical-align:middle"></span>analysis_stats_monitor</div>
    <div style="float:right;text-align:right;padding:2px 1px">
  
  <a id="a_analysis_stats_monitor" class="help-header" style="cursor:pointer;font-weight:bold;border-radius:5px;background-color:#FFF;border:1px solid #667aa6;padding:1px 2px;margin-right:5px" onclick="show_hide('analysis_stats_monitor','columns')">
    <img src="http://www.ensembl.org/i/16/plus-button.png" style="width:12px;height:12px;position:relative;top:2px" alt="show"/> Show columns
  </a>
      <span style="margin-right:5px;border-right:1px solid #000"> </span> <a href="#top" style="text-decoration:none">[Back to top]</a>
    </div>
    <div style="clear:both"></div>
  </div>
  <p style="padding:5px 0px;margin-bottom:0px;width:800px">A regular timestamped snapshot of the analysis_stats table.</p>

  <div id="div_analysis_stats_monitor" style="display:none">
    <table style="border:1px solid #667aa6;padding:0px;min-width:1000px;max-width:1200px">
      <tr class="center" style="color:#FFFFFF;background-color:#667aa6"><th style="color:#FFF;padding:2px">Column</th><th style="color:#FFF;padding:2px">Type</th><th style="color:#FFF;padding:2px;min-width:80px">Default value</th><th style="color:#FFF;padding:2px;min-width:500px">Description</th><th style="color:#FFF;padding:2px;min-width:100px">Index</th></tr>
      <tr class="bg1"><td><b>when_logged</b></td><td>TIMESTAMP</td><td>CURRENT_TIMESTAMP</td><td>when this snapshot was taken</td><td></td></tr>
      <tr class="bg2"><td><b>analysis_id</b></td><td>INTEGER</td><td>-</td><td>foreign-keyed to the corresponding analysis_base entry</td><td></td></tr>
      <tr class="bg1"><td><b>batch_size</b></td><td>INTEGER</td><td>1</td><td>how many jobs are claimed in one claiming operation before Worker starts executing them</td><td></td></tr>
      <tr class="bg2"><td><b>hive_capacity</b></td><td>INTEGER</td><td>NULL</td><td>a reciprocal limiter on the number of Workers running at the same time (dependent on Workers of other Analyses)</td><td></td></tr>
      <tr class="bg1"><td><b>status</b></td><td>ENUM('BLOCKED', 'LOADING', 'SYNCHING', 'EMPTY', 'READY', 'WORKING', 'ALL_CLAIMED', 'DONE', 'FAILED')</td><td>'EMPTY'</td><td>cached state of the Analysis</td><td></td></tr>
      <tr class="bg2"><td><b>total_job_count</b></td><td>INTEGER</td><td>0</td><td>total number of Jobs of this Analysis</td><td></td></tr>
      <tr class="bg1"><td><b>semaphored_job_count</b></td><td>INTEGER</td><td>0</td><td>number of Jobs of this Analysis that are in SEMAPHORED state</td><td></td></tr>
      <tr class="bg2"><td><b>ready_job_count</b></td><td>INTEGER</td><td>0</td><td>number of Jobs of this Analysis that are in READY state</td><td></td></tr>
      <tr class="bg1"><td><b>done_job_count</b></td><td>INTEGER</td><td>0</td><td>number of Jobs of this Analysis that are in DONE state</td><td></td></tr>
      <tr class="bg2"><td><b>failed_job_count</b></td><td>INTEGER</td><td>0</td><td>number of Jobs of this Analysis that are in FAILED state</td><td></td></tr>
      <tr class="bg1"><td><b>num_running_workers</b></td><td>INTEGER</td><td>0</td><td>number of running Workers of this Analysis</td><td></td></tr>
      <tr class="bg2"><td><b>behaviour</b></td><td>ENUM('STATIC', 'DYNAMIC')</td><td>'STATIC'</td><td>whether hive_capacity is set or is dynamically calculated based on timers</td><td></td></tr>
      <tr class="bg1"><td><b>input_capacity</b></td><td>INTEGER</td><td>4</td><td>used to compute hive_capacity in DYNAMIC mode</td><td></td></tr>
      <tr class="bg2"><td><b>output_capacity</b></td><td>INTEGER</td><td>4</td><td>used to compute hive_capacity in DYNAMIC mode</td><td></td></tr>
      <tr class="bg1"><td><b>avg_msec_per_job</b></td><td>INTEGER</td><td>NULL</td><td>weighted average used to compute DYNAMIC hive_capacity</td><td></td></tr>
      <tr class="bg2"><td><b>avg_input_msec_per_job</b></td><td>INTEGER</td><td>NULL</td><td>weighted average used to compute DYNAMIC hive_capacity</td><td></td></tr>
      <tr class="bg1"><td><b>avg_run_msec_per_job</b></td><td>INTEGER</td><td>NULL</td><td>weighted average used to compute DYNAMIC hive_capacity</td><td></td></tr>
      <tr class="bg2"><td><b>avg_output_msec_per_job</b></td><td>INTEGER</td><td>NULL</td><td>weighted average used to compute DYNAMIC hive_capacity</td><td></td></tr>
      <tr class="bg1"><td><b>when_updated</b></td><td>TIMESTAMP</td><td>NULL</td><td>when this entry was last updated</td><td></td></tr>
      <tr class="bg2"><td><b>sync_lock</b></td><td>SMALLINT</td><td>-</td><td>a binary lock flag to prevent simultaneous updates</td><td></td></tr>
    </table>
  </div>


</body>
</html>