private void removeOldQueues(ReadWriteTransaction transaction, QosEntriesBuilder qosEntryBuilder, Map<Long, UUID> oldQueueList, Qos qos, InstanceIdentifier<Node> nodeIId) { InstanceIdentifier<QosEntries> qosIId = nodeIId .augmentation(OvsdbNodeAugmentation.class) .child(QosEntries.class, qosEntryBuilder.build().getKey()); Collection<Long> queueListKeys = oldQueueList.keySet(); for (Long queueListKey : queueListKeys) { KeyedInstanceIdentifier<QueueList, QueueListKey> otherIId = qosIId .child(QueueList.class, new QueueListKey(new Long(queueListKey.toString()))); transaction.delete(LogicalDatastoreType.OPERATIONAL, otherIId); } }
private QosEntriesKey getQosEntriesKey(Node node, UUID qosUuid) { List<QosEntries> qosList = node.getAugmentation(OvsdbNodeAugmentation.class).getQosEntries(); if (qosList == null || qosList.isEmpty()) { LOG.debug("Deleting Qos {}, Ovsdb Node {} does not have a Qos list.", qosUuid.toString(), node); return null; } Iterator<QosEntries> itr = qosList.iterator(); Uuid quUuid = new Uuid(qosUuid.toString()); while (itr.hasNext()) { QosEntries qos = itr.next(); if (qos.getQosUuid().equals(quUuid)) { return qos.getKey(); } } LOG.debug("Deleted Queue {} not found in Ovsdb Node {}", qosUuid.toString(), node); return null; }
if (!Objects.equals(_key, other.getKey())) { return false;
public QosEntriesBuilder(QosEntries base) { if (base.getKey() == null) { this._key = new QosEntriesKey( base.getQosId() ); this._qosId = base.getQosId(); } else { this._key = base.getKey(); this._qosId = _key.getQosId(); } this._qosExternalIds = base.getQosExternalIds(); this._qosOtherConfig = base.getQosOtherConfig(); this._qosType = base.getQosType(); this._qosUuid = base.getQosUuid(); this._queueList = base.getQueueList(); if (base instanceof QosEntriesImpl) { QosEntriesImpl impl = (QosEntriesImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.QosEntries> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.QosEntries>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
private void removeOldConfigs(ReadWriteTransaction transaction, QosEntriesBuilder qosEntryBuilder, Map<String, String> oldOtherConfigs, Qos qos, InstanceIdentifier<Node> nodeIId) { InstanceIdentifier<QosEntries> qosIId = nodeIId .augmentation(OvsdbNodeAugmentation.class) .child(QosEntries.class, qosEntryBuilder.build().getKey()); Set<String> otherConfigKeys = oldOtherConfigs.keySet(); for (String otherConfigKey : otherConfigKeys) { KeyedInstanceIdentifier<QosOtherConfig, QosOtherConfigKey> otherIId = qosIId .child(QosOtherConfig.class, new QosOtherConfigKey(otherConfigKey)); transaction.delete(LogicalDatastoreType.OPERATIONAL, otherIId); } }
private void removeOldExternalIds(ReadWriteTransaction transaction, QosEntriesBuilder qosEntryBuilder, Map<String, String> oldExternalIds, Qos qos, InstanceIdentifier<Node> nodeIId) { InstanceIdentifier<QosEntries> qosIId = nodeIId .augmentation(OvsdbNodeAugmentation.class) .child(QosEntries.class, qosEntryBuilder.build().getKey()); Set<String> externalIdsKeys = oldExternalIds.keySet(); for (String extIdKey : externalIdsKeys) { KeyedInstanceIdentifier<QosExternalIds, QosExternalIdsKey> externalIId = qosIId .child(QosExternalIds.class, new QosExternalIdsKey(extIdKey)); transaction.delete(LogicalDatastoreType.OPERATIONAL, externalIId); } }
InstanceIdentifier<QosEntries> iid = nodeIId .augmentation(OvsdbNodeAugmentation.class) .child(QosEntries.class, qosEntry.getKey()); transaction.merge(LogicalDatastoreType.OPERATIONAL, iid, qosEntry);
QosEntriesKey qosEntryKey = null; for (final QosEntries qosEntry : qosList) { qosEntryKey = qosEntry.getKey();
private static void updateQosMaxRate(DataBroker dataBroker, Optional<Node> optionalOvsdbNode, EvcAugmentation evc) { final NodeId ovsdbNodeId = optionalOvsdbNode.get().getNodeId(); final List<QosEntries> qosList = optionalOvsdbNode.get() .getAugmentation(OvsdbNodeAugmentation.class) .getQosEntries(); LOG.trace("QOS entries list {} for node {}", qosList, ovsdbNodeId); QosEntriesKey qosEntryKey = null; for (final QosEntries qosEntry : qosList) { qosEntryKey = qosEntry.getKey(); } final InstanceIdentifier<QosOtherConfig> qosOtherConfigIid = UnimgrMapper .getQosOtherConfigIid(ovsdbNodeId, qosEntryKey); final QosOtherConfig qOtherConfig = new QosOtherConfigBuilder() .setKey(new QosOtherConfigKey(UnimgrConstants.QOS_MAX_RATE)) .setOtherConfigKey(UnimgrConstants.QOS_MAX_RATE) .setOtherConfigValue(UniUtils.getSpeed(evc.getIngressBw().getSpeed())) .build(); final WriteTransaction transaction = dataBroker.newWriteOnlyTransaction(); transaction.put(LogicalDatastoreType.CONFIGURATION, qosOtherConfigIid, qOtherConfig, true); final CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit(); try { future.checkedGet(); LOG.info("Update qos-entries max-rate to ovsdb for node {} {}", ovsdbNodeId, qosOtherConfigIid); } catch (final TransactionCommitFailedException e) { LOG.warn("Failed to put {}", qosOtherConfigIid, e); } }
QosEntriesKey qosEntryKey = null; for (final QosEntries qosEntry : qosList) { qosEntryKey = qosEntry.getKey(); InstanceIdentifier<QosEntries> qosIid = UnimgrMapper.getOvsdbQoSEntriesIid(ovsdbNode, qosEntryKey);