Jonathan Hart
Committed by Gerrit Code Review

Upgrade Kryo to 3.0.3.

Possible fix for ONOS-4206.

Now stable on multi-instance.

Change-Id: Icd56759a6223b572d3d166555136d64f26706aaa
......@@ -40,7 +40,7 @@
<bundle>mvn:io.dropwizard.metrics/metrics-json/3.1.2</bundle>
<bundle>mvn:com.eclipsesource.minimal-json/minimal-json/0.9.1</bundle>
<bundle>mvn:com.esotericsoftware/kryo/3.0.0</bundle>
<bundle>mvn:com.esotericsoftware/kryo/3.0.3</bundle>
<bundle>mvn:com.esotericsoftware/reflectasm/1.11.0</bundle>
<bundle>mvn:org.ow2.asm/asm/4.2</bundle>
<bundle>mvn:com.esotericsoftware/minlog/1.3.0</bundle>
......
......@@ -321,7 +321,7 @@
<dependency>
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo</artifactId>
<version>3.0.0</version>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>com.esotericsoftware</groupId>
......
......@@ -15,17 +15,6 @@
*/
package org.onlab.util;
import static org.slf4j.LoggerFactory.getLogger;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.tuple.Pair;
import org.slf4j.Logger;
import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.Serializer;
import com.esotericsoftware.kryo.io.ByteBufferInput;
......@@ -36,6 +25,17 @@ import com.esotericsoftware.kryo.pool.KryoFactory;
import com.esotericsoftware.kryo.pool.KryoPool;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
import org.apache.commons.lang3.tuple.Pair;
import org.objenesis.strategy.StdInstantiatorStrategy;
import org.slf4j.Logger;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import static org.slf4j.LoggerFactory.getLogger;
/**
* Pool of Kryo instances, with classes pre-registered.
......@@ -381,6 +381,11 @@ public final class KryoNamespace implements KryoFactory, KryoPool {
public Kryo create() {
Kryo kryo = new Kryo();
kryo.setRegistrationRequired(registrationRequired);
// TODO rethink whether we want to use StdInstantiatorStrategy
kryo.setInstantiatorStrategy(
new Kryo.DefaultInstantiatorStrategy(new StdInstantiatorStrategy()));
for (RegistrationBlock block : registeredBlocks) {
int id = block.begin();
if (id == FLOATING_ID) {
......