Archive Ensembl HomeArchive Ensembl Home
Bio::EnsEMBL::Hive::Queen Class Reference
Inheritance diagram for Bio::EnsEMBL::Hive::Queen:

List of all members.


Class Summary

Synopsis

  The Queen of the Hive based job control system

Description

  The Queen of the Hive based job control system is responsible to 'birthing' the
  correct number of workers of the right type so that they can find jobs to do.
  It will also free up jobs of Workers that died unexpectantly so that other workers
  can claim them to do.
  Hive based processing is a concept based on a more controlled version
  of an autonomous agent type system.  Each worker is not told what to do
  (like a centralized control system - like the current pipeline system)
  but rather queries a central database for jobs (give me jobs).
  Each worker is linked to an analysis_id, registers its self on creation
  into the Hive, creates a RunnableDB instance of the Analysis->module,
  gets $analysis->stats->batch_size jobs from the job table, does its work,
  creates the next layer of job entries by interfacing to
  the DataflowRuleAdaptor to determine the analyses it needs to pass its
  output data to and creates jobs on the next analysis database.
  It repeats this cycle until it has lived its lifetime or until there are no
  more jobs left.
  The lifetime limit is just a safety limit to prevent these from 'infecting'
  a system.
  The Queens job is to simply birth Workers of the correct analysis_id to get the
  work down.  The only other thing the Queen does is free up jobs that were
  claimed by Workers that died unexpectantly so that other workers can take
  over the work.
  The Beekeeper is in charge of interfacing between the Queen and a compute resource
  or 'compute farm'.  Its job is to query Queens if they need any workers and to
  send the requested number of workers to open machines via the runWorker.pl script.
  It is also responsible for interfacing with the Queen to identify worker which died
  unexpectantly.
 

Definition at line 52 of file Queen.pm.

Available Methods

protected _columns ()
protected _default_where_clause ()
protected _final_clause ()
protected Listref _generic_fetch ()
protected _left_join ()
protected _list_dbIDs ()
protected _objs_from_sth ()
protected _pick_best_analysis_for_new_worker ()
protected _straight_join ()
protected _tables ()
public Listref bind_param_generic_fetch ()
public check_for_dead_workers ()
public check_in_worker ()
public count_running_workers ()
public Bio::EnsEMBL::Hive::Worker create_new_worker ()
public
Bio::EnsEMBL::DBSQL::DBAdaptor 
db ()
public
Bio::EnsEMBL::DBSQL::DBConnection 
dbc ()
public dump_data ()
public fetch_all ()
public Listref fetch_all_by_dbID_list ()
public fetch_all_dead_workers_with_jobs ()
public Bio::EnsEMBL::Hive::Worker fetch_by_dbID ()
public fetch_failed_workers ()
public fetch_overdue_workers ()
public Listref generic_fetch ()
public get_dumped_data ()
public get_hive_current_load ()
public get_num_failed_analyses ()
public get_remaining_jobs_show_hive_progress ()
public Boolean is_multispecies ()
public Scalar last_insert_id ()
public monitor ()
public
Bio::EnsEMBL::DBSQL::BaseAdaptor 
new ()
public DBI::StatementHandle prepare ()
public print_analysis_status ()
public print_running_worker_status ()
public register_all_workers_dead ()
public register_worker_death ()
public reset_and_fetch_job_by_dbID ()
public safe_synchronize_AnalysisStats ()
public schedule_workers ()
public schedule_workers_resync_if_necessary ()
public Int species_id ()
public Newly synchronize_AnalysisStats ()
public synchronize_hive ()

Method Documentation

protected Bio::EnsEMBL::Hive::Queen::_columns ( )

Undocumented method

Code:
click to view

Reimplemented from Bio::EnsEMBL::DBSQL::BaseAdaptor.

protected Bio::EnsEMBL::Hive::Queen::_default_where_clause ( )

Undocumented method

Code:
click to view

Reimplemented from Bio::EnsEMBL::DBSQL::BaseAdaptor.

protected Bio::EnsEMBL::Hive::Queen::_final_clause ( )

Undocumented method

Code:
click to view

Reimplemented from Bio::EnsEMBL::DBSQL::BaseAdaptor.

protected Listref Bio::EnsEMBL::Hive::Queen::_generic_fetch ( )
  Arg [1]    : (optional) string $constraint
               An SQL query constraint (i.e. part of the WHERE clause)
  Arg [2]    : (optional) string $logic_name
               the logic_name of the analysis of the features to obtain
  Example    : $fts = $a->_generic_fetch('contig_id in (1234, 1235)', 'Swall');
  Description: Performs a database fetch and returns feature objects in
               contig coordinates.
  Returntype : listref of Bio::EnsEMBL::SeqFeature in contig coordinates
  Exceptions : none
  Caller     : BaseFeatureAdaptor, ProxyDnaAlignFeatureAdaptor::_generic_fetch
 
Code:
click to view
protected Bio::EnsEMBL::Hive::Queen::_objs_from_sth ( )

Undocumented method

Code:
click to view

Reimplemented from Bio::EnsEMBL::DBSQL::BaseAdaptor.

protected Bio::EnsEMBL::Hive::Queen::_pick_best_analysis_for_new_worker ( )

Undocumented method

Code:
click to view
protected Bio::EnsEMBL::Hive::Queen::_tables ( )

Undocumented method

Code:
click to view

Reimplemented from Bio::EnsEMBL::DBSQL::BaseAdaptor.

public Bio::EnsEMBL::Hive::Queen::check_for_dead_workers ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Queen::check_in_worker ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Queen::count_running_workers ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker Bio::EnsEMBL::Hive::Queen::create_new_worker ( )
  Arg [1]    : $analysis_id (optional)
  Example    :
  Description: If analysis_id is specified it will try to create a worker based
               on that analysis.  If not specified the queen will analyze the hive
               and pick the analysis that has the most amount of work to be done.
               It creates an entry in the worker table, and returns a Worker object 
               based on that insert.  This guarantees that each worker registered
               in this queens hive is properly registered.
  Returntype : Bio::EnsEMBL::Hive::Worker
  Exceptions :
  Caller     :
 
Code:
click to view
public Bio::EnsEMBL::Hive::Queen::fetch_all_dead_workers_with_jobs ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker Bio::EnsEMBL::Hive::Queen::fetch_by_dbID ( )
  Arg [1]    : int $id
               the unique database identifier for the feature to be obtained
  Example    : $feat = $queen->fetch_by_dbID(1234);
  Description: Returns the feature created from the database defined by the
               the id $id.
  Returntype : Bio::EnsEMBL::Hive::Worker
  Exceptions : thrown if $worker_id is not defined
  Caller     : general
 
Code:
click to view

Reimplemented from Bio::EnsEMBL::DBSQL::BaseAdaptor.

public Bio::EnsEMBL::Hive::Queen::fetch_failed_workers ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Queen::fetch_overdue_workers ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Queen::get_hive_current_load ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Queen::get_num_failed_analyses ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Queen::get_remaining_jobs_show_hive_progress ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Queen::monitor ( )
  Arg[1]     : --none--
  Example    : $queen->monitor();
  Description: Monitors current throughput and store the result in the monitor
               table
  Exceptions : none
  Caller     : beekeepers and other external processes
 
Code:
click to view
public Bio::EnsEMBL::Hive::Queen::print_analysis_status ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Queen::print_running_worker_status ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Queen::register_all_workers_dead ( )
  Example    : $queen->register_all_workers_dead();
  Description: Registers all workers dead
  Exceptions : none
  Caller     : beekeepers and other external processes
 
Code:
click to view
public Bio::EnsEMBL::Hive::Queen::register_worker_death ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Queen::reset_and_fetch_job_by_dbID ( )
  Arg [1]: int $job_id
  Example: 
    my $job = $queen->reset_and_fetch_job_by_dbID($job_id);
  Description: 
    For the specified job_id it will fetch just that job, 
    reset it completely as if it has never run, and return it.  
    Specifying a specific job bypasses the safety checks, 
    thus multiple workers could be running the 
    same job simultaneously (use only for debugging).
  Returntype : 
    Bio::EnsEMBL::Hive::AnalysisJob object
  Exceptions :
  Caller     : beekeepers, runWorker.pl scripts
 
Code:
click to view
public Bio::EnsEMBL::Hive::Queen::safe_synchronize_AnalysisStats ( )
  Arg [1]    : Bio::EnsEMBL::Hive::AnalysisStats object
  Example    : $self->synchronize($analysisStats);
  Description: Prewrapper around synchronize_AnalysisStats that does
               checks and grabs sync_lock before proceeding with sync.
               Used by distributed worker sync system to avoid contention.
  Exceptions : none
  Caller     : general
 
Code:
click to view
public Bio::EnsEMBL::Hive::Queen::schedule_workers ( )
  Arg[1]     : Bio::EnsEMBL::Analysis object (optional)
  Example    : $count = $queen->schedule_workers();
  Description: Runs through the analyses in the system which are waiting
               for workers to be created for them.  Calculates the maximum
               number of workers needed to fill the current needs of the system
               If Arg[1] is defined, does it only for the given analysis.
  Exceptions : none
  Caller     : beekeepers and other external processes
 
Code:
click to view
public Bio::EnsEMBL::Hive::Queen::schedule_workers_resync_if_necessary ( )

Undocumented method

Code:
click to view
public Newly Bio::EnsEMBL::Hive::Queen::synchronize_AnalysisStats ( )
  Arg [1]    : Bio::EnsEMBL::Hive::AnalysisStats object
  Example    : $self->synchronize($analysisStats);
  Description: Queries the job and worker tables to get summary counts
               and rebuilds the AnalysisStats object.  Then updates the
               analysis_stats table with the new summary info
  Returntype : newly synced Bio::EnsEMBL::Hive::AnalysisStats object
  Exceptions : none
  Caller     : general
 
Code:
click to view
public Bio::EnsEMBL::Hive::Queen::synchronize_hive ( )
  Arg [1]    : $filter_analysis (optional)
  Example    : $queen->synchronize_hive();
  Description: Runs through all analyses in the system and synchronizes
              the analysis_stats summary with the states in the job 
              and worker tables.  Then follows by checking all the blocking rules
              and blocks/unblocks analyses as needed.
  Exceptions : none
  Caller     : general
 
Code:
click to view

The documentation for this class was generated from the following file: