Change-Id: I24122eeda1c66ebe8598beaec0ff23bd33b262a0
This commit is contained in:
Yuta HIGUCHI 2014-10-17 11:56:06 -07:00
parent 7d1ad60622
commit 0858b35e88

View File

@ -127,7 +127,7 @@ public class DistributedFlowRuleStore
@Override @Override
public void storeFlowRule(FlowRule rule) { public void storeFlowRule(FlowRule rule) {
ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(rule.deviceId()); ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(rule.deviceId());
if (replicaInfo.master().get().equals(clusterService.getLocalNode())) { if (replicaInfo.master().get().equals(clusterService.getLocalNode().id())) {
storeFlowEntryInternal(rule); storeFlowEntryInternal(rule);
return; return;
} }
@ -146,7 +146,7 @@ public class DistributedFlowRuleStore
} }
} }
public synchronized void storeFlowEntryInternal(FlowRule flowRule) { private synchronized void storeFlowEntryInternal(FlowRule flowRule) {
FlowEntry flowEntry = new DefaultFlowEntry(flowRule); FlowEntry flowEntry = new DefaultFlowEntry(flowRule);
DeviceId deviceId = flowRule.deviceId(); DeviceId deviceId = flowRule.deviceId();
// write to local copy. // write to local copy.
@ -161,7 +161,7 @@ public class DistributedFlowRuleStore
@Override @Override
public synchronized void deleteFlowRule(FlowRule rule) { public synchronized void deleteFlowRule(FlowRule rule) {
ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(rule.deviceId()); ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(rule.deviceId());
if (replicaInfo.master().get().equals(clusterService.getLocalNode())) { if (replicaInfo.master().get().equals(clusterService.getLocalNode().id())) {
deleteFlowRuleInternal(rule); deleteFlowRuleInternal(rule);
return; return;
} }
@ -180,7 +180,7 @@ public class DistributedFlowRuleStore
} }
} }
public synchronized void deleteFlowRuleInternal(FlowRule flowRule) { private synchronized void deleteFlowRuleInternal(FlowRule flowRule) {
FlowEntry entry = getFlowEntry(flowRule); FlowEntry entry = getFlowEntry(flowRule);
if (entry == null) { if (entry == null) {
return; return;
@ -192,7 +192,7 @@ public class DistributedFlowRuleStore
@Override @Override
public FlowRuleEvent addOrUpdateFlowRule(FlowEntry rule) { public FlowRuleEvent addOrUpdateFlowRule(FlowEntry rule) {
ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(rule.deviceId()); ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(rule.deviceId());
if (replicaInfo.master().get().equals(clusterService.getLocalNode())) { if (replicaInfo.master().get().equals(clusterService.getLocalNode().id())) {
return addOrUpdateFlowRuleInternal(rule); return addOrUpdateFlowRuleInternal(rule);
} }
@ -235,7 +235,7 @@ public class DistributedFlowRuleStore
@Override @Override
public FlowRuleEvent removeFlowRule(FlowEntry rule) { public FlowRuleEvent removeFlowRule(FlowEntry rule) {
ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(rule.deviceId()); ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(rule.deviceId());
if (replicaInfo.master().get().equals(clusterService.getLocalNode())) { if (replicaInfo.master().get().equals(clusterService.getLocalNode().id())) {
// bypass and handle it locally // bypass and handle it locally
return removeFlowRuleInternal(rule); return removeFlowRuleInternal(rule);
} }