Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.Path.toUri()


        for (FileStatus stat : all) {
            if (FileSystemCompatibility.isDirectory(stat)) {
                continue;
            }
            Path path = stat.getPath();
            URI uri = path.toUri();
            URI relative = baseUri.relativize(uri);
            if (relative.equals(uri) == false) {
                results.add(new Path(relative));
            } else {
                throw new IOException(MessageFormat.format(
View Full Code Here


    static String selectLibraries(String libraries) {
        String minLibrary = null;
        long minSize = Long.MAX_VALUE;
        for (String library : libraries.split(",")) {
            Path path = new Path(library);
            String scheme = path.toUri().getScheme();
            if (scheme != null && scheme.equals("file")) {
                File file = new File(path.toUri());
                long size = file.length();
                if (size < minSize) {
                    minLibrary = library;
View Full Code Here

        long minSize = Long.MAX_VALUE;
        for (String library : libraries.split(",")) {
            Path path = new Path(library);
            String scheme = path.toUri().getScheme();
            if (scheme != null && scheme.equals("file")) {
                File file = new File(path.toUri());
                long size = file.length();
                if (size < minSize) {
                    minLibrary = library;
                    minSize = size;
                }
View Full Code Here

        List<Path> results = new ArrayList<Path>();
        LocalFileSystem local = FileSystem.getLocal(configuration);
        for (String name : names) {
            Path path = new Path(name);
            FileSystem fs;
            if (path.toUri().getScheme() == null) {
                fs = local;
            } else {
                fs = path.getFileSystem(configuration);
            }
            path = fs.makeQualified(path);
View Full Code Here

                                "Application class is in: file={2} ({1}), class={0}",
                                className,
                                path,
                                qualified));
                    }
                    URI target = qualified.toUri();
                    if (target.getScheme() != null
                            && (target.getScheme().equals("file") || target.getAuthority() != null)) {
                        configuration.set(KEY_CONF_JAR, qualified.toString());
                    }
                    break;
View Full Code Here

                LOG.info("TG-EXTRACTOR-11002", info.getId(), info.getTableName(), storage.getPatchProperties());

                Class<?> targetTableModel = targetTableBean.getImportTargetType();
                Path targetUri = storage.getPatchContents("0");
                LOG.info("TG-EXTRACTOR-11003", info.getId(), info.getTableName(), targetUri);
                long recordCount = write(targetTableModel, targetUri.toUri(), content);
                LOG.info("TG-EXTRACTOR-11004", info.getId(), info.getTableName(), targetUri, recordCount);
                LOG.info("TG-PROFILE-01002",
                        bean.getTargetName(),
                        bean.getBatchId(),
                        bean.getJobflowId(),
View Full Code Here

                    Arrays.toString(args)));
        }

        Path cacheDirectory = new Path(args[1]);
        modelClass = getConf().getClassByName(args[2]);
        this.storage = new CacheStorage(getConf(), cacheDirectory.toUri());
        try {
            clearNext();
            if (create) {
                create();
            } else {
View Full Code Here

        FileSystem fs;
        try {
            if (basePath == null) {
                fs = FileSystem.get(conf);
            } else {
                fs = FileSystem.get(basePath.toUri(), conf);
                basePath = fs.makeQualified(basePath);
            }
        } catch (IOException e) {
            throw new BulkLoaderSystemException(e, CLASS, "TG-COMMON-00019", rawPaths);
        }
View Full Code Here

      String[] fileArr = files.split(",");
      for (String tmpFile: fileArr) {
        Path tmp = new Path(tmpFile);
        Path newPath = copyRemoteFiles(fs,filesDir, tmp, job, replication);
        try {
          URI pathURI = new URI(newPath.toUri().toString() + "#" + newPath.getName());
          DistributedCache.addCacheFile(pathURI, job);
        } catch(URISyntaxException ue) {
          //should not throw a uri exception
          throw new IOException("Failed to create uri for " + tmpFile);
        }
View Full Code Here

     String[] archivesArr = archives.split(",");
     for (String tmpArchives: archivesArr) {
       Path tmp = new Path(tmpArchives);
       Path newPath = copyRemoteFiles(fs, archivesDir, tmp, job, replication);
       try {
         URI pathURI = new URI(newPath.toUri().toString() + "#" + newPath.getName());
         DistributedCache.addCacheArchive(pathURI, job);
       } catch(URISyntaxException ue) {
         //should not throw an uri excpetion
         throw new IOException("Failed to create uri for " + tmpArchives);
       }
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.