Package org.apache.oozie.action

Examples of org.apache.oozie.action.ActionExecutorException


        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", "chmod"
                        + ", path(s) that matches [{0}] does not exist", path);
            }
            checkGlobMax(pathArr);
            for (Path p : pathArr) {
                recursiveFsOperation("chmod", fs, nameNodePath, p, argsMap, dirFiles, recursive, true);
View Full Code Here


        else {
            if (permissions.length() == 10) {
                return FsPermission.valueOf(permissions);
            }
            else {
                throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS010",
                                                  "chmod, path [{0}] invalid permissions mask [{1}]", path, permissions);
            }
        }
    }
View Full Code Here

        return new Path(context.getActionDir(), "fs-" + context.getRecoveryId());
    }

    private void checkGlobMax(Path[] pathArr) throws ActionExecutorException {
        if(pathArr.length > maxGlobCount) {
            throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS013",
                    "too many globbed files/dirs to do FS operation");
        }
    }
View Full Code Here

                JobConf jobConf = new JobConf();
                XConfiguration.copy(conf, jobConf);
                jobClient = createJobClient(context, jobConf);
                RunningJob runningJob = jobClient.getJob(JobID.forName(action.getExternalId()));
                if (runningJob == null) {
                    throw new ActionExecutorException(ActionExecutorException.ErrorType.FAILED, "MR002",
                                                      "Unknown hadoop job [{0}] associated with action [{1}].  Failing this action!", action
                            .getExternalId(), action.getId());
                }

                // TODO this has to be done in a better way
                if (!runningJob.getJobName().startsWith("oozie:action:")) {
                    throw new ActionExecutorException(ActionExecutorException.ErrorType.FAILED, "MR001",
                                                      "ID swap should have happened in launcher job [{0}]", action.getExternalId());
                }
                Counters counters = runningJob.getCounters();
                if (counters != null) {
                    JSONObject json = counterstoJson(counters);
View Full Code Here

    void validatePath(Path path, boolean withScheme) throws ActionExecutorException {
        String scheme = path.toUri().getScheme();
        if (withScheme) {
            if (scheme == null) {
                throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS001",
                                                  "Missing scheme in path [{0}]", path);
            }
            else {
                if (!scheme.equals("hdfs")) {
                    throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS002",
                                                      "Scheme [{0}] not support in path [{1}]", scheme, path);
                }
            }
        }
        else {
            if (scheme != null) {
                throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS003",
                                                  "Scheme [{0}] not allowed in path [{1}]", scheme, path);
            }
        }
    }
View Full Code Here

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

            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

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

            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

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

            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

            validatePath(source, true);
            validatePath(target, false);
            FileSystem fs = getFileSystemFor(source, context);

            if (!fs.exists(source) && !recovery) {
                throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS006",
                                                  "move, source path [{0}] does not exist", source);
            }

            Path path = new Path(source, target);
            if (fs.exists(path) && !recovery) {
                throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS007",
                                                  "move, target path [{0}] already exists", target);
            }

            if (!fs.rename(source, target) && !recovery) {
                throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS008",
                                                  "move, could not move [{0}] to [{1}]", source, target);
            }
        }
        catch (Exception ex) {
            throw convertException(ex);
View Full Code Here

        try {
            validatePath(path, true);
            FileSystem fs = getFileSystemFor(path, context);

            if (!fs.exists(path)) {
                throw new ActionExecutorException(ActionExecutorException.ErrorType.ERROR, "FS009",
                                                  "chmod, path [{0}] does not exist", path);
            }

            FileStatus pathStatus = fs.getFileStatus(path);
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.