Greg Padgett has posted comments on this change.

Change subject: tools: notifier: filter messages based on severity
......................................................................


Patch Set 2:

(3 comments)

https://gerrit.ovirt.org/#/c/38442/2/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/filter/FirstMatchSimpleFilter.java
File 
backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/filter/FirstMatchSimpleFilter.java:

Line 22:             "\\s*" +
Line 23:             "((?<include>include)|(?<exclude>exclude))" +
Line 24:             ":" +
Line 25:             "((?<anymsg>\\*)|(?<message>\\w+))" +
Line 26:             "(?>" +
> ok, just seen your comment, I am almost sure it is not required.
True, not required, but if we can help the parser be more efficient why not?
Line 27:                 ":" +
Line 28:                 "((?<severity>\\*|ALERT|ERROR|WARNING|NORMAL))" +
Line 29:             ")?" +
Line 30:             "(?<recipient>" +


Line 24:             ":" +
Line 25:             "((?<anymsg>\\*)|(?<message>\\w+))" +
Line 26:             "(?>" +
Line 27:                 ":" +
Line 28:                 "((?<severity>\\*|ALERT|ERROR|WARNING|NORMAL))" +
> not sure you need two ()
Done
Line 29:             ")?" +
Line 30:             "(?<recipient>" +
Line 31:                 "\\(" +
Line 32:                     "(" +


Line 109:             boolean isExclusion) {
Line 110:         // Severity matching works in the opposite way for inclusions 
and exclusions; a filter will
Line 111:         // include events of equal-or-greater severity or exclude 
events of lesser-or-equal severity.
Line 112:         int cmp = eventSeverity.compareTo(filterSeverity);
Line 113:         return isExclusion ? cmp <= 0 : cmp >= 0;
> something like:
Done, I guess it's simple enough :)
Line 114:     }
Line 115: 
Line 116:     public static List<FilterEntry> parse(String filters) {
Line 117:         List<FilterEntry> ret = new LinkedList<>();


-- 
To view, visit https://gerrit.ovirt.org/38442
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia8abc34d56f1ede2fb51daf71dee293d08f198a3
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Greg Padgett <[email protected]>
Gerrit-Reviewer: Mooli Tayer <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to