Examples of listPaths()


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

      for (int i = 0; i < inputs.length; i++)
      {
        Path p = inputs[i];
        FileSystem fs = p.getFileSystem(job);
        Path [] ps = fs.listPaths(p);

        for (int j = 0; j < ps.length; j++)
        {
          if (fs.isDirectory(ps[j]))
          {
View Full Code Here

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

    conf.setNumMapTasks(numMaps);
    conf.setNumReduceTasks(numReduces);
    JobClient.runJob(conf);
    StringBuffer result = new StringBuffer();
    {
      Path[] fileList = fs.listPaths(outDir);
      for(int i=0; i < fileList.length; ++i) {
        BufferedReader file =
          new BufferedReader(new InputStreamReader(fs.open(fileList[i])));
        String line = file.readLine();
        while (line != null) {
View Full Code Here

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

    ArrayList segs = new ArrayList();
    long sliceSize = 0;
    boolean filter = false;
    for (int i = 1; i < args.length; i++) {
      if (args[i].equals("-dir")) {
        Path[] files = fs.listPaths(new Path(args[++i]), new PathFilter() {
          public boolean accept(Path f) {
            try {
              if (fs.isDirectory(f)) return true;
            } catch (IOException e) {}
            ;
View Full Code Here

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

        ArrayList dirs = new ArrayList();
        for (int i = 1; i < args.length; i++) {
          if (args[i] == null) continue;
          if (args[i].equals("-dir")) {
            Path dir = new Path(args[++i]);
            Path[] files = fs.listPaths(dir, new PathFilter() {
              public boolean accept(Path pathname) {
                try {
                  if (fs.isDirectory(pathname)) return true;
                } catch (IOException e) {};
                return false;
View Full Code Here

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

    output.collect(key, result);
  }

  public void invert(Path linkDb, final Path segmentsDir, boolean normalize, boolean filter, boolean force) throws IOException {
    final FileSystem fs = FileSystem.get(getConf());
    Path[] files = fs.listPaths(segmentsDir, new PathFilter() {
      public boolean accept(Path f) {
        try {
          if (fs.isDirectory(f)) return true;
        } catch (IOException ioe) {};
        return false;
View Full Code Here

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

    boolean normalize = true;
    boolean force = false;
    for (int i = 1; i < args.length; i++) {
      if (args[i].equals("-dir")) {
        segDir = new Path(args[++i]);
        Path[] files = fs.listPaths(segDir, new PathFilter() {
          public boolean accept(Path f) {
            try {
              if (fs.isDirectory(f)) return true;
            } catch (IOException ioe) {};
            return false;
View Full Code Here

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

  public static String readOutput(Path outDir,
                                  JobConf conf) throws IOException {
    FileSystem fs = outDir.getFileSystem(conf);
    StringBuffer result = new StringBuffer();
    {
      Path[] fileList = fs.listPaths(outDir);
      for(int i=0; i < fileList.length; ++i) {
        BufferedReader file =
          new BufferedReader(new InputStreamReader(fs.open(fileList[i])));
        String line = file.readLine();
        while (line != null) {
View Full Code Here

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

        file.close();
         
        job = new StreamJob(argv, mayExit);     
        job.go();
        String line = null;
        Path[] fileList = fileSys.listPaths(new Path(OUTPUT_DIR));
        for (int i = 0; i < fileList.length; i++){
          System.out.println(fileList[i].toString());
          BufferedReader bread =
            new BufferedReader(new InputStreamReader(fileSys.open(fileList[i])));
          line = bread.readLine();
View Full Code Here

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

    if (!fs.getFileStatus(parentdir).isDir()) {
      throw new IOException(parentdirName + " not a directory");
    }
    // Look for regions in parentdir.
    Path [] regiondirs =
      fs.listPaths(parentdir, new PathFilter() {
        /* (non-Javadoc)
         * @see org.apache.hadoop.fs.PathFilter#accept(org.apache.hadoop.fs.Path)
         */
        public boolean accept(Path path) {
          Matcher m = REGION_NAME_PARSER.matcher(path.getName());
View Full Code Here

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

    }
    List<Path> result = new ArrayList<Path>();
    for (Path p: dirs) {
      FileSystem fs = p.getFileSystem(job);
      Path[] matches =
        fs.listPaths(fs.globPaths(p, hiddenFileFilter), hiddenFileFilter);
      for (Path match: matches) {
        result.add(fs.makeQualified(match));
      }
    }
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.