-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APIs to serialize/deserialize data? #28
Comments
I guess it's a feature request more than anything else... but I concur; it'd be super-convenient if it was part of the API |
I used some dummy structs and manual memcpy to do so in a project a while back. It's gross and bad form but works. Just make sure the layout's the same. (Until it's actually supported, of course.) |
Would you mind sharing the code ? |
I can pull that out of a private repo. I’ll look it over tomorrow and see if a pull request is easier. If you’re doing sequence analysis, which I’m guessing based on your name, I could release the kmer database code around it if it meets your needs. |
Thanks! No, this time it's not for sequence analysis :) |
👍 to this! Serializing/deserializing seems more efficient than rebuilding the filter. @dnbaker hope it is possible to share the code. |
this is viable, yes? if so, something to point me to? |
assuming a surgically placed memcpy, but not feeling confident whereabout |
@dnbaker resurrecting an old thread :) I'm also interested in serialization. Any chance you can dig up that old code, or do you have recommendations for another cuckoo filter library? |
Here's the code I had. It's only valid for POD (std::is_trivial and std::is_standard_layout). Sorry I took a while to respond - I had to go find and extract it. First, there's a couple of dummy structs which are defined, and namespacing:
Writing to disk:
Reading:
At destruction, you'll need to manually call your destructor (since it's a pointer), and |
Thanks for this nice implementation of Cuckoo filter. Would you please let me know how to serialize/deserialize the filter's state?
The text was updated successfully, but these errors were encountered: