ONOS-7898 Action profile group/member refactoring
Also includes:
- New abstract P4Runtime codec implementation. Currently used for action
profile members/groups encoding/deconding, the plan is to handle all
other codecs via this.
- Improved read requests in P4RuntimeClientImpl
- Removed handling of max group size in P4Runtime driver. Instead, added
modified group translator to specify a max group size by using
information from the pipeline model.
Change-Id: I684bae0184d683bb448ba19863c561f9848479d2
diff --git a/protocols/p4runtime/model/src/main/java/org/onosproject/p4runtime/model/P4ActionProfileModel.java b/protocols/p4runtime/model/src/main/java/org/onosproject/p4runtime/model/P4ActionProfileModel.java
index 5417d44..443d407 100644
--- a/protocols/p4runtime/model/src/main/java/org/onosproject/p4runtime/model/P4ActionProfileModel.java
+++ b/protocols/p4runtime/model/src/main/java/org/onosproject/p4runtime/model/P4ActionProfileModel.java
@@ -32,14 +32,17 @@
private final PiActionProfileId id;
private final ImmutableSet<PiTableId> tables;
private final boolean hasSelector;
- private final long maxSize;
+ private final long size;
+ private final int maxGroupSize;
P4ActionProfileModel(PiActionProfileId id,
- ImmutableSet<PiTableId> tables, boolean hasSelector, long maxSize) {
+ ImmutableSet<PiTableId> tables, boolean hasSelector,
+ long size, int maxGroupSize) {
this.id = id;
this.tables = tables;
this.hasSelector = hasSelector;
- this.maxSize = maxSize;
+ this.size = size;
+ this.maxGroupSize = maxGroupSize;
}
@Override
@@ -58,13 +61,18 @@
}
@Override
- public long maxSize() {
- return maxSize;
+ public long size() {
+ return size;
+ }
+
+ @Override
+ public int maxGroupSize() {
+ return maxGroupSize;
}
@Override
public int hashCode() {
- return Objects.hash(id, tables, hasSelector, maxSize);
+ return Objects.hash(id, tables, hasSelector, size, maxGroupSize);
}
@Override
@@ -79,6 +87,7 @@
return Objects.equals(this.id, other.id)
&& Objects.equals(this.tables, other.tables)
&& Objects.equals(this.hasSelector, other.hasSelector)
- && Objects.equals(this.maxSize, other.maxSize);
+ && Objects.equals(this.size, other.size)
+ && Objects.equals(this.maxGroupSize, other.maxGroupSize);
}
}