Fix inconsistent update type during concurrent P4Runtime writes
This is achieved by optimistically updating the P4Runtime mirror using
the write request (instead of waiting for a response) and by serializing
building write requests for the same device.
This change requires updating the P4Runtime protocol classes to expose
the content of the write request.
It also includes:
- force member weight to 1 when reading groups (some server
implementation still fails to be compliant to the spec)
- remove unused operation timeout handling in GDP (now all RPCz have a
timeout)
Change-Id: Ib4f99a6085c1283f46a2797e0c883d96954e02e9
diff --git a/drivers/p4runtime/src/main/java/org/onosproject/drivers/p4runtime/mirror/P4RuntimeMirror.java b/drivers/p4runtime/src/main/java/org/onosproject/drivers/p4runtime/mirror/P4RuntimeMirror.java
index bee8c51..b836455 100644
--- a/drivers/p4runtime/src/main/java/org/onosproject/drivers/p4runtime/mirror/P4RuntimeMirror.java
+++ b/drivers/p4runtime/src/main/java/org/onosproject/drivers/p4runtime/mirror/P4RuntimeMirror.java
@@ -94,16 +94,17 @@
/**
* Synchronizes the state of the given device ID with the given collection
* of PI entities.
+ *
* @param deviceId device ID
* @param entities collection of PI entities
*/
void sync(DeviceId deviceId, Collection<E> entities);
/**
- * Uses the given P4Runtime write response to update the state of this
- * mirror.
+ * Uses the given P4Runtime write request to update the state of this
+ * mirror by optimistically assuming that all updates in it will succeed.
*
- * @param response P4Runtime write response
+ * @param request P4Runtime write request
*/
- void replayWriteResponse(P4RuntimeWriteClient.WriteResponse response);
+ void applyWriteRequest(P4RuntimeWriteClient.WriteRequest request);
}