ensembl-hive  2.1
 All Classes Namespaces Files Functions Pages
Bio::EnsEMBL::Hive::Worker Class Reference
+ Inheritance diagram for Bio::EnsEMBL::Hive::Worker:
+ Collaboration diagram for Bio::EnsEMBL::Hive::Worker:

Public Member Functions

public init ()
 
public meadow_type ()
 
public meadow_name ()
 
public host ()
 
public process_id ()
 
public work_done ()
 
public status ()
 
public born ()
 
public last_check_in ()
 
public died ()
 
public cause_of_death ()
 
public String log_dir ()
 
public current_role ()
 
public debug ()
 
public execute_writes ()
 
public special_batch ()
 
public perform_cleanup ()
 
public retry_throwing_jobs ()
 
public can_respecialize ()
 
public Int life_span ()
 
public lifespan_stopwatch ()
 
public life_span_limit_reached ()
 
public Hive::Limiter job_limiter ()
 
public more_work_done ()
 
public prev_job_error ()
 
public runnable_object ()
 
public get_stdout_redirector ()
 
public get_stderr_redirector ()
 
public worker_say ()
 
public toString ()
 
public void run ()
 
public specialize_and_compile_wrapper ()
 
public run_one_batch ()
 
public set_and_update_status ()
 
public enter_status ()
 
public start_job_output_redirection ()
 
public stop_job_output_redirection ()
 
- Public Member Functions inherited from Bio::EnsEMBL::Hive::Storable
public Bio::EnsEMBL::Hive::Storable new ()
 
public Int dbID ()
 
public
Bio::EnsEMBL::Hive::DBSQL::BaseAdaptor 
adaptor ()
 
public DESTROY ()
 
public AUTOLOAD ()
 

Detailed Description

Description

    Object which encapsulates the details of how to find jobs, how to run those
    jobs, and then check the rules to create the next jobs in the chain.
    Essentially knows where to find data, how to process data, and where to
    put it when it is done (put in next persons INBOX) so the next Worker
    in the chain can find data to work on.

    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 relevant configuration information from the database, 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 database of the next analysis.
    It repeats this cycle until it has lived its lifetime or until there are no
    more jobs left to process.
    The lifetime limit is a safety limit to prevent these from 'infecting'
    a system and sitting on a compute node for longer than is socially exceptable.
    This is primarily needed on compute resources like an LSF system where jobs
    are not preempted and run until they are done.

    The Queens primary job is to create Workers to get the work down.
    As part of this, she is also responsible for summarizing the status of the
    analyses by querying the jobs, summarizing, and updating the
    analysis_stats table.  From this she is also responsible for monitoring and
    'unblocking' analyses via the analysis_ctrl_rules.
    The Queen is also responsible for freeing 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 workers which died
    unexpectantly so that she can free the dead workers unfinished jobs.

Member Function Documentation

public Bio::EnsEMBL::Hive::Worker::born ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::can_respecialize ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::cause_of_death ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::current_role ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::debug ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::died ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::enter_status ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::execute_writes ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::get_stderr_redirector ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::get_stdout_redirector ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::host ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::init ( )

Undocumented method

Code:
click to view
public Hive::Limiter Bio::EnsEMBL::Hive::Worker::job_limiter ( )
  Title   :   job_limiter
  Arg [1] :   (optional) integer $value
  Usage   :   $limiter_obj = $self->job_limiter;
              $self->job_limiter($new_value);
  Description: The maximum number of jobs to be done by the Worker can be limited by the given number.
               A worker 'dies' when either the 'life_span' or 'job_limit' is exceeded.
  DefaultValue : undef (relies on life_span to limit life of worker)
  Returntype : Hive::Limiter object
 
Code:
click to view
public Bio::EnsEMBL::Hive::Worker::last_check_in ( )

Undocumented method

Code:
click to view
public Int Bio::EnsEMBL::Hive::Worker::life_span ( )
  Arg [1] : (optional) integer $value (in seconds)
  Title   :   life_span
  Usage   :   $value = $self->life_span;
              $self->life_span($new_value);
  Description: Defines the maximum time a worker can live for. Workers are always
               allowed to complete the jobs they get, but whether they can
               do multiple rounds of work is limited by their life_span
  DefaultValue : 3600 (60 minutes)
  Returntype : integer scalar
 
Code:
click to view
public Bio::EnsEMBL::Hive::Worker::life_span_limit_reached ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::lifespan_stopwatch ( )

Undocumented method

Code:
click to view
public String Bio::EnsEMBL::Hive::Worker::log_dir ( )
  Arg [1] : (optional) string directory path
  Title   : log_dir
  Usage   : $worker_log_dir = $self->log_dir;
            $self->log_dir($worker_log_dir);
  Description: Storable getter/setter attribute for the directory where STDOUT and STRERR of the worker will be redirected to.
               In this directory each job will have its own .out and .err files.
  Returntype : string
 
Code:
click to view
public Bio::EnsEMBL::Hive::Worker::meadow_name ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::meadow_type ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::more_work_done ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::perform_cleanup ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::prev_job_error ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::process_id ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::retry_throwing_jobs ( )

Undocumented method

Code:
click to view
public void Bio::EnsEMBL::Hive::Worker::run ( )
  Title   :   run
  Usage   :   $worker->run;
  Description: 
    This is a self looping autonomous function to process jobs.
    First all STDOUT/STDERR is rediected, then looping commences.
    Looping consists of 
      1) claiming jobs,
      2) processing those jobs through an instance of the 'module class' of 
         the analysis asigned to this worker,  
      3) updating the job, analysis_stats, and hive tables to track the 
         progress of the job, the analysis and this worker.
    Looping stops when any one of these are met:
      1) there is no more jobs to process 
      2) job_limit is reached
      3) life_span has been reached.
  Returntype : none
 
Code:
click to view
public Bio::EnsEMBL::Hive::Worker::run_one_batch ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::runnable_object ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::set_and_update_status ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::special_batch ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::specialize_and_compile_wrapper ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::start_job_output_redirection ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::status ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::stop_job_output_redirection ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::toString ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::work_done ( )

Undocumented method

Code:
click to view
public Bio::EnsEMBL::Hive::Worker::worker_say ( )

Undocumented method

Code:
click to view

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