Binary incompatible serializer changes
- If the field type is fixed and the type is final, Class info can be omitted
- Annotations serializer to use optimization based on the fact Map<String, String> and non-null key/value
- Reduce number of Map copy required for ImmutableMap serializer
- Reduce number of array copy behind Immutable{List, Set} serializer
Change-Id: Ie467a943a33fbfb43b289b8b71ad91ee5890bfb0
diff --git a/core/store/dist/src/main/java/org/onosproject/store/device/impl/InternalPortStatusEventSerializer.java b/core/store/dist/src/main/java/org/onosproject/store/device/impl/InternalPortStatusEventSerializer.java
index 1d67dc7..c623aac 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/device/impl/InternalPortStatusEventSerializer.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/device/impl/InternalPortStatusEventSerializer.java
@@ -15,6 +15,8 @@
*/
package org.onosproject.store.device.impl;
+import static org.onosproject.store.serializers.DeviceIdSerializer.deviceIdSerializer;
+
import org.onosproject.net.DeviceId;
import org.onosproject.net.device.PortDescription;
import org.onosproject.net.provider.ProviderId;
@@ -41,7 +43,7 @@
@Override
public void write(Kryo kryo, Output output, InternalPortStatusEvent event) {
kryo.writeClassAndObject(output, event.providerId());
- kryo.writeClassAndObject(output, event.deviceId());
+ kryo.writeObject(output, event.deviceId(), deviceIdSerializer());
kryo.writeClassAndObject(output, event.portDescription());
}
@@ -49,7 +51,7 @@
public InternalPortStatusEvent read(Kryo kryo, Input input,
Class<InternalPortStatusEvent> type) {
ProviderId providerId = (ProviderId) kryo.readClassAndObject(input);
- DeviceId deviceId = (DeviceId) kryo.readClassAndObject(input);
+ DeviceId deviceId = kryo.readObject(input, DeviceId.class, deviceIdSerializer());
@SuppressWarnings("unchecked")
Timestamped<PortDescription> portDescription = (Timestamped<PortDescription>) kryo.readClassAndObject(input);