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/22 05:36:41 UTC

[GitHub] [incubator-druid] Fokko commented on a change in pull request #7925: Use ComplexMetrics.registerSerde() across the codebase

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

 ##########
 File path: benchmarks/src/main/java/org/apache/druid/benchmark/FilterPartitionBenchmark.java
 ##########
 @@ -149,9 +149,7 @@ public void setup() throws IOException
   {
     log.info("SETUP CALLED AT " + System.currentTimeMillis());
 
-    if (ComplexMetrics.getSerdeForType("hyperUnique") == null) {
-      ComplexMetrics.registerSerde("hyperUnique", new HyperUniquesSerde(HyperLogLogHash.getDefault()));
-    }
+    ComplexMetrics.registerSerde("hyperUnique", () -> new HyperUniquesSerde(HyperLogLogHash.getDefault()));
 
 Review comment:
   I would create a constant for `hyperUnique` to avoid typo's. Similar to the `THETA_SKETCH`.

----------------------------------------------------------------
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