Package org.apache.oozie.action

Examples of org.apache.oozie.action.ActionExecutorException


                Element actionXml = XmlUtils.parseXml(action.getConf());
                JobConf jobConf = createBaseHadoopConf(context, actionXml);
                jobClient = createJobClient(context, jobConf);
                RunningJob runningJob = jobClient.getJob(JobID.forName(action.getExternalChildIDs()));
                if (runningJob == null) {
                    throw new ActionExecutorException(ActionExecutorException.ErrorType.FAILED, "MR002",
                            "Unknown hadoop job [{0}] associated with action [{1}].  Failing this action!",
                            action.getExternalChildIDs(), action.getId());
                }

                Counters counters = runningJob.getCounters();
View Full Code Here


    protected void verifyAndInjectSubworkflowDepth(Configuration parentConf, Configuration conf) throws ActionExecutorException {
        int depth = conf.getInt(SUBWORKFLOW_DEPTH, 0);
        int maxDepth = ConfigurationService.getInt(SUBWORKFLOW_MAX_DEPTH);
        if (depth >= maxDepth) {
            throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "SUBWF001",
                    "Depth [{0}] cannot exceed maximum subworkflow depth [{1}]", (depth + 1), maxDepth);
        }
        conf.setInt(SUBWORKFLOW_DEPTH, depth + 1);
    }
View Full Code Here

    void validatePath(Path path, boolean withScheme) throws ActionExecutorException {
        try {
            String scheme = path.toUri().getScheme();
            if (withScheme) {
                if (scheme == null) {
                    throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS001",
                                                      "Missing scheme in path [{0}]", path);
                }
                else {
                    Services.get().get(HadoopAccessorService.class).checkSupportedFilesystem(path.toUri());
                }
            }
            else {
                if (scheme != null) {
                    throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS002",
                                                      "Scheme [{0}] not allowed in path [{1}]", scheme, path);
                }
            }
        }
        catch (HadoopAccessorException hex) {
View Full Code Here

            if (pathScheme == null || pathAuthority == null) {
                if (path.isAbsolute()) {
                    String nameNodeSchemeAuthority = nameNode.toUri().getScheme() + "://" + nameNode.toUri().getAuthority();
                    fullPath = new Path(nameNodeSchemeAuthority + path.toString());
                } else {
                    throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS011",
                            "Path [{0}] cannot be relative", path);
                }
            } else {
                // If the path has a scheme and authority, but its not the nameNode then validate the path as-is and return it as-is
                // If it is the nameNode, then it should have already been verified earlier so return it as-is
View Full Code Here

        String t = destPath.toUri().getScheme() + destPath.toUri().getAuthority();
        String s = source.toUri().getScheme() + source.toUri().getAuthority();

        //checking whether NN prefix of source and target is same. can modify this to adjust for a set of multiple whitelisted NN
        if(!t.equals(s)) {
            throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS007",
                    "move, target NN URI different from that of source", dest);
        }
    }
View Full Code Here

        try {
            FileSystem fs = getFileSystemFor(path, context, fsConf);
            path = resolveToFullPath(nameNodePath, path, true);
            Path[] pathArr = FileUtil.stat2Paths(fs.globStatus(path));
            if (pathArr == null || pathArr.length == 0) {
                throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS009", "chgrp"
                        + ", path(s) that matches [{0}] does not exist", path);
            }
            checkGlobMax(pathArr);
            for (Path p : pathArr) {
                recursiveFsOperation("chgrp", fs, nameNodePath, p, argsMap, dirFiles, recursive, true);
View Full Code Here

            path = resolveToFullPath(nameNodePath, path, true);
            FileSystem fs = getFileSystemFor(path, context, fsConf);

            if (!fs.exists(path)) {
                if (!fs.mkdirs(path)) {
                    throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS004",
                                                      "mkdir, path [{0}] could not create directory", path);
                }
            }
        }
        catch (Exception ex) {
View Full Code Here

            if (pathArr != null && pathArr.length > 0) {
                checkGlobMax(pathArr);
                for (Path p : pathArr) {
                    if (fs.exists(p)) {
                        if (!fs.delete(p, true)) {
                            throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS005",
                                    "delete, path [{0}] could not delete path", p);
                        }
                    }
                }
            }
View Full Code Here

            validatePath(path, true);
            FileSystem fs = getFileSystemFor(path, user);

            if (fs.exists(path)) {
                if (!fs.delete(path, true)) {
                    throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS005",
                            "delete, path [{0}] could not delete path", path);
                }
            }
        }
        catch (Exception ex) {
View Full Code Here

            validateSameNN(source, target);
            FileSystem fs = getFileSystemFor(source, context, fsConf);
            Path[] pathArr = FileUtil.stat2Paths(fs.globStatus(source));
            if (( pathArr == null || pathArr.length == 0 ) ){
                if (!recovery) {
                    throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS006",
                        "move, source path [{0}] does not exist", source);
                } else {
                    return;
                }
            }
            if (pathArr.length > 1 && (!fs.exists(target) || fs.isFile(target))) {
                if(!recovery) {
                    throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS012",
                            "move, could not rename multiple sources to the same target name");
                } else {
                    return;
                }
            }
            checkGlobMax(pathArr);
            for (Path p : pathArr) {
                if (!fs.rename(p, target) && !recovery) {
                    throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS008",
                            "move, could not move [{0}] to [{1}]", p, target);
                }
            }
        }
        catch (Exception ex) {
View Full Code Here

TOP

Related Classes of org.apache.oozie.action.ActionExecutorException

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.