[ML] Convert std::shared_ptrs to std::unique_ptrs where possible #115
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As originally implemented in #108, the fix for
m_Exemplar
being null after restore relied on writing additional state. This fails if the fix is present on master and not 6.4: elastic/elasticsearch#30982. In fact, this doesn't need to be fixed by modifying the state we write, instead we can just as well pass this into the restore constructor.In the first commit this reapplies #108, which I reverted from master. In the second I've implemented the alternative fix. This commit is therefore the only one which needs reviewing.
Just to reiterate, the affects on results should be small:
CNaiveBayes
. This code isn't released, but as it is the exemplar would wind up null after a persist and restore. This is then a crash waiting to happen: since we'll try and clone it if we get a new (classification) class down the road.