Yuta HIGUCHI
Committed by Gerrit Code Review

Update kryo to 4.0.0

- WARN:Serialized bytes are not binary compatible
- Release summary: https://github.com/EsotericSoftware/kryo/releases/tag/kryo-parent-4.0.0
- KryoNamespace: stop using direct buffer

This might fix ONOS-5130

Change-Id: I6e1e00f147a90ae8bfded78b2fa3a77158602c76
...@@ -40,9 +40,9 @@ ...@@ -40,9 +40,9 @@
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.4</bundle> 41 <bundle>mvn:com.eclipsesource.minimal-json/minimal-json/0.9.4</bundle>
42 42
43 - <bundle>mvn:com.esotericsoftware/kryo/3.0.3</bundle> 43 + <bundle>mvn:com.esotericsoftware/kryo/4.0.0</bundle>
44 - <bundle>mvn:com.esotericsoftware/reflectasm/1.11.0</bundle> 44 + <bundle>mvn:com.esotericsoftware/reflectasm/1.11.3</bundle>
45 - <bundle>mvn:org.ow2.asm/asm/5.0.3</bundle> 45 + <bundle>mvn:org.ow2.asm/asm/5.0.4</bundle>
46 <bundle>mvn:com.esotericsoftware/minlog/1.3.0</bundle> 46 <bundle>mvn:com.esotericsoftware/minlog/1.3.0</bundle>
47 <bundle>mvn:org.objenesis/objenesis/2.2</bundle> 47 <bundle>mvn:org.objenesis/objenesis/2.2</bundle>
48 48
......
1 -# ***** This file was auto-generated at Thu Aug 11 12:54:15 PDT 2016. Do not edit this file manually. ***** 1 +# ***** This file was auto-generated at Tue Aug 16 15:39:29 PDT 2016. Do not edit this file manually. *****
2 osgi_feature_group( 2 osgi_feature_group(
3 name = 'COMPILE', 3 name = 'COMPILE',
4 visibility = ['PUBLIC'], 4 visibility = ['PUBLIC'],
...@@ -124,10 +124,10 @@ remote_jar ( ...@@ -124,10 +124,10 @@ remote_jar (
124 124
125 remote_jar ( 125 remote_jar (
126 name = 'asm', 126 name = 'asm',
127 - out = 'asm-5.0.3.jar', 127 + out = 'asm-5.0.4.jar',
128 - url = 'mvn:org.ow2.asm:asm:jar:5.0.3', 128 + url = 'mvn:org.ow2.asm:asm:jar:5.0.4',
129 - sha1 = 'dcc2193db20e19e1feca8b1240dbbc4e190824fa', 129 + sha1 = '0da08b8cce7bbf903602a25a3a163ae252435795',
130 - maven_coords = 'org.ow2.asm:asm:5.0.3', 130 + maven_coords = 'org.ow2.asm:asm:5.0.4',
131 visibility = [ 'PUBLIC' ], 131 visibility = [ 'PUBLIC' ],
132 ) 132 )
133 133
...@@ -628,10 +628,10 @@ remote_jar ( ...@@ -628,10 +628,10 @@ remote_jar (
628 628
629 remote_jar ( 629 remote_jar (
630 name = 'kryo', 630 name = 'kryo',
631 - out = 'kryo-3.0.3.jar', 631 + out = 'kryo-4.0.0.jar',
632 - url = 'mvn:com.esotericsoftware:kryo:jar:3.0.3', 632 + url = 'mvn:com.esotericsoftware:kryo:jar:4.0.0',
633 - sha1 = '01ebca99f633ef31484176a727093e78c7fa43e7', 633 + sha1 = '9f5c64c1315ec79bee0f56bb88e4ae94b65048ce',
634 - maven_coords = 'com.esotericsoftware:kryo:3.0.3', 634 + maven_coords = 'com.esotericsoftware:kryo:4.0.0',
635 visibility = [ 'PUBLIC' ], 635 visibility = [ 'PUBLIC' ],
636 ) 636 )
637 637
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
85 "artifacts": { 85 "artifacts": {
86 "gmetric4j": "mvn:info.ganglia.gmetric4j:gmetric4j:1.0.10", 86 "gmetric4j": "mvn:info.ganglia.gmetric4j:gmetric4j:1.0.10",
87 "aopalliance-repackaged": "mvn:org.glassfish.hk2.external:aopalliance-repackaged:2.4.0-b34", 87 "aopalliance-repackaged": "mvn:org.glassfish.hk2.external:aopalliance-repackaged:2.4.0-b34",
88 - "asm": "mvn:org.ow2.asm:asm:5.0.3", 88 + "asm": "mvn:org.ow2.asm:asm:5.0.4",
89 "atomix": "mvn:io.atomix:atomix-all:1.0.0-rc9", 89 "atomix": "mvn:io.atomix:atomix-all:1.0.0-rc9",
90 "commons-codec": "mvn:commons-codec:commons-codec:1.10", 90 "commons-codec": "mvn:commons-codec:commons-codec:1.10",
91 "commons-collections": "mvn:commons-collections:commons-collections:3.2.2", 91 "commons-collections": "mvn:commons-collections:commons-collections:3.2.2",
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
141 "jsch": "mvn:com.jcraft:jsch:0.1.53", 141 "jsch": "mvn:com.jcraft:jsch:0.1.53",
142 "jsr305": "mvn:com.google.code.findbugs:jsr305:3.0.1", 142 "jsr305": "mvn:com.google.code.findbugs:jsr305:3.0.1",
143 "junit": "mvn:junit:junit:4.12", 143 "junit": "mvn:junit:junit:4.12",
144 - "kryo": "mvn:com.esotericsoftware:kryo:3.0.3", 144 + "kryo": "mvn:com.esotericsoftware:kryo:4.0.0",
145 "mapdb": "mvn:org.mapdb:mapdb:1.0.9", 145 "mapdb": "mvn:org.mapdb:mapdb:1.0.9",
146 "metrics-core": "mvn:io.dropwizard.metrics:metrics-core:3.1.0", 146 "metrics-core": "mvn:io.dropwizard.metrics:metrics-core:3.1.0",
147 "metrics-ganglia": "mvn:io.dropwizard.metrics:metrics-ganglia:3.1.2", 147 "metrics-ganglia": "mvn:io.dropwizard.metrics:metrics-ganglia:3.1.2",
......
...@@ -263,18 +263,17 @@ ...@@ -263,18 +263,17 @@
263 <dependency> 263 <dependency>
264 <groupId>com.esotericsoftware</groupId> 264 <groupId>com.esotericsoftware</groupId>
265 <artifactId>kryo</artifactId> 265 <artifactId>kryo</artifactId>
266 - <version>3.0.3</version> 266 + <version>4.0.0</version>
267 </dependency> 267 </dependency>
268 <dependency> 268 <dependency>
269 <groupId>com.esotericsoftware</groupId> 269 <groupId>com.esotericsoftware</groupId>
270 <artifactId>reflectasm</artifactId> 270 <artifactId>reflectasm</artifactId>
271 - <version>1.11.0</version> 271 + <version>1.11.3</version>
272 - <type>bundle</type>
273 </dependency> 272 </dependency>
274 <dependency> 273 <dependency>
275 <groupId>org.ow2.asm</groupId> 274 <groupId>org.ow2.asm</groupId>
276 <artifactId>asm</artifactId> 275 <artifactId>asm</artifactId>
277 - <version>5.0.3</version> 276 + <version>5.0.4</version>
278 </dependency> 277 </dependency>
279 <dependency> 278 <dependency>
280 <groupId>com.esotericsoftware</groupId> 279 <groupId>com.esotericsoftware</groupId>
......
...@@ -174,6 +174,7 @@ public class BuckLibGenerator { ...@@ -174,6 +174,7 @@ public class BuckLibGenerator {
174 writer.write(String.format( 174 writer.write(String.format(
175 "# ***** This file was auto-generated at %s. Do not edit this file manually. *****\n", 175 "# ***** This file was auto-generated at %s. Do not edit this file manually. *****\n",
176 new Date().toString())); 176 new Date().toString()));
177 + writer.write("# ***** Use onos-lib-gen *****\n");
177 libraries.forEach(library -> writer.print(library.getBuckFragment())); 178 libraries.forEach(library -> writer.print(library.getBuckFragment()));
178 artifacts.forEach(artifact -> writer.print(artifact.getBuckFragment())); 179 artifacts.forEach(artifact -> writer.print(artifact.getBuckFragment()));
179 writer.flush(); 180 writer.flush();
......
...@@ -21,6 +21,7 @@ import com.esotericsoftware.kryo.Serializer; ...@@ -21,6 +21,7 @@ import com.esotericsoftware.kryo.Serializer;
21 import com.esotericsoftware.kryo.io.ByteBufferInput; 21 import com.esotericsoftware.kryo.io.ByteBufferInput;
22 import com.esotericsoftware.kryo.io.ByteBufferOutput; 22 import com.esotericsoftware.kryo.io.ByteBufferOutput;
23 import com.esotericsoftware.kryo.io.Input; 23 import com.esotericsoftware.kryo.io.Input;
24 +import com.esotericsoftware.kryo.io.Output;
24 import com.esotericsoftware.kryo.pool.KryoCallback; 25 import com.esotericsoftware.kryo.pool.KryoCallback;
25 import com.esotericsoftware.kryo.pool.KryoFactory; 26 import com.esotericsoftware.kryo.pool.KryoFactory;
26 import com.esotericsoftware.kryo.pool.KryoPool; 27 import com.esotericsoftware.kryo.pool.KryoPool;
...@@ -271,19 +272,12 @@ public final class KryoNamespace implements KryoFactory, KryoPool { ...@@ -271,19 +272,12 @@ public final class KryoNamespace implements KryoFactory, KryoPool {
271 * @return serialized bytes 272 * @return serialized bytes
272 */ 273 */
273 public byte[] serialize(final Object obj, final int bufferSize) { 274 public byte[] serialize(final Object obj, final int bufferSize) {
274 - ByteBufferOutput out = new ByteBufferOutput(bufferSize, MAX_BUFFER_SIZE); 275 + Output out = new Output(bufferSize, MAX_BUFFER_SIZE);
275 - try { 276 + return pool.run(kryo -> {
276 - Kryo kryo = borrow(); 277 + kryo.writeClassAndObject(out, obj);
277 - try { 278 + out.flush();
278 - kryo.writeClassAndObject(out, obj); 279 + return out.toBytes();
279 - out.flush(); 280 + });
280 - return out.toBytes();
281 - } finally {
282 - release(kryo);
283 - }
284 - } finally {
285 - out.release();
286 - }
287 } 281 }
288 282
289 /** 283 /**
......