Skip to content

Conversation

lvfangmin
Copy link
Contributor

Cache the approximate data tree size, and update it when txns applied to data tree, this could make this query not that expensive.

@anmolnar
Copy link
Contributor

anmolnar commented Aug 9, 2018

@lvfangmin I this is a very good improvement. Do you think that existing unit tests cover this functionality or it might be beneficial to add some?

@anmolnar
Copy link
Contributor

@lvfangmin
Copy link
Contributor Author

Thanks @anmolnar, I've updated the code to read the node.data inside the synchronized section. I'll check the Findbugs result for the updated patch.

@lvfangmin
Copy link
Contributor Author

@anmolnar the updated code has passed all the tests and no Findbugs warning.

@lvfangmin
Copy link
Contributor Author

@anmolnar I think this should be ready to go in now.

Copy link
Contributor

@anmolnar anmolnar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@asfgit asfgit closed this in 687ea7e Sep 4, 2018
@anmolnar
Copy link
Contributor

anmolnar commented Sep 4, 2018

Committed to master.
Thanks @lvfangmin !

RokLenarcic pushed a commit to RokLenarcic/zookeeper that referenced this pull request Sep 3, 2022
Cache the approximate data tree size, and update it when txns applied to data tree, this could make this query not that expensive.

Author: Fangmin Lyu <allenlyu@fb.com>

Reviewers: andor@apache.org

Closes apache#594 from lvfangmin/ZOOKEEPER-3116 and squashes the following commits:

ad2ce21 [Fangmin Lyu] move to synchronize when visiting node.data
2e0cbb1 [Fangmin Lyu] add test case to test cached approximate data tree size
21243f5 [Fangmin Lyu] cache the approximate data size in DataTree
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

Successfully merging this pull request may close these issues.

2 participants