writeFlowStatistics(data, deviceInfo, flowRegistry, txFacade);
txFacade.submitTransaction();
EventsTimeCounter.markEnd(eventIdentifier);
- flowRegistry.processMarks();
return Boolean.TRUE;
});
}
final short tableId = flowStat.getTableId();
final FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), flowBuilder.build());
- registry.store(flowRegistryKey);
- final FlowId flowId = registry.retrieveDescriptor(flowRegistryKey).getFlowId();
+ final FlowId flowId = registry.storeIfNecessary(flowRegistryKey);
final FlowKey flowKey = new FlowKey(flowId);
flowBuilder.setKey(flowKey);
final DeviceMeterRegistry meterRegistry,
final InstanceIdentifier<FlowCapableNode> flowNodeIdent,
final TxFacade txFacade) throws TransactionChainClosedException {
- meterRegistry.forEach(meterId -> {
+ for (final MeterId meterId : meterRegistry.getAllMeterIds()) {
final InstanceIdentifier<Meter> meterIdent = flowNodeIdent.child(Meter.class, new MeterKey(meterId));
txFacade.addDeleteToTxChain(LogicalDatastoreType.OPERATIONAL, meterIdent);
- });
- meterRegistry.processMarks();
+ }
+ meterRegistry.removeMarked();
}
private static void processGroupDescStats(
final TxFacade txFacade,
final InstanceIdentifier<FlowCapableNode> flowNodeIdent,
final DeviceGroupRegistry groupRegistry) throws TransactionChainClosedException {
- groupRegistry.forEach(groupId -> {
+ for (final GroupId groupId : groupRegistry.getAllGroupIds()) {
final InstanceIdentifier<Group> groupIdent = flowNodeIdent.child(Group.class, new GroupKey(groupId));
txFacade.addDeleteToTxChain(LogicalDatastoreType.OPERATIONAL, groupIdent);
- });
- groupRegistry.processMarks();
+ }
+ groupRegistry.removeMarked();
}
private static void processGroupStatistics(