Committed by
Gerrit Code Review
Upgrade Kryo to 3.0.3.
Possible fix for ONOS-4206. Now stable on multi-instance. Change-Id: Icd56759a6223b572d3d166555136d64f26706aaa
Showing
3 changed files
with
18 additions
and
13 deletions
... | @@ -40,7 +40,7 @@ | ... | @@ -40,7 +40,7 @@ |
40 | <bundle>mvn:io.dropwizard.metrics/metrics-json/3.1.2</bundle> | 40 | <bundle>mvn:io.dropwizard.metrics/metrics-json/3.1.2</bundle> |
41 | <bundle>mvn:com.eclipsesource.minimal-json/minimal-json/0.9.1</bundle> | 41 | <bundle>mvn:com.eclipsesource.minimal-json/minimal-json/0.9.1</bundle> |
42 | 42 | ||
43 | - <bundle>mvn:com.esotericsoftware/kryo/3.0.0</bundle> | 43 | + <bundle>mvn:com.esotericsoftware/kryo/3.0.3</bundle> |
44 | <bundle>mvn:com.esotericsoftware/reflectasm/1.11.0</bundle> | 44 | <bundle>mvn:com.esotericsoftware/reflectasm/1.11.0</bundle> |
45 | <bundle>mvn:org.ow2.asm/asm/4.2</bundle> | 45 | <bundle>mvn:org.ow2.asm/asm/4.2</bundle> |
46 | <bundle>mvn:com.esotericsoftware/minlog/1.3.0</bundle> | 46 | <bundle>mvn:com.esotericsoftware/minlog/1.3.0</bundle> | ... | ... |
... | @@ -321,7 +321,7 @@ | ... | @@ -321,7 +321,7 @@ |
321 | <dependency> | 321 | <dependency> |
322 | <groupId>com.esotericsoftware</groupId> | 322 | <groupId>com.esotericsoftware</groupId> |
323 | <artifactId>kryo</artifactId> | 323 | <artifactId>kryo</artifactId> |
324 | - <version>3.0.0</version> | 324 | + <version>3.0.3</version> |
325 | </dependency> | 325 | </dependency> |
326 | <dependency> | 326 | <dependency> |
327 | <groupId>com.esotericsoftware</groupId> | 327 | <groupId>com.esotericsoftware</groupId> | ... | ... |
... | @@ -15,17 +15,6 @@ | ... | @@ -15,17 +15,6 @@ |
15 | */ | 15 | */ |
16 | package org.onlab.util; | 16 | package org.onlab.util; |
17 | 17 | ||
18 | -import static org.slf4j.LoggerFactory.getLogger; | ||
19 | - | ||
20 | -import java.io.InputStream; | ||
21 | -import java.io.OutputStream; | ||
22 | -import java.nio.ByteBuffer; | ||
23 | -import java.util.ArrayList; | ||
24 | -import java.util.List; | ||
25 | - | ||
26 | -import org.apache.commons.lang3.tuple.Pair; | ||
27 | -import org.slf4j.Logger; | ||
28 | - | ||
29 | import com.esotericsoftware.kryo.Kryo; | 18 | import com.esotericsoftware.kryo.Kryo; |
30 | import com.esotericsoftware.kryo.Serializer; | 19 | import com.esotericsoftware.kryo.Serializer; |
31 | import com.esotericsoftware.kryo.io.ByteBufferInput; | 20 | import com.esotericsoftware.kryo.io.ByteBufferInput; |
... | @@ -36,6 +25,17 @@ import com.esotericsoftware.kryo.pool.KryoFactory; | ... | @@ -36,6 +25,17 @@ import com.esotericsoftware.kryo.pool.KryoFactory; |
36 | import com.esotericsoftware.kryo.pool.KryoPool; | 25 | import com.esotericsoftware.kryo.pool.KryoPool; |
37 | import com.google.common.base.MoreObjects; | 26 | import com.google.common.base.MoreObjects; |
38 | import com.google.common.collect.ImmutableList; | 27 | import com.google.common.collect.ImmutableList; |
28 | +import org.apache.commons.lang3.tuple.Pair; | ||
29 | +import org.objenesis.strategy.StdInstantiatorStrategy; | ||
30 | +import org.slf4j.Logger; | ||
31 | + | ||
32 | +import java.io.InputStream; | ||
33 | +import java.io.OutputStream; | ||
34 | +import java.nio.ByteBuffer; | ||
35 | +import java.util.ArrayList; | ||
36 | +import java.util.List; | ||
37 | + | ||
38 | +import static org.slf4j.LoggerFactory.getLogger; | ||
39 | 39 | ||
40 | /** | 40 | /** |
41 | * Pool of Kryo instances, with classes pre-registered. | 41 | * Pool of Kryo instances, with classes pre-registered. |
... | @@ -381,6 +381,11 @@ public final class KryoNamespace implements KryoFactory, KryoPool { | ... | @@ -381,6 +381,11 @@ public final class KryoNamespace implements KryoFactory, KryoPool { |
381 | public Kryo create() { | 381 | public Kryo create() { |
382 | Kryo kryo = new Kryo(); | 382 | Kryo kryo = new Kryo(); |
383 | kryo.setRegistrationRequired(registrationRequired); | 383 | kryo.setRegistrationRequired(registrationRequired); |
384 | + | ||
385 | + // TODO rethink whether we want to use StdInstantiatorStrategy | ||
386 | + kryo.setInstantiatorStrategy( | ||
387 | + new Kryo.DefaultInstantiatorStrategy(new StdInstantiatorStrategy())); | ||
388 | + | ||
384 | for (RegistrationBlock block : registeredBlocks) { | 389 | for (RegistrationBlock block : registeredBlocks) { |
385 | int id = block.begin(); | 390 | int id = block.begin(); |
386 | if (id == FLOATING_ID) { | 391 | if (id == FLOATING_ID) { | ... | ... |
-
Please register or login to post a comment