ONOS-7733 Meter Creation Fails :
When we want to create a meter, MeterManager & DefaultMeter.Builder gives the following error:
java.lang.IllegalArgumentException: Must specify a cell id.
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:134)
at org.onosproject.net.meter.DefaultMeter$Builder.build(DefaultMeter.java:241)
at org.onosproject.net.meter.DefaultMeter$Builder.build(DefaultMeter.java:184)
at org.onosproject.net.meter.impl.MeterManager.submit(MeterManager.java:204)
It seems that MeterManager still uses meter id instead of meter cell id. It must be changed with the proper value.
Change-Id: I623746b38af1148ca7f33efe5e48d6590a11051a
Note: Cord OLT application must create meters for the technology profile implementation and it uses 1.13.1 version.
diff --git a/core/net/src/main/java/org/onosproject/net/meter/impl/MeterManager.java b/core/net/src/main/java/org/onosproject/net/meter/impl/MeterManager.java
index 04e3e56..8517913 100644
--- a/core/net/src/main/java/org/onosproject/net/meter/impl/MeterManager.java
+++ b/core/net/src/main/java/org/onosproject/net/meter/impl/MeterManager.java
@@ -195,7 +195,7 @@
.forDevice(request.deviceId())
.fromApp(request.appId())
.withBands(request.bands())
- .withId(id)
+ .withCellId(id)
.withUnit(request.unit());
if (request.isBurst()) {
@@ -214,7 +214,7 @@
.forDevice(request.deviceId())
.fromApp(request.appId())
.withBands(request.bands())
- .withId(meterId)
+ .withCellId(meterId)
.withUnit(request.unit());
if (request.isBurst()) {
diff --git a/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java b/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
index e948ee2..e181ca0 100644
--- a/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
+++ b/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
@@ -204,6 +204,7 @@
import org.onosproject.net.link.DefaultLinkDescription;
import org.onosproject.net.meter.MeterCellId;
import org.onosproject.net.meter.MeterCellId.MeterCellType;
+import org.onosproject.net.meter.MeterFailReason;
import org.onosproject.net.meter.MeterId;
import org.onosproject.net.packet.DefaultOutboundPacket;
import org.onosproject.net.packet.DefaultPacketRequest;
@@ -424,6 +425,7 @@
MeterCellId.class,
MeterCellType.class,
MeterId.class,
+ MeterFailReason.class,
Version.class,
ControllerNode.State.class,
ApplicationState.class,
diff --git a/drivers/default/src/main/resources/onos-drivers.xml b/drivers/default/src/main/resources/onos-drivers.xml
index 8670366..85375e2 100644
--- a/drivers/default/src/main/resources/onos-drivers.xml
+++ b/drivers/default/src/main/resources/onos-drivers.xml
@@ -166,6 +166,8 @@
manufacturer="PMC GPON Networks" hwVersion="PASffffffff v-1" swVersion="vOLT.*">
<behaviour api="org.onosproject.net.behaviour.Pipeliner"
impl="org.onosproject.driver.pipeline.OltPipeline"/>
+ <behaviour api="org.onosproject.net.behaviour.MeterQuery"
+ impl="org.onosproject.driver.query.FullMetersAvailable"/>
</driver>
<driver name="voltha" extends="default"
manufacturer="VOLTHA Project" hwVersion=".*" swVersion=".*">