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

Feature: Add the ability to save internal state #4

Open
daxbert opened this issue Jul 18, 2016 · 0 comments
Open

Feature: Add the ability to save internal state #4

daxbert opened this issue Jul 18, 2016 · 0 comments

Comments

@daxbert
Copy link

daxbert commented Jul 18, 2016

The current implementation doesn't allow the internal state to be saved and later restored.

I'm proposing adding the following to TDigest:

  • load function ( takes object typically achieved via JSON.parse )
  • traverse function ( to traverse the centroid binary tree )
  • _insert_centroid ( to allow direct insertion )

"saving" will be accomplished via JSON.stringify ( tdObject )

I'll be forking this repo and doing the above shortly.

daxbert pushed a commit to daxbert/tdigest that referenced this issue Jul 18, 2016
* added _traverse private method
    walks the binary tree calling _insert_centroid on each data node

* added _insert_centroid private method
    simply inserts an existing object into the tree

* added public load method
    takes an object and re-initializes state from that object
daxbert added a commit to daxbert/tdigest that referenced this issue Jul 18, 2016
Issue-welch#4: Add support for saving state
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