You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/06/27 23:34:39 UTC

[GitHub] [incubator-druid] clintropolis opened a new pull request #7985: fail complex type 'serde' registration when registered type does not match expected type

clintropolis opened a new pull request #7985: fail complex type 'serde' registration when registered type does not match expected type
URL: https://github.com/apache/incubator-druid/pull/7985
 
 
   Resolves #7959
   
   ### Description
   
   This PR modifies the behavior of `ComplexMetrics.registerSerde` to ensure that when a `ComplexMetricSerde` is already registered to a type string, that the existing type is the _expected_ type. This is done to confirm that the usages of complex type strings is a unique mapping to `ComplexMetricSerde` implementations, and triggering a failure otherwise. This is a change of the current behavior, which silently ignores registration when a `ComplexMetricSerde` is already registered to a type.
   
   This is done mechanically by passing the class of the registered `ComplexMetricSerde` type into the registration function. Perhaps there is a more elegant way to do this?
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [ ] ~added documentation for new or modified features or behaviors.~
   - [ ] ~added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.~
   - [ ] ~added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.~
   - [x] added unit tests or modified existing tests to cover new code paths.
   - [ ] ~added integration tests.~
   - [ ] ~been tested in a test Druid cluster.~

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org