jbapple / libfilter

High-speed Bloom filters and taffy filters for C, C++, and Java
Apache License 2.0
32 stars 6 forks source link

serialization and cross language/platform support #20

Open patelprateek opened 2 years ago

patelprateek commented 2 years ago

Are these filters serializable ? can we load and serialize filters in a compatible way in different languages and platform ?

jbapple commented 2 years ago

Just added (de)serialization for block filters. Will soon add for other filters.

patelprateek commented 2 years ago

great , thanks for the prompt response . I have use cases where i am creating filters in java and consumed by c++ applications , is there a serialization spec that makes it compatible across different platforms or language ?

jbapple commented 2 years ago

Not yet, but I'll add that.

jbapple commented 2 years ago

@patelprateek How do you plan to pass the filters from Java to C++ - JNI? Disk? MappedByteBuffer? Something else?

patelprateek commented 2 years ago

@jbapple : initial plan is to pass it through jni for some local computation in native code , but also in future serialized bytes over wire in a protocol buffer message along with some other data to remote server written in c++

jbapple commented 2 years ago

@patelprateek See JavaSerDeTest in block.cpp For example of how to use the new JNI compatible serialization/deserialization to get a filter from Java to C++.

hskun commented 1 year ago

Hi @jbapple , Have any (de)serialization usage or example for reference? Thanks.