forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add method to check if object is generically writeable in stream
When calling scripts in metric aggregation, the returned metric state is passed along to the coordinating node to do the final reduce. However, it is possible the object could contain nested state which is unknown to StreamOutput/StreamInput. This would then result in the node crashing as exceptions are not expected in the middle of serialization. This commit adds a method to StreamOutput that can determine if an object is writeable by the stream. It uses the same logic writeGenericValue, special casing each of the supported collection types to recursively determine if each contained value is itself writeable. relates elastic#54708
- Loading branch information
Showing
2 changed files
with
51 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters