Branch Coverage

blib/lib/Helios/Service.pm
Criterion Covered Total %
branch 0 170 0.0


line true false branch
202 0 0 unless $_[0]->MaxRetries
203 0 0 unless $_[0]->RetryInterval
208 0 0 unless $_[0]->JobLockInterval
222 0 0 if ($class->JobClass) { }
230 0 0 unless (eval { do { if ($class->JobClass) { $job = $class->JobClass->new($schwartz_job); } else { $job = 'Helios::Job'->new($schwartz_job); } ; 1 } })
237 0 0 $WORKER_START_TIME ? :
249 0 0 if ($self->debug)
253 0 0 if (defined $CACHED_CONFIG and $Helios::Service::CACHED_CONFIG->{'LAZY_CONFIG_UPDATE'} == 1 and $Helios::Service::CACHED_CONFIG->{'OVERDRIVE'} == 1 and $CACHED_CONFIG_RETRIEVAL_COUNT % 10 != 0) { }
260 0 0 if ($self->debug)
267 0 0 if (defined $self->getConfig->{'LAZY_CONFIG_UPDATE'} and $self->getConfig->{'LAZY_CONFIG_UPDATE'} == 1)
281 0 0 if (defined $job_init_error)
282 0 0 if ($self->debug)
294 0 0 unless (eval { do { if ($self->debug) { print 'CACHED_CONFIG=', $CACHED_CONFIG, "\n"; print 'CACHED_CONFIG_RETRIEVAL_COUNT=', $CACHED_CONFIG_RETRIEVAL_COUNT, "\n"; } ; if (defined $CACHED_CONFIG and $Helios::Service::CACHED_CONFIG->{'LAZY_CONFIG_UPDATE'} == 1 and $Helios::Service::CACHED_CONFIG->{'OVERDRIVE'} == 1 and $CACHED_CONFIG_RETRIEVAL_COUNT % 10 != 0) { $self->prep('CACHED_CONFIG', $CACHED_CONFIG); ++$CACHED_CONFIG_RETRIEVAL_COUNT; if ($self->debug) { $self->logMsg(7, 'Retrieved config params from in-memory cache'); } ; } else { $self->prep; if (defined $self->getConfig->{'LAZY_CONFIG_UPDATE'} and $self->getConfig->{'LAZY_CONFIG_UPDATE'} == 1) { $CACHED_CONFIG = $self->getConfig; $CACHED_CONFIG_RETRIEVAL_COUNT = 1; } ; } ; if (defined $job_init_error) { if ($self->debug) { print 'JOB INITIALIZATION ERROR: ' . $job_init_error . "\n"; } ; $self->logMsg(2, "JOB INITIALIZATION ERROR: $job_init_error"); exit 1; } ; $job->debug($self->debug); $job->setConfig($self->getConfig); $job->setDriver($self->getDriver); $args = $job->parseArgs; 1 } })
296 0 0 if ($E->isa('Helios::Error::InvalidArg')) { }
0 0 elsif ($E->isa('Helios::Error::DatabaseError')) { }
314 0 0 if ($job->isaMetaJob) { }
316 0 0 if ($self->debug)
318 0 0 if ($self->debug)
321 0 0 if ($self->debug)
323 0 0 if ($self->debug)
326 0 0 unless (eval { do { if ($job->isaMetaJob) { if ($self->debug) { print 'CALLING METARUN() for metajob ' . $job->getJobid . "...\n"; } ; $return_code = $self->metarun($job); if ($self->debug) { print 'METARUN() RETURN CODE: ' . $return_code . "\n"; } ; } else { if ($self->debug) { print 'CALLING RUN() for job ' . $job->getJobid . "...\n"; } ; $return_code = $self->run($job); if ($self->debug) { print 'RUN() RETURN CODE: ' . $return_code . "\n"; } ; } ; 1 } })
345 0 0 if (defined $self->getConfig->{'DOWNSHIFT_ON_NONZERO_RUN'} and $self->getConfig->{'DOWNSHIFT_ON_NONZERO_RUN'} == 1 and $return_code != 0)
357 0 0 if ($self->shouldExitOverdrive)
410 0 0 unless (eval { do { $self->logMsg($metajob, 5, 'Bursting metajob ' . $metajob->getJobid); my $jobCount = $self->burstJob($metajob); $self->logMsg($metajob, 5, 'Metajob ' . $metajob->getJobid . ' burst into ' . $jobCount . ' jobs.'); 1 } })
412 0 0 if ($E->isa('Helios::Error::BaseError')) { }
473 0 0 if (defined $_[0]{'altJobTypes'}) { }
492 0 0 if (defined $_[0]{'altJobtypeids'}) { }
529 0 0 @_ ? :
530 0 0 @_ ? :
621 0 0 if (defined $params{'CACHED_CONFIG'})
624 0 0 if (defined $params{'DRIVER'})
627 0 0 if (defined $params{'LOGGERS'} and keys %{$params{'LOGGERS'};})
630 0 0 if (defined $params{'INIFILE'})
641 0 0 unless (defined $self->getHostname)
643 0 0 if ($CACHED_HOSTNAME) { }
653 0 0 if (defined $ENV{'HELIOS_DEBUG'})
658 0 0 if (defined $inifile)
660 0 0 if (defined $self->getIniFile)
662 0 0 if (defined $ENV{'HELIOS_INI'})
665 0 0 if (defined $cached_config) { }
670 0 0 unless ($INIT_CONFIG_CLASS)
680 0 0 if (defined $driver) { }
687 0 0 unless (defined $loggers)
714 0 0 unless ($INIT_CONFIG_CLASS)
715 0 0 if (defined $inifile)
752 0 0 unless ($INIT_CONFIG_CLASS)
788 0 0 if ($self->debug)
794 0 0 if (scalar @funcids > 0)
798 0 0 unless (eval { do { my $driver = $self->getDriver; my(@funcids) = $driver->search('TheSchwartz::FuncMap', {'funcname', $jobtype}); if (scalar @funcids > 0) { $self->setFuncid($funcids[0]->funcid); } ; 1 } })
830 0 0 unless ($jtid)
851 0 0 if ($jobtype) { }
878 0 0 unless (defined $primary_jobtypeid)
882 0 0 if ($self->getAltJobTypes)
883 0 0 if ($self->getAltJobtypeids) { }
890 0 0 if (@alt_jobtypeids) { }
906 0 0 unless (eval { do { my $dbh = $self->dbConnect; unless (defined $primary_jobtypeid) { $primary_jobtypeid = $self->lookupJobtypeid($self->getJobType); $self->setJobtypeid($primary_jobtypeid); } ; if ($self->getAltJobTypes) { if ($self->getAltJobtypeids) { @alt_jobtypeids = $self->getAltJobtypeids; } else { @alt_jobtypeids = $self->lookupAltJobtypeids; } ; } ; if (@alt_jobtypeids) { my(@plhrs) = '?'; foreach $_ (@alt_jobtypeids) { push @plhrs, '?'; } ; my $plhrs_str = join(',', @plhrs); $sth = $dbh->prepare_cached("SELECT COUNT(*) FROM job WHERE funcid IN($plhrs_str) AND (run_after < ?) AND (grabbed_until < ?)"); $sth->execute($primary_jobtypeid, @alt_jobtypeids, time, time); } else { $sth = $dbh->prepare_cached('SELECT COUNT(*) FROM job WHERE funcid = ? AND (run_after < ?) AND (grabbed_until < ?)'); $sth->execute($primary_jobtypeid, time, time); } ; my $r = $sth->fetchrow_arrayref; $sth->finish; $num_of_jobs = $r->[0]; 1 } })
933 0 0 if ($self->debug)
939 0 0 if ($self->debug)
960 0 0 if (defined $params->{'HALT'})
961 0 0 if (defined $params->{'HOLD'} and $params->{'HOLD'} == 1)
962 0 0 if (defined $params->{'WORKER_MAX_TTL'} and $params->{'WORKER_MAX_TTL'} > 0 and time > $WORKER_START_TIME + $params->{'WORKER_MAX_TTL'})
1010 0 0 unless (defined $dsn)
1025 0 0 if ($options)
1027 0 0 if $@
1035 0 0 if ($connect_to_heliosdb)
1046 0 0 if ($self->debug)
1048 0 0 if (defined $user)
1049 0 0 if (defined $options)
1056 0 0 unless (defined $dbh)
1061 0 0 unless (eval { do { if ($options) { $o = eval "{$options}"; 'Helios::Error::ConfigError'->throw($@) if $@; } ; if ($connect_to_heliosdb) { $o->{'RaiseError'} = 1; $o->{'AutoCommit'} = 1; } ; $$o{'private_heliconn_dbconnect_' . $$} = $$; if ($self->debug) { print "dbConnect():\n\tdsn=$dsn\n"; if (defined $user) { print "\tuser=$user\n"; } ; if (defined $options) { print "\toptions=$options\n"; } ; } ; $dbh = 'DBI'->connect_cached($dsn, $user, $password, $o); unless (defined $dbh) { 'Helios::Error::DatabaseError'->throw($DBI::errstr); } ; 1 } })
1189 0 0 if (ref $args[0] and $args[0]->isa('Helios::Job'))
1195 0 0 if (defined $args[0] and defined $args[1]) { }
1214 0 0 unless (eval { do { $logger->logMsg($job, $level, $msg); 1 } })
1251 0 0 $self->ConfigClass ? :
1254 0 0 unless (defined $INIT_CONFIG_CLASS)
1311 0 0 if (defined $config->{'loggers'})
1317 0 0 unless (defined $config->{'internal_logger'} and $config->{'internal_logger'} eq 'off' || $config->{'internal_logger'} eq '0')
1325 0 0 unless (defined $INIT_LOG_CLASSES{$logger})
1343 0 0 unless (eval { do { $logger->init; 1 } })
1357 0 0 if ($self->debug)
1375 0 0 $job->getArgs ? :
1575 0 0 unless ($class =~ /^[A-Za-z]([A-Za-z0-9_\-]|:{2})*[A-Za-z0-9_\-]$/)
1578 0 0 unless ($class->can('init'))
1585 0 0 unless (eval { do { my $class_file = $class; $class_file .= '.pm'; $class_file =~ s[::][/]g; require $class_file; 1 } })
1590 0 0 if ($requested_superclass and not $class->isa($requested_superclass))