Class P4RuntimeMeterProgrammable

  • All Implemented Interfaces:
    org.onosproject.net.driver.Behaviour, org.onosproject.net.driver.HandlerBehaviour, org.onosproject.net.meter.MeterProgrammable

    public class P4RuntimeMeterProgrammable
    extends AbstractP4RuntimeHandlerBehaviour
    implements org.onosproject.net.meter.MeterProgrammable
    Implementation of MeterProgrammable behaviour for P4Runtime.
    • Constructor Detail

      • P4RuntimeMeterProgrammable

        public P4RuntimeMeterProgrammable()
    • Method Detail

      • performMeterOperation

        public CompletableFuture<Boolean> performMeterOperation​(org.onosproject.net.meter.MeterOperation meterOp)
        Specified by:
        performMeterOperation in interface org.onosproject.net.meter.MeterProgrammable
      • getMeters

        public CompletableFuture<Collection<org.onosproject.net.meter.Meter>> getMeters()
        Specified by:
        getMeters in interface org.onosproject.net.meter.MeterProgrammable
      • getMeterFeatures

        public CompletableFuture<Collection<org.onosproject.net.meter.MeterFeatures>> getMeterFeatures()
        Specified by:
        getMeterFeatures in interface org.onosproject.net.meter.MeterProgrammable
      • isSimilar

        protected boolean isSimilar​(org.onosproject.net.pi.runtime.PiMeterCellConfig onosMeter,
                                    org.onosproject.net.pi.runtime.PiMeterCellConfig deviceMeter)
        Returns true if the given PiMeterCellConfigs are similar enough to be deemed equal for reconciliation purposes. This is required to handle read/write asymmetry in devices that allow variations in the meter rate/burst. E.g., devices that implement metering with a rate or burst size that is slightly higher/lower than the configured ones, so the values written by ONOS will be different than those read from the device.
        Parameters:
        onosMeter - the ONOS meter
        deviceMeter - the meter in the device
        Returns:
        true if the meters are similar, false otherwise