leventov commented on a change in pull request #7925: Use 
ComplexMetrics.registerSerde() across the codebase
URL: https://github.com/apache/incubator-druid/pull/7925#discussion_r297073182
 
 

 ##########
 File path: 
processing/src/main/java/org/apache/druid/segment/serde/ComplexMetrics.java
 ##########
 @@ -37,11 +38,13 @@ public static ComplexMetricSerde getSerdeForType(String 
type)
     return complexSerializers.get(type);
   }
 
-  public static void registerSerde(String type, ComplexMetricSerde serde)
+  public static void registerSerde(String type, Supplier<ComplexMetricSerde> 
serdeSupplier)
   {
-    if (complexSerializers.containsKey(type)) {
-      throw new ISE("Serializer for type[%s] already exists.", type);
+    if (ComplexMetrics.getSerdeForType(type) == null) {
+      if (complexSerializers.containsKey(type)) {
 
 Review comment:
   I think failure is better than silent behavior. I've created #7959 about 
this.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to