From: Josh Date: Thu, 11 May 2017 13:43:07 +0000 (+0300) Subject: fix config file for mdsal-trace and filtering mechanism X-Git-Tag: release/nitrogen~271 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=2625c4b5cd121c448de8f5c050cfb98a0db3775d fix config file for mdsal-trace and filtering mechanism Initially missed this but this patch fixes the initial config xml file. Also, this code contains a fix for an issue with filtering paths that CODEC could not handle and were reconstructed. Change-Id: I34da4ce9e78c075439b0047407c75aa0b86feb16 Signed-off-by: Josh --- diff --git a/opendaylight/md-sal/mdsal-trace/api/pom.xml b/opendaylight/md-sal/mdsal-trace/api/pom.xml index ea1f7bbf77..79ecc8d528 100644 --- a/opendaylight/md-sal/mdsal-trace/api/pom.xml +++ b/opendaylight/md-sal/mdsal-trace/api/pom.xml @@ -48,6 +48,28 @@ and is available at http://www.eclipse.org/legal/epl-v10.html checkstyle.violationSeverity=error + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + + attach-artifact + + package + + + + ${project.build.directory}/classes/initial/mdsaltrace_config.xml + xml + config + + + + + + diff --git a/opendaylight/md-sal/mdsal-trace/api/src/main/resources/initial/mdsaltrace_config.xml b/opendaylight/md-sal/mdsal-trace/api/src/main/resources/initial/mdsaltrace_config.xml new file mode 100644 index 0000000000..8e17c8b5fe --- /dev/null +++ b/opendaylight/md-sal/mdsal-trace/api/src/main/resources/initial/mdsaltrace_config.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/opendaylight/md-sal/mdsal-trace/dom-impl/src/main/java/org/opendaylight/controller/md/sal/trace/dom/impl/TracingBroker.java b/opendaylight/md-sal/mdsal-trace/dom-impl/src/main/java/org/opendaylight/controller/md/sal/trace/dom/impl/TracingBroker.java index c971ec300d..a30d3e065e 100644 --- a/opendaylight/md-sal/mdsal-trace/dom-impl/src/main/java/org/opendaylight/controller/md/sal/trace/dom/impl/TracingBroker.java +++ b/opendaylight/md-sal/mdsal-trace/dom-impl/src/main/java/org/opendaylight/controller/md/sal/trace/dom/impl/TracingBroker.java @@ -60,7 +60,7 @@ import org.slf4j.LoggerFactory; * features * xml * runtime - * 0.1.5-SNAPSHOT + * 0.1.6-SNAPSHOT * * } * @@ -117,7 +117,17 @@ public class TracingBroker implements TracingDOMDataBroker { } private boolean isParent(String parent, String child) { - return child.startsWith(parent); + int parentOffset = 0; + if (parent.length() > 0 && parent.charAt(0) == '<') { + parentOffset = parent.indexOf('>') + 1; + } + + int childOffset = 0; + if (child.length() > 0 && child.charAt(0) == '<') { + childOffset = child.indexOf('>') + 1; + } + + return child.startsWith(parent.substring(parentOffset), childOffset); } public boolean subtreesOverlap(YangInstanceIdentifier iid, LogicalDatastoreType store, @@ -127,7 +137,6 @@ public class TracingBroker implements TracingDOMDataBroker { } String otherIidString = toIidCompString(iid); - switch (scope) { case BASE: return isParent(iidString, otherIidString); @@ -178,6 +187,7 @@ public class TracingBroker implements TracingDOMDataBroker { * @param store Which LogicalDataStore? or null for both */ public void watchRegistrations(String iidString, LogicalDatastoreType store) { + LOG.info("Watching registrations to {} in {}", iidString, store); registrationWatches.add(new Watch(iidString, store)); } @@ -187,6 +197,7 @@ public class TracingBroker implements TracingDOMDataBroker { * @param store Which LogicalDataStore? or null for both */ public void watchWrites(String iidString, LogicalDatastoreType store) { + LOG.info("Watching writes to {} in {}", iidString, store); Watch watch = new Watch(iidString, store); writeWatches.add(watch); } @@ -243,7 +254,7 @@ public class TracingBroker implements TracingDOMDataBroker { } private void reconstructIidPathString(YangInstanceIdentifier yiid, StringBuilder sb) { - sb.append("RECONSTRUCTED: "); + sb.append(""); for (YangInstanceIdentifier.PathArgument pathArg : yiid.getPathArguments()) { if (pathArg instanceof YangInstanceIdentifier.AugmentationIdentifier) { sb.append('/').append("AUGMENTATION"); @@ -251,7 +262,6 @@ public class TracingBroker implements TracingDOMDataBroker { } sb.append('/').append(pathArg.getNodeType().getLocalName()); } - sb.append(" ->->-> [[[ ").append(yiid.toString()).append(" ]]]"); } String getStackSummary() { diff --git a/opendaylight/md-sal/mdsal-trace/features/features-mdsal-trace/src/main/features/features.xml b/opendaylight/md-sal/mdsal-trace/features/features-mdsal-trace/src/main/features/features.xml index ac91121309..3eb6d7b325 100644 --- a/opendaylight/md-sal/mdsal-trace/features/features-mdsal-trace/src/main/features/features.xml +++ b/opendaylight/md-sal/mdsal-trace/features/features-mdsal-trace/src/main/features/features.xml @@ -19,5 +19,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html mvn:org.opendaylight.controller/mdsal-trace-api/{{VERSION}} mvn:org.opendaylight.controller/mdsal-trace-dom-impl/{{VERSION}} mvn:org.opendaylight.controller/mdsal-trace-binding-impl/{{VERSION}} + mvn:org.opendaylight.controller/mdsal-trace-api/{{VERSION}}/xml/config