Package org.apache.oozie

Examples of org.apache.oozie.XException


            started.set(idx, false);
        }

        @Override
        public void reRun(String jobId, Configuration conf) throws BaseEngineException {
            throw new BaseEngineException(new XException(ErrorCode.E0301));
        }
View Full Code Here


            started.set(idx, true);
        }

        @Override
        public void reRun(String jobId, Configuration conf) throws BaseEngineException {
            throw new BaseEngineException(new XException(ErrorCode.E0301, "invalid use of rerun"));
        }
View Full Code Here

                                LOG.trace("Removed Job [{0}] from map after End-processed", jobId);
                            }
                        }
                    }
                    catch (InterruptedException e) {
                        throw new XException(ErrorCode.E0606, slaCalc.getId(), slaCalc.getLockTimeOut());
                    }
                    finally {
                        slaCalc.releaseLock();
                    }
                }
View Full Code Here

            if (s.contains("::")) {
                List<String> listOfActions = getCoordActionIdsFromDateRange(jobId, s);
                actionSet.addAll(listOfActions);
            }
            else {
                throw new XException(ErrorCode.E0308, "'" + s + "'. Separator '::' is missing for start and end dates of range");
            }
        }
        return new ArrayList<String>(actionSet);
    }
View Full Code Here

    public static List<CoordinatorActionBean> getCoordActionsFromDateRange(String jobId, String range, boolean active)
            throws XException {
            String[] dateRange = range.split("::");
            // This block checks for errors in the format of specifying date range
            if (dateRange.length != 2) {
                throw new XException(ErrorCode.E0308, "'" + range +
                    "'. Date value expected on both sides of the scope resolution operator '::' to signify start and end of range");

            }
            Date start;
            Date end;
            try {
            // Get the start and end dates for the range
                start = DateUtils.parseDateOozieTZ(dateRange[0].trim());
                end = DateUtils.parseDateOozieTZ(dateRange[1].trim());
            }
            catch (ParseException dx) {
                throw new XException(ErrorCode.E0308, "Error in parsing start or end date. " + dx);
            }
            if (start.after(end)) {
                throw new XException(ErrorCode.E0308, "'" + range + "'. Start date '" + start + "' is older than end date: '" + end
                        + "'");
            }
            List<CoordinatorActionBean> listOfActions = getActionsFromDateRange(jobId, start, end, active);
            return listOfActions;
    }
View Full Code Here

     */
    public static List<String> getCoordActionIdsFromDateRange(String jobId, String range) throws XException{
            String[] dateRange = range.split("::");
            // This block checks for errors in the format of specifying date range
            if (dateRange.length != 2) {
                throw new XException(ErrorCode.E0308, "'" + range
                  + "'. Date value expected on both sides of the scope resolution operator '::' to signify start and end of range");

            }
            Date start;
            Date end;
            try {
            // Get the start and end dates for the range
                start = DateUtils.parseDateOozieTZ(dateRange[0].trim());
                end = DateUtils.parseDateOozieTZ(dateRange[1].trim());
            }
            catch (ParseException dx) {
                throw new XException(ErrorCode.E0308, "Error in parsing start or end date. " + dx);
            }
            if (start.after(end)) {
                throw new XException(ErrorCode.E0308, "'" + range + "'. Start date '" + start + "' is older than end date: '" + end
+ "'");
            }
            List<String> list = null;
            JPAService jpaService = Services.get().get(JPAService.class);
            list = jpaService.execute(new CoordJobGetActionIdsForDateRangeJPAExecutor(jobId, start, end));
View Full Code Here

            started.set(idx, false);
        }

        @Override
        public void reRun(String jobId, Configuration conf) throws BaseEngineException {
            throw new BaseEngineException(new XException(ErrorCode.E0301, "invalid use of rerun"));
        }
View Full Code Here

            if (s.contains("::")) {
                List<String> listOfActions = getCoordActionIdsFromDateRange(jobId, s);
                actionSet.addAll(listOfActions);
            }
            else {
                throw new XException(ErrorCode.E0308, "'" + s + "'. Separator '::' is missing for start and end dates of range");
            }
        }
        return new ArrayList<String>(actionSet);
    }
View Full Code Here

     */
    public static List<CoordinatorActionBean> getCoordActionsFromDateRange(String jobId, String range) throws XException{
            String[] dateRange = range.split("::");
            // This block checks for errors in the format of specifying date range
            if (dateRange.length != 2) {
                throw new XException(ErrorCode.E0308, "'" + range +
                    "'. Date value expected on both sides of the scope resolution operator '::' to signify start and end of range");

            }
            Date start;
            Date end;
            try {
            // Get the start and end dates for the range
                start = DateUtils.parseDateOozieTZ(dateRange[0].trim());
                end = DateUtils.parseDateOozieTZ(dateRange[1].trim());
            }
            catch (ParseException dx) {
                throw new XException(ErrorCode.E0308, "Error in parsing start or end date. " + dx);
            }
            if (start.after(end)) {
                throw new XException(ErrorCode.E0308, "'" + range + "'. Start date '" + start + "' is older than end date: '" + end
                        + "'");
            }
            List<CoordinatorActionBean> listOfActions = getActionsFromDateRange(jobId, start, end);
            return listOfActions;
    }
View Full Code Here

     */
    public static List<String> getCoordActionIdsFromDateRange(String jobId, String range) throws XException{
            String[] dateRange = range.split("::");
            // This block checks for errors in the format of specifying date range
            if (dateRange.length != 2) {
                throw new XException(ErrorCode.E0308, "'" + range
                  + "'. Date value expected on both sides of the scope resolution operator '::' to signify start and end of range");

            }
            Date start;
            Date end;
            try {
            // Get the start and end dates for the range
                start = DateUtils.parseDateOozieTZ(dateRange[0].trim());
                end = DateUtils.parseDateOozieTZ(dateRange[1].trim());
            }
            catch (ParseException dx) {
                throw new XException(ErrorCode.E0308, "Error in parsing start or end date. " + dx);
            }
            if (start.after(end)) {
                throw new XException(ErrorCode.E0308, "'" + range + "'. Start date '" + start + "' is older than end date: '" + end
+ "'");
            }
            List<String> list = null;
            JPAService jpaService = Services.get().get(JPAService.class);
            list = jpaService.execute(new CoordJobGetActionIdsForDateRangeJPAExecutor(jobId, start, end));
View Full Code Here

TOP

Related Classes of org.apache.oozie.XException

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.