Search in sources :

Example 1 with HiddenFilter

use of org.apache.gobblin.util.filters.HiddenFilter in project incubator-gobblin by apache.

the class RecursivePathFinder method getPaths.

public Set<FileStatus> getPaths(boolean skipHiddenPaths) throws IOException {
    if (!this.fs.exists(this.rootPath)) {
        return Sets.newHashSet();
    }
    PathFilter actualFilter = skipHiddenPaths ? new AndPathFilter(new HiddenFilter(), this.pathFilter) : this.pathFilter;
    List<FileStatus> files = FileListUtils.listFilesToCopyAtPath(this.fs, this.rootPath, actualFilter, includeEmptyDirectories);
    return Sets.newHashSet(files);
}
Also used : PathFilter(org.apache.hadoop.fs.PathFilter) AndPathFilter(org.apache.gobblin.util.filters.AndPathFilter) HiddenFilter(org.apache.gobblin.util.filters.HiddenFilter) FileStatus(org.apache.hadoop.fs.FileStatus) AndPathFilter(org.apache.gobblin.util.filters.AndPathFilter)

Example 2 with HiddenFilter

use of org.apache.gobblin.util.filters.HiddenFilter in project incubator-gobblin by apache.

the class FsCommitSequenceStore method get.

@Override
public Collection<String> get(String jobName) throws IOException {
    ImmutableList.Builder<String> builder = new ImmutableList.Builder<>();
    Path jobPath = new Path(this.rootPath, jobName);
    if (this.fs.exists(jobPath)) {
        for (FileStatus status : this.fs.listStatus(jobPath, new HiddenFilter())) {
            builder.add(status.getPath().getName());
        }
    }
    return builder.build();
}
Also used : Path(org.apache.hadoop.fs.Path) FileStatus(org.apache.hadoop.fs.FileStatus) HiddenFilter(org.apache.gobblin.util.filters.HiddenFilter) ImmutableList(com.google.common.collect.ImmutableList)

Aggregations

HiddenFilter (org.apache.gobblin.util.filters.HiddenFilter)2 FileStatus (org.apache.hadoop.fs.FileStatus)2 ImmutableList (com.google.common.collect.ImmutableList)1 AndPathFilter (org.apache.gobblin.util.filters.AndPathFilter)1 Path (org.apache.hadoop.fs.Path)1 PathFilter (org.apache.hadoop.fs.PathFilter)1