[ 
https://issues.apache.org/jira/browse/SAMZA-481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14227704#comment-14227704
 ] 

Martin Kleppmann commented on SAMZA-481:
----------------------------------------

What do you dislike about it? That it always requires 8 bytes, even for small 
numbers?

Avro uses a variable-length encoding that uses one byte for -128 <= x < +128, 
two bytes for -16384 <= x < +16384, etc. up to a maximum of 10 bytes (so it's 
less efficient than a fixed 8 bytes if you mostly have very large numbers). 
It's quite simple but effective. We could [borrow 
it|https://github.com/apache/avro/blob/branch-1.3/lang/java/src/java/org/apache/avro/io/BinaryEncoder.java#L192-L199]
 if we want.

> Write a LongSerde
> -----------------
>
>                 Key: SAMZA-481
>                 URL: https://issues.apache.org/jira/browse/SAMZA-481
>             Project: Samza
>          Issue Type: Bug
>          Components: container
>    Affects Versions: 0.9.0
>            Reporter: Chris Riccomini
>              Labels: newbie
>             Fix For: 0.9.0
>
>
> We ship with an IntegerSerde, but it'd be nice to support longs as well.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to