9 A light-weight
object to record a Beekeeper instance.
11 This
object does not perform any of tasks beekeeper
do (submitting jobs, etc),
12 its purpose is merely to record the fact that a beekeeper has been
run, and
17 Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
18 Copyright [2016-2024] EMBL-European Bioinformatics Institute
20 Licensed under the Apache License,
Version 2.0 (the
"License"); you may not use
this file except in compliance with the License.
21 You may obtain a copy of the License at
25 Unless required by applicable law or agreed to in writing, software distributed under the License
26 is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27 See the License
for the specific language governing permissions and limitations under the License.
31 Please subscribe to the
Hive mailing list: http:
36 package Bio::EnsEMBL::Hive::Beekeeper;
41 use base (
'Bio::EnsEMBL::Hive::Storable' ); # To enable dbID() and adaptor()
44 =head2 new_from_Valley
47 Description : A specific constructor that sets all the fields according to the given
Valley.
56 my ($class, $valley, @args) = @_;
58 my ($meadow, $pid, $meadow_host, $meadow_user) = $valley->whereami;
59 unless($meadow->can(
'deregister_local_process')) {
60 die
"beekeeper.pl detected it has been itself submitted to '".$meadow->type.
"/".$meadow->cached_name.
"', but this mode of operation is not supported.\n"
61 .
"Please just run beekeeper.pl on a farm head node, preferably from under a 'screen' session.\n";
63 $meadow->deregister_local_process();
65 return $class->SUPER::new(
66 'meadow' => $meadow_host,
67 'meadow_host' => $meadow_host,
68 'meadow_user' => $meadow_user,
75 # --------------------------------- Getter / Setters ---------------------------------------
79 $self->{
'_meadow_host'} = shift
if(@_);
80 return $self->{
'_meadow_host'};
85 $self->{
'_meadow_user'} = shift
if(@_);
86 return $self->{
'_meadow_user'};
91 $self->{
'_process_id'} = shift
if(@_);
92 return $self->{
'_process_id'};
97 $self->{
'_is_blocked'} = shift
if(@_);
98 return $self->{
'_is_blocked'};
103 $self->{
'_cause_of_death'} = shift
if(@_);
104 return $self->{
'_cause_of_death'};
109 $self->{
'_sleep_minutes'} = shift
if(@_);
110 return $self->{
'_sleep_minutes'};
113 sub analyses_pattern {
115 $self->{
'_analyses_pattern'} = shift
if(@_);
116 return $self->{
'_analyses_pattern'};
121 $self->{
'_loop_limit'} = shift
if(@_);
122 return $self->{
'_loop_limit'};
127 $self->{
'_loop_until'} = shift
if(@_);
128 return $self->{
'_loop_until'};
133 $self->{
'_options'} = shift
if(@_);
134 return $self->{
'_options'};
137 sub meadow_signatures {
139 $self->{
'_meadow_signatures'} = shift
if(@_);
140 return $self->{
'_meadow_signatures'};
144 # --------------------------------- Convenient methods ---------------------------------------
148 $self->{
'_meadow'} = shift
if(@_);
149 return $self->{
'_meadow'};
153 =head2 set_cause_of_death
156 Description : Set the
"cause of death" of
this beekeeper in the
object and in the database.
164 sub set_cause_of_death {
165 my ($self, $cause_of_death) = @_;
167 $self->cause_of_death( $cause_of_death );
168 $self->adaptor->update_cause_of_death($self)
if $self->adaptor;
172 =head2 check_if_blocked
174 Example : my $check_if_blocked = $beekeeper->check_if_blocked();
175 Description : Updates the
object with the freshest value of is_blocked coming from the database
176 for this beekeeper, and
return the
new value.
184 sub check_if_blocked {
186 $self->adaptor->reload_beekeeper_is_blocked($self)
if $self->adaptor;
187 return $self->is_blocked;
193 Example : print $beekeeper->toString();
194 Description : Produces a
string summary of properties of
this beekeeper.
206 'process=' . $self->meadow_user() .
'@' . $self->meadow_host() .
'#' . $self->process_id(),
207 "options='" . $self->options() .
"'",