FOSSology  4.6.0
Open Source License Compliance by Open Source Software
Fossology\Lib\Dao\ShowJobsDao Class Reference
Collaboration diagram for Fossology\Lib\Dao\ShowJobsDao:
Collaboration graph

Public Member Functions

 __construct (DbManager $dbManager, UploadDao $uploadDao)
 
 uploads2Jobs ($upload_pks, $page=0)
 Find all the jobs for a given set of uploads. More...
 
 getJobName ($uploadId)
 Return job name. Used for deleted jobs. More...
 
 myJobs ($allusers, $page=0)
 Find all of my jobs submitted within the last n hours. More...
 
 getJobInfo ($job_pks)
 Get job queue data from db. More...
 
 getNumItemsPerSec ($itemsprocessed, $numSecs)
 Returns Number of files/items processed per sec. More...
 
 getEstimatedTime ($job_pk, $jq_Type='', $filesPerSec=0, $uploadId=0, $timeInSec=0)
 Returns Estimated time using jobid. More...
 
 getDataForASingleJob ($jq_pk)
 Return total Job data with time elapsed. More...
 
 getJobStatus ($jqPk)
 
 getItemsProcessedForDecider ($jqType, $jobId)
 
 getJobsForAll ()
 
 isJobIdPresentInReportGen ($jobId)
 

Private Member Functions

 toPgIntArray (array $ints)
 Convert an array of integers to a Postgres array literal string. More...
 
 fetchJobRecords ($jobPkArray)
 Fetch job records for the given job_pk's. More...
 
 fetchUploadData ($jobPkArray)
 Fetch both existing uploads and jobs referencing deleted uploads. More...
 
 fetchUploadtreeRoots ($uploadRows)
 Fetch root records from uploadtree tables for the given upload records. More...
 
 attachUploadData (&$jobData, $uploadRows, $uploadtreeRows, $deletedMap)
 Attach upload and uploadtree data to job data. Also handles deleted uploads using the pre-fetched deletedMap. More...
 
 attachJobQueueData (&$jobData, $jobPkArray)
 Attach jobqueue data to job data for the given job_pk's. More...
 

Private Attributes

 $dbManager
 
 $uploadDao
 
 $logger
 
 $maxJobsPerPage = 10
 
 $nhours = 336
 

Detailed Description

Definition at line 15 of file ShowJobsDao.php.

Member Function Documentation

◆ attachJobQueueData()

Fossology\Lib\Dao\ShowJobsDao::attachJobQueueData ( $jobData,
  $jobPkArray 
)
private

Attach jobqueue data to job data for the given job_pk's.

Parameters
array$jobDataArray of job records indexed by job_pk
string$jobPkArrayArray of job_pk's in Postgres array format (e.g. "{1,2,3}")

Definition at line 334 of file ShowJobsDao.php.

◆ attachUploadData()

Fossology\Lib\Dao\ShowJobsDao::attachUploadData ( $jobData,
  $uploadRows,
  $uploadtreeRows,
  $deletedMap 
)
private

Attach upload and uploadtree data to job data. Also handles deleted uploads using the pre-fetched deletedMap.

Parameters
array$jobDataArray of job records indexed by job_pk
array$uploadRowsArray of upload records indexed by upload_pk
array$uploadtreeRowsArray of uploadtree root records indexed by upload_fk
array$deletedMapMap of job_pk => upload_fk for jobs referencing deleted uploads

Definition at line 307 of file ShowJobsDao.php.

◆ fetchJobRecords()

Fossology\Lib\Dao\ShowJobsDao::fetchJobRecords (   $jobPkArray)
private

Fetch job records for the given job_pk's.

Parameters
string$jobPkArrayArray of job_pk's in Postgres array format (e.g. "{1,2,3}")
Returns
array of job records indexed by job_pk

Definition at line 221 of file ShowJobsDao.php.

◆ fetchUploadData()

Fossology\Lib\Dao\ShowJobsDao::fetchUploadData (   $jobPkArray)
private

Fetch both existing uploads and jobs referencing deleted uploads.

Parameters
string$jobPkArray
Returns
array Two-element array: [uploadRows indexed by upload_pk, deletedMap of job_pk => upload_fk]

Definition at line 240 of file ShowJobsDao.php.

◆ fetchUploadtreeRoots()

Fossology\Lib\Dao\ShowJobsDao::fetchUploadtreeRoots (   $uploadRows)
private

Fetch root records from uploadtree tables for the given upload records.

Parameters
array$uploadRowsArray of upload records indexed by upload_pk
Returns
array of uploadtree root records indexed by upload_fk

Definition at line 273 of file ShowJobsDao.php.

◆ getDataForASingleJob()

