chaokunyang commented on PR #1413:
URL: https://github.com/apache/incubator-fury/pull/1413#issuecomment-2027911546

   > > > > > > One more thing is that do we need to add a int16 magic number at 
the header? JDK serialization use two bytes, avro use 4 bytes, 
kryo/protobuf/flatbuffer doesn't add magic number. @theweipeng @PragmaTwice 
@LiangliangSui @pjfanning
   > > > > > 
   > > > > > 
   > > > > > I think it would be necessary, we can use the magic number to 
indicate the protocol version
   > > > > 
   > > > > 
   > > > > There are 4 bits empty in fury header, which can be used to indicate 
the protocol version too.
   > > > 
   > > > 
   > > > I have noticed that sometimes, applications may encapsulate the data 
buffer using a proprietary protocol. On the receiving end, the use of a magic 
number is helpful for them to identify which protocol is being used.
   > > 
   > > 
   > > Added two bytes header to the spec
   > 
   > Use two bytes to store the magic number, and use two bytes to store the 
protocol version, just like [JDK 
serialization](https://docs.oracle.com/javase/8/docs/api/java/io/ObjectStreamConstants.html#STREAM_MAGIC)
 (maybe we can also use one byte to store the protocol version), we still keep 
4 empty bits in the header(after all, the number of version numbers that can be 
represented by 4 bits is relatively small.) , leaving room for future expansion.
   
   @LiangliangSui I think 2 bytes is OK, the protocol will be backward/forward 
compatible in the future, we barely bump protocol version. Only things like 
proto2 -> proto3 need to bump protocol version. But that can be expressed by 
bump magic number


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to