BUG-5280: log a message when tell-based protocol is active 20/54320/2
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 4 Apr 2017 16:27:34 +0000 (18:27 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Thu, 6 Apr 2017 16:35:54 +0000 (16:35 +0000)
Discerning the two access modes is critical to understanding
when failures occur. Add an explicit note when the tell-based
protocol is enabled on a data store.

Change-Id: I3e2b1d2f84a73ce1a3759d419176c47a6dd0ad12
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreFactory.java

index 8ecb1df70a0c436da6a859f0f105b5e7a2482c9c..e5b6f695474487782ee31887ce9ffba0ca53afe7 100644 (file)
@@ -38,9 +38,15 @@ public class DistributedDataStoreFactory {
         ClusterWrapper clusterWrapper = new ClusterWrapperImpl(actorSystem);
         DatastoreContextFactory contextFactory = introspector.newContextFactory();
 
-        final AbstractDataStore dataStore = datastoreContext.isUseTellBasedProtocol()
-                ? new ClientBackedDataStore(actorSystem, clusterWrapper, config, contextFactory, restoreFromSnapshot) :
-                    new DistributedDataStore(actorSystem, clusterWrapper, config, contextFactory, restoreFromSnapshot);
+        final AbstractDataStore dataStore;
+        if (datastoreContext.isUseTellBasedProtocol()) {
+            dataStore = new ClientBackedDataStore(actorSystem, clusterWrapper, config, contextFactory,
+                restoreFromSnapshot);
+            LOG.info("Data store {} is using tell-based protocol", datastoreContext.getDataStoreName());
+        } else {
+            dataStore = new DistributedDataStore(actorSystem, clusterWrapper, config, contextFactory,
+                restoreFromSnapshot);
+        }
 
         overlay.setListener(dataStore);