use of org.onosproject.store.Timestamp in project onos by opennetworkinglab.
the class InternalDeviceStatusChangeEventSerializer method read.
@Override
public InternalDeviceStatusChangeEvent read(Kryo kryo, Input input, Class<InternalDeviceStatusChangeEvent> type) {
DeviceId deviceId = kryo.readObject(input, DeviceId.class, deviceIdSerializer());
Timestamp timestamp = (Timestamp) kryo.readClassAndObject(input);
Boolean available = (Boolean) kryo.readClassAndObject(input);
return new InternalDeviceStatusChangeEvent(deviceId, timestamp, available);
}
use of org.onosproject.store.Timestamp in project onos by opennetworkinglab.
the class MastershipBasedTimestampTest method testKryoSerializable.
@Test
public final void testKryoSerializable() {
final ByteBuffer buffer = ByteBuffer.allocate(1 * 1024 * 1024);
final KryoNamespace kryos = KryoNamespace.newBuilder().register(MastershipBasedTimestamp.class).build();
kryos.serialize(TS_2_1, buffer);
buffer.flip();
Timestamp copy = kryos.deserialize(buffer);
new EqualsTester().addEqualityGroup(TS_2_1, copy).testEquals();
}
Aggregations