Examples of ExecException


Examples of PrologPlusCG.prolog.ExecException

      int niv2) throws ExecException {
    PrologDataIndexPair valIndLeft = env.unification.valueFromUnifStack(rla1, niv1);
    PrologDataIndexPair valIndRight = env.unification.valueFromUnifStack(rla2, niv2);
   
    if ((valIndLeft.pData == null) || (valIndRight.pData == null)) {
      throw new ExecException(
      "Error: for CG operations, relations should have specific values\nand not be free variables.");
    }
   
    // The two PrologData are particular relations
    // Les deux donn?es sont des relations particuliers
View Full Code Here

Examples of org.apache.camel.component.exec.ExecException

            ExecResult result = new ExecResult(command, stdout, stderr, exitValue);
            return result;

        } catch (ExecuteException ee) {
            LOG.error("ExecException while executing command: " + command.toString() + " - " + ee.getMessage());
            throw new ExecException("Failed to execute command " + command, ee);
        } catch (IOException ioe) {
            // invalid working dir
            LOG.error("IOException while executing command: " + command.toString() + " - " + ioe.getMessage());
            throw new ExecException("Unable to execute command " + command, ioe);
        } finally {
            // the inputStream must be closed after the execution
            IOUtils.closeQuietly(command.getInput());
        }
    }
View Full Code Here

Examples of org.apache.pig.backend.executionengine.ExecException

    @Override
    public void readFields(DataInput in) throws IOException {
        // TODO Auto-generated method stub
        int errCode = 2113;
        String msg = "SingleTupleBag should never be serialized or serialized.";
        throw new ExecException(msg, errCode, PigException.BUG);
    }
View Full Code Here

Examples of org.apache.pig.backend.executionengine.ExecException

    @Override
    public void write(DataOutput out) throws IOException {
        // TODO Auto-generated method stub
        int errCode = 2113;
        String msg = "SingleTupleBag should never be serialized or serialized.";
        throw new ExecException(msg, errCode, PigException.BUG);
    }
View Full Code Here

Examples of org.apache.pig.backend.executionengine.ExecException

            jobClient = new JobClient(new JobConf(configuration));
        }
        catch (IOException e) {
            int errCode = 6009;
            String msg = "Failed to create job client:" + e.getMessage();
            throw new ExecException(msg, errCode, PigException.BUG, e);
        }
    }
View Full Code Here

Examples of org.apache.pig.backend.executionengine.ExecException

    public PhysicalPlan compile(LogicalPlan plan,
                                Properties properties) throws ExecException {
        if (plan == null) {
            int errCode = 2041;
            String msg = "No Plan to compile";
            throw new ExecException(msg, errCode, PigException.BUG);
        }

        try {
            LogToPhyTranslationVisitor translator =
                new LogToPhyTranslationVisitor(plan);
            translator.setPigContext(pigContext);
            translator.visit();
            return translator.getPhysicalPlan();
        } catch (VisitorException ve) {
            int errCode = 2042;
            String msg = "Internal error. Unable to translate logical plan to physical plan.";
            throw new ExecException(msg, errCode, PigException.BUG, ve);
        }
    }
View Full Code Here

Examples of org.apache.pig.backend.executionengine.ExecException

            // is an ExecException, just let it through.  Else wrap it.
            if (e instanceof ExecException) throw (ExecException)e;
            else {
                int errCode = 2043;
                String msg = "Unexpected error during execution.";
                throw new ExecException(msg, errCode, PigException.BUG, e);
            }
        } finally {
            launcher.reset();
        }
View Full Code Here

Examples of org.apache.pig.backend.executionengine.ExecException

    private void readBaseData(List<LogicalOperator> loads) throws ExecException, FrontendException {
        baseData = new HashMap<LOLoad, DataBag>();
        for (LogicalOperator op : loads) {
            Schema schema = op.getSchema();
            if(schema == null) {
                throw new ExecException("Example Generator requires a schema. Please provide a schema while loading data.");
            }
           
            DataBag opBaseData = BagFactory.getInstance().newDefaultBag();

            POLoad poLoad = (POLoad) LogToPhyMap.get(op);
View Full Code Here

Examples of org.apache.pig.backend.executionengine.ExecException

            default: {
                int errCode = 2082;
                String msg = "Did not expect result of type: " +
                        DataType.findTypeName(resultType);
                    throw new ExecException(msg, errCode, PigException.BUG);               
            }
           
            }
      return res;
    }
View Full Code Here

Examples of org.apache.pig.backend.executionengine.ExecException

                    }
                    else{   // At this point right side can't be behind.
                        int errCode = 1102;
                        String errMsg = "Data is not sorted on right side. Last two tuples encountered were: \n"+
                        curJoiningRightTup+ "\n" + (Tuple)rightInp.result ;
                        throw new ExecException(errMsg,errCode);
                    }   
                }
            }
        }

        curLeftInp = processInput();
        switch(curLeftInp.returnStatus){

        case POStatus.STATUS_OK:
            curLeftKey = extractKeysFromTuple(curLeftInp, 0);
            if(null == curLeftKey) // We drop the tuples which have null keys.
                return new Result(POStatus.STATUS_EOP, null);
           
            int cmpVal = ((Comparable)curLeftKey).compareTo(prevLeftKey);
            if(cmpVal == 0){
                // Keep on accumulating.
                leftTuples.add((Tuple)curLeftInp.result);
                return new Result(POStatus.STATUS_EOP, null);
            }
            else if(cmpVal > 0){ // Filled with left bag. Move on.
                curJoinKey = prevLeftKey;
                break;  
            }
            else{   // Current key < Prev Key
                int errCode = 1102;
                String errMsg = "Data is not sorted on left side. Last two keys encountered were: \n"+
                prevLeftKey+ "\n" + curLeftKey ;
                throw new ExecException(errMsg,errCode);
            }
        case POStatus.STATUS_EOP:
            if(this.parentPlan.endOfAllInput){
                // We hit the end on left input.
                // Tuples in bag may still possibly join with right side.
                curJoinKey = prevLeftKey;
                curLeftKey = null;
                break;               
            }
            else    // Fetch next left input.
                return curLeftInp;

        default:    // If encountered with ERR / NULL on left side, we send it down.
            return curLeftInp;
        }

        if((null != prevRightKey) && !this.parentPlan.endOfAllInput && ((Comparable)prevRightKey).compareTo(curLeftKey) >= 0){

            // This will happen when we accumulated inputs on left side and moved on, but are still behind the right side
            // In that case, throw away the tuples accumulated till now and add the one we read in this function call.
            leftTuples = new ArrayList<Tuple>(arrayListSize);
            leftTuples.add((Tuple)curLeftInp.result);
            prevLeftInp = curLeftInp;
            prevLeftKey = curLeftKey;
            return new Result(POStatus.STATUS_EOP, null);
        }

        // Accumulated tuples with same key on left side.
        // But since we are reading ahead we still haven't checked the read ahead right tuple.
        // Accumulated left tuples may potentially join with that. So, lets check that first.
       
        if((null != prevRightKey) && prevRightKey.equals(prevLeftKey)){

            curJoiningRightTup = (Tuple)prevRightInp.result;
            counter = leftTuples.size();
            rightTupSize = curJoiningRightTup.size();
            doingJoin = true;
            prevLeftInp = curLeftInp;
            prevLeftKey = curLeftKey;
            return this.getNext(dummyTuple);
        }

        // We will get here only when curLeftKey > prevRightKey
        while(true){
            // Start moving on right stream to find the tuple whose key is same as with current left bag key.
            Result rightInp = getNextRightInp();
            if(rightInp.returnStatus != POStatus.STATUS_OK)
                return rightInp;

            Object extractedRightKey = extractKeysFromTuple(rightInp, 1);
           
            if(null == extractedRightKey) // If we see tuple having null keys in stream, we drop them
                continue;       // and fetch next tuple.
           
            Comparable rightKey = (Comparable)extractedRightKey;
           
            if( prevRightKey != null && rightKey.compareTo(prevRightKey) < 0){
                // Sanity check.
                int errCode = 1102;
                String errMsg = "Data is not sorted on right side. Last two keys encountered were: \n"+
                prevRightKey+ "\n" + rightKey ;
                throw new ExecException(errMsg,errCode);
            }

            int cmpval = rightKey.compareTo(prevLeftKey);
            if(cmpval < 0)     // still behind the left side, do nothing, fetch next right tuple.
                continue;
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.