> On 七月 26, 2016, 3:44 p.m., Denes Arvay wrote: > > flume-ng-sources/flume-taildir-source/src/main/java/org/apache/flume/source/taildir/TaildirMatcher.java, > > line 264 > > <https://reviews.apache.org/r/50378/diff/2/?file=1451879#file1451879line264> > > > > In general I think this approach is not the best, as it has to iterate > > over the `"*?[{"` string every time, whereas with a `Set` it could be > > faster. As the length of the pattern string is only 4, it mightn't be worth > > the change, mostly because of the char->Character autoboxing's overhead. > > But with a `BitSet` we could have a bit (no pun intended) better > > performace (although I don't have numbers): > > ``` > > private static final BitSet GLOB_WILDCARD_BIT_SET = new BitSet(8); > > static { > > for (char ch : "*?[{".toCharArray()) { > > GLOB_WILDCARD_BIT_SET.set(ch); > > } > > } > > ``` > > and then check with `GLOB_WILDCARD_BIT_SET.get(path.charAt(i))` > > > > But again, I just wanted to share my opinion with you, I'm definitely > > not insisting on this change.
Thanks. I checked Glob.java in package sun.nio.fs, code is as follows: private static boolean isRegexMeta(char var0) { return ".^$+{[]|()".indexOf(var0) != -1; } private static boolean isGlobMeta(char var0) { return "\*?[{".indexOf(var0) != -1; } > On 七月 26, 2016, 3:44 p.m., Denes Arvay wrote: > > flume-ng-sources/flume-taildir-source/src/test/java/org/apache/flume/source/taildir/TestTaildirSource.java, > > lines 269-271 > > <https://reviews.apache.org/r/50378/diff/2/?file=1451880#file1451880line269> > > > > are these `sleep`s really needed? I delete this test. On 七月 26, 2016, 3:44 p.m., qiao wen wrote: > > Thanks for the patch. Besides the line-comments I've added there are a > > handful of minor formatting issues which make the checkstyle fail, please > > fix those too. You can run the checkstyle with `mvn clean verify > > -DskipTests -Drat.skip`. Let me know if you have any issues running it, I'm > > happy to help. Thanks for your review. I haved runed checkstyle and modify the code. - qiao ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/50378/#review143526 ----------------------------------------------------------- On 七月 25, 2016, 3:40 p.m., qiao wen wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/50378/ > ----------------------------------------------------------- > > (Updated 七月 25, 2016, 3:40 p.m.) > > > Review request for Flume. > > > Repository: flume-git > > > Description > ------- > > In our log management project, we wan't to track many log files like this: > /app/dir1/log.* > /app/dir2/log.* > ... > /app/dirn/log.* > But TaildirSource can't support wildcards in filegroup directory name. The > following config is expected: > a1.sources.r1.filegroups.fg = /app/*/log.* > > > Diffs > ----- > > flume-ng-doc/sphinx/FlumeUserGuide.rst 1334500 > > flume-ng-sources/flume-taildir-source/src/main/java/org/apache/flume/source/taildir/TaildirMatcher.java > ad9f720 > > flume-ng-sources/flume-taildir-source/src/test/java/org/apache/flume/source/taildir/TestTaildirSource.java > 097ee0b > > Diff: https://reviews.apache.org/r/50378/diff/ > > > Testing > ------- > > All tests in TestTaildirSource passed. > > > Thanks, > > qiao wen > >