Examples of Task


Examples of hu.u_szeged.nbo.res_alloc.model.type.Task

        log += (new Date()).toString() + ": nincs elvegezheto munka\n";
        efs.setNotUsable(true);
        continue;
      }
    // step 4
      Task cTask = minimizeL(L, ID, l)// Chosen task
      log += (new Date()).toString() + ": " + cTask.getId() + ". munka beutemezese\n";
    // step 5: Registration
      Registrate(cTask, l.get(cTask), ID.get(cTask), M);
    }
   
    model.NormalizeOutputs();
View Full Code Here

Examples of hudson.model.Queue.Task

     * - a computer with 1 executor, idle.
     * - a future load of size 1 is predicted
     * - hence the consideration of the current task at hand shall fail, as it'll collide with the estimated future load.
     */
    public void test1() throws Exception {
        Task t = mock(Task.class);
        when(t.getEstimatedDuration()).thenReturn(10000L);
        when(t.getSubTasks()).thenReturn((Collection) asList(t));


        Computer c = createMockComputer(1);

        JobOffer o = createMockOffer(c.getExecutors().get(0));
View Full Code Here

Examples of info.unipax.bina.platform.tasks.Task

   
    final SequencedTask t = Tasks.createSequencedTask("perform analysis");   
   
    t.addTask(session.getMainWindow().createOpenFile(file));
   
    t.addTask(new Task("add wait")
    {
      public void run()
      {         
        initializeController();
        controller.getVisualization().addLock(t);
      }
    })
   
    t.addTask(new Task("map Data")
    {
      public void run()
      {         
        mapData(session, task);       
      }
    });   
   
    t.addTask(new Task("analysis")
    {
      public void run()
      { 
        UDISPerspective.mapOfData.put(controller, new DataMethods(session, controller));
       
        initializeController();       

        UDISPerspective.mapOfData.get(controller).makeAnalysis();         
      }
    });
   
    t.addTask(new Task("remove wait")
    {
      public void run()
       {         
        controller.getVisualization().removeLock(t);
      }
View Full Code Here

Examples of io.crate.executor.Task

    @Override
    @SuppressWarnings("unchecked")
    public List<ListenableFuture<TaskResult>> execute(Job job) {
        assert job.tasks().size() > 0;

        Task lastTask = null;
        for (Task task : job.tasks()) {
            // chaining tasks
            if (lastTask != null) {
                task.upstreamResult(lastTask.result());
            }
            task.start();
            lastTask = task;
        }

        assert lastTask != null;
        return (List<ListenableFuture<TaskResult>>)lastTask.result();
    }
View Full Code Here

Examples of io.dropwizard.servlets.tasks.Task

    private final MetricRegistry metricRegistry = new MetricRegistry();
    private final AdminEnvironment env = new AdminEnvironment(handler, healthCheckRegistry, metricRegistry);

    @Test
    public void addsATaskServlet() throws Exception {
        final Task task = new Task("thing") {
            @Override
            public void execute(ImmutableMultimap<String, String> parameters, PrintWriter output) throws Exception {
            }
        };
        env.addTask(task);
View Full Code Here

Examples of io.druid.indexing.common.task.Task

  {
    final File taskFile = Preconditions.checkNotNull(config.getTaskFile(), "taskFile");
    final File statusFile = Preconditions.checkNotNull(config.getStatusFile(), "statusFile");
    final InputStream parentStream = Preconditions.checkNotNull(config.getParentStream(), "parentStream");

    final Task task;

    try {
      task = jsonMapper.readValue(taskFile, Task.class);

      log.info(
          "Running with task: %s",
          jsonMapper.writerWithDefaultPrettyPrinter().writeValueAsString(task)
      );
    }
    catch (IOException e) {
      throw Throwables.propagate(e);
    }

    // Spawn monitor thread to keep a watch on parent's stdin
    // If stdin reaches eof, the parent is gone, and we should shut down
    parentMonitorExec.submit(
        new Runnable()
        {
          @Override
          public void run()
          {
            try {
              while (parentStream.read() != -1) {
                // Toss the byte
              }
            }
            catch (Exception e) {
              log.error(e, "Failed to read from stdin");
            }

            // Kind of gross, but best way to kill the JVM as far as I know
            log.info("Triggering JVM shutdown.");
            System.exit(2);
          }
        }
    );

    // Won't hurt in remote mode, and is required for setting up locks in local mode:
    try {
      if (!task.isReady(taskActionClientFactory.create(task))) {
        throw new ISE("Task is not ready to run yet!", task.getId());
      }
    } catch (Exception e) {
      throw new ISE(e, "Failed to run isReady", task.getId());
    }

    statusFuture = Futures.transform(
        taskRunner.run(task),
        new Function<TaskStatus, TaskStatus>()
View Full Code Here

Examples of it.sauronsoftware.cron4j.Task

*/
public class MyTaskCollector implements TaskCollector {

  public TaskTable getTasks() {
    SchedulingPattern pattern = new SchedulingPattern("* * * * *");
    Task task = new MyTask();
    TaskTable ret = new TaskTable();
    ret.add(pattern, task);
    return ret;
  }
View Full Code Here

Examples of javafx.concurrent.Task

        /**
         * Per prima cosa riordino in base alla priorita.
         */
        Collections.sort(data_table, table_comparator);

        Task task = new Task<Void>() {
            @Override
            protected Void call() throws Exception {
                String message = "";
                backup_running = true;
                try {

                    List<File> fileList = Collections.synchronizedList(new ArrayList<>());

                    long millis = System.currentTimeMillis();

                    int prec = 0;
                    int total = data_table.size();

                    for (int i = 0; i < total; i++) {

                        //----------------------------------------------------//
                        EncryptedNode node = data_table.get(i).getNode();
                        String source_path = node.getProperties().get("source");
                        String dest_path = node.getProperties().get("destination");
                        String action = node.getProperties().get("action");
                        //----------------------------------------------------//

                        File file_source = new File(source_path);
                        File file_dest = new File(dest_path);

                        if (!file_source.exists()) {
                            ini.store("last_result_bck", "Error - " + Utility.data());
                            message = "Can't find souce path: " + file_source + "\n";
                            showMessage(message);
                            return null;
                        }

                        if (!file_dest.exists()) {
                            ini.store("last_result_bck", "Error - " + Utility.data());
                            message = message + "Can't find dest. path: " + file_dest;
                            showMessage(message);
                            return null;
                        }
                    }

                    for (int i = 0; i < total; i++) {

                        //----------------------------------------------------//
                        EncryptedNode node = data_table.get(i).getNode();
                        String source_path = node.getProperties().get("source");
                        String dest_path = node.getProperties().get("destination");
                        String action = node.getProperties().get("action");
                        //----------------------------------------------------//

                        File file_source = new File(source_path);
                        File file_dest = new File(dest_path);
                        boolean exits_all = true;

                        if (!file_source.exists()) {
                            ini.store("last_result_bck", "Error - " + Utility.data());
                            message = "Can't find souce path: " + file_source + "\n";
                            exits_all = false;
                        }

                        if (!file_dest.exists()) {
                            ini.store("last_result_bck", "Error - " + Utility.data());
                            message = message + "Can't find dest. path: " + file_dest;
                            exits_all = false;
                        }

                        if (exits_all) {

                            //------------------------------------------------//
                            //------------------------------------------------//
                            //------------------------------------------------//
                            node.getProperties().put("status", "Running");
                            updateTable();

                            fileList.clear();

                            if (!fileList.isEmpty()) {
                                Utility.log("ERROR CAN'T CLEAR FILE LIST!");
                                showMessage("Application Error, can't clear file list.");
                                return null;
                            }

                            //------------------------------------------------//
                            //------------------------------------------------//
                            //------------------------------------------------//
                            /**
                             * Da ricordare che: 1) NIO nella copia dei file mi
                             * da' dei problemi su alcuni attributi per win7,
                             * quindi in caso di errore faccio la copia
                             * "normale" 2) Lo Zip mi dava problemi con le
                             * cartelle vuote quindi le creo io con il path
                             * "cartella/"
                             */
                            switch (action) {
                                case ACTION_ZIP: {
                                    visitor.setAction("Analyse");
                                    Utility.listFiles(file_source, fileList, visitor);
                                    File result = new File(file_dest + File.separator + file_source.getName() + ".zip");
                                    visitor.setAction("Processing");
                                    Utility.createZipFile(result, file_source, fileList, visitor);
                                    break;
                                }
                                case ACTION_COPY: {
                                    if (file_source.isFile()) {
                                        visitor.setAction("Processing");
                                        Utility.copyFile(file_source.toString(), file_dest + File.separator + file_source.getName(), visitor);
                                    } else {
                                        visitor.setAction("Processing");
                                        Utility.copyRecursively(file_source.toString(), file_dest + File.separator + file_source.getName(), visitor);
                                    }
                                    break;
                                }
                            }
                            node.getProperties().put("status", "Done");
                            updateTable();

                        } else {
                            showMessage(message);
                            return null;
                        }

                        prec += (i + 1 * 100) / total;
                        updateProgress(prec, 100);
                        setPercentValue(prec);
                    }

                    String __val_total_time = String.format("%d hour, %d min, %d sec",
                            TimeUnit.MILLISECONDS.toHours(System.currentTimeMillis() - millis),
                            TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis() - millis),
                            TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis() - millis)
                            - TimeUnit.MINUTES.toSeconds(
                                    TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis() - millis)));

                    setCenterMessage("Backup completed. Time Total: " + __val_total_time);

                    ini.store("last_result_bck", "OK - " + Utility.data());

                } catch (Exception exc) {

                    Utility.exc(exc);
                    exc.printStackTrace();

                    message = exc.getMessage();
                    showMessage(message);

                    ini.store("last_result_bck", "Error - " + Utility.data());

                } finally {
                    Thread.currentThread().sleep(5000);
                    setLastResult();
                }
                return null;
            }

            @Override
            protected void succeeded() {

                backup_running = false;
                setAllStatusValue("");
                setPercentValue(0);
                endProg();
                __btn_bck_add.setDisable(false);
                __btn_bck_remove.setDisable(false);
                __btn_bck_remove_all.setDisable(false);
                __btn_bck_start_backup.setDisable(false);
                super.succeeded();
            }
        };

        prog_bk_total.progressProperty().unbind();
        prog_bk_total.progressProperty().bind(task.progressProperty());

        __btn_bck_add.setDisable(true);
        __btn_bck_remove.setDisable(true);
        __btn_bck_remove_all.setDisable(true);
        __btn_bck_start_backup.setDisable(true);
View Full Code Here

Examples of jline.internal.ShutdownHooks.Task

    public void init() throws Exception {
        if (shutdownTask != null) {
            ShutdownHooks.remove(shutdownTask);
        }
        // Register a task to restore the terminal on shutdown
        this.shutdownTask = ShutdownHooks.add(new Task()
        {
            public void run() throws Exception {
                restore();
            }
        });
View Full Code Here

Examples of jsx.ui.samaple.todo.TodoTasks.Task

     */
    private void add() {
        String value = input.value.get();

        if (value != null && value.length() != 0) {
            todos.list.add(new Task(value));

            input.clear();
        }
    }
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.