Improve Singleton Service Logs 55/52155/2
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Wed, 22 Feb 2017 09:08:05 +0000 (10:08 +0100)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Fri, 3 Mar 2017 07:50:16 +0000 (08:50 +0100)
Improve Singleton Service Logs

Change-Id: Ie09d2e00e7159539dcecc520ef0e9cd39ca4e02f
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/RIBImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/config/AppPeer.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/config/BgpDeployerImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/config/BgpPeer.java

index dd48667963ac8e976d4705ae7a276193923a1c1b..ec6e192863113afd81ec155e579f3a3a77655edd 100755 (executable)
@@ -153,7 +153,7 @@ public final class RIBImpl extends BGPRIBStateImpl implements ClusterSingletonSe
         this.exportPolicyPeerTrackerMap = exportPolicies.build();
 
         this.renderStats = new RIBImplRuntimeMXBeanImpl(localBgpId, ribId, localAs, cId, this, this.localTablesKeys);
-        LOG.info("RIB Singleton Service {} registered", getIdentifier());
+        LOG.info("RIB Singleton Service {} registered, RIB {}", getIdentifier().getValue(), this.ribId.getValue());
         //this need to be always the last step
         this.registration = registerClusterSingletonService(this);
     }
@@ -316,7 +316,7 @@ public final class RIBImpl extends BGPRIBStateImpl implements ClusterSingletonSe
         if(this.configurationWriter != null) {
             this.configurationWriter.apply();
         }
-        LOG.info("RIB Singleton Service {} instantiated", getIdentifier());
+        LOG.info("RIB Singleton Service {} instantiated, RIB {}", getIdentifier().getValue(), this.ribId.getValue());
         LOG.debug("Instantiating RIB table {} at {}", this.ribId , this.yangRibId);
 
         final ContainerNode bgpRib = Builders.containerBuilder().withNodeIdentifier(new NodeIdentifier(BgpRib.QNAME))
@@ -350,7 +350,7 @@ public final class RIBImpl extends BGPRIBStateImpl implements ClusterSingletonSe
 
     @Override
     public synchronized ListenableFuture<Void> closeServiceInstance() {
-        LOG.info("RIB {} closing instance", this.ribId.getValue());
+        LOG.info("Close RIB Singleton Service {}, RIB {}", getIdentifier().getValue(), this.ribId.getValue());
         this.txChainToLocRibWriter.values().forEach(LocRibWriter::close);
         this.txChainToLocRibWriter.clear();
 
index aea1d61336b311a2329ed19e4cb6cb555db5d1ae..7d9fe8f76db2ada0f2f1943aee1b782c1f4d0c9d 100644 (file)
@@ -111,7 +111,8 @@ public final class AppPeer implements PeerBean, BGPPeerStateConsumer {
             this.dataTreeChangeService = rib.getService();
             this.serviceGroupIdentifier = rib.getRibIServiceGroupIdentifier();
             this.configurationWriter = configurationWriter;
-            LOG.info("Application Peer Singleton Service {} registered", getIdentifier());
+            LOG.info("Application Peer Singleton Service {} registered, Application peer {}",
+                getIdentifier().getValue(), this.appRibId.getValue());
             //this need to be always the last step
             this.singletonServiceRegistration = rib.registerClusterSingletonService(this);
         }
@@ -129,7 +130,8 @@ public final class AppPeer implements PeerBean, BGPPeerStateConsumer {
             if(this.configurationWriter != null) {
                 this.configurationWriter.apply();
             }
-            LOG.info("Application Peer Singleton Service {} instantiated", getIdentifier());
+            LOG.info("Application Peer Singleton Service {} instantiated, Application peer {}",
+                getIdentifier().getValue(), this.appRibId.getValue());
             final YangInstanceIdentifier yangIId = YangInstanceIdentifier.builder().node(ApplicationRib.QNAME)
                 .nodeWithKey(ApplicationRib.QNAME, APP_ID_QNAME, this.appRibId.getValue()).node(Tables.QNAME).node(Tables.QNAME).build();
             this.applicationPeer.instantiateServiceInstance(this.dataTreeChangeService,
@@ -138,7 +140,8 @@ public final class AppPeer implements PeerBean, BGPPeerStateConsumer {
 
         @Override
         public ListenableFuture<Void> closeServiceInstance() {
-            LOG.info("Application Peer Singleton Service {} instance closed", getIdentifier());
+            LOG.info("Application Peer Singleton Service {} instance closed, Application peer {}",
+                getIdentifier().getValue(), this.appRibId.getValue());
             return this.applicationPeer.close();
         }
 
index 42b0f96a5282f6f9a82d3cb54841a5d0b51addeb..9939b4667b971bea0fc3b8e3a6f577d8eef97b31 100644 (file)
@@ -126,6 +126,7 @@ public final class BgpDeployerImpl implements BgpDeployer, ClusteredDataTreeChan
 
     @Override
     public synchronized void close() throws Exception {
+        LOG.info("Closing BGP Deployer.");
         this.registration.close();
         this.peers.values().forEach(PeerBean::close);
         this.peers.clear();
index ce2328217e6afa26e76f4b409a1e272ecc701847..135381098d6fcb2c06c5b7e2f2bbc6481ec296ff 100644 (file)
@@ -256,7 +256,7 @@ public final class BgpPeer implements PeerBean, BGPPeerStateConsumer, BGPPeerRun
             if(this.configurationWriter != null) {
                 this.configurationWriter.apply();
             }
-            LOG.info("Peer Singleton Service {} instantiated", getIdentifier().getValue());
+            LOG.info("Peer Singleton Service {} instantiated, Peer {}", getIdentifier().getValue(), this.neighborAddress);
             this.bgpPeer.instantiateServiceInstance();
             this.dispatcher.getBGPPeerRegistry().addPeer(this.neighborAddress, this.bgpPeer, this.prefs);
             if (this.activeConnection) {
@@ -266,7 +266,7 @@ public final class BgpPeer implements PeerBean, BGPPeerStateConsumer, BGPPeerRun
 
         @Override
         public ListenableFuture<Void> closeServiceInstance() {
-            LOG.info("Close Peer Singleton Service {}", getIdentifier().getValue());
+            LOG.info("Close Peer Singleton Service {}, Peer {}", getIdentifier().getValue(), this.neighborAddress);
             if (this.connection != null) {
                 this.connection.cancel(true);
                 this.connection = null;