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); }
function updateExclusiveJob($id, KalturaExclusiveLockKey $lockKey, KalturaBatchJob $job) { $kparams = array(); $this->client->addParam($kparams, "id", $id); $this->client->addParam($kparams, "lockKey", $lockKey->toParams()); $this->client->addParam($kparams, "job", $job->toParams()); $this->client->queueServiceActionCall("metadata_metadatabatch", "updateExclusiveJob", $kparams); if ($this->client->isMultiRequest()) { return null; } $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "KalturaBatchJob"); return $resultObject; }
/** * 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); }