Examples of Task


Examples of com.google.devtools.moe.client.tasks.Task

    // Strip off the task name
    // This mutates t.getOptions, and so has to be called before we create the injector.
    Flags.parseOptions(t.getOptions(), ImmutableList.copyOf(args).subList(1, args.length));
    Injector injector = Guice.createInjector(t, new MoeModule());
    Task task = injector.getInstance(Task.class);

    Task.Explanation result = task.executeAtTopLevel();
    if (!Strings.isNullOrEmpty(result.message)) {
      logger.info(result.message);
      System.out.println(result.message);
    }
    System.exit(result.exitCode);
View Full Code Here

Examples of com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap.Task

    final int[] expected = { map.nextOrder };
    int maxTasks = 2 * BUFFER_THRESHOLD;

    for (int i = 0; i < maxTasks; i++) {
      final int id = map.nextOrdering();
      Task task = mock(Task.class);
      when(task.getOrder()).thenReturn(id);
      doAnswer(new Answer<Void>() {
        @Override public Void answer(InvocationOnMock invocation) {
          assertThat(id, is(expected[0]++));
          return null;
        }
View Full Code Here

Examples of com.gwtmobile.persistence.test.domain.Task

            final Category c = categoryEntity.newInstance();
            c.setName("Main");
            final Tag tag = tagEntity.newInstance();
            tag.setName("Urgent");
            for (int i = 0; i < 5; i++) {
              Task t = taskEntity.newInstance();
              t.setName("Task" + Integer.toString(i));
              t.setDescription("Task No #" + Integer.toString(i));
              if (i % 2 == 0) {
                t.setDone(true);
                t.setCompleteDate(new Date(2010 - 1900, 12 - 1, 1 + i));
                t.setPriority(i);
                t.setPercentage((float)i / 10);
                t.setProfit((double)i * 12.34);
                t.setAlphabet((char) ('A' + i));
                t.setJson((JSONObject) JSONParser.parse("{\"symbol\": \"ABC\", \"price\": 96.204659543522}"));
              }
              t.setCategory(c);
              t.getTags().add(tag);
            }
            Persistence.flush(callback);
          }
        });
      }
View Full Code Here

Examples of com.intalio.bpms.workflow.taskManagementServices20051109.Task

  @Test
  public void testUpdate() throws Exception {
    XmlObject xmlObject = XmlObject.Factory.parse(this.getClass().getResource("/update.xml"));
    Assert.assertNotNull(xmlObject);
        System.out.println(xmlObject.toString());
        Task taskElement = Task.Factory.newInstance();
        TaskMetadata metadata = taskElement.addNewMetadata();
       
        metadata.set(new TaskUnmarshaller().expectElement(xmlObject, "taskMetadata"));
        System.out.println(taskElement.getMetadata().getTaskId());
  }
View Full Code Here

Examples of com.intellij.openapi.progress.Task

        }
    }

    private static void compileAskHaddock(final Module module) {
        Project project = module.getProject();
        final Task haddockBackgroundTask = new Task.Backgroundable(project, "Setting up Haddock", true) {
            public void run(ProgressIndicator indicator) {
                indicator.setText("Please wait while setting up Haddock (Haskell documentation tool) installation...");
                indicator.setText2("Checking Haddock installation...");
                indicator.setFraction(0.0);
                HaddockLocation.get(module, indicator);
                indicator.setFraction(1.0);
            }
        }.setCancelText("Stop Haddock installation");
        ApplicationManager.getApplication().invokeLater(new Runnable() {
            public void run() {
                haddockBackgroundTask.queue();
            }
        });
    }
View Full Code Here

