Alon Bar-Lev has posted comments on this change. Change subject: tools: notifier - simple first match include/exclude. ......................................................................
Patch Set 2: (6 comments) http://gerrit.ovirt.org/#/c/24018/2/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/NotificationService.java File backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/NotificationService.java: Line 85: deleteObsoleteHistoryData(); Line 86: log.debug("Finished event notification service iteration"); Line 87: } catch (Throwable t) { Line 88: log.error("Exception while querying for notifications.", t); Line 89: if (t instanceof SQLException) { > I'm not sure what you meant. try { try { } catch (SQLException e) { distributeDbDownEvent(); throw e; } } catch (Exception e) { log.error(....) } Line 90: distributeDbDownEvent(); Line 91: } Line 92: if (!Thread.interrupted()) { Line 93: log.error(String.format("Failed to run the service."), t); http://gerrit.ovirt.org/#/c/24018/2/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/filter/FilterEntry.java File backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/filter/FilterEntry.java: Line 12: Line 13: private FilterEntry(String eventName, boolean exclude, String transportCandidate, String address) { Line 14: this.eventName = eventName; Line 15: this.exclude = exclude; Line 16: this.transportCandidate = transportCandidate; > It does't matter that transport is per recipient. What I am saying is that please don't. Line 17: this.address = address; Line 18: } Line 19: Line 20: public static FilterEntry createEntryFromRecipient( Line 13: private FilterEntry(String eventName, boolean exclude, String transportCandidate, String address) { Line 14: this.eventName = eventName; Line 15: this.exclude = exclude; Line 16: this.transportCandidate = transportCandidate; Line 17: this.address = address; > see my comment on FirstMatchSimpleFilter line 71. transport + name only consistent, please. Line 18: } Line 19: Line 20: public static FilterEntry createEntryFromRecipient( Line 21: String eventName, http://gerrit.ovirt.org/#/c/24018/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: > Exactly as I did In a previous patch set. not sure I understand this comment. Line 1: package org.ovirt.engine.core.notifier.filter; Line 2: Line 3: import java.util.HashMap; Line 4: import java.util.HashSet; Line 84: log.debug(String.format("parse: handling '%s'", m.group(0))); Line 85: boolean exclude = "exclude".equals(m.group("exclude")); Line 86: String event = m.group("event"); Line 87: String recipient = m.group("recipient"); Line 88: ret.add(FilterEntry.createEntryFromRecipient(event, exclude, recipient)); > What I don't get I why this is part of the class: recipient.split(":", 2); createFromConfigrationString is plain simple parse of string, why do you need a story as function name? Line 89: } Line 90: return ret; Line 91: } http://gerrit.ovirt.org/#/c/24018/2/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java File backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java: Line 224: if (!StringUtils.isEmpty(filter)) { Line 225: String[] filterElements = filter.split("\\s+"); Line 226: for (String filterElement : filterElements) { Line 227: if (!StringUtils.isEmpty(filterElement)) { Line 228: if (!FILTER_ELEMENT_PATTERN.matcher(filterElement).matches()) { > If I do validation here and I do not duplicate pattern, and I allow wrong t you do not check if transports are wrong, only that the configuration can be parsed. Line 229: throw new IllegalArgumentException( Line 230: String.format("%s Illegal value for %s , (%s)", Line 231: GENERIC_MESSAGE, Line 232: FILTER, -- To view, visit http://gerrit.ovirt.org/24018 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia0b94ee8665ff8030b36b463207e50beea44b47d Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: mooli tayer <mta...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Barak Azulay <bazu...@redhat.com> Gerrit-Reviewer: Martin Peřina <mper...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: mooli tayer <mta...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches