Yuta HIGUCHI
Committed by Gerrit Code Review

Dist.FlowRuleStore: log operation, when encountered no master situation

Change-Id: I6b6df423f747f35248c4f675147dfd32e471e1b5
...@@ -266,7 +266,7 @@ public class DistributedFlowRuleStore ...@@ -266,7 +266,7 @@ public class DistributedFlowRuleStore
266 ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(rule.deviceId()); 266 ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(rule.deviceId());
267 267
268 if (!replicaInfo.master().isPresent()) { 268 if (!replicaInfo.master().isPresent()) {
269 - log.warn("No master for {}", rule); 269 + log.warn("Failed to getFlowEntry: No master for {}", rule.deviceId());
270 // TODO: should we try returning from backup? 270 // TODO: should we try returning from backup?
271 return null; 271 return null;
272 } 272 }
...@@ -312,7 +312,7 @@ public class DistributedFlowRuleStore ...@@ -312,7 +312,7 @@ public class DistributedFlowRuleStore
312 ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(deviceId); 312 ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(deviceId);
313 313
314 if (!replicaInfo.master().isPresent()) { 314 if (!replicaInfo.master().isPresent()) {
315 - log.warn("No master for {}", deviceId); 315 + log.warn("Failed to getFlowEntries: No master for {}", deviceId);
316 // TODO: should we try returning from backup? 316 // TODO: should we try returning from backup?
317 return Collections.emptyList(); 317 return Collections.emptyList();
318 } 318 }
...@@ -369,10 +369,10 @@ public class DistributedFlowRuleStore ...@@ -369,10 +369,10 @@ public class DistributedFlowRuleStore
369 ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(deviceId); 369 ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(deviceId);
370 370
371 if (!replicaInfo.master().isPresent()) { 371 if (!replicaInfo.master().isPresent()) {
372 - log.warn("No master for {}", deviceId); 372 + log.warn("Failed to storeBatch: No master for {}", deviceId);
373 // TODO: revisit if this should be "success" from Future point of view 373 // TODO: revisit if this should be "success" from Future point of view
374 // with every FlowEntry failed 374 // with every FlowEntry failed
375 - return Futures.immediateFailedFuture(new IOException("No master to forward to")); 375 + return Futures.immediateFailedFuture(new IOException("Failed to storeBatch: No master for " + deviceId));
376 } 376 }
377 377
378 final NodeId local = clusterService.getLocalNode().id(); 378 final NodeId local = clusterService.getLocalNode().id();
...@@ -529,7 +529,7 @@ public class DistributedFlowRuleStore ...@@ -529,7 +529,7 @@ public class DistributedFlowRuleStore
529 } 529 }
530 530
531 if (!replicaInfo.master().isPresent()) { 531 if (!replicaInfo.master().isPresent()) {
532 - log.warn("No master for {}", deviceId); 532 + log.warn("Failed to removeFlowRule: No master for {}", deviceId);
533 // TODO: revisit if this should be null (="no-op") or Exception 533 // TODO: revisit if this should be null (="no-op") or Exception
534 return null; 534 return null;
535 } 535 }
......