Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.PathFilter


        !conf.getBoolVar(HiveConf.ConfVars.LOCALMODEAUTO)) {
      return;
    }

    final Context lCtx = ctx;
    PathFilter p = new PathFilter () {
        public boolean accept(Path file) {
          return !lCtx.isMRTmpFileURI(file.toUri().getPath());
        }
      };
    List<ExecDriver> mrtasks = Utilities.getMRTasks(rootTasks);
View Full Code Here


        // Look for reference files.  Call listPaths with an anonymous
        // instance of PathFilter.

        FileStatus [] ps = fs.listStatus(p,
            new PathFilter () {
              public boolean accept(Path path) {
                return HStore.isReference(path);
              }
            }
        );
View Full Code Here

        !conf.getBoolVar(HiveConf.ConfVars.LOCALMODEAUTO)) {
      return;
    }

    final Context lCtx = ctx;
    PathFilter p = new PathFilter() {
      public boolean accept(Path file) {
        return !lCtx.isMRTmpFileURI(file.toUri().getPath());
      }
    };
    List<ExecDriver> mrtasks = Utilities.getMRTasks(rootTasks);
View Full Code Here

   * @return array of the current HFiles in the table (could be a zero-length array)
   * @throws IOException on unexecpted error reading the FS
   */
  public static FileStatus[] listHFiles(final FileSystem fs, Path tableDir) throws IOException {
    // setup the filters we will need based on the filesystem
    PathFilter regionFilter = new FSUtils.RegionDirFilter(fs);
    PathFilter familyFilter = new FSUtils.FamilyDirFilter(fs);
    final PathFilter fileFilter = new PathFilter() {
      @Override
      public boolean accept(Path file) {
        try {
          return fs.isFile(file);
        } catch (IOException e) {
View Full Code Here

                archiveList.add(processWorkflowLib);
                return;
            }

            // lib path is a directory, add each file under the lib dir to archive
            final FileStatus[] fileStatuses = fs.listStatus(libPath, new PathFilter() {
                @Override
                public boolean accept(Path path) {
                    try {
                        return fs.isFile(path) && path.getName().endsWith(".jar");
                    } catch (IOException ignore) {
View Full Code Here

    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

   * @throws IOException
   */
  private Text [] getFamilies(final FileSystem fs,
      final Path regiondir)
  throws IOException {
    Path [] subdirs = fs.listPaths(regiondir, new PathFilter() {
      public boolean accept(Path path) {
        return !path.getName().equals("log");
      }
    });
    List<Text> families = new ArrayList<Text>();
View Full Code Here

        // Look for reference files.  Call listPaths with an anonymous
        // instance of PathFilter.

        Path [] ps = fs.listPaths(p,
            new PathFilter () {
              public boolean accept(Path path) {
                return HStoreFile.isReference(path);
              }
            }
        );
View Full Code Here

      // a path filter that matches 4 parts of the filenames namely
      //  - jt-hostname
      //  - job-id
      //  - username
      //  - jobname
      PathFilter filter = new PathFilter() {
        public boolean accept(Path path) {
          String fileName = path.getName();
          try {
            fileName = decodeJobHistoryFileName(fileName);
          } catch (IOException ioe) {
View Full Code Here

   * @throws IOException When scanning the files fails.
   */
  static List<Path> getStoreFiles(FileSystem fs, Path regionDir)
  throws IOException {
    List<Path> res = new ArrayList<Path>();
    PathFilter dirFilter = new FSUtils.DirFilter(fs);
    FileStatus[] familyDirs = fs.listStatus(regionDir, dirFilter);
    for(FileStatus dir : familyDirs) {
      FileStatus[] files = fs.listStatus(dir.getPath());
      for (FileStatus file : files) {
        if (!file.isDir()) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.fs.PathFilter

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.