samza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ruslan Khafizov" <ruslan.khafi...@gmail.com>
Subject Review Request 30825: SAMZA-547: Add Java Serializable Serde
Date Tue, 10 Feb 2015 13:26:09 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30825/
-----------------------------------------------------------

Review request for samza.


Repository: samza


Description
-------

I added 2 implementations as I'm not sure how Serde will be used.
Intention is to add only one but I need feedback to make correct trade-off.

Generic serializer SerializableSerde creates quite clumsy API because it takes and returns
Serializable. So real objects need to be casted as shown in TestSerializableSerde.

```scala
serde.toBytes(obj.asInstanceOf[java.io.Serializable])
val objRoundTrip:String = serde.fromBytes(bytes).asInstanceOf[String]
```

Type-specific one SerializableTypeSerde gives more clean API but most other Serdes instantiated
from config string. Not sure type can be passed in runtime.


Diffs
-----

  samza-core/src/main/scala/org/apache/samza/serializers/SerializableSerde.scala PRE-CREATION

  samza-core/src/main/scala/org/apache/samza/serializers/SerializableTypeSerde.scala PRE-CREATION

  samza-core/src/test/scala/org/apache/samza/serializers/TestSerializableSerde.scala PRE-CREATION

  samza-core/src/test/scala/org/apache/samza/serializers/TestSerializableTypeSerde.scala PRE-CREATION


Diff: https://reviews.apache.org/r/30825/diff/


Testing
-------


Thanks,

Ruslan Khafizov


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message