Skip to content

Commit

Permalink
[INLONG-8652][Agent] delete the capacity of setting blacklist
Browse files Browse the repository at this point in the history
fix code format problem
  • Loading branch information
justinwwhuang committed Aug 9, 2023
1 parent 0cb4f98 commit 3fdbe48
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@

/**
* Path pattern for file filter.
* It’s identified by watchDir, which matches {@link org.apache.inlong.agent.plugin.trigger.PathPattern#whiteList} and filters {@link org.apache.inlong.agent.plugin.trigger.PathPattern#blackList}.
* It’s identified by watchDir, which matches {@link PathPattern#whiteList}.
*/
public class PathPattern {

private static final Logger LOGGER =
LoggerFactory.getLogger(org.apache.inlong.agent.plugin.trigger.PathPattern.class);
LoggerFactory.getLogger(PathPattern.class);

private final String rootDir;
private final Set<String> subDirs;
Expand All @@ -66,15 +66,15 @@ public PathPattern(String rootDir, Set<String> whiteList, String offset) {
}
}

public static Set<org.apache.inlong.agent.plugin.trigger.PathPattern> buildPathPattern(Set<String> whiteList,
public static Set<PathPattern> buildPathPattern(Set<String> whiteList,
String offset) {
Set<String> commonWatchDir = PathUtils.findCommonRootPath(whiteList);
return commonWatchDir.stream().map(rootDir -> {
Set<String> commonWatchDirWhiteList =
whiteList.stream()
.filter(whiteRegex -> whiteRegex.startsWith(rootDir))
.collect(Collectors.toSet());
return new org.apache.inlong.agent.plugin.trigger.PathPattern(rootDir, commonWatchDirWhiteList, offset);
return new PathPattern(rootDir, commonWatchDirWhiteList, offset);
}).collect(Collectors.toSet());
}

Expand All @@ -87,7 +87,7 @@ public void cleanup() {
}

/**
* Research all children files with {@link org.apache.inlong.agent.plugin.trigger.PathPattern#rootDir} matched whiteList and filtered by blackList.
* Research all children files with {@link PathPattern#rootDir} matched whiteList and filtered by blackList.
*
* @param maxNum
* @return
Expand Down Expand Up @@ -162,9 +162,8 @@ public int hashCode() {

@Override
public boolean equals(Object object) {
if (object instanceof org.apache.inlong.agent.plugin.trigger.PathPattern) {
org.apache.inlong.agent.plugin.trigger.PathPattern entity =
(org.apache.inlong.agent.plugin.trigger.PathPattern) object;
if (object instanceof PathPattern) {
PathPattern entity = (PathPattern) object;
return entity.rootDir.equals(this.rootDir);
} else {
return false;
Expand Down

0 comments on commit 3fdbe48

Please sign in to comment.