private String getQueueUuid(OvsdbQueueRef queueRef, OvsdbNodeAugmentation operNode) { QueuesKey queueKey = queueRef.getValue().firstKeyOf(Queues.class); if (operNode.getQueues() != null && !operNode.getQueues().isEmpty()) { for (Queues queue : operNode.getQueues()) { if (queue.getQueueId().equals(queueKey.getQueueId())) { return queue.getQueueUuid().getValue(); } } } return SouthboundConstants.QUEUE_NAMED_UUID_PREFIX + TransactUtils.bytesToHexString(queueKey.getQueueId().getValue().getBytes()); }
private QueuesKey getQueueKey(Node node, UUID queueUuid) { List<Queues> queueList = node.getAugmentation(OvsdbNodeAugmentation.class).getQueues(); if (queueList == null || queueList.isEmpty()) { LOG.debug("Deleting Queue {}, Ovsdb Node {} does not have a Queue list.", queueUuid.toString(), node); return null; } Iterator<Queues> itr = queueList.iterator(); Uuid quUuid = new Uuid(queueUuid.toString()); while (itr.hasNext()) { Queues queue = itr.next(); if (queue.getQueueUuid().equals(quUuid)) { return queue.getKey(); } } LOG.debug("Deleted Queue {} not found in Ovsdb Node {}", queueUuid.toString(), node); return null; }
return false; if (!Objects.equals(_queues, other.getQueues())) { return false;
List<Queues> origQueues = original.getQueues(); List<Queues> updatedQueues = update.getQueues(); if (origQueues != null && !origQueues.isEmpty()) { for (Queues origQueue : origQueues) { state.getBridgeNode(ovsdbNodeIid).get().getAugmentation( OvsdbNodeAugmentation.class); List<Queues> operQueues = operNode.getQueues();
.getAugmentation(OvsdbNodeAugmentation.class).getQueues(); for (final Queues queue : queuesList) { queueUuid = queue.getQueueUuid();
@SuppressWarnings("unchecked") private InstanceIdentifier<Queues> getQueueIid(UUID queueUuid, Node ovsdbNode) { Queue queue = getQueue(queueUuid); if (queue != null && queue.getExternalIdsColumn() != null && queue.getExternalIdsColumn().getData() != null && queue.getExternalIdsColumn().getData().containsKey(SouthboundConstants.IID_EXTERNAL_ID_KEY)) { return (InstanceIdentifier<Queues>) SouthboundUtil.deserializeInstanceIdentifier( queue.getExternalIdsColumn().getData().get(SouthboundConstants.IID_EXTERNAL_ID_KEY)); } else { OvsdbNodeAugmentation node = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class); if (node.getQueues() != null && !node.getQueues().isEmpty()) { for (Queues q : node.getQueues()) { if (q.getQueueUuid().equals(new Uuid(queueUuid.toString()))) { return SouthboundMapper.createInstanceIdentifier(ovsdbNode.getNodeId()) .augmentation(OvsdbNodeAugmentation.class) .child(Queues.class, new QueuesKey(q.getQueueId())); } } } LOG.debug("A Queue with UUID {} was not found in Ovsdb Node {}", queueUuid, node); return SouthboundMapper.createInstanceIdentifier(ovsdbNode.getNodeId()) .augmentation(OvsdbNodeAugmentation.class) .child(Queues.class, new QueuesKey( new Uri(SouthboundConstants.QUEUE_URI_PREFIX + "://" + queueUuid.toString()))); } }
private static void updateQueuesMaxRate(DataBroker dataBroker, Optional<Node> optionalOvsdbNode, EvcAugmentation evc) { final NodeId ovsdbNodeId = optionalOvsdbNode.get().getNodeId(); final List<Queues> queues = optionalOvsdbNode.get() .getAugmentation(OvsdbNodeAugmentation.class) .getQueues(); QueuesKey queuesKey = null; for (final Queues queue: queues) { queuesKey = queue.getKey(); } final InstanceIdentifier<QueuesOtherConfig> queuesOtherConfigIid = UnimgrMapper .getQueuesOtherConfigIid(ovsdbNodeId, queuesKey); final QueuesOtherConfig queuesOtherConfig = new QueuesOtherConfigBuilder() .setKey(new QueuesOtherConfigKey(UnimgrConstants.QOS_MAX_RATE)) .setQueueOtherConfigKey(UnimgrConstants.QOS_MAX_RATE) .setQueueOtherConfigValue(UniUtils.getSpeed(evc.getIngressBw().getSpeed())) .build(); final WriteTransaction transaction = dataBroker.newWriteOnlyTransaction(); transaction.put(LogicalDatastoreType.CONFIGURATION, queuesOtherConfigIid, queuesOtherConfig, true); final CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit(); try { future.checkedGet(); LOG.info("Update queues max-rate to ovsdb for node {} {}", ovsdbNodeId, queuesOtherConfigIid); } catch (final TransactionCommitFailedException e) { LOG.warn("Failed to put {} ", queuesOtherConfigIid, e); } }
Uuid operQueueUuid = getQueueEntryUuid(operNode.getQueues(), queueEntry.getQueueId()); if (operQueueUuid == null) { UUID namedUuid = new UUID(SouthboundConstants.QUEUE_NAMED_UUID_PREFIX
public OvsdbNodeAugmentationBuilder(OvsdbNodeAugmentation base) { this._autoattach = base.getAutoattach(); this._connectionInfo = base.getConnectionInfo(); this._datapathTypeEntry = base.getDatapathTypeEntry(); this._dbVersion = base.getDbVersion(); this._interfaceTypeEntry = base.getInterfaceTypeEntry(); this._managedNodeEntry = base.getManagedNodeEntry(); this._managerEntry = base.getManagerEntry(); this._openvswitchExternalIds = base.getOpenvswitchExternalIds(); this._openvswitchOtherConfigs = base.getOpenvswitchOtherConfigs(); this._ovsVersion = base.getOvsVersion(); this._qosEntries = base.getQosEntries(); this._queues = base.getQueues(); }
.getQueues(); QueuesKey queuesKey = null; for (final Queues queue : queuesList) {