Invokes a map-reduce job do parallel raiding.
@return true if the job was started, false otherwise
187769
public boolean startDistRaid() throws IOException {
    assert(raidPolicyPathPairList.size() > 0);
    if (setup()) {
      this.jobClient = new JobClient(jobconf);
      this.runningJob = this.jobClient.submitJob(jobconf);
      LOG.info("Job Started: " + runningJob.getID());
      this.startTime = System.currentTimeMillis();
      return true;
    }
    return false;
  }
1059209
@Override
    public boolean isCallTimedOut(Operation op) {
        // Join and WAN replication operations should not be checked for timeout
        // because caller is not member of this cluster and can have a different
        // clock.
        if (isJoinOperation(op) || isWanReplicationOperation(op)) {
            return false;
        }

        long callTimeout = op.getCallTimeout();
        long invocationTime = op.getInvocationTime();
        long expireTime = invocationTime + callTimeout;

        if (expireTime <= 0 || expireTime == Long.MAX_VALUE) {
            return false;
        }

        ClusterClock clusterClock = nodeEngine.getClusterService().getClusterClock();
        long now = clusterClock.getClusterTime();
        if (expireTime < now) {
            return true;
        }

        return false;
    }
132770
protected boolean lockJobIfNeeded() {
    try {
      if (job.isExclusive()) {
        processEngineConfiguration.getCommandExecutor().execute(new LockExclusiveJobCmd(job));
      }

    } catch (Throwable lockException) {
      if (log.isDebugEnabled()) {
        log.debug("Could not lock exclusive job. Unlocking job so it can be acquired again. Catched exception: " + lockException.getMessage());
      }

      // Release the job again so it can be acquired later or by another node
      unacquireJob();
      
      return false;
    }
    
    return true;
  }
150060
protected boolean scheduleNewTask(String taskId) {
    // Put it to the pending start queue
    LOG.info(String.format("We are to schedule task: [%s]", taskId));

    // Update the tasksId
    int containerIndex = TaskUtils.getContainerIndexForTaskId(taskId);
    tasksId.put(containerIndex, taskId);

    // Re-schedule it
    toScheduleTasks.add(taskId);
    LOG.info(String.format("Added task: %s into the to-schedule-tasks queue: ", taskId));
    return true;
  }
299682
public boolean trySaveToBean() {

        try {
            m_group.commit();
        } catch (Exception e) {
            LOG.info(e.getLocalizedMessage(), e);
            return false;
        }
        m_job.setParameters(readParams());
        return true;
    }
940000
def check_running_job_count():
    """"""
    try:
        job_list = current_k8s_batchv1_api_client.\
            list_job_for_all_namespaces()
        if len(job_list.items) > K8S_MAXIMUM_CONCURRENT_JOBS:
            return False
    except ApiException as e:
        log.error('Something went wrong while getting running job list.')
        log.error(e)
        return False
    return True
833084
public static <K1,V1,K2,V2> 
  void setMapperClass(Job job, 
                      Class<? extends Mapper<K1,V1,K2,V2>> cls) {
    if (MultithreadedMapper.class.isAssignableFrom(cls)) {
      throw new IllegalArgumentException("Can't have recursive " + 
                                         "MultithreadedMapper instances.");
    }
    job.getConfiguration().setClass("mapred.map.multithreadedrunner.class",
                                    cls, Mapper.class);
  }
471878
public function queue()
    {
        if (Event::fire(Event::JOB_QUEUE, $this) === false) {
            return false;
        }

        $this->redis->sadd(Queue::redisKey(), $this->queue);
        $status = $this->redis->rpush(Queue::redisKey($this->queue), $this->payload);

        if ($status < 1) {
            return false;
        }

        $this->setStatus(self::STATUS_WAITING);

        Stats::incr('queued', 1);
        Stats::incr('queued', 1, Queue::redisKey($this->queue, 'stats'));

        Event::fire(Event::JOB_QUEUED, $this);

        return true;
    }
55518
protected final boolean hasScheduledTasks() {
        Queue<ScheduledFutureTask<?>> scheduledTaskQueue = this.scheduledTaskQueue;
        ScheduledFutureTask<?> scheduledTask = scheduledTaskQueue == null ? null : scheduledTaskQueue.peek();
        return scheduledTask != null && scheduledTask.deadlineNanos() <= nanoTime();
    }
732088
protected boolean jobTooOld(final JobInfo jobInfo, final JobDefinition jobDefinition) {
        final Optional<OffsetDateTime> stopped = jobInfo.getStopped();
        if (stopped.isPresent() && jobDefinition.maxAge().isPresent()) {
            final OffsetDateTime deadlineToRerun = stopped.get().plus(jobDefinition.maxAge().get());
            return deadlineToRerun.isBefore(now());
        }

        return false;
    }
