/** * @param $rootJobParams array * @return void */ protected function insertPartitionJobs($rootJobParams = array()) { // Carry over any "root job" information $rootJobParams = $this->getRootJobParams(); $batches = $this->blCache->partition($this->params['table'], $this->rowsPerJob); if (!count($batches)) { return; // no jobs to insert } $jobs = array(); foreach ($batches as $batch) { list($start, $end) = $batch; $jobs[] = new HTMLCacheUpdateJob($this->title, array('table' => $this->params['table'], 'start' => $start, 'end' => $end) + $rootJobParams); } JobQueueGroup::singleton()->push($jobs); }
/** * Get a backlink cache object * * @return BacklinkCache */ public function getBacklinkCache() { return BacklinkCache::get($this); }
/** * Create a new BacklinkCache or reuse any existing one. * Currently, only one cache instance can exist; callers that * need multiple backlink cache objects should keep them in scope. * * @param Title $title : Title object to get a backlink cache for * @return BacklinkCache */ public static function get(Title $title) { if (!self::$cache) { // init cache self::$cache = new ProcessCacheLRU(1); } $dbKey = $title->getPrefixedDBkey(); if (!self::$cache->has($dbKey, 'obj')) { self::$cache->set($dbKey, 'obj', new self($title)); } return self::$cache->get($dbKey, 'obj'); }
/** * Create a new BacklinkCache or reuse any existing one. * Currently, only one cache instance can exist; callers that * need multiple backlink cache objects should keep them in scope. * * @param Title $title Title object to get a backlink cache for * @return BacklinkCache */ public static function get(Title $title) { if (!self::$instance || !self::$instance->title->equals($title)) { self::$instance = new self($title); } return self::$instance; }