Java 类org.apache.hadoop.fs.GlobPattern 实例源码

项目:hadoop-oss    文件:Name.java   
@Override
public void prepare() throws IOException {
  String argPattern = getArgument(1);
  if (!caseSensitive) {
    argPattern = StringUtils.toLowerCase(argPattern);
  }
  globPattern = new GlobPattern(argPattern);
}
项目:hadoop    文件:Name.java   
@Override
public void prepare() throws IOException {
  String argPattern = getArgument(1);
  if (!caseSensitive) {
    argPattern = StringUtils.toLowerCase(argPattern);
  }
  globPattern = new GlobPattern(argPattern);
}
项目:aliyun-oss-hadoop-fs    文件:Name.java   
@Override
public void prepare() throws IOException {
  String argPattern = getArgument(1);
  if (!caseSensitive) {
    argPattern = StringUtils.toLowerCase(argPattern);
  }
  globPattern = new GlobPattern(argPattern);
}
项目:stocator    文件:ObjectStoreGlobFilter.java   
void init(String filePattern, PathFilter filter) throws IOException {
  try {
    userFilter = filter;
    pattern = new GlobPattern(filePattern);
  } catch (PatternSyntaxException e) {
    throw new IOException("Illegal file pattern: " + e.getMessage(), e);
  }
}
项目:big-c    文件:Name.java   
@Override
public void prepare() throws IOException {
  String argPattern = getArgument(1);
  if (!caseSensitive) {
    argPattern = StringUtils.toLowerCase(argPattern);
  }
  globPattern = new GlobPattern(argPattern);
}
项目:hops    文件:Name.java   
@Override
public void prepare() throws IOException {
  String argPattern = getArgument(1);
  if (!caseSensitive) {
    argPattern = StringUtils.toLowerCase(argPattern);
  }
  globPattern = new GlobPattern(argPattern);
}
项目:Cubert    文件:FileSystemUtils.java   
public static Path getFirstMatch(FileSystem fs, Path path, String globPatternStr, boolean recursive)
    throws IOException
{
    RemoteIterator<LocatedFileStatus> files = fs.listFiles(path, recursive);
    GlobPattern globPattern = new GlobPattern(globPatternStr);

    while (files.hasNext())
    {
        Path aFile = files.next().getPath();
        if(globPattern.matches(aFile.getName()))
            return aFile;
    }

    return null;
}
项目:hadoop-oss    文件:GlobFilter.java   
@Override
protected Pattern compile(String s) {
  return GlobPattern.compile(s);
}
项目:hadoop    文件:GlobFilter.java   
@Override
protected Pattern compile(String s) {
  return GlobPattern.compile(s);
}
项目:aliyun-oss-hadoop-fs    文件:GlobFilter.java   
@Override
protected Pattern compile(String s) {
  return GlobPattern.compile(s);
}
项目:big-c    文件:GlobFilter.java   
@Override
protected Pattern compile(String s) {
  return GlobPattern.compile(s);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:GlobFilter.java   
@Override
protected Pattern compile(String s) {
  return GlobPattern.compile(s);
}
项目:hadoop-plus    文件:GlobFilter.java   
@Override
protected Pattern compile(String s) {
  return GlobPattern.compile(s);
}
项目:hops    文件:GlobFilter.java   
@Override
protected Pattern compile(String s) {
  return GlobPattern.compile(s);
}
项目:bigdata-interop    文件:GoogleHadoopFileSystemBase.java   
/**
 * Determines based on config settings and suitability of {@code fixedPath} whether to use
 * flat globbing logic where we use a single large listing during globStatus to then perform
 * the core globbing logic in-memory.
 */
@VisibleForTesting
boolean shouldUseFlatGlob(Path fixedPath) {
  // Config setting overrides all else.
  if (!enableFlatGlob) {
    return false;
  }

  // Only works for filesystems where the base Hadoop Path scheme matches the underlying URI
  // scheme for GCS.
  if (!getUri().getScheme().equals(GoogleCloudStorageFileSystem.SCHEME)) {
    LOG.debug(
        "Flat glob is on, but doesn't work for scheme '{}'; using default behavior.",
        getUri().getScheme());
    return false;
  }

  // The full pattern should have a wildcard, otherwise there's no point doing the flat glob.
  GlobPattern fullPattern = new GlobPattern(fixedPath.toString());
  if (!fullPattern.hasWildcard()) {
    LOG.debug(
        "Flat glob is on, but Path '{}' has no wildcard; using default behavior.",
        fixedPath);
    return false;
  }

  // To use a flat glob, there must be an authority defined.
  if (Strings.isNullOrEmpty(fixedPath.toUri().getAuthority())) {
    LOG.info(
        "Flat glob is on, but Path '{}' has a empty authority, using default behavior.",
        fixedPath);
    return false;
  }

  // And the authority must not contain a wildcard.
  GlobPattern authorityPattern = new GlobPattern(fixedPath.toUri().getAuthority());
  if (authorityPattern.hasWildcard()) {
    LOG.info(
        "Flat glob is on, but Path '{}' has a wildcard authority, using default behavior.",
        fixedPath);
    return false;
  }

  return true;
}
项目:hadoop-TCP    文件:GlobFilter.java   
@Override
protected Pattern compile(String s) {
  return GlobPattern.compile(s);
}
项目:hadoop-on-lustre    文件:GlobFilter.java   
@Override
protected Pattern compile(String s) {
  return GlobPattern.compile(s);
}
项目:hardfs    文件:GlobFilter.java   
@Override
protected Pattern compile(String s) {
  return GlobPattern.compile(s);
}
项目:hadoop-on-lustre2    文件:GlobFilter.java   
@Override
protected Pattern compile(String s) {
  return GlobPattern.compile(s);
}
项目:hortonworks-extension    文件:GlobFilter.java   
@Override
protected Pattern compile(String s) {
  return GlobPattern.compile(s);
}
项目:hortonworks-extension    文件:GlobFilter.java   
@Override
protected Pattern compile(String s) {
  return GlobPattern.compile(s);
}
项目:parquet-mr    文件:PathGlobPattern.java   
/**
 * Compile glob pattern string
 *
 * @param globPattern the glob pattern
 * @return the pattern object
 */
public static Pattern compile(String globPattern) {
  return new GlobPattern(globPattern).compiled();
}