Examples of com.jbidwatcher.util.Task

    return null;
  }

  private void removeAuctionsFromTab(final boolean deleteFirst, final AuctionListHolder holder) {
    holder.getList().each(new Task() {
      public void execute(Object o) {
        AuctionEntry ae = (AuctionEntry) o;

        if (deleteFirst) {
          holder.getUI().delEntry(ae);
View Full Code Here

Examples of com.linkedin.whiteelephant.parsing.Task

     
      String line = value.toString();
     
      Job job = null;
      Attempt attempt = null;
      Task task = null;
     
      job = LineParsing.tryParseJob(line);
     
      if (job == null)
      {     
        attempt = LineParsing.tryParseAttempt(line);
       
        if (attempt == null)
        {
          task = LineParsing.tryParseTask(line);
        }
      }
     
      LogData data = new LogData();
      String jobId = null;
     
      data.setCluster(_clusterName);
     
      try
      {
        if (job != null)
        {
          // log lines are sometimes truncated, so data may be missing - just ignore these
          if (job.getJobId() != null)
          {
            jobId = job.getJobId().toString();
            job.setTasks(new ArrayList<Task>());
            data.setEntry(job);
            data.setPath(findInputSplitForJob(jobId,inputSplits));
            context.write(new AvroKey<String>(jobId), new AvroValue<LogData>(data));
          }
        }
        else if (attempt != null)
        {
          // log lines are sometimes truncated, so data may be missing - just ignore these
          if (attempt.getJobId() != null && attempt.getTaskId() != null && attempt.getTaskAttemptId() != null && attempt.getType() != null)
          {
            jobId = attempt.getJobId().toString();
            data.setEntry(attempt);
            data.setPath(findInputSplitForJob(jobId,inputSplits));
            context.write(new AvroKey<String>(jobId), new AvroValue<LogData>(data));
          }
        }
        else if (task != null)
        {
          // log lines are sometimes truncated, so data may be missing - just ignore these
          if (task.getJobId() != null && task.getTaskId() != null && task.getType() != null)
          {
            jobId = task.getJobId().toString();
            task.setAttempts(new ArrayList<Attempt>());
            data.setEntry(task);
            data.setPath(findInputSplitForJob(jobId,inputSplits));
            context.write(new AvroKey<String>(jobId), new AvroValue<LogData>(data));
          }
        }
View Full Code Here

Examples of com.melitronic.domain.entity.Task

      return resp;
    }
   
    public Task store(Task task, Item item, Sprint sprint, Person person, CallContext context) {
     
      Task resp = PmTask.instance().store(task, item, sprint, person, em, context);
     
      return resp;
    }
View Full Code Here

Examples of com.melitronic.rmapp.model.Task

            AbstractEntityUtil.sort(AbstractEntityUtil.convert(domainItem.getTasks(null)));

          for (AbstractEntity i3 : sortedColl3) {
            com.melitronic.domain.entity.Task domainTask =
              (com.melitronic.domain.entity.Task)i3;
            Task task = getUC().getTask(domainTask);
            it.addChild(task);
          }
         
        }
      }
View Full Code Here

Examples of com.mozilla.grouperfish.model.Task

    public String toString() {
        return name;
    }

    public void run() {
        Task task = null;
        try {
            while (!Thread.currentThread().isInterrupted()) {
                task = inQueue.take();
                try {
                    // :TODO: NEXT:
                    // If power fails, tasks can go MIA here.
                    // We should maintain a global map of tasks, check it periodically, and restart tasks that went MIA.
                    // Task update their status there, and clients could check the status using a GET /run/... call.
                    task = handler.handle(task);
                }
                catch (final Fail e) {
                    log.warn(String.format("%s %s: failed with message '%s'", name, task, e.getMessage()));
                    if (task.failures().size() >= NUM_TRIES) {
                        log.error(String.format("%s %s: Error details:", name, task), e);
                        log.error(String.format("%s %s: Retries exhausted. Failing.", name, task));
                        failQueue.put(task);
                    }
                    else {
                        log.warn(String.format("%s %s: recording failure & requeuing...", name, task));
                        inQueue.put(task.fail(e.getMessage()));
                    }
                    continue;
                }
                catch (final Exception e) {
                    log.error(String.format("%s %s: Exception while handling.", name, task));
                    log.error(String.format("%s %s: Error details:", name, task), e);
                    failQueue.put(task.fail(e.getMessage()));
                    continue;
                }

                if (outQueue != null) outQueue.put(task);
                task = null;
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.