Examples of POSplit


Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POSplit

    }
   
    @Override
    public void visit(LOSplit loSplit) throws FrontendException {
        String scope = DEFAULT_SCOPE;
        POSplit physOp = new POSplit(new OperatorKey(scope, nodeGen
                .getNextNodeId(scope)), loSplit.getRequestedParallelisam());
        physOp.setAlias(loSplit.getAlias());
        FileSpec splStrFile;
        try {
            splStrFile = new FileSpec(FileLocalizer.getTemporaryPath(pc).toString(),new FuncSpec(Utils.getTmpFileCompressorName(pc)));
        } catch (IOException e1) {
            byte errSrc = pc.getErrorSource();
            int errCode = 0;
            switch(errSrc) {
            case PigException.BUG:
                errCode = 2016;
                break;
            case PigException.REMOTE_ENVIRONMENT:
                errCode = 6002;
                break;
            case PigException.USER_ENVIRONMENT:
                errCode = 4003;
                break;
            }
            String msg = "Unable to obtain a temporary path." ;
            throw new LogicalToPhysicalTranslatorException(msg, errCode, errSrc, e1);

        }
        physOp.setSplitStore(splStrFile);
        logToPhyMap.put(loSplit, physOp);

        currentPlan.add(physOp);

        List<Operator> op = loSplit.getPlan().getPredecessors(loSplit);
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POSplit

            checkPhysicalPlan(mo1.reducePlan, 1, 1, 2);
            PhysicalOperator leaf = mo1.reducePlan.getLeaves().get(0);
           
            Assert.assertTrue(leaf instanceof POSplit);

            POSplit split = (POSplit)leaf;
           
            int i = 0;
            for (PhysicalPlan p: split.getPlans()) {
                checkPhysicalPlan(p, 1, 1, 1);
                ++i;
            }

            Assert.assertEquals(i,2);
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POSplit

            checkPhysicalPlan(mo.mapPlan, 1, 1, 4);
            PhysicalOperator leaf = mo.mapPlan.getLeaves().get(0);
           
            Assert.assertTrue(leaf instanceof POSplit);
           
            POSplit split = (POSplit)leaf;

            int i = 0;
            for (PhysicalPlan p: split.getPlans()) {
                checkPhysicalPlan(p, 1, 1, 1);
                ++i;
            }

            Assert.assertEquals(i,3);
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POSplit

        int numMerges = 0;
       
        PhysicalPlan splitterPl = isMapOnly(mr) ? mr.mapPlan : mr.reducePlan;                           
        POStore storeOp = (POStore)splitterPl.getLeaves().get(0);
       
        POSplit splitOp = null;
       
        // case 3: multiple splittees and at least one of them is map-only
        if (mappers.size() > 0) {               
            splitOp = getSplit()
            int n = mergeAllMapOnlySplittees(mappers, mr, splitOp);           
           
            log.info("Merged " + n + " map-only splittees.");
           
            numMerges += n;  
        }           
       
        if (mapReducers.size() > 0) {
           
            boolean isMapOnly = isMapOnly(mr);
            int merged = 0;
           
            // case 4: multiple splittees and at least one of them has reducer 
            //         and the splitter is map-only  
            if (isMapOnly) {
                        
                PhysicalOperator leaf = splitterPl.getLeaves().get(0);
                                                           
                splitOp = (leaf instanceof POStore) ? getSplit() : (POSplit)leaf;
                   
                merged = mergeMapReduceSplittees(mapReducers, mr, splitOp)
            }
           
            // case 5: multiple splittees and at least one of them has reducer
            //         and splitter has reducer
            else {
               
                merged = mergeMapReduceSplittees(mapReducers, mr)
               
            }
           
            log.info("Merged " + merged + " map-reduce splittees.");
           
            numMerges += merged;     
        }
       
        // Finally, add original store to the split operator
        // if there is splittee that hasn't been merged into the splitter
        if (splitOp != null
                && (numMerges < numSplittees)) {

            PhysicalPlan storePlan = new PhysicalPlan();
            try {
                storePlan.addAsLeaf(storeOp);
                splitOp.addPlan(storePlan);
            } catch (PlanException e) {
                int errCode = 2129;
                String msg = "Internal Error. Unable to add store to the split plan for optimization.";
                throw new OptimizerException(msg, errCode, PigException.BUG, e);
            }   
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POSplit

                // multiple splittees have different map key types
                if (!sameKeyType) {
                    lr.setKeyType(DataType.TUPLE);
                }
            } else if (leaf instanceof POSplit) {
                POSplit spl = (POSplit)leaf;
                index = setIndexOnLRInSplit(index, spl, sameKeyType);
            }
        }

        return index;
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POSplit

            // merged earlier), then we want the POLocalRearrange
            // operators in the split to have indices 1, 2 ...
            // essentially we are flattening the index numbers
            // across all POLocalRearranges in all merged map plans
            // including nested ones in POSplit
            POSplit spl = (POSplit)leaf;
            curIndex = setIndexOnLRInSplit(index, spl, sameKeyType);
        }
                   
        splitOp.addPlan(pl);
       
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POSplit

    private boolean isSinglePredecessor(MapReduceOper mr) {
        return (getPlan().getPredecessors(mr).size() == 1);
    }
   
    private POSplit getSplit(){
        return new POSplit(new OperatorKey(scope, nig.getNextNodeId(scope)));
    }
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POSplit

        int numMerges = 0;
       
        PhysicalPlan splitterPl = isMapOnly(mr) ? mr.mapPlan : mr.reducePlan;                           
        POStore storeOp = (POStore)splitterPl.getLeaves().get(0);
       
        POSplit splitOp = null;
       
        // case 3: multiple splittees and at least one of them is map-only
        if (mappers.size() > 0) {               
            splitOp = getSplit()
            int n = mergeAllMapOnlySplittees(mappers, mr, splitOp);           
           
            log.info("Merged " + n + " map-only splittees.");
           
            numMerges += n;  
        }           
       
        if (mapReducers.size() > 0) {
           
            boolean isMapOnly = isMapOnly(mr);
            int merged = 0;
           
            // case 4: multiple splittees and at least one of them has reducer 
            //         and the splitter is map-only  
            if (isMapOnly) {
                        
                PhysicalOperator leaf = splitterPl.getLeaves().get(0);
                                                           
                splitOp = (leaf instanceof POStore) ? getSplit() : (POSplit)leaf;
                   
                merged = mergeMapReduceSplittees(mapReducers, mr, splitOp)
            }
           
            // case 5: multiple splittees and at least one of them has reducer
            //         and splitter has reducer
            else {
               
                merged = mergeMapReduceSplittees(mapReducers, mr)
               
            }
           
            log.info("Merged " + merged + " map-reduce splittees.");
           
            numMerges += merged;     
        }
       
        // Finally, add original store to the split operator
        // if there is splittee that hasn't been merged into the splitter
        if (splitOp != null
                && (numMerges < numSplittees)) {

            PhysicalPlan storePlan = new PhysicalPlan();
            try {
                storePlan.addAsLeaf(storeOp);
                splitOp.addPlan(storePlan);
            } catch (PlanException e) {
                int errCode = 2129;
                String msg = "Internal Error. Unable to add store to the split plan for optimization.";
                throw new OptimizerException(msg, errCode, PigException.BUG, e);
            }   
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POSplit

                // multiple splittees have different map key types
                if (!sameKeyType) {
                    lr.setKeyType(DataType.TUPLE);
                }
            } else if (leaf instanceof POSplit) {
                POSplit spl = (POSplit)leaf;
                index = setIndexOnLRInSplit(index, spl, sameKeyType);
            }
        }

        return index;
View Full Code Here

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POSplit

            // merged earlier), then we want the POLocalRearrange
            // operators in the split to have indices 1, 2 ...
            // essentially we are flattening the index numbers
            // across all POLocalRearranges in all merged map plans
            // including nested ones in POSplit
            POSplit spl = (POSplit)leaf;
            curIndex = setIndexOnLRInSplit(index, spl, sameKeyType);
        }
                   
        splitOp.addPlan(pl);
       
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.