Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.PathFilter


     */
    public static Path getLatestVersionedPath(FileSystem fs, Path directory, String acceptRegex)
            throws IOException {
        final String pattern = acceptRegex != null ? acceptRegex : "\\S+";

        PathFilter filter = new PathFilter() {

            @Override
            public boolean accept(Path arg0) {
                return !arg0.getName().startsWith("_") && Pattern.matches(pattern, arg0.getName());
            }
View Full Code Here


        if(backupNumber < 1) {
            logger.error("Number of versions must be 1 or greater");
            return;
        }

        PathFilter filter = new PathFilter() {

            @Override
            public boolean accept(Path arg0) {
                return !arg0.getName().startsWith("_")
                       && Pattern.matches(acceptRegex, arg0.getName());
View Full Code Here

        return blobStore.fileSystem().create(file, true, blobStore.bufferSizeInBytes());
    }

    @Override
    public ImmutableMap<String, BlobMetaData> listBlobsByPrefix(final @Nullable String blobNamePrefix) throws IOException {
        FileStatus[] files = blobStore.fileSystem().listStatus(path, new PathFilter() {
            @Override
            public boolean accept(Path path) {
                return path.getName().startsWith(blobNamePrefix);
            }
        });
View Full Code Here

   * @return true if family contains reference files
   * @throws IOException
   */
  public boolean hasReferences(final String familyName) throws IOException {
    FileStatus[] files = FSUtils.listStatus(fs, getStoreDir(familyName),
      new PathFilter () {
        public boolean accept(Path path) {
          return StoreFileInfo.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

        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

    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

                archiveList.add(libPath.toString());
                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

    private static Path getStagingPath(org.apache.falcon.entity.v0.cluster.Cluster cluster, Path path)
        throws FalconException {
        try {
            FileSystem fs = HadoopClientFactory.get().createFileSystem(ClusterHelper.getConfiguration(cluster));
            FileStatus latest = null;
            FileStatus[] files = fs.globStatus(path, new PathFilter() {
                @Override
                public boolean accept(Path path) {
                    if (path.getName().equals("logs")) {
                        return false;
                    }
View Full Code Here

  }

  private Collection<Fragment> getFragments(TableMeta meta, Path tablePath)
      throws IOException {
    List<Fragment> fraglist = Lists.newArrayList();
    FileStatus[] files = fs.listStatus(tablePath, new PathFilter() {
      @Override
      public boolean accept(Path path) {
        return path.getName().charAt(0) != '.';
      }
    });
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.