Fossology\Lib\Dao\ShowJobsDao::getDataForASingleJob (   $jq_pk)

Return total Job data with time elapsed.

Parameters
$jq_pk
Returns
array

Definition at line 447 of file ShowJobsDao.php.

◆ getEstimatedTime()

Fossology\Lib\Dao\ShowJobsDao::getEstimatedTime (   $job_pk,
  $jq_Type = '',
  $filesPerSec = 0,
  $uploadId = 0,
  $timeInSec = 0 
)

Returns Estimated time using jobid.

Parameters
int$job_pk
string$jq_Type
float$filesPerSec
int$uploadId
Returns
string Returns empty if estimated time is 0 else returns time.

Definition at line 382 of file ShowJobsDao.php.

◆ getItemsProcessedForDecider()

Fossology\Lib\Dao\ShowJobsDao::getItemsProcessedForDecider (   $jqType,
  $jobId 
)
Parameters
$jqType
$jobId
Returns
array

Definition at line 482 of file ShowJobsDao.php.

◆ getJobInfo()

Fossology\Lib\Dao\ShowJobsDao::getJobInfo (   $job_pks)

Get job queue data from db.

Parameters
array$job_pksArray of $job_pk's to display.
Returns
array of job data
JobData [job_pk] Array of job records (JobRec)
JobRec['jobqueue'][jq_pk] = array of JobQueue records
JobRec['jobqueue'][jq_pk]['depends'] = array of jq_pk's for dependencies
JobRec['upload'] = array for upload record
JobRec['job'] = array for job record
JobRec['uploadtree'] = array for parent uploadtree record
JobQueue ['jq_pk'] = jq_pk
JobQueue ['jq_type'] = jq_type
JobQueue ['jq_itemsprocessed'] = jq_itemsprocessed
JobQueue ['jq_starttime'] = jq_starttime
JobQueue ['jq_endtime'] = jq_endtime
JobQueue ['jq_log'] = jq_log
JobQueue ['jq_endtext'] = jq_endtext
JobQueue ['jq_end_bits'] = jq_end_bits
Contains information required by uploadtree elements.
Definition: adj2nest.c:93

Definition at line 190 of file ShowJobsDao.php.

◆ getJobName()

Fossology\Lib\Dao\ShowJobsDao::getJobName (   $uploadId)

Return job name. Used for deleted jobs.

Parameters
upload_pk
Returns
Original job name in job record.

Definition at line 100 of file ShowJobsDao.php.

◆ getJobsForAll()

Fossology\Lib\Dao\ShowJobsDao::getJobsForAll ( )

Get the status of all recent pending or running jobs.

Returns
array Containing job name, number of jobs pending and running

Definition at line 501 of file ShowJobsDao.php.

◆ getJobStatus()

Fossology\Lib\Dao\ShowJobsDao::getJobStatus (   $jqPk)
Parameters
$jqPk
Returns
bool

Definition at line 462 of file ShowJobsDao.php.

◆ getNumItemsPerSec()

Fossology\Lib\Dao\ShowJobsDao::getNumItemsPerSec (   $itemsprocessed,
  $numSecs 
)

Returns Number of files/items processed per sec.

Parameters
int$itemsprocessed
int$numSecs
Returns
double

Definition at line 369 of file ShowJobsDao.php.

◆ isJobIdPresentInReportGen()

Fossology\Lib\Dao\ShowJobsDao::isJobIdPresentInReportGen (   $jobId)
Parameters
$jobId
Returns
bool

Definition at line 519 of file ShowJobsDao.php.

◆ myJobs()

Fossology\Lib\Dao\ShowJobsDao::myJobs (   $allusers,
  $page = 0 
)

Find all of my jobs submitted within the last n hours.

Parameters
int$allusersGet data of all users if set to 1.
int$pageGet data for this display page. Starts with zero.
Returns
array of job_pk's and total number of pages created

Definition at line 120 of file ShowJobsDao.php.

◆ toPgIntArray()

Fossology\Lib\Dao\ShowJobsDao::toPgIntArray ( array  $ints)
private

Convert an array of integers to a Postgres array literal string.

Parameters
array$intsArray of integer values
Returns
string Postgres array literal, e.g. "{1,2,3}"

Definition at line 40 of file ShowJobsDao.php.

◆ uploads2Jobs()

Fossology\Lib\Dao\ShowJobsDao::uploads2Jobs (   $upload_pks,
  $page = 0 
)

Find all the jobs for a given set of uploads.

Parameters
array$upload_pksArray of upload_pk's
int$pageGet data for this display page. Starts with zero.
Returns
array of job_pk's for the uploads

Definition at line 53 of file ShowJobsDao.php.


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