concurrent-trees
concurrent-trees copied to clipboard
API method to clear all values in the tree
It'd be nice to have a clean way to prune a tree of all nodes, similar to Map.clear() Else it is not clear to the API user if it is enough/OK to set the tree to null.
Yes this could be feasible. It doesn't seem like a big deal. I'll consider adding this in a later release, thanks!
Thanks for the quick reply and for considering the little feature! And many thanks for the great implementation! Was quick to integrate and runs smoothly, search for partial keys works very fast, even for a large number of keys, like 240000.
So until then, is it enough to set the tree to null?
Niall Gallagher [email protected] schrieb am Mi., 28. Sep. 2016, 18:42:
Yes this could be feasible. It doesn't seem like a big deal. I'll consider adding this in a later release, thanks!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/npgall/concurrent-trees/issues/20#issuecomment-250224692, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYt2Gjk3NVfOT66T_13XtO91JNmCA_Tks5qupkMgaJpZM4KI0Jh .
By 'set the tree to null', do you mean to remove your application's reference to the RadixTree? If so then yes, that is enough to allow the entire tree to be garbage collected.
I was thinking about this issue a bit more, and I'm not 100% sure I would be able to implement a clear() method on the SuffixTree easily in a thread-safe manner. So I'll have to investigate this issue a bit more, to see what can be done.