Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.FileSystem.makeQualified()


        VariableTable variables = createVariables(context);
        Configuration config = configurations.newInstance();
        FileSystem fs = FileSystem.get(config);
        for (String path : description.getPaths()) {
            String resolved = variables.parse(path, false);
            Path target = fs.makeQualified(new Path(resolved));
            LOG.debug("Deleting file: {}", target);
            boolean succeed = fs.delete(target, true);
            LOG.debug("Deleted file (succeed={}): {}", succeed, target);
        }
        return;
View Full Code Here


        Path path = new Path(resolved);
        Path output = path.getParent();
        Path target;
        if (output == null) {
            LOG.warn("Skipped deleting output directory because it is a base directory: {}", path);
            target = fs.makeQualified(path);
        } else {
            LOG.warn("Output directory will be deleted: {}", output);
            target = fs.makeQualified(output);
        }
        LOG.debug("Deleting output target: {}", target);
View Full Code Here

        if (output == null) {
            LOG.warn("Skipped deleting output directory because it is a base directory: {}", path);
            target = fs.makeQualified(path);
        } else {
            LOG.warn("Output directory will be deleted: {}", output);
            target = fs.makeQualified(output);
        }
        LOG.debug("Deleting output target: {}", target);
        boolean succeed = fs.delete(target, true);
        LOG.debug("Deleted output target (succeed={}): {}", succeed, target);
    }
View Full Code Here

     */
    public void cleanWorkingDirectory() throws IOException {
        Configuration conf = configurations.newInstance();
        FileSystem fs = FileSystem.get(conf);
        Path path = new Path(context.getClusterWorkDir());
        Path fullPath = fs.makeQualified(path);
        LOG.debug("クラスタワークディレクトリを初期化します。Path: {}", fullPath);
        boolean deleted = fs.delete(fullPath, true);
        if (deleted) {
            LOG.debug("クラスタワークディレクトリを削除しました。Path: {}", fullPath);
        } else {
View Full Code Here

                LOG.debug("local path matched: " + path);
            }
            return localFileSystem.makeQualified(path);
        }
        FileSystem remoteFileSystem = remotePath.getFileSystem(configuration);
        remotePath = remoteFileSystem.makeQualified(remotePath);
        if (LOG.isDebugEnabled()) {
            LOG.debug("distributed cache is not localized explicitly: " + remotePath);
        }
        if (isLocal(remoteFileSystem) == false) {
            LOG.warn(MessageFormat.format(
View Full Code Here

            if (path.toUri().getScheme() == null) {
                fs = local;
            } else {
                fs = path.getFileSystem(configuration);
            }
            path = fs.makeQualified(path);
            if (fs.exists(path) == false) {
                throw new FileNotFoundException(path.toString());
            }
            results.add(path);
        }
View Full Code Here

        for (Path path : paths) {
            if (buf.length() != 0) {
                buf.append(',');
            }
            FileSystem fs = path.getFileSystem(configuration);
            buf.append(fs.makeQualified(path).toString());
        }
        String libjars = buf.toString();
        return libjars;
    }
View Full Code Here

            if (value) {
                if (LOG.isInfoEnabled()) {
                    LOG.info(MessageFormat.format(
                            "Creating transaction info: job={0}, path={1}",
                            jobContext.getJobID(),
                            fs.makeQualified(transactionInfo)));
                }
                FSDataOutputStream output = fs.create(transactionInfo, false);
                boolean closed = false;
                try {
                    PrintWriter writer = new PrintWriter(
View Full Code Here

                }
                if (LOG.isDebugEnabled()) {
                    LOG.debug(MessageFormat.format(
                            "Finish creating transaction info: job={0}, path={1}",
                            jobContext.getJobID(),
                            fs.makeQualified(transactionInfo)));
                }
                if (LOG.isTraceEnabled()) {
                    FSDataInputStream input = fs.open(transactionInfo);
                    try {
                        Scanner scanner = new Scanner(
View Full Code Here

            } else {
                if (LOG.isInfoEnabled()) {
                    LOG.info(MessageFormat.format(
                            "Deleting transaction info: job={0}, path={1}",
                            jobContext.getJobID(),
                            fs.makeQualified(transactionInfo)));
                }
                fs.delete(transactionInfo, false);
                if (LOG.isDebugEnabled()) {
                    LOG.debug(MessageFormat.format(
                            "Finish deleting transaction info: job={0}, path={1}",
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.