Examples of IncrementalTask


Examples of com.google.appengine.tools.mapreduce.impl.shardedjob.IncrementalTask

          shardObject.put("active", true);
        } else {
          shardObject.put("active", false);
          shardObject.put("result_status", taskState.getStatus().getStatusCode());
        }
        IncrementalTask task = taskState.getTask();
        if (task instanceof IncrementalTaskWithContext) {
          IncrementalTaskContext context = ((IncrementalTaskWithContext) task).getContext();
          totalCounters.addAll(context.getCounters());
          workerCallCounts[i] = context.getWorkerCallCount();
          shardObject.put("last_work_item", context.getLastWorkItemString());
View Full Code Here

Examples of org.waveprotocol.wave.client.scheduler.Scheduler.IncrementalTask

    assertFalse(task1.wasExecuted);
    assertEmpty(true);
  }

  public void testCancellingAnIncrementalTaskDuringExecutionIgnoresContinueValue() {
    IncrementalTask mock = new IncrementalTask() {
      boolean cancelled;
      @Override
      public boolean execute() {
        if (cancelled) {
          fail("Cancelled task was not removed from scheduler");
View Full Code Here

Examples of org.waveprotocol.wave.client.scheduler.Scheduler.IncrementalTask

  }

  /** Tests that multiple processes can be run at the same time. */
  public void testMultipleProcessesAtSameTime() {
    final int time = 100;
    final IncrementalTask anotherTask = mock(IncrementalTask.class, "anotherTask");
    timer.scheduleRepeating(repeating, 0, time);
    timer.scheduleRepeating(anotherTask, time, time);

    checking(new Expectations() {{
      one(repeating).execute();
View Full Code Here

Examples of org.waveprotocol.wave.client.scheduler.Scheduler.IncrementalTask

    cancel(process);
    tasks.add(new TimedTask(currentTime + minimumTime, process, interval));
  }

  private boolean findOrCancel(Schedulable job, boolean remove) {
    IncrementalTask incrementalTask;
    if (job instanceof IncrementalTask) {
      incrementalTask = (IncrementalTask) job;
    } else if (job instanceof Task) {
      incrementalTask = new TaskAsIncrementalTask((Task) job);
    } else {
View Full Code Here

Examples of org.waveprotocol.wave.client.scheduler.Scheduler.IncrementalTask

   */
  public void tick(int millisToAdvance) {
    currentTime += millisToAdvance;
    while (!tasks.isEmpty() && tasks.peek().getTime() <= currentTime) {
      TimedTask timedTask = tasks.poll();
      IncrementalTask task = timedTask.getTask();
      boolean doReschedule = task.execute();
      if (doReschedule) {
        // Note: If the next execution is at or before currentTime, the task
        // will be re-executed before this tick() call returns.
        tasks.add(timedTask.nextExecution());
      }
View Full Code Here

Examples of org.waveprotocol.wave.client.scheduler.Scheduler.IncrementalTask

    cancel(process);
    tasks.add(new TimedTask(currentTime + minimumTime, process, interval));
  }

  private boolean findOrCancel(Schedulable job, boolean remove) {
    IncrementalTask incrementalTask;
    if (job instanceof IncrementalTask) {
      incrementalTask = (IncrementalTask) job;
    } else if (job instanceof Task) {
      incrementalTask = new TaskAsIncrementalTask((Task) job);
    } else {
View Full Code Here

Examples of org.waveprotocol.wave.client.scheduler.Scheduler.IncrementalTask

   */
  public void tick(int millisToAdvance) {
    currentTime += millisToAdvance;
    while (!tasks.isEmpty() && tasks.peek().getTime() <= currentTime) {
      TimedTask timedTask = tasks.poll();
      IncrementalTask task = timedTask.getTask();
      boolean doReschedule = task.execute();
      if (doReschedule) {
        // Note: If the next execution is at or before currentTime, the task
        // will be re-executed before this tick() call returns.
        tasks.add(timedTask.nextExecution());
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.