信息
该版本发布于 Fury 进入 Apache 孵化器之前,因此属于非 ASF 发布。
我很高兴宣布 Fury 0.3.0 版本发布。这个版本已支持 Scala 2/3 的完整对象序列化,包括 case/pojo/object/option/tuple/collection/enum 等类型。其中 case/pojo/object 与 Fury JIT 深度集成,Fury 会在运行时自动生成高性能序列化代码,因此在这类对象上的序列化速度非常快。
作者:chaokunyang
我很高兴宣布 Fury 0.3.0 版本发布。这个版本已支持 Scala 2/3 的完整对象序列化,包括 case/pojo/object/option/tuple/collection/enum 等类型。其中 case/pojo/object 与 Fury JIT 深度集成,Fury 会在运行时自动生成高性能序列化代码,因此在这类对象上的序列化速度非常快。
长期以来,Scala 序列化一直是个难题,最稳妥的方案通常只有 JDK serialization,但它速度慢、序列化体积也偏大。虽然也有 chill 这样的框架,但对 Scala 类型支持有限,性能上也有约束。现在借助 Fury Scala,你可以序列化几乎任意 Scala 对象,同时获得非常可观的性能表现。欢迎试用并反馈问题。
Scala 序列化指南
安装依赖:
libraryDependencies += "org.furyio" % "fury-core" % "0.3.0"
创建 Fury:
val fury = Fury.builder()
.withScalaOptimizationEnabled(true)
.requireClassRegistration(false)
.withRefTracking(true)
.build()
序列化 case 对象:
case class Person(github: String, age: Int, id: Long)
val p = Person("https://github.com/chaokunyang", 18, 1)
println(fury.deserialize(fury.serialize(p)))
println(fury.deserializeJavaObject(fury.serializeJavaObject(p)))
序列化单例对象:
object singleton {
}
val o1 = fury.deserialize(fury.serialize(singleton))
val o2 = fury.deserialize(fury.serialize(singleton))
println(o1 == o2)
序列化集合对象:
val seq = Seq(1,2)
val list = List("a", "b") val map = Map("a" -> 1, "b" -> 2)
println(fury.deserialize(fury.serialize(seq)))
println(fury.deserialize(fury.serialize(list)))
println(fury.deserialize(fury.serialize(map)))
序列化枚举:
enum Color { case Red, Green, Blue }
println(fury.deserialize(fury.serialize(Color.Green)))
亮点
- [Scala] Support scala serialization:
case/object/tuple/string/collection/enum/basicall supported - [Scala] Add scala user documentation
- [Scala] add optimized scala singleton object serializer
- [Java] Make
java.io.Externalizablecompatible with JavawriteReplace/readResolveAPI - [Java] Integrate fury with dubbo https://github.com/apache/dubbo-spi-extensions/pull/226
- [Java] support bytes string serialization for jdk8 with JDK17 runtime
缺陷修复
- [Java] Allow for
InputStreamnot reading entire length - [Java] Use
ReflectionUtils.getCtrHandle()for non-public constructor inExternalizableSerializer - [Java] fix jdk compatible serialization for inheritance
变更列表
- [Impove]-[Doc] Improve README by @caicancai in https://github.com/alipay/fury/pull/1011
- [Java] rename wrong ascii naming to latin by @chaokunyang in https://github.com/alipay/fury/pull/1013
- [Doc] Update go install doc by @chaokunyang in https://github.com/alipay/fury/pull/1015
- fix(grammatical): correct typos and improve grammar by @iamahens in https://github.com/alipay/fury/pull/1018
- [Improve]-[Doc] Improve README by @caicancai in https://github.com/alipay/fury/pull/1020
- [Improve]-[Doc] add environment requirement by @caicancai in https://github.com/alipay/fury/pull/1022
- chore(docs): fixed typos by @Smoothieewastaken in https://github.com/alipay/fury/pull/1023
- bugfix: read buffer error when object contain binary field by @wangweipeng2 in https://github.com/alipay/fury/pull/1026
- [Doc] Optimize class registration doc by @chaokunyang in https://github.com/alipay/fury/pull/1027
- [Java] fix jdk compatible serialization for inheritance by @chaokunyang in https://github.com/alipay/fury/pull/1030
- [Doc] add scala user doc by @chaokunyang in https://github.com/alipay/fury/pull/1028
- [Doc] refine scala doc by @chaokunyang in https://github.com/alipay/fury/pull/1031
- Update README.md - fix grammatrical errors in README. by @ayushrakesh in https://github.com/alipay/fury/pull/1037
- [Java] Support local static class jit by @chaokunyang in https://github.com/alipay/fury/pull/1036
- [Java] support bytes string serialization for jdk8 by @chaokunyang in https://github.com/alipay/fury/pull/1039
- [Java] set timeout to JITContextTest by @chaokunyang in https://github.com/alipay/fury/pull/1040
- [Java] fix string builder serialization for jdk8 with jdk17 runtime by @chaokunyang in https://github.com/alipay/fury/pull/1042
- [Doc] add auto code reviewers by @chaokunyang in https://github.com/alipay/fury/pull/1043
- [Java] Allow for
InputStreamnot reading entire length by @knutwannheden in https://github.com/alipay/fury/pull/1034 - [Java] Use
ReflectionUtils.getCtrHandle()inExternalizableSerializerby @knutwannheden in https://github.com/alipay/fury/pull/1044 - [Improve] make maven-spotless-plugin version as a parameter by @caicancai in https://github.com/alipay/fury/pull/1046
- Update README.md by @Shivam250702 in https://github.com/alipay/fury/pull/1047
- [Java] support writeReplace/readResolve for Externalizable by @chaokunyang in https://github.com/alipay/fury/pull/1048
- Update README.md by @Spyrosigma in https://github.com/alipay/fury/pull/1051
- Grammatical error in CODE_OF_CONDUCT.md by @HimanshuMahto in https://github.com/alipay/fury/pull/1050
- Update scala link title README.md by @chaokunyang in https://github.com/alipay/fury/pull/1052
- [Doc] add scala readme and refine document by @chaokunyang in https://github.com/alipay/fury/pull/1041
- [Java] populate StackOverflowError with enable ref tracking message by @chaokunyang in https://github.com/alipay/fury/pull/1049
- [Scala] Setup scala project by @chaokunyang in https://github.com/alipay/fury/pull/1054
- [Scala] add scala singleton object serializer by @chaokunyang in https://github.com/alipay/fury/pull/1053
- Updated README.md by @vidhijain27 in https://github.com/alipay/fury/pull/1056
- [Scala] add scala tuple serialization tests by @chaokunyang in https://github.com/alipay/fury/pull/1059
- Empty ListExpression#genCode will throw npe by @farmerworking in https://github.com/alipay/fury/pull/1063
新贡献者
- @iamahens made their first contribution in https://github.com/alipay/fury/pull/1018
- @Smoothieewastaken made their first contribution in https://github.com/alipay/fury/pull/1023
- @ayushrakesh made their first contribution in https://github.com/alipay/fury/pull/1037
- @knutwannheden made their first contribution in https://github.com/alipay/fury/pull/1034
- @Shivam250702 made their first contribution in https://github.com/alipay/fury/pull/1047
- @Spyrosigma made their first contribution in https://github.com/alipay/fury/pull/1051
- @HimanshuMahto made their first contribution in https://github.com/alipay/fury/pull/1050
- @vidhijain27 made their first contribution in https://github.com/alipay/fury/pull/1056
- @farmerworking made their first contribution in https://github.com/alipay/fury/pull/1063
完整更新日志:https://github.com/alipay/fury/compare/v0.2.1...v0.3.0
