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/01/15 11:04:31 UTC

[GitHub] leventov opened a new issue #6858: Free AggregatorFactory implementors from boilerplate in getMergingFactory()

leventov opened a new issue #6858: Free AggregatorFactory implementors from boilerplate in getMergingFactory()
URL: https://github.com/apache/incubator-druid/issues/6858
 
 
   Currently AggregatorFactory implementors should write code like the following themselves:
   ```java
   if (other.getName().equals(this.getName()) && other.getClass() == getClass()) {
     ...
   } else {
     throw new AggregatorFactoryNotMergeableException(...);
   }
   ```
   or
   ```java
   if (other.getName().equals(this.getName()) && other instanceof MyBaseAggregatorFactory) {
     ...
   } else {
     throw new AggregatorFactoryNotMergeableException(...);
   }
   ```
   
   if `MyBaseAggregatorFactory` is extended by other aggregator factory classes.
   
   It could be replaced by e. g. by adding a generic parameter `BaseMergeAggregatorFactory` to `AggregatorFactory` class; adding a method `Class<BaseMergeAggregatorFactory> getBaseMergeAggregatorFactory()` method; and changing the signature of `getMergeFactory()` to accept `BaseMergeAggregatorFactory` as the parameter.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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