public FlowStatisticsDataBuilder(FlowStatisticsData base) { this._flowStatistics = base.getFlowStatistics(); }
@Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (!(obj instanceof DataObject)) { return false; } if (!org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowStatisticsData.class.equals(((DataObject)obj).getImplementedInterface())) { return false; } org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowStatisticsData other = (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowStatisticsData)obj; if (_flowStatistics == null) { if (other.getFlowStatistics() != null) { return false; } } else if(!_flowStatistics.equals(other.getFlowStatistics())) { return false; } return true; }
@Override public void processStats(DataObject dataObject, JsonBuilderFactory factory, Properties properties) { this.factory = factory; this.properties = properties; FlowStatisticsData ofStatData = (FlowStatisticsData) dataObject; FlowStatistics ofStat = ofStatData.getFlowStatistics(); if (ofStat == null) { return; } sendToNewPersistenceService(ofStat, objectToJsonMapper(ofStat)); }
if (statsFromDataStore != null) { final FlowOnNode it = new FlowOnNode(ToSalConversionsUtils.toFlow(flow, node)); ret.add(addFlowStats(it, statsFromDataStore.getFlowStatistics()));
@Override public FlowOnNode readFlow(final Node node, final org.opendaylight.controller.sal.flowprogrammer.Flow targetFlow, final boolean cached) { FlowOnNode ret = null; final Table table = readOperationalTable(node, OPENFLOWV10_TABLE_ID); if (table != null) { final List<Flow> flows = table.getFlow(); InventoryAndReadAdapter.LOG.trace("Number of flows installed in table 0 of node {} : {}", node, flows.size()); for (final Flow mdsalFlow : flows) { if(FromSalConversionsUtils.flowEquals(mdsalFlow, MDFlowMapping.toMDSalflow(targetFlow))) { final FlowStatisticsData statsFromDataStore = mdsalFlow.getAugmentation(FlowStatisticsData.class); if (statsFromDataStore != null) { InventoryAndReadAdapter.LOG.debug("Found matching flow in the data store flow table "); ret = addFlowStats(new FlowOnNode(targetFlow), statsFromDataStore.getFlowStatistics()); // FIXME: break; ? } } } } //TODO: Refer TODO (main) final GetFlowStatisticsFromFlowTableInputBuilder input = new GetFlowStatisticsFromFlowTableInputBuilder().setNode(NodeMapping.toNodeRef(node)); input.fieldsFrom(MDFlowMapping.toMDSalflow(targetFlow)); getFlowStatisticsService().getFlowStatisticsFromFlowTable(input.build()); return ret; }
@Override public void handleData(InstanceIdentifier<Node> nodeID, InstanceIdentifier<?> id, DataObject dataObject) { FlowStatisticsData stData = (FlowStatisticsData) dataObject; FlowStatistics gs = stData.getFlowStatistics(); if(gs==null){ //no data yet, ignore return; } TSDRMetricRecordBuilderContainer bc = getCollector().getTSDRMetricRecordBuilderContainer(id); if (bc != null) { TSDRMetricRecordBuilder builder[] = bc.getBuilders(); long timeStamp = getTimeStamp(); builder[0].setMetricValue(new Counter64(new BigInteger("" + gs.getByteCount().getValue()))); builder[0].setTimeStamp(timeStamp); builder[1].setMetricValue(new Counter64(new BigInteger("" + gs.getPacketCount().getValue()))); builder[1].setTimeStamp(timeStamp); } else { List<RecordKeys> recKeys = createRecordKeys(id); getCollector().createTSDRMetricRecordBuilder(nodeID,id, recKeys, "ByteCount", "" + gs.getByteCount().getValue(), DataCategory.FLOWSTATS); getCollector().createTSDRMetricRecordBuilder(nodeID,id, recKeys, "PacketCount", "" + gs.getPacketCount().getValue(), DataCategory.FLOWSTATS); } } }
flow.getAugmentation(FlowStatisticsData.class); if (data != null) { GenericStatistics fstats = data.getFlowStatistics(); String err = FlowStatsUtils.check(fstats); if (err == null) {