You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.
thanks for creating the library. i've been using a bloom filter, but need the ability to delete items. how would you recommend saving the filter to disk to preserve state over time? bloom_live has a tofile() method, but I don't see a similar option here. pickle the object?
i have tried pickling the object to a file and later reading it back in. There don't seem to be any issues with the write or load, but the reloaded filter doesn't recognize the objects it is supposed to contain. that is, the length of the filter is correct, but the contains() method will return false for any items i know are in there. running something like the below repeatedly inserts the item in the filter.
`def load_cuckoo_filter(path):
try:
old = pickle.load(open(path, 'rb'))
return old
except:
print("creating new filter")
return cuckoopy.CuckooFilter(10000)
thanks for creating the library. i've been using a bloom filter, but need the ability to delete items. how would you recommend saving the filter to disk to preserve state over time? bloom_live has a tofile() method, but I don't see a similar option here. pickle the object?
i have tried pickling the object to a file and later reading it back in. There don't seem to be any issues with the write or load, but the reloaded filter doesn't recognize the objects it is supposed to contain. that is, the length of the filter is correct, but the contains() method will return false for any items i know are in there. running something like the below repeatedly inserts the item in the filter.
`def load_cuckoo_filter(path):
try:
old = pickle.load(open(path, 'rb'))
return old
except:
print("creating new filter")
return cuckoopy.CuckooFilter(10000)
def write_cuckoo_filter(filter, path):
pickle.dump(filter, open(path, 'wb'))
return
def main():
data = load('cuckoo.out')
if data.contains('a'):
print("data contains a")
else:
data.insert('a')
write_cuckoo_filter(data, 'cuckoo.out')
`
The text was updated successfully, but these errors were encountered: