Skip to content

Commit

Permalink
fix regexRarse bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sunbiaobiao authored and sunbiaobiao committed Oct 21, 2016
1 parent ea38643 commit d60fa2c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
5 changes: 0 additions & 5 deletions src/main/java/streaming/common/regex/RegexParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,9 @@ object LogParser {
if (regexer == null) {
regexer = new Regex(patten, keys: _*)
}
println(s"patten1 ${patten}")
for(key <- keys) {
println(s"keys1 ${key}")
}
val regexFind = regexer findFirstMatchIn line
val ret = new mutable.HashMap[String, String]()
if (!regexFind.isDefined) {
ret.put("aaa", "nomatch")
return ret.toMap
}
val _match = regexFind.get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ class RegexParserCompositor[T] extends Compositor[T] with CompositorHelper {
val dstream = middleResult(0).asInstanceOf[DStream[String]]
val _keys = keys.toArray
val _patten = patten
println(s"patten ${patten}")
for(key <- _keys) {
println(s"keys ${key}")
}
val newDstream = dstream.map { line =>
RegexParser.parse(line, _patten, _keys)
}
Expand Down

0 comments on commit d60fa2c

Please sign in to comment.