-
Notifications
You must be signed in to change notification settings - Fork 36
fix detector and feature serialization #322
fix detector and feature serialization #322
Conversation
Codecov Report
@@ Coverage Diff @@
## master #322 +/- ##
============================================
+ Coverage 72.11% 72.92% +0.80%
- Complexity 1985 2000 +15
============================================
Files 201 201
Lines 9558 9563 +5
Branches 850 852 +2
============================================
+ Hits 6893 6974 +81
+ Misses 2256 2176 -80
- Partials 409 413 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
if (input.readBoolean()) { | ||
this.user = new User(input); | ||
} else { | ||
user = null; | ||
} | ||
if (input.readBoolean()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious: why readBoolean
being true indicates uiMetadata can be read from readMap()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We write true if uiMetadata is not null in the writeTo method: check https://github.com/opendistro-for-elasticsearch/anomaly-detection/pull/322/files#diff-ab4bf6eb04e845b21b1182e30afb84c73b282bae5cc26dbcfef2e846211bcdecR248
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for change Yaliang!
Issue #, if available:
Description of changes:
Detector and feature serialization has issue, see such error:
Changes
This PR fixed serialization of anomaly detector and feature by writing to and reading from stream.
Test
1.Add unit test cases for serialization of anomaly detector and feature
2.
./gradlew build
pass3.
./gradlew run
and testBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.