Skip to main content

Fury v0.3.0 released

· 5 min read
Shawn Yang
info

This release was made before Fury joined the Apache Incubator and thus it's a non-ASF release.

I'm pleased to announce the 0.3.0 release of the Fury. With this release, fury supports all scala 2/3 objects serializaiton now, including: case/pojo/object/option/tuple/collecton/enum and other types. case/pojo/object are tightly integrated with fury JIT. Fury will generate highly-optimized serializer by generate serialize code at runtime to speed up serializaiton. The serialization for those objects will be extremely fast.

Author: chaokunyang

I'm pleased to announce the 0.3.0 release of the Fury. With this release, fury supports all scala 2/3 objects serializaiton now, including: case/pojo/object/option/tuple/collecton/enum and other types. case/pojo/object are tightly integrated with fury JIT. Fury will generate highly-optimized serializer by generate serialize code at runtime to speed up serializaiton. The serialization for those objects will be extremely fast.

For a long time, scala serialization is always tricky, only reliable way is JDK serialization. But it’s too slow, and the serialized size is too large. Although we have frameworks such as chill, but the support for scala types are limited, and the performance is limited too.Now with fury scala, you can serialize any scala objects you want and get extremly fast performance. Please try it out and let us know if you have any issues.

Scala Serialization Guide

Install dependecy:

libraryDependencies += "org.furyio" % "fury-core" % "0.3.0"

Creating fury:

val fury = Fury.builder()
.withScalaOptimizationEnabled(true)
.requireClassRegistration(false)
.withRefTracking(true)
.build()

Serialize case objects:

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)))

Serialize singleton objects:

object singleton {
}
val o1 = fury.deserialize(fury.serialize(singleton))
val o2 = fury.deserialize(fury.serialize(singleton))
println(o1 == o2)

Serialize collection objects:

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)))

Serialize enum:

enum Color { case Red, Green, Blue }
println(fury.deserialize(fury.serialize(Color.Green)))

Highlight

  • [Scala] Support scala serialization: case/object/tuple/string/collection/enum/basic all supported
  • [Scala] Add scala user documentation
  • [Scala] add optimized scala singleton object serializer
  • [Java] Make java.io.Externalizable compatible with Java writeReplace/readResolve API
  • [Java] Integrate fury with dubbo https://github.com/apache/dubbo-spi-extensions/pull/226
  • [Java] support bytes string serialization for jdk8 with JDK17 runtime

BugFix

  • [Java] Allow for InputStream not reading entire length
  • [Java] Use ReflectionUtils.getCtrHandle() for non-public constructor in ExternalizableSerializer
  • [Java] fix jdk compatible serialization for inheritance

What's Changed

New Contributors

Full Changelog: https://github.com/alipay/fury/compare/v0.2.1...v0.3.0