@Override protected Pattern compile(String s) { return GlobPattern.compile(s); } }
public ConfigurableGlobDatasetFinder(FileSystem fs, Properties jobProps, Config config) { for (String property : requiredProperties()) { Preconditions.checkArgument(config.hasPath(property) || config.hasPath(DEPRECATIONS.get(property)), String.format("Missing required property %s", property)); } if (ConfigUtils.hasNonEmptyPath(config, DATASET_BLACKLIST_KEY)) { this.blacklist = Optional.of(Pattern.compile(config.getString(DATASET_BLACKLIST_KEY))); } else if (ConfigUtils.hasNonEmptyPath(config, DATASET_FINDER_BLACKLIST_KEY)) { this.blacklist = Optional.of(Pattern.compile(config.getString(DATASET_FINDER_BLACKLIST_KEY))); } else { this.blacklist = Optional.absent(); } if (ConfigUtils.hasNonEmptyPath(config, DATASET_FINDER_GLOB_BLACKLIST_KEY)) { this.globPatternBlacklist = Optional.of(GlobPattern.compile(config.getString(DATASET_FINDER_GLOB_BLACKLIST_KEY))); } else { this.globPatternBlacklist = Optional.absent(); } this.fs = fs; Path tmpDatasetPattern; if (config.hasPath(DATASET_FINDER_PATTERN_KEY)) { tmpDatasetPattern = new Path(config.getString(DATASET_FINDER_PATTERN_KEY)); } else { tmpDatasetPattern = new Path(config.getString(DATASET_PATTERN_KEY)); } this.datasetPattern = tmpDatasetPattern.isAbsolute() ? tmpDatasetPattern : new Path(this.fs.getWorkingDirectory(), tmpDatasetPattern); this.commonRoot = PathUtils.deepestNonGlobPath(this.datasetPattern); this.props = jobProps; }
Pattern pattern = GlobPattern.compile(serverKeyPattern); if (!pattern.matcher(serverPrincipal).matches()) { throw new IllegalArgumentException(String.format(
@Override protected Pattern compile(String s) { return GlobPattern.compile(s); } }
@Override protected Pattern compile(String s) { return GlobPattern.compile(s); } }
@Override protected Pattern compile(String s) { return GlobPattern.compile(s); } }
@Override protected Pattern compile(String s) { return GlobPattern.compile(s); } }
private void shouldThrow(String... globs) { for (String glob : globs) { try { GlobPattern.compile(glob); } catch (PatternSyntaxException e) { e.printStackTrace(); continue; } assertTrue("glob "+ glob +" should throw", false); } }
public ConfigurableGlobDatasetFinder(FileSystem fs, Properties jobProps, Config config) { for (String property : requiredProperties()) { Preconditions.checkArgument(config.hasPath(property) || config.hasPath(DEPRECATIONS.get(property)), String.format("Missing required property %s", property)); } if (ConfigUtils.hasNonEmptyPath(config, DATASET_BLACKLIST_KEY)) { this.blacklist = Optional.of(Pattern.compile(config.getString(DATASET_BLACKLIST_KEY))); } else if (ConfigUtils.hasNonEmptyPath(config, DATASET_FINDER_BLACKLIST_KEY)) { this.blacklist = Optional.of(Pattern.compile(config.getString(DATASET_FINDER_BLACKLIST_KEY))); } else { this.blacklist = Optional.absent(); } if (ConfigUtils.hasNonEmptyPath(config, DATASET_FINDER_GLOB_BLACKLIST_KEY)) { this.globPatternBlacklist = Optional.of(GlobPattern.compile(config.getString(DATASET_FINDER_GLOB_BLACKLIST_KEY))); } else { this.globPatternBlacklist = Optional.absent(); } this.fs = fs; Path tmpDatasetPattern; if (config.hasPath(DATASET_FINDER_PATTERN_KEY)) { tmpDatasetPattern = new Path(config.getString(DATASET_FINDER_PATTERN_KEY)); } else { tmpDatasetPattern = new Path(config.getString(DATASET_PATTERN_KEY)); } this.datasetPattern = tmpDatasetPattern.isAbsolute() ? tmpDatasetPattern : new Path(this.fs.getWorkingDirectory(), tmpDatasetPattern); this.commonRoot = PathUtils.deepestNonGlobPath(this.datasetPattern); this.props = jobProps; }
Pattern pattern = GlobPattern.compile(serverKeyPattern); isPrincipalValid = pattern.matcher(serverPrincipal).matches(); } else {
Pattern pattern = GlobPattern.compile(serverKeyPattern); if (!pattern.matcher(serverPrincipal).matches()) { throw new IllegalArgumentException(String.format(
Pattern pattern = GlobPattern.compile(serverKeyPattern); isPrincipalValid = pattern.matcher(serverPrincipal).matches(); } else {
private void shouldThrow(String... globs) { for (String glob : globs) { try { GlobPattern.compile(glob); } catch (PatternSyntaxException e) { e.printStackTrace(); continue; } assertTrue("glob "+ glob +" should throw", false); } }
private void shouldThrow(String... globs) { for (String glob : globs) { try { GlobPattern.compile(glob); } catch (PatternSyntaxException e) { e.printStackTrace(); continue; } assertTrue("glob "+ glob +" should throw", false); } }
Pattern pattern = GlobPattern.compile(serverKeyPattern); isPrincipalValid = pattern.matcher(serverPrincipal).matches(); } else {