From 4b4f81a345dda902475f6a212b14c7abf257ac57 Mon Sep 17 00:00:00 2001 From: Nicholas Nezis Date: Thu, 7 Jan 2021 08:48:46 -0500 Subject: [PATCH 01/20] Updated to use the newer Kryo5 shaded jar --- build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 755831fe..a9a03b49 100644 --- a/build.sbt +++ b/build.sbt @@ -3,7 +3,7 @@ import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings val akkaVersion = "2.6.20" val algebirdVersion = "0.13.9" val bijectionVersion = "0.9.7" -val kryoVersion = "4.0.2" +val kryoVersion = "5.0.3" val scroogeVersion = "21.2.0" val asmVersion = "4.16" val protobufVersion = "3.22.2" @@ -53,7 +53,7 @@ val sharedSettings = Seq( "org.scalacheck" %% "scalacheck" % "1.15.2" % "test", "org.scalatest" %% "scalatest" % "3.2.15" % "test", "org.scalatestplus" %% "scalatestplus-scalacheck" % "3.1.0.0-RC2" % "test", - "com.esotericsoftware" % "kryo-shaded" % kryoVersion + "com.esotericsoftware.kryo" % "kryo5" % kryoVersion ), Test / parallelExecution := true, pomExtra := https://github.com/twitter/chill From 826d9c85b498c67aaf7c8e04e370fbaa7716b219 Mon Sep 17 00:00:00 2001 From: Nicholas Nezis Date: Thu, 7 Jan 2021 21:33:41 -0500 Subject: [PATCH 02/20] Initial change to use kryo5 --- .../chill/algebird/AlgebirdRegistrar.scala | 4 ++-- .../chill/algebird/AlgebirdSerializers.scala | 2 +- .../chill/avro/AvroSerializerJavaTest.java | 4 ++-- .../twitter/chill/hadoop/KryoSerialization.java | 4 ++-- .../com/twitter/chill/hadoop/HadoopTests.scala | 2 +- .../java/com/twitter/chill/ClassRegistrar.java | 2 +- .../java/com/twitter/chill/IKryoRegistrar.java | 2 +- .../java/com/twitter/chill/KryoInstantiator.java | 4 ++-- .../src/main/java/com/twitter/chill/KryoPool.java | 6 +++--- .../twitter/chill/ReflectingDefaultRegistrar.java | 4 ++-- .../com/twitter/chill/ReflectingRegistrar.java | 6 +++--- .../main/java/com/twitter/chill/SerDeState.java | 8 ++++---- .../com/twitter/chill/SingleDefaultRegistrar.java | 4 ++-- .../java/com/twitter/chill/SingleRegistrar.java | 4 ++-- .../chill/config/ConfiguredInstantiator.java | 6 +++--- .../chill/config/ReflectingInstantiator.java | 8 ++++---- .../chill/java/ArraysAsListSerializer.java | 10 +++++----- .../com/twitter/chill/java/BitSetSerializer.java | 12 ++++++------ .../chill/java/InetSocketAddressSerializer.java | 10 +++++----- .../com/twitter/chill/java/IterableRegistrar.java | 4 ++-- .../chill/java/IterableRegistrarSerializer.java | 10 +++++----- .../twitter/chill/java/Java8ClosureRegistrar.java | 4 ++-- .../com/twitter/chill/java/LocaleSerializer.java | 10 +++++----- .../com/twitter/chill/java/PackageRegistrar.java | 2 +- .../chill/java/PriorityQueueSerializer.java | 10 +++++----- .../com/twitter/chill/java/RegexSerializer.java | 10 +++++----- .../chill/java/SimpleDateFormatSerializer.java | 2 +- .../com/twitter/chill/java/SqlDateSerializer.java | 10 +++++----- .../com/twitter/chill/java/SqlTimeSerializer.java | 10 +++++----- .../twitter/chill/java/TimestampSerializer.java | 10 +++++----- .../com/twitter/chill/java/URISerializer.java | 10 +++++----- .../com/twitter/chill/java/UUIDSerializer.java | 10 +++++----- .../java/UnmodifiableCollectionSerializer.java | 8 ++++---- .../UnmodifiableJavaCollectionSerializer.java | 10 +++++----- .../chill/java/UnmodifiableListSerializer.java | 8 ++++---- .../chill/java/UnmodifiableMapSerializer.java | 8 ++++---- .../chill/java/UnmodifiableSetSerializer.java | 8 ++++---- .../java/UnmodifiableSortedMapSerializer.java | 8 ++++---- .../java/UnmodifiableSortedSetSerializer.java | 8 ++++---- .../com/twitter/chill/java/TestCollections.java | 6 +++--- .../java/com/twitter/chill/java/TestLists.java | 6 +++--- .../chill/config/ConfiguredInstantiatorTest.scala | 2 +- .../scala/com/twitter/chill/java/BitSetTest.scala | 6 +++--- .../scala/com/twitter/chill/java/LocaleTest.scala | 9 ++++----- .../twitter/chill/java/OldBitSetSerializer.java | 10 +++++----- .../twitter/chill/java/PriorityQueueTest.scala | 15 ++++++++------- .../chill/protobuf/ProtobufSerializer.java | 8 ++++---- .../com/twitter/chill/protobuf/ProtobufTest.scala | 2 +- .../scala/com/twitter/chill/Externalizer.scala | 2 +- .../main/scala/com/twitter/chill/KryoBase.scala | 5 +++-- .../config/ReflectingInstantiatorBuilder.scala | 2 +- .../scrooge/ScroogeThriftStructSerializer.scala | 8 ++++---- .../twitter/chill/storm/BlizzardKryoFactory.java | 2 +- .../com/twitter/chill/thrift/TBaseSerializer.java | 12 ++++++------ 54 files changed, 179 insertions(+), 178 deletions(-) diff --git a/chill-algebird/src/main/scala/com/twitter/chill/algebird/AlgebirdRegistrar.scala b/chill-algebird/src/main/scala/com/twitter/chill/algebird/AlgebirdRegistrar.scala index 4aa6d737..94a8dd76 100644 --- a/chill-algebird/src/main/scala/com/twitter/chill/algebird/AlgebirdRegistrar.scala +++ b/chill-algebird/src/main/scala/com/twitter/chill/algebird/AlgebirdRegistrar.scala @@ -15,8 +15,8 @@ limitations under the License. */ package com.twitter.chill.algebird -import com.esotericsoftware.kryo.Kryo -import com.esotericsoftware.kryo.serializers.FieldSerializer +import com.esotericsoftware.kryo.kryo5.Kryo +import com.esotericsoftware.kryo.kryo5.Serializers.FieldSerializer import com.twitter.chill.IKryoRegistrar diff --git a/chill-algebird/src/main/scala/com/twitter/chill/algebird/AlgebirdSerializers.scala b/chill-algebird/src/main/scala/com/twitter/chill/algebird/AlgebirdSerializers.scala index 59f13e93..22d6f34d 100644 --- a/chill-algebird/src/main/scala/com/twitter/chill/algebird/AlgebirdSerializers.scala +++ b/chill-algebird/src/main/scala/com/twitter/chill/algebird/AlgebirdSerializers.scala @@ -15,7 +15,7 @@ limitations under the License. */ package com.twitter.chill.algebird -import com.esotericsoftware.kryo.Kryo +import com.esotericsoftware.kryo.kryo5.Kryo import com.esotericsoftware.kryo.{Serializer => KSerializer} import com.esotericsoftware.kryo.io.{Input, Output} diff --git a/chill-avro/src/test/java/com/twitter/chill/avro/AvroSerializerJavaTest.java b/chill-avro/src/test/java/com/twitter/chill/avro/AvroSerializerJavaTest.java index 921c44cc..aa87279a 100644 --- a/chill-avro/src/test/java/com/twitter/chill/avro/AvroSerializerJavaTest.java +++ b/chill-avro/src/test/java/com/twitter/chill/avro/AvroSerializerJavaTest.java @@ -1,8 +1,8 @@ package com.twitter.chill.avro; import avro.FiscalRecord; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.Serializer; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.Serializer; import com.twitter.chill.KryoInstantiator; import com.twitter.chill.KryoPool; import org.apache.avro.Schema; diff --git a/chill-hadoop/src/main/java/com/twitter/chill/hadoop/KryoSerialization.java b/chill-hadoop/src/main/java/com/twitter/chill/hadoop/KryoSerialization.java index 29d1dc5a..cdaa0ece 100644 --- a/chill-hadoop/src/main/java/com/twitter/chill/hadoop/KryoSerialization.java +++ b/chill-hadoop/src/main/java/com/twitter/chill/hadoop/KryoSerialization.java @@ -16,8 +16,8 @@ package com.twitter.chill.hadoop; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.io.Output; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.io.Output; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configured; diff --git a/chill-hadoop/src/test/scala/com/twitter/chill/hadoop/HadoopTests.scala b/chill-hadoop/src/test/scala/com/twitter/chill/hadoop/HadoopTests.scala index 97f9cde8..0cb2cc93 100644 --- a/chill-hadoop/src/test/scala/com/twitter/chill/hadoop/HadoopTests.scala +++ b/chill-hadoop/src/test/scala/com/twitter/chill/hadoop/HadoopTests.scala @@ -16,7 +16,7 @@ limitations under the License. package com.twitter.chill.hadoop -import com.esotericsoftware.kryo.Kryo +import com.esotericsoftware.kryo.kryo5.Kryo import org.objenesis.strategy.StdInstantiatorStrategy diff --git a/chill-java/src/main/java/com/twitter/chill/ClassRegistrar.java b/chill-java/src/main/java/com/twitter/chill/ClassRegistrar.java index 9a1aac9d..4130d9a7 100644 --- a/chill-java/src/main/java/com/twitter/chill/ClassRegistrar.java +++ b/chill-java/src/main/java/com/twitter/chill/ClassRegistrar.java @@ -16,7 +16,7 @@ package com.twitter.chill; -import com.esotericsoftware.kryo.Kryo; +import com.esotericsoftware.kryo.kryo5.Kryo; /** Register this class to be used with the default serializer for this class */ public class ClassRegistrar implements IKryoRegistrar { diff --git a/chill-java/src/main/java/com/twitter/chill/IKryoRegistrar.java b/chill-java/src/main/java/com/twitter/chill/IKryoRegistrar.java index 25a95076..0d4bf35d 100644 --- a/chill-java/src/main/java/com/twitter/chill/IKryoRegistrar.java +++ b/chill-java/src/main/java/com/twitter/chill/IKryoRegistrar.java @@ -16,7 +16,7 @@ package com.twitter.chill; -import com.esotericsoftware.kryo.Kryo; +import com.esotericsoftware.kryo.kryo5.Kryo; import java.io.Serializable; /** diff --git a/chill-java/src/main/java/com/twitter/chill/KryoInstantiator.java b/chill-java/src/main/java/com/twitter/chill/KryoInstantiator.java index 5af3aa21..1e2da834 100644 --- a/chill-java/src/main/java/com/twitter/chill/KryoInstantiator.java +++ b/chill-java/src/main/java/com/twitter/chill/KryoInstantiator.java @@ -16,8 +16,8 @@ package com.twitter.chill; -import com.esotericsoftware.kryo.Kryo; -import org.objenesis.strategy.InstantiatorStrategy; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.objenesis.strategy.InstantiatorStrategy; import java.io.Serializable; /** Class to create a new Kryo instance. diff --git a/chill-java/src/main/java/com/twitter/chill/KryoPool.java b/chill-java/src/main/java/com/twitter/chill/KryoPool.java index ce15cb66..eb79a889 100644 --- a/chill-java/src/main/java/com/twitter/chill/KryoPool.java +++ b/chill-java/src/main/java/com/twitter/chill/KryoPool.java @@ -16,9 +16,9 @@ package com.twitter.chill; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.io.Input; -import com.esotericsoftware.kryo.io.Output; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.io.Input; +import com.esotericsoftware.kryo.kryo5.io.Output; import java.io.OutputStream; import java.io.ByteArrayOutputStream; diff --git a/chill-java/src/main/java/com/twitter/chill/ReflectingDefaultRegistrar.java b/chill-java/src/main/java/com/twitter/chill/ReflectingDefaultRegistrar.java index 7ace7507..ea149925 100644 --- a/chill-java/src/main/java/com/twitter/chill/ReflectingDefaultRegistrar.java +++ b/chill-java/src/main/java/com/twitter/chill/ReflectingDefaultRegistrar.java @@ -16,8 +16,8 @@ package com.twitter.chill; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.Serializer; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.Serializer; /** Set the default serializers for subclasses of the given class */ diff --git a/chill-java/src/main/java/com/twitter/chill/ReflectingRegistrar.java b/chill-java/src/main/java/com/twitter/chill/ReflectingRegistrar.java index e55fa04b..fa716fa3 100644 --- a/chill-java/src/main/java/com/twitter/chill/ReflectingRegistrar.java +++ b/chill-java/src/main/java/com/twitter/chill/ReflectingRegistrar.java @@ -16,9 +16,9 @@ package com.twitter.chill; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.Serializer; -import com.esotericsoftware.kryo.util.Util; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.Serializer; +import com.esotericsoftware.kryo.kryo5.util.Util; /** Use reflection to instantiate a serializer. * Used when serializer classes are written to config files diff --git a/chill-java/src/main/java/com/twitter/chill/SerDeState.java b/chill-java/src/main/java/com/twitter/chill/SerDeState.java index 24cd403c..0796641e 100644 --- a/chill-java/src/main/java/com/twitter/chill/SerDeState.java +++ b/chill-java/src/main/java/com/twitter/chill/SerDeState.java @@ -16,9 +16,9 @@ package com.twitter.chill; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.io.Input; -import com.esotericsoftware.kryo.io.Output; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.io.Input; +import com.esotericsoftware.kryo.kryo5.io.Output; import java.io.OutputStream; import java.io.InputStream; @@ -43,7 +43,7 @@ protected SerDeState(Kryo k, Input in, Output out) { /** Call this when to reset the state to the initial state */ public void clear() { input.setBuffer(EMPTY_BUFFER); - output.clear(); + output.reset(); } public void setInput(byte[] in) { input.setBuffer(in); } diff --git a/chill-java/src/main/java/com/twitter/chill/SingleDefaultRegistrar.java b/chill-java/src/main/java/com/twitter/chill/SingleDefaultRegistrar.java index b11b4573..4fd738db 100644 --- a/chill-java/src/main/java/com/twitter/chill/SingleDefaultRegistrar.java +++ b/chill-java/src/main/java/com/twitter/chill/SingleDefaultRegistrar.java @@ -16,8 +16,8 @@ package com.twitter.chill; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.Serializer; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.Serializer; /** Set the default serializers for subclasses of the given class */ diff --git a/chill-java/src/main/java/com/twitter/chill/SingleRegistrar.java b/chill-java/src/main/java/com/twitter/chill/SingleRegistrar.java index f449339b..680dc662 100644 --- a/chill-java/src/main/java/com/twitter/chill/SingleRegistrar.java +++ b/chill-java/src/main/java/com/twitter/chill/SingleRegistrar.java @@ -16,8 +16,8 @@ package com.twitter.chill; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.Serializer; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.Serializer; public class SingleRegistrar implements IKryoRegistrar { final Class klass; diff --git a/chill-java/src/main/java/com/twitter/chill/config/ConfiguredInstantiator.java b/chill-java/src/main/java/com/twitter/chill/config/ConfiguredInstantiator.java index d526e706..866615fb 100644 --- a/chill-java/src/main/java/com/twitter/chill/config/ConfiguredInstantiator.java +++ b/chill-java/src/main/java/com/twitter/chill/config/ConfiguredInstantiator.java @@ -20,9 +20,9 @@ import java.lang.reflect.InvocationTargetException; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.io.Input; -import com.esotericsoftware.kryo.io.Output; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.io.Input; +import com.esotericsoftware.kryo.kryo5.io.Output; /** * This is the standard Config based KryoInstantiator. diff --git a/chill-java/src/main/java/com/twitter/chill/config/ReflectingInstantiator.java b/chill-java/src/main/java/com/twitter/chill/config/ReflectingInstantiator.java index 7ba42b63..b1baf6c2 100644 --- a/chill-java/src/main/java/com/twitter/chill/config/ReflectingInstantiator.java +++ b/chill-java/src/main/java/com/twitter/chill/config/ReflectingInstantiator.java @@ -22,10 +22,10 @@ import com.twitter.chill.ReflectingRegistrar; import com.twitter.chill.ReflectingDefaultRegistrar; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.Serializer; -import org.objenesis.strategy.InstantiatorStrategy; -import org.objenesis.strategy.StdInstantiatorStrategy; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.Serializer; +import com.esotericsoftware.kryo.kryo5.objenesis.strategy.InstantiatorStrategy; +import com.esotericsoftware.kryo.kryo5.objenesis.strategy.StdInstantiatorStrategy; import java.util.ArrayList; import java.util.List; import java.lang.reflect.InvocationTargetException; diff --git a/chill-java/src/main/java/com/twitter/chill/java/ArraysAsListSerializer.java b/chill-java/src/main/java/com/twitter/chill/java/ArraysAsListSerializer.java index f4811d95..68818bec 100644 --- a/chill-java/src/main/java/com/twitter/chill/java/ArraysAsListSerializer.java +++ b/chill-java/src/main/java/com/twitter/chill/java/ArraysAsListSerializer.java @@ -26,10 +26,10 @@ import java.util.HashMap; import java.util.Map; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.Serializer; -import com.esotericsoftware.kryo.io.Input; -import com.esotericsoftware.kryo.io.Output; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.Serializer; +import com.esotericsoftware.kryo.kryo5.io.Input; +import com.esotericsoftware.kryo.kryo5.io.Output; /** * A kryo {@link Serializer} for lists created via {@link Arrays#asList(Object...)}. @@ -71,7 +71,7 @@ public ArraysAsListSerializer() { } @Override - public List read(final Kryo kryo, final Input input, final Class> type) { + public List read(final Kryo kryo, final Input input, final Class> type) { final int length = input.readInt(true); Class componentType = kryo.readClass(input).getType(); try { diff --git a/chill-java/src/main/java/com/twitter/chill/java/BitSetSerializer.java b/chill-java/src/main/java/com/twitter/chill/java/BitSetSerializer.java index 597699c6..b7bb618a 100644 --- a/chill-java/src/main/java/com/twitter/chill/java/BitSetSerializer.java +++ b/chill-java/src/main/java/com/twitter/chill/java/BitSetSerializer.java @@ -16,11 +16,11 @@ package com.twitter.chill.java; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.KryoException; -import com.esotericsoftware.kryo.Serializer; -import com.esotericsoftware.kryo.io.Input; -import com.esotericsoftware.kryo.io.Output; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.KryoException; +import com.esotericsoftware.kryo.kryo5.Serializer; +import com.esotericsoftware.kryo.kryo5.io.Input; +import com.esotericsoftware.kryo.kryo5.io.Output; import com.twitter.chill.IKryoRegistrar; import com.twitter.chill.SingleRegistrar; @@ -81,7 +81,7 @@ public void write(Kryo kryo, Output output, BitSet bitSet) { } @Override - public BitSet read(Kryo kryo, Input input, Class bitSetClass) { + public BitSet read(Kryo kryo, Input input, Class bitSetClass) { int len = input.readInt(true); long[] target = new long[len]; diff --git a/chill-java/src/main/java/com/twitter/chill/java/InetSocketAddressSerializer.java b/chill-java/src/main/java/com/twitter/chill/java/InetSocketAddressSerializer.java index c1515853..757377ee 100644 --- a/chill-java/src/main/java/com/twitter/chill/java/InetSocketAddressSerializer.java +++ b/chill-java/src/main/java/com/twitter/chill/java/InetSocketAddressSerializer.java @@ -16,10 +16,10 @@ package com.twitter.chill.java; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.Serializer; -import com.esotericsoftware.kryo.io.Input; -import com.esotericsoftware.kryo.io.Output; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.Serializer; +import com.esotericsoftware.kryo.kryo5.io.Input; +import com.esotericsoftware.kryo.kryo5.io.Output; import com.twitter.chill.IKryoRegistrar; import com.twitter.chill.SingleRegistrar; @@ -39,7 +39,7 @@ public void write(Kryo kryo, Output output, InetSocketAddress obj) { } @Override - public InetSocketAddress read(Kryo kryo, Input input, Class klass) { + public InetSocketAddress read(Kryo kryo, Input input, Class klass) { String host = input.readString(); int port = input.readInt(true); return new InetSocketAddress(host, port); diff --git a/chill-java/src/main/java/com/twitter/chill/java/IterableRegistrar.java b/chill-java/src/main/java/com/twitter/chill/java/IterableRegistrar.java index e5ad1ea7..9f42c1bc 100644 --- a/chill-java/src/main/java/com/twitter/chill/java/IterableRegistrar.java +++ b/chill-java/src/main/java/com/twitter/chill/java/IterableRegistrar.java @@ -18,8 +18,8 @@ import com.twitter.chill.IKryoRegistrar; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.DefaultSerializer; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.DefaultSerializer; import java.util.Arrays; diff --git a/chill-java/src/main/java/com/twitter/chill/java/IterableRegistrarSerializer.java b/chill-java/src/main/java/com/twitter/chill/java/IterableRegistrarSerializer.java index de61fe8b..3a6e2964 100644 --- a/chill-java/src/main/java/com/twitter/chill/java/IterableRegistrarSerializer.java +++ b/chill-java/src/main/java/com/twitter/chill/java/IterableRegistrarSerializer.java @@ -17,10 +17,10 @@ package com.twitter.chill.java; import com.twitter.chill.IKryoRegistrar; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.io.Input; -import com.esotericsoftware.kryo.io.Output; -import com.esotericsoftware.kryo.Serializer; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.io.Input; +import com.esotericsoftware.kryo.kryo5.io.Output; +import com.esotericsoftware.kryo.kryo5.Serializer; import java.util.ArrayList; @@ -32,7 +32,7 @@ public void write(Kryo kryo, Output output, IterableRegistrar obj) { } kryo.writeClassAndObject(output, null); } - public IterableRegistrar read(Kryo kryo, Input input, Class type) { + public IterableRegistrar read(Kryo kryo, Input input, Class type) { ArrayList krs = new ArrayList(); IKryoRegistrar thisKr = (IKryoRegistrar)kryo.readClassAndObject(input); while(thisKr != null) { diff --git a/chill-java/src/main/java/com/twitter/chill/java/Java8ClosureRegistrar.java b/chill-java/src/main/java/com/twitter/chill/java/Java8ClosureRegistrar.java index dea99914..d8a87b89 100644 --- a/chill-java/src/main/java/com/twitter/chill/java/Java8ClosureRegistrar.java +++ b/chill-java/src/main/java/com/twitter/chill/java/Java8ClosureRegistrar.java @@ -1,7 +1,7 @@ package com.twitter.chill.java; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.serializers.ClosureSerializer; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.serializers.ClosureSerializer; import com.twitter.chill.IKryoRegistrar; /** diff --git a/chill-java/src/main/java/com/twitter/chill/java/LocaleSerializer.java b/chill-java/src/main/java/com/twitter/chill/java/LocaleSerializer.java index aa769aa7..cd6fbef0 100644 --- a/chill-java/src/main/java/com/twitter/chill/java/LocaleSerializer.java +++ b/chill-java/src/main/java/com/twitter/chill/java/LocaleSerializer.java @@ -16,11 +16,11 @@ package com.twitter.chill.java; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.serializers.JavaSerializer; -import com.esotericsoftware.kryo.Serializer; -import com.esotericsoftware.kryo.io.Input; -import com.esotericsoftware.kryo.io.Output; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.serializers.JavaSerializer; +import com.esotericsoftware.kryo.kryo5.Serializer; +import com.esotericsoftware.kryo.kryo5.io.Input; +import com.esotericsoftware.kryo.kryo5.io.Output; import com.twitter.chill.IKryoRegistrar; import com.twitter.chill.SingleRegistrar; diff --git a/chill-java/src/main/java/com/twitter/chill/java/PackageRegistrar.java b/chill-java/src/main/java/com/twitter/chill/java/PackageRegistrar.java index 21d1ebf2..fce8e307 100644 --- a/chill-java/src/main/java/com/twitter/chill/java/PackageRegistrar.java +++ b/chill-java/src/main/java/com/twitter/chill/java/PackageRegistrar.java @@ -18,7 +18,7 @@ import com.twitter.chill.IKryoRegistrar; -import com.esotericsoftware.kryo.Kryo; +import com.esotericsoftware.kryo.kryo5.Kryo; import java.util.ArrayList; diff --git a/chill-java/src/main/java/com/twitter/chill/java/PriorityQueueSerializer.java b/chill-java/src/main/java/com/twitter/chill/java/PriorityQueueSerializer.java index c9dd95fd..1d3de4dd 100644 --- a/chill-java/src/main/java/com/twitter/chill/java/PriorityQueueSerializer.java +++ b/chill-java/src/main/java/com/twitter/chill/java/PriorityQueueSerializer.java @@ -19,10 +19,10 @@ import com.twitter.chill.IKryoRegistrar; import com.twitter.chill.SingleRegistrar; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.Serializer; -import com.esotericsoftware.kryo.io.Input; -import com.esotericsoftware.kryo.io.Output; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.Serializer; +import com.esotericsoftware.kryo.kryo5.io.Input; +import com.esotericsoftware.kryo.kryo5.io.Output; import java.lang.reflect.Field; import java.util.PriorityQueue; @@ -62,7 +62,7 @@ public void write(Kryo k, Output o, PriorityQueue q) { o.flush(); } } - public PriorityQueue read(Kryo k, Input i, Class> c) { + public PriorityQueue read(Kryo k, Input i, Class> c) { Comparator comp = (Comparator)k.readClassAndObject(i); int sz = i.readInt(true); // can't create with size 0: diff --git a/chill-java/src/main/java/com/twitter/chill/java/RegexSerializer.java b/chill-java/src/main/java/com/twitter/chill/java/RegexSerializer.java index 2f9742ab..168bb78d 100644 --- a/chill-java/src/main/java/com/twitter/chill/java/RegexSerializer.java +++ b/chill-java/src/main/java/com/twitter/chill/java/RegexSerializer.java @@ -16,10 +16,10 @@ package com.twitter.chill.java; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.Serializer; -import com.esotericsoftware.kryo.io.Input; -import com.esotericsoftware.kryo.io.Output; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.Serializer; +import com.esotericsoftware.kryo.kryo5.io.Input; +import com.esotericsoftware.kryo.kryo5.io.Output; import com.twitter.chill.IKryoRegistrar; import com.twitter.chill.SingleRegistrar; @@ -38,7 +38,7 @@ public void write(Kryo kryo, Output output, Pattern pattern) { } @Override - public Pattern read(Kryo kryo, Input input, Class patternClass) { + public Pattern read(Kryo kryo, Input input, Class patternClass) { return Pattern.compile(input.readString()); } } diff --git a/chill-java/src/main/java/com/twitter/chill/java/SimpleDateFormatSerializer.java b/chill-java/src/main/java/com/twitter/chill/java/SimpleDateFormatSerializer.java index f3711a30..d5a4b28e 100644 --- a/chill-java/src/main/java/com/twitter/chill/java/SimpleDateFormatSerializer.java +++ b/chill-java/src/main/java/com/twitter/chill/java/SimpleDateFormatSerializer.java @@ -16,7 +16,7 @@ package com.twitter.chill.java; -import com.esotericsoftware.kryo.serializers.JavaSerializer; +import com.esotericsoftware.kryo.kryo5.serializers.JavaSerializer; import com.twitter.chill.IKryoRegistrar; import com.twitter.chill.SingleRegistrar; diff --git a/chill-java/src/main/java/com/twitter/chill/java/SqlDateSerializer.java b/chill-java/src/main/java/com/twitter/chill/java/SqlDateSerializer.java index d31061df..d93a9d51 100644 --- a/chill-java/src/main/java/com/twitter/chill/java/SqlDateSerializer.java +++ b/chill-java/src/main/java/com/twitter/chill/java/SqlDateSerializer.java @@ -16,10 +16,10 @@ package com.twitter.chill.java; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.Serializer; -import com.esotericsoftware.kryo.io.Input; -import com.esotericsoftware.kryo.io.Output; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.Serializer; +import com.esotericsoftware.kryo.kryo5.io.Input; +import com.esotericsoftware.kryo.kryo5.io.Output; import com.twitter.chill.IKryoRegistrar; import com.twitter.chill.SingleRegistrar; @@ -38,7 +38,7 @@ public void write(Kryo kryo, Output output, Date date) { } @Override - public Date read(Kryo kryo, Input input, Class dateClass) { + public Date read(Kryo kryo, Input input, Class dateClass) { return new Date(input.readLong(true)); } } diff --git a/chill-java/src/main/java/com/twitter/chill/java/SqlTimeSerializer.java b/chill-java/src/main/java/com/twitter/chill/java/SqlTimeSerializer.java index eeb5e938..0f613544 100644 --- a/chill-java/src/main/java/com/twitter/chill/java/SqlTimeSerializer.java +++ b/chill-java/src/main/java/com/twitter/chill/java/SqlTimeSerializer.java @@ -16,10 +16,10 @@ package com.twitter.chill.java; -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.Serializer; -import com.esotericsoftware.kryo.io.Input; -import com.esotericsoftware.kryo.io.Output; +import com.esotericsoftware.kryo.kryo5.Kryo; +import com.esotericsoftware.kryo.kryo5.Serializer; +import com.esotericsoftware.kryo.kryo5.io.Input; +import com.esotericsoftware.kryo.kryo5.io.Output; import com.twitter.chill.IKryoRegistrar; import com.twitter.chill.SingleRegistrar; @@ -38,7 +38,7 @@ public void write(Kryo kryo, Output output, Time time) { } @Override - public Time read(Kryo kryo, Input input, Class