protected function getExclusiveJobs(KalturaExclusiveLockKey $lockKey, $maxExecutionTime, $numberOfJobs, KalturaBatchJobFilter $filter = null, $jobType, $maxOffset = null) { $dbJobType = kPluginableEnumsManager::apiToCore('BatchJobType', $jobType); if (!is_null($filter)) { $jobsFilter = $filter->toFilter($dbJobType); } return kBatchExclusiveLock::getExclusiveJobs($lockKey->toObject(), $maxExecutionTime, $numberOfJobs, $dbJobType, $jobsFilter, $maxOffset); }
/** * batch updateExclusiveJobAction action updates a BatchJob of extended type that was claimed using the getExclusiveJobs * * @action updateExclusiveJob * @param int $id The id of the job to free * @param KalturaExclusiveLockKey $lockKey The unique lock key from the batch-process. Is used for the locking mechanism * @param KalturaBatchJob $job * @return KalturaBatchJob */ function updateExclusiveJobAction($id, KalturaExclusiveLockKey $lockKey, KalturaBatchJob $job) { $dbBatchJob = BatchJobPeer::retrieveByPK($id); $dbBatchJob = kBatchManager::updateExclusiveBatchJob($id, $lockKey->toObject(), $job->toObject($dbBatchJob)); $batchJob = new KalturaBatchJob(); // start from blank return $batchJob->fromObject($dbBatchJob); }