X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fconfig-persister-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fpersist%2Fimpl%2FConfigPusherImpl.java;h=b06219c978558cb69c92bb353d279cb0f8c480cb;hp=b346522f4498b587c5550f7898f6a9639b48f395;hb=8d9cdd0223be6d550d6f44dcb42fe7366bce3cf9;hpb=b5b204bafd8ee18692fc023cb2eae6e123369340 diff --git a/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPusherImpl.java b/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPusherImpl.java index b346522f44..b06219c978 100644 --- a/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPusherImpl.java +++ b/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPusherImpl.java @@ -53,7 +53,7 @@ import org.xml.sax.SAXException; @Immutable public class ConfigPusherImpl implements ConfigPusher { - private static final Logger logger = LoggerFactory.getLogger(ConfigPusherImpl.class); + private static final Logger LOG = LoggerFactory.getLogger(ConfigPusherImpl.class); private final long maxWaitForCapabilitiesMillis; private final long conflictingVersionTimeoutMillis; @@ -83,35 +83,35 @@ public class ConfigPusherImpl implements ConfigPusher { * it is good idea to perform garbage collection to prune * any garbage we have accumulated during startup. */ - logger.debug("Running post-initialization garbage collection..."); + LOG.debug("Running post-initialization garbage collection..."); System.gc(); - logger.debug("Post-initialization garbage collection completed."); - logger.debug("ConfigPusher has pushed configs {}, gc completed", configs); + LOG.debug("Post-initialization garbage collection completed."); + LOG.debug("ConfigPusher has pushed configs {}, gc completed", configs); } catch (NetconfDocumentedException e) { - logger.error("Error pushing configs {}",configs); + LOG.error("Error pushing configs {}",configs); throw new IllegalStateException(e); } } } public void pushConfigs(List configs) throws InterruptedException { - logger.debug("Requested to push configs {}", configs); + LOG.debug("Requested to push configs {}", configs); this.queue.put(configs); } private LinkedHashMap internalPushConfigs(List configs) throws NetconfDocumentedException { - logger.debug("Last config snapshots to be pushed to netconf: {}", configs); + LOG.debug("Last config snapshots to be pushed to netconf: {}", configs); LinkedHashMap result = new LinkedHashMap<>(); // start pushing snapshots: for (ConfigSnapshotHolder configSnapshotHolder : configs) { if(configSnapshotHolder != null) { EditAndCommitResponse editAndCommitResponseWithRetries = pushConfigWithConflictingVersionRetries(configSnapshotHolder); - logger.debug("Config snapshot pushed successfully: {}, result: {}", configSnapshotHolder, result); + LOG.debug("Config snapshot pushed successfully: {}, result: {}", configSnapshotHolder, result); result.put(configSnapshotHolder, editAndCommitResponseWithRetries); } } - logger.debug("All configuration snapshots have been pushed successfully."); + LOG.debug("All configuration snapshots have been pushed successfully."); return result; } @@ -133,7 +133,7 @@ public class ConfigPusherImpl implements ConfigPusher { return pushConfig(configSnapshotHolder, operationService); } catch (ConflictingVersionException e) { lastException = e; - logger.debug("Conflicting version detected, will retry after timeout"); + LOG.debug("Conflicting version detected, will retry after timeout"); sleep(); } } while (stopwatch.elapsed(TimeUnit.MILLISECONDS) < conflictingVersionTimeoutMillis); @@ -148,7 +148,7 @@ public class ConfigPusherImpl implements ConfigPusher { try { return getOperationService(expectedCapabilities, idForReporting); } catch (NotEnoughCapabilitiesException e) { - logger.debug("Not enough capabilities: " + e.toString()); + LOG.debug("Not enough capabilities: {}", e.toString()); lastException = e; sleep(); } @@ -187,9 +187,9 @@ public class ConfigPusherImpl implements ConfigPusher { return serviceCandidate; } else { serviceCandidate.close(); - logger.trace("Netconf server did not provide required capabilities for {} " + + LOG.trace("Netconf server did not provide required capabilities for {} ", idForReporting, "Expected but not found: {}, all expected {}, current {}", - idForReporting, notFoundDiff, expectedCapabilities, serviceCandidate.getCapabilities() + notFoundDiff, expectedCapabilities, serviceCandidate.getCapabilities() ); throw new NotEnoughCapabilitiesException("Not enough capabilities for " + idForReporting + ". Expected but not found: " + notFoundDiff); } @@ -234,7 +234,7 @@ public class ConfigPusherImpl implements ConfigPusher { } catch (SAXException | IOException e) { throw new IllegalStateException("Cannot parse " + configSnapshotHolder); } - logger.trace("Pushing last configuration to netconf: {}", configSnapshotHolder); + LOG.trace("Pushing last configuration to netconf: {}", configSnapshotHolder); Stopwatch stopwatch = new Stopwatch().start(); NetconfMessage editConfigMessage = createEditConfigMessage(xmlToBePersisted); @@ -244,16 +244,16 @@ public class ConfigPusherImpl implements ConfigPusher { Document commitResponseMessage = sendRequestGetResponseCheckIsOK(getCommitMessage(), operationService, "commit", configSnapshotHolder.toString()); - if (logger.isTraceEnabled()) { + if (LOG.isTraceEnabled()) { StringBuilder response = new StringBuilder("editConfig response = {"); response.append(XmlUtil.toString(editResponseMessage)); response.append("}"); response.append("commit response = {"); response.append(XmlUtil.toString(commitResponseMessage)); response.append("}"); - logger.trace("Last configuration loaded successfully"); - logger.trace("Detailed message {}", response); - logger.trace("Total time spent {} ms", stopwatch.elapsed(TimeUnit.MILLISECONDS)); + LOG.trace("Last configuration loaded successfully"); + LOG.trace("Detailed message {}", response); + LOG.trace("Total time spent {} ms", stopwatch.elapsed(TimeUnit.MILLISECONDS)); } return new EditAndCommitResponse(editResponseMessage, commitResponseMessage); }