Package com.netflix.lipstick.model

Examples of com.netflix.lipstick.model.P2jPlanPackage


                }

                MRPlanCalculator opPlan = new MRPlanCalculator(opPlanGenerator.getP2jPlan(), plan, p2lMap, opPlanGenerator.getReverseMap());
                MRPlanCalculator unopPlan = new MRPlanCalculator(unopPlanGenerator.getP2jPlan(), plan, p2lMap, unopPlanGenerator.getReverseMap());

                P2jPlanPackage plans = new P2jPlanPackage(opPlan.getP2jPlan(), unopPlan.getP2jPlan(), script, planId);

                Properties props = context.getProperties();
                plans.setUserName(UserGroupInformation.getCurrentUser().getUserName());
                if (props.containsKey(JOB_NAME_PROP)) {
                    plans.setJobName(props.getProperty(JOB_NAME_PROP));
                } else {
                    plans.setJobName("unknown");
                }

                if(props.containsKey(ENABLE_SAMPLE_OUTPUT_PROP)) {
                    String strProp = props.getProperty(ENABLE_SAMPLE_OUTPUT_PROP).toLowerCase();
                    if(strProp.equals("f") || strProp.equals("false")) {
                        enableSampleOutput = false;
                        LOG.warn("Sample Output has been disabled.");
                    }
                }

                plans.getStatus().setStartTime();
                plans.getStatus().setStatusText(StatusText.running);
                invalidClient = (psClient.savePlan(plans) == null);

            } catch (Exception e) {
                LOG.error("Caught unexpected exception generating json plan.", e);
                invalidClient = true;
View Full Code Here


    }

    @Test
    public void persistPlan() throws JsonParseException, JsonMappingException, IOException {
        ObjectMapper mapper = new ObjectMapper();
        P2jPlanPackage p = mapper.readValue(PersistTest.class.getResourceAsStream("/test.json"), P2jPlanPackage.class);

        EntityTransaction et = em.getTransaction();
        et.begin();
        em.persist(p);
        em.flush();
        et.commit();
        P2jPlanPackage p2 = em.find(P2jPlanPackage.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.P2jPlanPackage

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.