fury icon indicating copy to clipboard operation
fury copied to clipboard

[Java] Support userContext for user custom global data

Open MrChang0 opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

when I want compress some Map<String, String> map, it have lots of same string key, I want make user serializer contain a map key dict suche as Map<String, Integer> dict and I can just serializer key as int, then write dict data after metaContext. but fury cant costum metaContext to save user global data.

btw, stringRefIgnored open will take slow serilizer time.

Describe the solution you'd like

maybe we can support user context with open interface like interface userContext with method wirteData(MemoryBuffer buffer) and write(MemoryBuffer buffer) and constructr(Fury fury). we can take it just like fury.registerUserContext("name", CompressStringDictMapContext.class). we can take userContext like fury.getUserContext("name") when after wirte metaContext, wirte all register userContext data by register order, same to read.

Additional context

I make a simple compress map version in my local project, so I think a userContext can take better flexibility

thanks

MrChang0 avatar Apr 29 '24 07:04 MrChang0

Hi, Fury has a SerializationContext class. Could we use this class to implement this feature?

chaokunyang avatar Apr 29 '24 08:04 chaokunyang

sure, I will take a simple code for this feature.

MrChang0 avatar Apr 29 '24 09:04 MrChang0