Closed jxieeducation closed 10 years ago
Hey @jxieeducation thanks for the pull request, this looks promising! Sorry that I didn't reply faster, I'm really busy right now but will have a detailed look at your code until next week. Thanks for your contribution :)
Hey Jason, sorry for taking so much time to review this, I was really busy this months. So this looks much more promising than the other BTree implementation! I think what we need now is an implementation that supports the following methods implemented in blitzdb.backends.file.index.Index
:
add_key(attributes,store_key)
: Adds a store_key to the index, using attributes to index it.remove_key(store_key)
: Removes a store_key.get_keys_for(value)
: Retrieves all keys for a given attribute value.sort_keys(keys,order = 1)
: Sorts a list of keys in a given order.Let me know if you have any questions, I think your example goes in the right direction. It will probably a good idea to write tests for the Index
class as well so that we have a test suite we can develop against.
Hey @jxieeducation , I will close this PR for now, let me know if you have time to contribute to BlitzDB again, your help is highly appreciated :)
Here's a simple BTree implementation that I modified based on Teepark's BTree.
Current flaws with the BTree:
However, I think we can build on this to implement the backend index.