Package com.netflix.lipstick.model.operators

Examples of com.netflix.lipstick.model.operators.P2jLogicalRelationalOperator$Join


     */
    protected Boolean schemaEqualsPredecessor(P2jLogicalRelationalOperator oper) {
        if (oper.getSchemaString() != null) {
            String operString = oper.getSchemaString().substring(1, oper.getSchemaString().length() - 1);
            for (String predName : oper.getPredecessors()) {
                P2jLogicalRelationalOperator pred = p2jMap.get(predName);
                try {
                    if (pred.getSchemaString() != null) {
                        String predString = pred.getSchemaString().substring(1, pred.getSchemaString().length() - 1);
                        if (!Schema.equals(Utils.getSchemaFromString(predString),
                                           Utils.getSchemaFromString(operString),
                                           true,
                                           false)) {
                            return false;
View Full Code Here


            attributeGraphNode(node, e.getKey());
            if (!appendToSubgraph(subgraphs, node, e.getKey())) {
                gv.node(node);
            }
            for (String i : e.getKey().getSuccessors()) {
                P2jLogicalRelationalOperator dst = p2jMap.get(i);
                Edge edge = new Edge(node, graphMap.get(dst));
                gv.edge(edge);
            }
        }
        for (Entry<String, Graph> sg : subgraphs.entrySet()) {
View Full Code Here

     * @param node the LogicalRelationalOperator to convert
     * @param lp the LogicalPlan containing the LogicalRelationalOperator
     * @throws FrontendException
     */
    public LOJsonAdaptor(LogicalRelationalOperator node, LogicalPlan lp) throws FrontendException {
        this(node, new P2jLogicalRelationalOperator(), lp);
    }
View Full Code Here

            verifyLimitAdaptor((LOLimitJsonAdaptor) adaptor, (LOLimit) lro);
        }
    }

    private void verifyGenericAdaptor(LOJsonAdaptor adaptor, LogicalRelationalOperator lro) throws FrontendException {
        P2jLogicalRelationalOperator p2j = adaptor.getToP2jOperator();
        if (lro.getSchema() != null) {
            Assert.assertEquals(p2j.getSchemaString(), Util.translateSchema(lro.getSchema()).toString());
        }
        Assert.assertEquals(p2j.getOperator(), lro.getClass().getSimpleName());
        Assert.assertEquals(p2j.getAlias(), lro.getAlias());
        Assert.assertEquals(p2j.getLocation().getLine(), (Integer) lro.getLocation().line());
        Assert.assertEquals(p2j.getLocation().getFilename(), lro.getLocation().file());
    }
View Full Code Here

        }

        String stepTypeString = stepType.toString();

        if (pop instanceof POStore) {
            P2jLogicalRelationalOperator node = getOpForStore((POStore) pop);
            if (node != null) {
                node.setMapReduce(jid, stepTypeString);
                return;
            }
        } else if (phy2LogMap.containsKey(pop) && reverseMap.containsKey(phy2LogMap.get(pop))) {
            String nodeId = reverseMap.get(phy2LogMap.get(pop));
            P2jLogicalRelationalOperator node = p2jMap.get(nodeId);
            node.setMapReduce(jid, stepTypeString);
            LOG.debug("Found key for: " + pop.toString());
            return;
        } else {
            LOG.debug("No node for pop: " + pop + pop.getClass() + " ... Searching locationMap.");
            boolean didAssign = false;
            for (OriginalLocation loc : pop.getOriginalLocations()) {
                LOG.debug("Checking location: " + loc);
                if (locationMap.containsKey(loc.toString())) {
                    P2jLogicalRelationalOperator node = p2jMap.get(reverseMap.get(locationMap.get(loc.toString())));
                    LOG.debug("Found location... " + node);
                    if (node.getMapReduce() == null) {
                        if (node.getOperator().equalsIgnoreCase("LOJoin")
                            || node.getOperator().equalsIgnoreCase("LOGroup")) {
                            stepTypeString = MRStepType.REDUCER.toString();
                        }
                        node.setMapReduce(jid, stepTypeString);
                        didAssign = true;
                        LOG.debug("Assign location... " + node);
                    }
                }
            }
View Full Code Here

     * @return a set of map/reduce job scopes
     */
    protected Set<String> generateScopesForNode(P2jLogicalRelationalOperator node, ScopeGetter scopeGetter) {
        Set<String> scopes = Sets.newHashSet();
        for (String id : scopeGetter.getScopes(node)) {
            P2jLogicalRelationalOperator job = p2jMap.get(id);
            if (job.getMapReduce() != null && job.getMapReduce().getJobId() != null) {
                scopes.add(job.getMapReduce().getJobId());
            } else {
                scopes.addAll(generateScopesForNode(job, scopeGetter));
            }
        }
        return scopes;
View Full Code Here

     *
     */
    protected P2jLogicalRelationalOperator convertNodeToP2j(LogicalRelationalOperator node,
                                                            LogicalPlan lp,
                                                            Map<Operator, String> reverseMap) throws FrontendException {
        P2jLogicalRelationalOperator p2jNode = convertNodeToAdaptor(node, lp).getToP2jOperator();
        p2jNode.setPredecessors(generateP2jIdList(lp.getPredecessors(node), reverseMap));
        p2jNode.setSuccessors(generateP2jIdList(lp.getSuccessors(node), reverseMap));
        p2jNode.setUid(reverseMap.get(node));
        return p2jNode;
    }
View Full Code Here

        expectedOps.add(limit1);

        // For each op, ensure the aliases and all predecessors/successors match
        for (String scope : plan.getPlan().keySet()) {
            P2jLogicalRelationalOperator actualOp = plan.getPlan().get(scope);

            String actualId = getIdentifier(actualOp);

            P2jLogicalRelationalOperator matchedOp = null;
            for (P2jLogicalRelationalOperator expectedOp : expectedOps) {
                String expectedId = getIdentifier(expectedOp);
                if (actualId.equals(expectedId)) {
                    matchedOp = expectedOp;
                    // Compare classes
View Full Code Here

        expectedIdToStepTypeMap.put("colors_filtered", MRStepType.UNKNOWN);
        expectedIdToStepTypeMap.put("tiny_colors_cogrp", MRStepType.MAPPER);
        expectedIdToStepTypeMap.put("out", MRStepType.REDUCER);

        for (String scope : opPlan.getPlan().keySet()) {
            P2jLogicalRelationalOperator actualOp = opPlan.getPlan().get(scope);

            String actualId = getIdentifier(actualOp);

            String actualStepType = actualOp.getMapReduce().getStepType();
            String expectedStepType = expectedIdToStepTypeMap.get(actualId).toString();

            Assert.assertEquals(actualStepType, expectedStepType);
        }
    }
View Full Code Here

TOP

Related Classes of com.netflix.lipstick.model.operators.P2jLogicalRelationalOperator$Join

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.