Search in sources :

Example 1 with BURST

use of org.onosproject.ovsdb.controller.OvsdbConstant.BURST in project onos by opennetworkinglab.

the class OvsdbQueueConfig method getQueues.

@Override
public Collection<QueueDescription> getQueues() {
    OvsdbClientService ovsdbClient = getOvsdbClient(handler());
    if (ovsdbClient == null) {
        return Collections.emptyList();
    }
    Set<OvsdbQueue> queues = ovsdbClient.getQueues();
    return queues.stream().map(q -> DefaultQueueDescription.builder().queueId(QueueId.queueId(q.externalIds().get(QUEUE_EXTERNAL_ID_KEY))).type(types(q)).dscp(q.dscp().isPresent() ? q.dscp().get().intValue() : null).maxRate(q.otherConfigs().get(MAX_RATE) != null ? Bandwidth.bps(Long.parseLong(q.otherConfigs().get(MAX_RATE))) : Bandwidth.bps(0L)).minRate(q.otherConfigs().get(MIN_RATE) != null ? Bandwidth.bps(Long.parseLong(q.otherConfigs().get(MIN_RATE))) : Bandwidth.bps(0L)).burst(q.otherConfigs().get(BURST) != null ? Long.valueOf(q.otherConfigs().get(BURST)) : 0L).priority(q.otherConfigs().get(PRIORITY) != null ? Long.valueOf(q.otherConfigs().get(PRIORITY)) : 0L).build()).collect(Collectors.toSet());
}
Also used : QUEUE_EXTERNAL_ID_KEY(org.onosproject.ovsdb.controller.OvsdbConstant.QUEUE_EXTERNAL_ID_KEY) OvsdbNodeId(org.onosproject.ovsdb.controller.OvsdbNodeId) QueueId(org.onosproject.net.behaviour.QueueId) MIN_RATE(org.onosproject.ovsdb.controller.OvsdbConstant.MIN_RATE) AbstractHandlerBehaviour(org.onosproject.net.driver.AbstractHandlerBehaviour) DefaultQueueDescription(org.onosproject.net.behaviour.DefaultQueueDescription) OvsdbController(org.onosproject.ovsdb.controller.OvsdbController) BURST(org.onosproject.ovsdb.controller.OvsdbConstant.BURST) PRIORITY(org.onosproject.ovsdb.controller.OvsdbConstant.PRIORITY) EnumSet(java.util.EnumSet) IpAddress(org.onlab.packet.IpAddress) Logger(org.slf4j.Logger) Bandwidth(org.onlab.util.Bandwidth) Collection(java.util.Collection) Set(java.util.Set) Collectors(java.util.stream.Collectors) OvsdbQueue(org.onosproject.ovsdb.controller.OvsdbQueue) DriverHandler(org.onosproject.net.driver.DriverHandler) QueueDescription(org.onosproject.net.behaviour.QueueDescription) Type(org.onosproject.net.behaviour.QueueDescription.Type) MAX_RATE(org.onosproject.ovsdb.controller.OvsdbConstant.MAX_RATE) LoggerFactory.getLogger(org.slf4j.LoggerFactory.getLogger) OvsdbClientService(org.onosproject.ovsdb.controller.OvsdbClientService) QueueConfigBehaviour(org.onosproject.net.behaviour.QueueConfigBehaviour) DeviceId(org.onosproject.net.DeviceId) Collections(java.util.Collections) OvsdbClientService(org.onosproject.ovsdb.controller.OvsdbClientService) OvsdbQueue(org.onosproject.ovsdb.controller.OvsdbQueue)

Aggregations

Collection (java.util.Collection)1 Collections (java.util.Collections)1 EnumSet (java.util.EnumSet)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 IpAddress (org.onlab.packet.IpAddress)1 Bandwidth (org.onlab.util.Bandwidth)1 DeviceId (org.onosproject.net.DeviceId)1 DefaultQueueDescription (org.onosproject.net.behaviour.DefaultQueueDescription)1 QueueConfigBehaviour (org.onosproject.net.behaviour.QueueConfigBehaviour)1 QueueDescription (org.onosproject.net.behaviour.QueueDescription)1 Type (org.onosproject.net.behaviour.QueueDescription.Type)1 QueueId (org.onosproject.net.behaviour.QueueId)1 AbstractHandlerBehaviour (org.onosproject.net.driver.AbstractHandlerBehaviour)1 DriverHandler (org.onosproject.net.driver.DriverHandler)1 OvsdbClientService (org.onosproject.ovsdb.controller.OvsdbClientService)1 BURST (org.onosproject.ovsdb.controller.OvsdbConstant.BURST)1 MAX_RATE (org.onosproject.ovsdb.controller.OvsdbConstant.MAX_RATE)1 MIN_RATE (org.onosproject.ovsdb.controller.OvsdbConstant.MIN_RATE)1 PRIORITY (org.onosproject.ovsdb.controller.OvsdbConstant.PRIORITY)1