*/
package org.opendaylight.controller.md.statistics.manager;
-import java.util.HashMap;
-import java.util.List;
-import java.util.concurrent.ConcurrentMap;
-
import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.util.HashMap;
+import java.util.List;
+import java.util.concurrent.ConcurrentMap;
+
/**
* Class implement statistics manager related listener interface and augment all the
* received statistics data to data stores.
sucLogger.debug("Associated original flow is not found in data store. Augmenting flow in operational data store");
//TODO: Temporary fix: format [ 1+tableid+1+unaccounted flow counter]
long flowKey = Long.parseLong(new String("1"+Short.toString(tableId)+"1"+Integer.toString(this.unaccountedFlowsCounter)));
- FlowKey newFlowKey = new FlowKey(new FlowId(flowKey));
+ FlowKey newFlowKey = new FlowKey(new FlowId(Long.toString(flowKey)));
InstanceIdentifier<Flow> flowRef = InstanceIdentifier.builder(Nodes.class).child(Node.class, key)
.augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(tableId))
* _ethernetSource=EthernetSource [_address=MacAddress [_value=00:00:00:00:00:00], _mask=null, augmentation=[]],
* _ethernetType=EthernetType [_type=EtherType [_value=2048], _mask=null, augmentation=[]]
*
- * So this custom equals method add additional check, in case any match element is null in data-store-flow, but not
+ * Similarly for inPort, if user/application don't set any value for it, FRM will store null value for it in data store.
+ * When we fetch the same flow (with its statistics) from switch, plugin converts its value to openflow:X:0.
+ * e.g _inPort=Uri [_value=openflow:1:0]
+ *
+ * So this custom equals method add additional check to take care of these scenario, in case any match element is null in data-store-flow, but not
* in the flow fetched from switch.
*
* @param statsFlow
return false;
}
}
- } //else if(!storedFlow.getEthernetMatch().equals(statsFlow.getEthernetMatch())) {
- else if(!EthernetMatchEquals(statsFlow.getEthernetMatch(),storedFlow.getEthernetMatch())) {
+ } else if(!EthernetMatchEquals(statsFlow.getEthernetMatch(),storedFlow.getEthernetMatch())) {
return false;
}
if (storedFlow.getIcmpv4Match()== null) {
}
if (storedFlow.getInPort()== null) {
if (statsFlow.getInPort() != null) {
- if(statsFlow.getInPort()!= 0){
- return false;
+ String[] portArr = statsFlow.getInPort().getValue().split(":");
+ if(portArr.length >= 3){
+ if(Integer.parseInt(portArr[2]) != 0){
+ return false;
+ }
}
}
} else if(!storedFlow.getInPort().equals(statsFlow.getInPort())) {