pravega-samples icon indicating copy to clipboard operation
pravega-samples copied to clipboard

Change samples to use UTF8StringSerializer

Open claudiofahey opened this issue 6 years ago • 0 comments

Currently, events that consist of strings are serialized in Pravega using JavaSerializer. This is not ideal because 1) it is difficult to use in non-Java environments, 2) it adds unnecessary framing, and 3) it uses inefficient UTF-16 encoding.

A new commit has been added to Pravega to provide a UTF-8 serializer (https://github.com/pravega/pravega/pull/2607/commits/78c5adea87ada5606400ea97b0cb1303a7004808)

All samples that currently use JavaSerializer<String> should be converted to use UTF8StringSerializer to demonstrate this best practice. Note that this is a breaking change as JavaSerializer<String> is a different encoding than UTF-8.

For more information on why UTF-8 is preferred over UTF-16: http://utf8everywhere.org/

claudiofahey avatar May 24 '18 15:05 claudiofahey