1291105
public boolean execute(ProcessInstance processInstance) {
		log.debug("{}",this);
		ProcessInstanceUtils.setQueue(processInstance, getOwnerProcess().getWorkflowManager().getQueue(m_queue));
		return false;
	}
896559
protected boolean wasStopIssuedOnJob() {
        StopLock stopLock = getStopLock(); // Store in local variable to facilitate Ctrl+Shift+G search in Eclipse
        synchronized (stopLock) {
            if (runtimeWorkUnitExecution.getBatchStatus().equals(BatchStatus.STOPPING)) {
                return true;
            } else {
                return false;
            }
        }
    }
28605
public boolean createJob(Map<Integer, BaseContainer> jobDefinition) {
    synchronized (this) {
      if (isTerminated) {
        LOG.severe("Job has been killed");
        return false;
      }

      // Record the jobDefinition
      containersInfo.putAll(jobDefinition);

      // To scheduler them with 0 attempt
      for (Map.Entry<Integer, BaseContainer> entry : jobDefinition.entrySet()) {
        Integer containerIndex = entry.getKey();
        BaseContainer container = entry.getValue();
        String taskId = TaskUtils.getTaskId(container.name, 0);
        scheduleNewTask(taskId);
      }
    }

    return true;
  }
446259
public boolean handleNextTask() {
		Runnable task = this.getNextTask();

		if (task != null) {
			synchronized (this.tasksReachesZero) {
				this.runningTasks++;
			}
			try {
				task.run();
			} catch (Throwable t) {
				t.printStackTrace();
			}

			synchronized (this.tasksReachesZero) {
				this.runningTasks--;
				if (this.runningTasks == 0) {
					this.tasksReachesZero.notifyAll();
				}
			}

			synchronized (task) {
				task.notifyAll();
			}
			return true;
		}
		return false;
	}
260620
public synchronized boolean delete(final Job job) {
        // if already shutdown in the process of shutdown, there is no
        // need to remove Jobs as they will never be executed.
        if (shutdown) {
            return false;
        }
        int i = findIndex(job);
        if (i != -1) {
            ScheduledJobEntry se = (ScheduledJobEntry) jobList.remove(i);
            if (se.job != job) { // this should never happen
                new IllegalStateException("Internal programming error");
            }
            // if the job is the first on the list,
            // then notify the scheduler thread to schedule a new job
            if (i == 0) {
                this.notifyAll();
            }
            return true;
        } else {
            return false;
        }
    }
379239
@Override
    public <K, V, R> R invoke(Cache<K, V> cache, Operation<K, V, R> operation, Flag... allFlags) {
        Flag[] attemptFlags = null;
        // attemptFlags = allFlags - Flag.FAIL_SILENTLY
        if ((allFlags != null) && (allFlags.length > 0)) {
            Set<Flag> flags = EnumSet.noneOf(Flag.class);
            flags.addAll(Arrays.asList(allFlags));
            flags.remove(Flag.FAIL_SILENTLY);
            attemptFlags = flags.toArray(new Flag[flags.size()]);
        }

        Exception exception = null;

        for (int i = 0; i <= this.backOffIntervals.length; ++i) {
            // Make sure Flag.FAIL_SILENTLY, if specified, is applied to the last try only
            try {
                return this.invoker.invoke(cache, operation, (i < this.backOffIntervals.length) ? attemptFlags : allFlags);
            } catch (TimeoutException e) {
                exception = e;
            }

            if (i < this.backOffIntervals.length) {
                int delay = this.backOffIntervals[i];

                try {
                    if (ROOT_LOGGER.isTraceEnabled()) {
                        ROOT_LOGGER.tracef(exception, "Cache operation failed.  Retrying in %d ms", Integer.valueOf(delay));
                    }

                    Thread.sleep(delay);
                } catch (InterruptedException e) {
                    Thread.currentThread().interrupt();
                }
            }
        }

        throw MESSAGES.abortingCacheOperation(exception, this.backOffIntervals.length + 1);
    }
335713
public boolean performAsyncButOrdered(K key, Runnable runnable) {
        Queue<Runnable> keyQueue;
        synchronized (pendingRunnables) {
            keyQueue = pendingRunnables.get(key);
            if (keyQueue == null) {
                keyQueue = new ConcurrentLinkedQueue<>();
                pendingRunnables.put(key, keyQueue);
            }
        }

        keyQueue.add(runnable);

        boolean newHandler;
        synchronized (threadActiveMap) {
            Boolean threadActive = threadActiveMap.get(key);
            if (threadActive == null) {
                threadActive = false;
                threadActiveMap.put(key, threadActive);
            }

            newHandler = !threadActive;
            if (newHandler) {
                Handler handler = new Handler(keyQueue, key);
                threadActiveMap.put(key, true);
                if (executor == null) {
                    AbstractXMPPConnection.asyncGo(handler);
                } else {
                    executor.execute(handler);
                }
            }
        }

        return newHandler;
    }