Examples of Task


Examples of org.apache.hadoop.yarn.server.resourcemanager.Task

    application_0.addResourceRequestSpec(priority_1, capability_0_0);
   
    Resource capability_0_1 = Resources.createResource(2 * GB, 1);
    application_0.addResourceRequestSpec(priority_0, capability_0_1);

    Task task_0_0 = new Task(application_0, priority_1,
        new String[] {host_0, host_1});
    application_0.addTask(task_0_0);
      
    // Submit another application
    Application application_1 = new Application("user_1", "b2", resourceManager);
    application_1.submit();
   
    application_1.addNodeManager(host_0, 1234, nm_0);
    application_1.addNodeManager(host_1, 1234, nm_1);
   
    Resource capability_1_0 = Resources.createResource(3 * GB, 1);
    application_1.addResourceRequestSpec(priority_1, capability_1_0);
   
    Resource capability_1_1 = Resources.createResource(2 * GB, 1);
    application_1.addResourceRequestSpec(priority_0, capability_1_1);

    Task task_1_0 = new Task(application_1, priority_1,
        new String[] {host_0, host_1});
    application_1.addTask(task_1_0);
       
    // Send resource requests to the scheduler
    application_0.schedule();
    application_1.schedule();

    // Send a heartbeat to kick the tires on the Scheduler
    LOG.info("Kick!");
   
    // task_0_0 and task_1_0 allocated, used=4G
    nodeUpdate(nm_0);
   
    // nothing allocated
    nodeUpdate(nm_1);
   
    // Get allocations from the scheduler
    application_0.schedule();     // task_0_0
    checkApplicationResourceUsage(1 * GB, application_0);

    application_1.schedule();     // task_1_0
    checkApplicationResourceUsage(3 * GB, application_1);
   
    checkNodeResourceUsage(4*GB, nm_0)// task_0_0 (1G) and task_1_0 (3G)
    checkNodeResourceUsage(0*GB, nm_1)// no tasks, 2G available

    LOG.info("Adding new tasks...");
   
    Task task_1_1 = new Task(application_1, priority_0,
        new String[] {ResourceRequest.ANY});
    application_1.addTask(task_1_1);

    application_1.schedule();

    Task task_0_1 = new Task(application_0, priority_0,
        new String[] {host_0, host_1});
    application_0.addTask(task_0_1);

    application_0.schedule();

View Full Code Here

Examples of org.apache.hama.bsp.Task

    private void restartTask(TaskInProgress tip, long superstep,
        Map<String, GroomServerStatus> groomStatuses,
        Map<GroomServerStatus, List<GroomServerAction>> actionMap) {
      GroomServerStatus serverStatus = tip.getGroomServerStatus();
      Task task = tip.constructTask(serverStatus);
      populateAction(task, superstep, serverStatus, actionMap);

    }
View Full Code Here

Examples of org.apache.hama.monitor.Monitor.Task

    LOG.debug("Scanning jar files within "+pluginDir+".");
    for(File jar: pluginDir.listFiles()) {
      String jarPath = jar.getPath();
      Long timestamp = repos.get(jarPath);
      if(null == timestamp || jar.lastModified() > timestamp) {
        Task t = load(jar, loader);
        if(null != t) {
          t.setListener(listener);
          taskList.put(jarPath, t);
          repos.put(jarPath, new Long(jar.lastModified()));
          LOG.debug(jar.getName()+" is loaded.");
        }
      }
View Full Code Here

Examples of org.apache.harmony.awt.wtk.NativeEventQueue.Task

        hwnd = w.getId();
        dropTargetPtr = registerDropTarget();
    }
   
    private long registerDropTarget() {
        Task task = new Task() {
            @Override
            public void perform() {
                long ret = WinDataTransfer.registerDropTarget(
                        hwnd, WinDropTarget.this);
                returnValue = new Long(ret);
View Full Code Here

Examples of org.apache.isis.viewer.html.task.Task

    // ////////////////////////////////////////////////////
    // Tasks
    // ////////////////////////////////////////////////////

    public Task getTask(final String taskId) {
        Task task = null;
        for (int i = crumbs.size() - 1; i >= 0; i--) {
            final Object crumb = crumbs.get(i);
            if (crumb instanceof TaskCrumb) {
                final TaskCrumb taskCrumb = (TaskCrumb) crumb;
                final String id = taskCrumb.getTask().getId();
View Full Code Here

Examples of org.apache.lenya.cms.task.Task

        String contextPath = map.get(Task.PARAMETER_SERVLET_CONTEXT);
        String publicationId = map.get(Task.PARAMETER_PUBLICATION_ID);
       
        Publication publication = new Publication(publicationId, contextPath);
        TaskManager manager = new TaskManager(publication.getDirectory().getAbsolutePath());
        Task task = manager.getTask(taskId);

        try {
            task.parameterize(map.getParameters());
            task.execute(contextPath);
        }
        catch (ParameterException e) {
            log.debug("Initializing task failed: ", e);
        }
        catch (ExecutionException e) {
View Full Code Here

Examples of org.apache.marmotta.platform.core.api.task.Task

        }
        if (type == null || !importService.getAcceptTypes().contains(type)) return Response.status(412).entity("define a valid content-type (types: "+importService.getAcceptTypes()+")").build();
        final String finalType = type;
        final InputStream in = request.getInputStream();

        Task t = taskManagerService.createTask(String.format("Upload-Import from %s (%s)", request.getRemoteHost(), finalType), TASK_GROUP_NAME);
        t.updateMessage("preparing import...");
        t.updateDetailMessage("type", finalType);
        try {
            //create context
            URI context = getContext(context_string);
            if (context != null) {
                t.updateDetailMessage("context", context.toString());
            }

            t.updateMessage("importing data...");
            importService.importData(in,finalType, userService.getCurrentUser(), context);
            t.updateMessage("import complete");

            return Response.ok().entity("import of content successful\n").build();
        } catch(Exception ex) {
            log.error("error while importing", ex);
            return Response.status(500).entity("error while importing: " + ex.getMessage()).build();
View Full Code Here

Examples of org.apache.ode.scheduler.simple.Task

    }
   
    public void testSchedulingResolution() throws Exception {
        _st.start();
        long schedtime = System.currentTimeMillis() + 300;
        _st.enqueue(new Task(schedtime));
        Thread.sleep(1000);
        assertEquals(1,_tasks.size());
        assertTrue(_tasks.get(0).time < schedtime + SCHED_TOLERANCE / 2);
        assertTrue(_tasks.get(0).time > schedtime - SCHED_TOLERANCE / 2);
    }
View Full Code Here

Examples of org.apache.pivot.util.concurrent.Task

                        searchCriterias.add(criteriaType + ":" + selectedViewItem.getId());
                    }
                }
            }
        }
        Task task = null;
        if (listButton != null) {
            task = browserMap.get(mainType).createTask(viewMap.get(listButton), type, searchCriterias);
        } else {
            task = browserMap.get(mainType).createTask(tracksTableView, type, searchCriterias);
        }

        // Activate search indicator
        searchActivity.setActive(true);
        searchActivity.setVisible(true);
        task.execute(new TaskAdapter<Void>(new TaskListener<Void>() {
            public void executeFailed(Task<Void> voidTask) {
                taskExecuted(voidTask);
            }

            public void taskExecuted(Task<Void> voidTask) {
View Full Code Here

Examples of org.apache.stratos.throttling.manager.tasks.Task

    public static final String THROTTLING_TASK_CONTEXT_KEY = "throttlingTask";

    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
        carbonContext.setTenantId(MultitenantConstants.SUPER_TENANT_ID);
        Task task = (Task) jobExecutionContext.getMergedJobDataMap().get(THROTTLING_TASK_CONTEXT_KEY);
        executeTask(task);
    }
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.