Skip to content
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

Need a resizable mapping table #45

Open
wangziqi2013 opened this issue Aug 1, 2016 · 0 comments
Open

Need a resizable mapping table #45

wangziqi2013 opened this issue Aug 1, 2016 · 0 comments

Comments

@wangziqi2013
Copy link
Owner

Currently the mapping table is just a huge fix sized array built into BwTree object (which makes a super heavy object). If NodeID overflows then the entire data structure must be rebuilt with a larger mapping table

This design is not acceptable if the key number grows indefinitely without an upper bound. One alternative would be to use a stack of fixed sized arrays as the mapping table. NodeIDs are dispatched to arrays based on their higher bits, and locates their own slots based on lower bits. When NodeID overflows, the thread just allocate a new fixed sized array and push it into the stack to extend the mapping table. This needs to be done also atomically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant