Package com.netflix.lipstick.model

Examples of com.netflix.lipstick.model.P2jPlanStatus


    public void updateProgress(int progress) {
        if(invalidClient) {
            return;
        }

        P2jPlanStatus planStatus = new P2jPlanStatus();
        planStatus.setProgress(progress);

        // toArray() done to avoid concurrent access errors during iteration
        for (String jobId : runningJobIds.toArray(new String[0])) {
            updatePlanStatusForJobId(planStatus, jobId);
        }
View Full Code Here


                jobStatus.setScope(jobStats.getName());
                jobIdToJobStatusMap.put(jobId, jobStatus);
                runningJobIds.add(jobId);
            }
        }
        P2jPlanStatus planStatus = new P2jPlanStatus();
        updatePlanStatusForJobId(planStatus, jobId);
        psClient.saveStatus(planId, planStatus);
    }
View Full Code Here

        if (!runningJobIds.remove(jobId)) {
            LOG.error("Internal Error.  Job finished with no record of running jobId: " + jobId);
        }

        // Update the status of this job
        P2jPlanStatus planStatus = new P2jPlanStatus();
        jobIdToJobStatusMap.get(jobId).setFinishTime(System.currentTimeMillis());
        if (context.getExecType() == ExecType.LOCAL) {
            jobIdToJobStatusMap.get(jobId).setMapProgress(1);
            jobIdToJobStatusMap.get(jobId).setReduceProgress(1);
        }
View Full Code Here

     * Set the planStatus as ended with status statusText and saveStatus to the client.
     *
     * @param statusText job state at completition
     */
    protected void planEndedWithStatusText(StatusText statusText) {
        P2jPlanStatus planStatus = new P2jPlanStatus();
        planStatus.setEndTime();
        planStatus.setStatusText(statusText);
        psClient.saveStatus(planId, planStatus);
    }
View Full Code Here

    @Test
    public void persistStatus() throws JsonParseException, JsonMappingException, IOException {
        ObjectMapper mapper = new ObjectMapper();
        StringWriter writer = new StringWriter();
        IOUtils.copy(PersistTest.class.getResourceAsStream("/status.json"), writer, "UTF-8");
        P2jPlanStatus p = mapper.readValue(PersistTest.class.getResourceAsStream("/status.json"), P2jPlanStatus.class);

        EntityTransaction et = em.getTransaction();
        et.begin();
        em.persist(p);
        em.flush();
        et.commit();
        P2jPlanStatus p2 = em.find(P2jPlanStatus.class, p.getId());

        String j = mapper.writeValueAsString(p);
        String j2 = mapper.writeValueAsString(p2);
        Assert.assertEquals(j2, j);
    }
View Full Code Here

TOP

Related Classes of com.netflix.lipstick.model.P2jPlanStatus

Copyright © 2018 www.massapicom. 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.