/*
Popuate the job stats
778941
private void populate_Job (Hashtable<Enum, String> job, java.util.Map<JobHistory.Keys, String> jobC) throws ParseException {
    int size = jobC.size(); 
    java.util.Iterator<Map.Entry<JobHistory.Keys, String>> kv = jobC.entrySet().iterator();
    for (int i = 0; i < size; i++)
    {
      Map.Entry<JobHistory.Keys, String> entry = (Map.Entry<JobHistory.Keys, String>) kv.next();
      JobHistory.Keys key = entry.getKey();
      String value = entry.getValue();
      //System.out.println("JobHistory.JobKeys."+key+": "+value);
      switch (key) {
      case JOBTRACKERID: job.put(JobKeys.JOBTRACKERID, value); break;
      case FINISH_TIME: job.put(JobKeys.FINISH_TIME, value); break;
      case JOBID: job.put(JobKeys.JOBID, value); break;
      case JOBNAME: job.put(JobKeys.JOBNAME, value); break;
      case USER: job.put(JobKeys.USER, value); break;
      case JOBCONF: job.put(JobKeys.JOBCONF, value); break;
      case SUBMIT_TIME: job.put(JobKeys.SUBMIT_TIME, value); break;
      case LAUNCH_TIME: job.put(JobKeys.LAUNCH_TIME, value); break;
      case TOTAL_MAPS: job.put(JobKeys.TOTAL_MAPS, value); break;
      case TOTAL_REDUCES: job.put(JobKeys.TOTAL_REDUCES, value); break;
      case FAILED_MAPS: job.put(JobKeys.FAILED_MAPS, value); break;
      case FAILED_REDUCES: job.put(JobKeys.FAILED_REDUCES, value); break;
      case FINISHED_MAPS: job.put(JobKeys.FINISHED_MAPS, value); break;
      case FINISHED_REDUCES: job.put(JobKeys.FINISHED_REDUCES, value); break;
      case JOB_STATUS: job.put(JobKeys.STATUS, value); break;
      case JOB_PRIORITY: job.put(JobKeys.JOB_PRIORITY, value); break;
      case COUNTERS:
        value.concat(",");
        parseAndAddJobCounters(job, value);
        break;
      default:   System.err.println("JobHistory.Keys."+key+" : NOT INCLUDED IN PERFORMANCE ADVISOR COUNTERS");
               break;
      }
    }
  }
894498
public void populateSalary(ResultSet row, ObjectNode s) throws SQLException {
    s.put("employeeId", row.getInt("emp_no"));
    s.put("salary", row.getInt("salary"));
    Calendar fromDate = Calendar.getInstance();
    fromDate.setTime(row.getDate("from_date"));
    s.put("fromDate", dateFormat.format(fromDate.getTime()));
    Calendar toDate = Calendar.getInstance();
    toDate.setTime(row.getDate("to_date"));
    s.put("toDate", dateFormat.format(toDate.getTime()));
  }
1059679
function _executeFirstJob() {
    var i,
        l,
        test,
        kill,
        pushed = false,
        time = __dateNow(),
        job = _sortedByPriorityJobs.shift();

    // Execute the job and look at the result:
    test = job.job();

    // Deal with stats:
    time = __dateNow() - time;
    job.done++;
    job.time += time;
    job.currentTime += time;
    job.weightTime = job.currentTime / (job.weight || 1);
    job.averageTime = job.time / job.done;

    // Check if the job has to be killed:
    kill = job.count ? (job.count <= job.done) : !test;

    // Reset priorities:
    if (!kill) {
      for (i = 0, l = _sortedByPriorityJobs.length; i < l; i++)
        if (_sortedByPriorityJobs[i].weightTime > job.weightTime) {
          _sortedByPriorityJobs.splice(i, 0, job);
          pushed = true;
          break;
        }

      if (!pushed)
        _sortedByPriorityJobs.push(job);
    }

    return kill ? job : null;
  }
466550
function parseJobList(body, host, excludeSponsored){
  const $ = cheerio.load(body);
  const jobTable = $('#resultsCol');
  const jobs = jobTable.find('.result');
  let cont = true;

  // Filter out ads
  const filtered = excludeSponsored
    ? jobs.filter((_, e) => {
        const job = $(e);
        const footer = job.find('.jobsearch-SerpJobCard-footer');
        const spanText = Array.from(
          footer.find('span').map((_, span) => $(span).text())
        );
        const isSponsered = spanText.some(text =>
          text.toLowerCase().includes('sponsored')
        );
        return !isSponsered;
      })
    : jobs;

  // Create objects
  const jobObjects = filtered.map((i, e) => {
    const job = $(e);

    const jobtitle = job.find('.jobtitle').text().trim();

    const url = 'https://' + host + job.find('.jobtitle').attr('href');

    const summary = job.find('.summary').text().trim();

    const company = job.find('.company').text().trim() || null;

    const location = job.find('.location').text().trim();

    const postDate = job.find('.date').text().trim();

    const salary = job.find('.salary.no-wrap').text().trim();

    return {
      title: jobtitle,
      summary: summary,
      url: url,
      company: company,
      location: location,
      postDate: postDate,
      salary: salary
    };
  }).get();

  if (jobTable.children().hasClass('dupetext')) {
    // We haven't seen all the results but indeed says the rest are duplicates
    cont = false;
  } else if (
    $('.pagination > *:last-child')
      .text()
      .indexOf('Next') === -1
  ) {
    // We have seen all the results
    cont = false;
  }

  return {
    error: null,
    continue: cont,
    jobs: jobObjects
  };
}
890099
public function stats()
    {
        $workers = call_user_func(array($this->ResqueStats, 'getWorkers'));
        // List of all queues
        $queues = array_unique(call_user_func(array($this->ResqueStats, 'getQueues')));

        // List of queues monitored by a worker
        $activeQueues = array();
        foreach ($workers as $worker) {
            $tokens = explode(':', $worker);
            $activeQueues = array_merge($activeQueues, explode(',', array_pop($tokens)));
        }

        $this->outputTitle('Resque statistics');

        $this->output->outputLine();
        $this->output->outputLine('Jobs Stats', 'subtitle');
        $this->output->outputLine('   ' . sprintf('Processed Jobs : %10s', number_format(\Resque_Stat::get('processed'))));
        $this->output->outputLine('   ' . sprintf('Failed Jobs    : %10s', number_format(\Resque_Stat::get('failed'))), 'failure');
        if ($this->runtime['Scheduler']['enabled'] === true) {
            $this->output->outputLine('   ' . sprintf('Scheduled Jobs : %10s', number_format(\ResqueScheduler\Stat::get())));
        }
        $this->output->outputLine();

        $count = array();
        $this->output->outputLine('Queues Stats', 'subtitle');
        for ($i = count($queues) - 1; $i >= 0; --$i) {
            $count[$queues[$i]] = call_user_func_array(array($this->ResqueStats, 'getQueueLength'), array($queues[$i]));
            if (!in_array($queues[$i], $activeQueues) && $count[$queues[$i]] == 0) {
                unset($queues[$i]);
            }
        }

        $this->output->outputLine('   ' . sprintf('Queues count : %d', count($queues)));
        foreach ($queues as $queue) {
            $this->output->outputText(sprintf("\t- %-20s : %10s pending jobs", $queue, number_format($count[$queue])));
            if (!in_array($queue, $activeQueues)) {
                $this->output->outputText(' (unmonitored queue)', 'failure');
            }
            $this->output->outputText("\n");
        }
        $this->output->outputLine();

        $this->output->outputLine('Workers Stats', 'subtitle');
        $this->output->outputLine('  Active Workers : ' . count($workers));

        $schedulerWorkers = array();

        if (!empty($workers)) {

            $pausedWorkers = call_user_func(array($this->ResqueStatus, 'getPausedWorker'));

            foreach ($workers as $worker) {
                if ($this->runtime['Scheduler']['enabled'] === true && $this->ResqueStatus->isSchedulerWorker($worker)) {
                    $schedulerWorkers[] = $worker;
                    continue;
                }

                $this->output->outputText('    Worker : ' . $worker, 'bold');
                if (in_array((string)$worker, $pausedWorkers)) {
                    $this->output->outputText(' (Paused)', 'success');
                }
                $this->output->outputText("\n");

                $startDate = call_user_func_array(array($this->ResqueStats, 'getWorkerStartDate'), array($worker));

                $this->output->outputLine(
                    '     - Started on     : ' . $startDate
                );
                $this->output->outputLine(
                    '     - Uptime         : ' .
                    $this->formatDateDiff(new \DateTime($startDate))
                );
                $this->output->outputLine('     - Processed Jobs : ' . $worker->getStat('processed'));
                $worker->getStat('failed') == 0
                    ? $this->output->outputLine('     - Failed Jobs    : ' . $worker->getStat('failed'))
                    : $this->output->outputLine('     - Failed Jobs    : ' . $worker->getStat('failed'), 'failure');
            }
        }

        $this->output->outputLine("\n");

        if (!empty($schedulerWorkers)) {
            $this->output->outputText(ucwords('    scheduler worker'), 'bold');
            if (in_array((string)$schedulerWorkers[0], $pausedWorkers)) {
                $this->output->outputText(' (Paused)', 'success');
            }
            $this->output->outputText("\n");

            foreach ($schedulerWorkers as $worker) {
                $schedulerWorker = new \ResqueScheduler\ResqueScheduler();
                $delayedJobCount = $schedulerWorker->getDelayedQueueScheduleSize();
                $this->output->outputLine('    - Started on      : ' . call_user_func_array(array($this->ResqueStats, 'getWorkerStartDate'), array($worker)));
                $this->output->outputLine('    - Delayed Jobs    : ' . number_format($delayedJobCount));

                if ($delayedJobCount > 0) {
                    $this->output->outputLine('    - Next Job on     : ' . strftime('%a %b %d %H:%M:%S %Z %Y', $schedulerWorker->nextDelayedTimestamp()));
                }
            }
            $this->output->outputLine("\n");
        } elseif ($this->runtime['Scheduler']['enabled'] === true) {
            $jobsCount = \ResqueScheduler\ResqueScheduler::getDelayedQueueScheduleSize();
            if ($jobsCount > 0) {
                $this->output->outputLine("    ************ " . 'Alert' . " ************", 'failure');
                $this->output->outputLine("    " . 'The Scheduler Worker is not running', 'bold');
                $this->output->outputLine("    " . 'But there is still ' . number_format($jobsCount) . ' scheduled jobs left in its queue');
                $this->output->outputLine("    ********************************", 'failure');
                $this->output->outputLine("\n");
            }
        }
    }
1040243
def job_stats_enhanced(job_id):
    
    stats_dict = {}
    with os.popen('qstat -xf ' + str(job_id)) as f:
        try:
            line = f.readline().strip()
            while line:
                if line.startswith('Job Id:'):
                    stats_dict['job_id'] = line.split(':')[1].split('.')[0].strip()
                elif line.startswith('resources_used.walltime'):
                    stats_dict['wallclock'] = get_timedelta(line.split('=')[1])
                elif line.startswith('resources_used.cput'):
                    stats_dict['cpu'] = get_timedelta(line.split('=')[1])
                elif line.startswith('queue'):
                    stats_dict['queue'] = line.split('=')[1].strip()
                elif line.startswith('job_state'):
                    stats_dict['status'] = line.split('=')[1].strip()
                elif line.startswith('Exit_status'):
                    stats_dict['exit_code'] = line.split('=')[1].strip()
                elif line.startswith('Exit_status'):
                    stats_dict['exit_code'] = line.split('=')[1].strip()
                elif line.startswith('stime'):
                    stats_dict['start'] = line.split('=')[1].strip()
                line = f.readline().strip()
            if stats_dict['status'] == 'F' and 'exit_code' not in stats_dict:
                stats_dict['status'] = 'CA'
            elif stats_dict['status'] == 'F' and stats_dict['exit_code'] == '0':
                stats_dict['status'] = 'PBS_F'
        except Exception as e:
            with os.popen('qstat -xaw ' + str(job_id)) as f:
                try:
                    output = f.readlines()
                    for line in output:
                        if str(job_id) in line:
                            cols = line.split()
                            stats_dict['job_id'] = cols[0].split('.')[0]
                            stats_dict['queue'] = cols[2]
                            stats_dict['status'] = cols[9]
                            stats_dict['wallclock'] = get_timedelta(cols[10])
                            return stats_dict
                except Exception as e:
                    print(e)
                    print('PBS: Error reading job stats')
                    stats_dict['status'] = 'UNKNOWN'
    return stats_dict
1332009
public function jobPopulatePhoneNumberNumeric()
    {
        $numberList = $this->getEntityManager()->getRepository('PhoneNumber')->find();
        foreach ($numberList as $number) {
            $this->getEntityManager()->saveEntity($number);
        }
    }
103539
function(sids, options, callback) {
            sids = sids || [];

            if (sids.length === 0) {
                // If no job SIDs are provided, we list all jobs.
                var jobs = this.service.jobs();
                jobs.fetch(function(err, jobs) {
                    if (err) {
                        callback(err);
                        return;
                    }
                    
                    var list = jobs.list() || [];
                    for(var i = 0; i < list.length; i++) {
                        console.log("  Job " + (i + 1) + " sid: "+ list[i].sid);
                    }

                    callback(null, list);
                });
            }
            else {
                // If certain job SIDs are provided,
                // then we simply read the properties of those jobs
                this._foreach(sids, function(job, idx, done) {
                    job.fetch(function(err, job) {
                        if (err) {
                            done(err);
                            return;
                        }
                        
                        console.log("Job " + job.sid + ": ");
                        var properties = job.properties();
                        for(var key in properties) {
                            // Skip some keys that make the output hard to read
                            if (utils.contains(["performance"], key)) {
                                continue;
                            }

                            console.log("  " + key + ": ", properties[key]);
                        }
                        
                        done(null, properties);
                    });
                }, callback);
            }
        }
246069
function (jobName, customParams, callback) {
      [jobName, customParams, callback] = doArgs(arguments, ['string', ['object', {}], 'function']);

      this.job_info(jobName, function (error, data) {
        if (error) {
          callback(error, data);
          return;
        }

        const lastResultUrl = data.lastBuild.url;

        doRequest({
          urlPattern: [lastResultUrl + API, jobName]
        }, customParams, callback);
      });
    }
491288
public void populate(Result result) {
    // process job-level stats and properties
    NavigableMap<byte[], byte[]> infoValues = result.getFamilyMap(Constants.INFO_FAM_BYTES);

    this.jobId = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES
          .get(JobHistoryKeys.JOBID), infoValues);
    this.user = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES
          .get(JobHistoryKeys.USER), infoValues);
    this.jobName = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES
          .get(JobHistoryKeys.JOBNAME),infoValues);
    this.priority = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES
          .get(JobHistoryKeys.JOB_PRIORITY), infoValues);
    this.status = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES
          .get(JobHistoryKeys.JOB_STATUS), infoValues);
    this.hadoopVersion = getHadoopVersionFromResult(JobHistoryKeys.hadoopversion, infoValues);
    this.version = ByteUtil.getValueAsString(Constants.VERSION_COLUMN_BYTES, infoValues);
    this.cost = ByteUtil.getValueAsDouble(Constants.JOBCOST_BYTES, infoValues);

    // times
    this.submitTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES
          .get(JobHistoryKeys.SUBMIT_TIME), infoValues);
    this.launchTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES
          .get(JobHistoryKeys.LAUNCH_TIME), infoValues);
    this.finishTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES
          .get(JobHistoryKeys.FINISH_TIME), infoValues);
    this.megabyteMillis = ByteUtil.getValueAsLong(Constants.MEGABYTEMILLIS_BYTES, infoValues);
    this.cost = ByteUtil.getValueAsDouble(Constants.JOBCOST_BYTES, infoValues);

    // task counts
    this.totalMaps =
        ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.TOTAL_MAPS),
          infoValues);
    this.totalReduces =
        ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.TOTAL_REDUCES),
          infoValues);
    this.finishedMaps =
        ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FINISHED_MAPS),
          infoValues);
    this.finishedReduces =
        ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FINISHED_REDUCES),
          infoValues);
    this.failedMaps =
        ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FAILED_MAPS),
          infoValues);
    this.failedReduces =
        ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FAILED_REDUCES),
          infoValues);

    this.config = JobHistoryService.parseConfiguration(infoValues);
    this.queue = this.config.get(Constants.HRAVEN_QUEUE);
    this.counters = JobHistoryService.parseCounters(Constants.COUNTER_COLUMN_PREFIX_BYTES,
        infoValues);
    this.mapCounters = JobHistoryService.parseCounters(Constants.MAP_COUNTER_COLUMN_PREFIX_BYTES,
        infoValues);
    this.reduceCounters = JobHistoryService.parseCounters(Constants.REDUCE_COUNTER_COLUMN_PREFIX_BYTES,
        infoValues);

    // populate stats from counters for this job based on
    // hadoop version
    if (this.hadoopVersion == HadoopVersion.TWO) {
      // map file bytes read
      this.mapFileBytesRead = getCounterValueAsLong(this.mapCounters, 
            Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_READ);

      // map file bytes written
      this.mapFileBytesWritten = getCounterValueAsLong(this.mapCounters,
            Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_WRITTEN);

      // reduce file bytes read
      this.reduceFileBytesRead = getCounterValueAsLong(this.reduceCounters,
            Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_READ);

      // hdfs bytes read
      this.hdfsBytesRead = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTER_HADOOP2,
            Constants.HDFS_BYTES_READ);

      // hdfs bytes written
      this.hdfsBytesWritten = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTER_HADOOP2,
            Constants.HDFS_BYTES_WRITTEN);

      // map slot millis
      this.mapSlotMillis = getCounterValueAsLong(this.counters, Constants.JOB_COUNTER_HADOOP2,
            Constants.SLOTS_MILLIS_MAPS);

      // reduce slot millis
      this.reduceSlotMillis = getCounterValueAsLong(this.counters, Constants.JOB_COUNTER_HADOOP2,
            Constants.SLOTS_MILLIS_REDUCES);

      // reduce shuffle bytes
      this.reduceShuffleBytes = getCounterValueAsLong(this.reduceCounters, Constants.TASK_COUNTER_HADOOP2,
            Constants.REDUCE_SHUFFLE_BYTES);
    } else { // presume it's hadoop1
      // map file bytes read
      this.mapFileBytesRead = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTERS,
            Constants.FILES_BYTES_READ);

      // map file bytes written
      this.mapFileBytesWritten = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTERS,
            Constants.FILES_BYTES_WRITTEN);

      // reduce file bytes read
      this.reduceFileBytesRead = getCounterValueAsLong(this.reduceCounters, Constants.FILESYSTEM_COUNTERS,
            Constants.FILES_BYTES_READ);

      // hdfs bytes read
      this.hdfsBytesRead = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTERS,
            Constants.HDFS_BYTES_READ);

      // hdfs bytes written
      this.hdfsBytesWritten = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTERS,
            Constants.HDFS_BYTES_WRITTEN);

      // map slot millis
      this.mapSlotMillis = getCounterValueAsLong(this.counters, Constants.JOBINPROGRESS_COUNTER,
            Constants.SLOTS_MILLIS_MAPS);

      // reduce slot millis
      this.reduceSlotMillis = getCounterValueAsLong(this.counters, Constants.JOBINPROGRESS_COUNTER,
            Constants.SLOTS_MILLIS_REDUCES);

      // reduce shuffle bytes
      this.reduceShuffleBytes = getCounterValueAsLong(this.reduceCounters, Constants.TASK_COUNTER,
            Constants.REDUCE_SHUFFLE_BYTES);
    }
    // populate the task-level data
    // TODO: make sure to properly implement setTasks(...) before adding TaskDetails
    //populateTasks(result.getFamilyMap(Constants.TASK_FAM_BYTES));
  }
912587
@Override
  public JobStatus getJobStatus(final JobId jobId) {
    final ZooKeeperClient client = provider.get("getJobStatus");

    final Job job = getJob(client, jobId);
    if (job == null) {
      return null;
    }

    final List<String> hosts;
    try {
      hosts = listJobHosts(client, jobId);
    } catch (JobDoesNotExistException e) {
      return null;
    }

    final ImmutableMap.Builder<String, Deployment> deployments = ImmutableMap.builder();
    final ImmutableMap.Builder<String, TaskStatus> taskStatuses = ImmutableMap.builder();
    for (final String host : hosts) {
      final TaskStatus taskStatus = getTaskStatus(client, host, jobId);
      if (taskStatus != null) {
        taskStatuses.put(host, taskStatus);
      }
      final Deployment deployment = getDeployment(host, jobId);
      if (deployment != null) {
        deployments.put(host, deployment);
      }
    }

    final Map<String, Deployment> deploymentsMap = deployments.build();
    return JobStatus.newBuilder()
        .setJob(job)
        .setDeployments(deploymentsMap)
        .setTaskStatuses(taskStatuses.build())
        .build();
  }
707413
public void updateMetrics() {
    Counters counters = getCounters();
    for (Counters.Group group : counters) {
      jobMetrics.setTag("group", group.getDisplayName());
      for (Counters.Counter counter : group) {
        jobMetrics.setTag("counter", counter.getDisplayName());
        jobMetrics.setMetric("value", (float) counter.getCounter());
        jobMetrics.update();
      }
    }
  }
68118
function executeJob (options, opType, callback) {
  var job = client.query(options.namespace, options.set, options.statement)
  var stream = job.execute()
  stream.on('data', function (record) {
    // count the records returned
    intervalData[opType][TPS]++
  })
  stream.on('error', function (error) {
    intervalData[opType][ERROR]++
    if (error.code === status.ERR_TIMEOUT) {
      intervalData[opType][TIMEOUT]++
    }
  })
  stream.on('end', function () {
    // update a stat for number of jobs completed.
    callback(options)
  })
}
943171
public function jobPopulateArrayValues()
    {
        $scopeList = array_keys($this->getMetadata()->get(['scopes']));

        $sql = "DELETE FROM array_value";
        $this->getEntityManager()->getPdo()->query($sql);

        foreach ($scopeList as $scope) {
            if (!$this->getMetadata()->get(['scopes', $scope, 'entity'])) continue;
            if ($this->getMetadata()->get(['scopes', $scope, 'disabled'])) continue;

            $seed = $this->getEntityManager()->getEntity($scope);
            if (!$seed) continue;

            $attributeList = [];

            foreach ($seed->getAttributes() as $attribute => $defs) {
                if (!isset($defs['type']) || $defs['type'] !== \Espo\ORM\Entity::JSON_ARRAY) continue;
                if (!$seed->getAttributeParam($attribute, 'storeArrayValues')) continue;
                if ($seed->getAttributeParam($attribute, 'notStorable')) continue;
                $attributeList[] = $attribute;
            }
            $select = ['id'];
            $orGroup = [];
            foreach ($attributeList as $attribute) {
                $select[] = $attribute;
                $orGroup[$attribute . '!='] = null;
            }

            $sql = $this->getEntityManager()->getQuery()->createSelectQuery($scope, [
                'select' => $select,
                'whereClause' => [
                    'OR' => $orGroup
                ]
            ]);
            $sth = $this->getEntityManager()->getPdo()->prepare($sql);
            $sth->execute();

            while ($dataRow = $sth->fetch(\PDO::FETCH_ASSOC)) {
                $entity = $this->getEntityManager()->getEntityFactory()->create($scope);
                $entity->set($dataRow);
                $entity->setAsFetched();

                foreach ($attributeList as $attribute) {
                    $this->getEntityManager()->getRepository('ArrayValue')->storeEntityAttribute($entity, $attribute, true);
                }
            }
        }
    }
895438
def pop(self, count=None):
        ''''''
        results = [Job(self.client, **job) for job in json.loads(
            self.client('pop', self.name, self.worker_name, count or 1))]
        if count is None:
            return (len(results) and results[0]) or None
        return results
254508
void selectJobsToInitialize() {
    for (String queue : jobQueues.keySet()) {
      ArrayList<JobInProgress> jobsToInitialize = getJobsToInitialize(queue);
      printJobs(jobsToInitialize);
      JobInitializationThread t = threadsToQueueMap.get(queue);
      for (JobInProgress job : jobsToInitialize) {
        t.addJobsToQueue(queue, job);
      }
    }
  }
140323
def update_stats(job_stats)
      s = @stats.stats
      current_speed = job_stats.stats[:current_speed] *
                      @stats.penalty(@threads)

      s[:resolution][:completed_records] +=
        job_stats.stats[:resolution][:completed_records]
      @stats.update_eta(current_speed)
      s[:resolution][:time_span] = Time.now - s[:resolution][:start_time]
      s[:matches][7] += job_stats.stats[:matches][7]
    end