@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && other.getClass() == this.getClass()) { JavaScriptAggregatorFactory castedOther = (JavaScriptAggregatorFactory) other; if (this.fnCombine.equals(castedOther.fnCombine) && this.fnReset.equals(castedOther.fnReset)) { return getCombiningFactory(); } } throw new AggregatorFactoryNotMergeableException(this, other); }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && this.getClass() == other.getClass()) { return getCombiningFactory(); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && this.getClass() == other.getClass()) { return getCombiningFactory(); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && this.getClass() == other.getClass()) { return getCombiningFactory(); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && this.getClass() == other.getClass()) { return getCombiningFactory(); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && this.getClass() == other.getClass()) { return getCombiningFactory(); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && other instanceof DoublesSketchAggregatorFactory) { // DoublesUnion supports inputs with different k. // The result will have effective k between the specified k and the minimum k from all input sketches // to achieve higher accuracy as much as possible. return new DoublesSketchMergeAggregatorFactory(name, Math.max(k, ((DoublesSketchAggregatorFactory) other).k)); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && other instanceof ApproximateHistogramAggregatorFactory) { ApproximateHistogramAggregatorFactory castedOther = (ApproximateHistogramAggregatorFactory) other; return new ApproximateHistogramFoldingAggregatorFactory( name, name, Math.max(resolution, castedOther.resolution), numBuckets, Math.min(lowerLimit, castedOther.lowerLimit), Math.max(upperLimit, castedOther.upperLimit) ); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (Objects.equals(getName(), other.getName()) && other instanceof VarianceAggregatorFactory) { return getCombiningFactory(); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && other instanceof SketchMergeAggregatorFactory) { SketchMergeAggregatorFactory castedOther = (SketchMergeAggregatorFactory) other; return new SketchMergeAggregatorFactory( name, name, Math.max(size, castedOther.size), shouldFinalize, false, errorBoundsStdDev ); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
/** * Returns an AggregatorFactory that can be used to merge the output of aggregators from this factory and * other factory. * This method is relevant only for AggregatorFactory which can be used at ingestion time. * * @return a new Factory that can be used for merging the output of aggregators from this factory and other. */ public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { final AggregatorFactory combiningFactory = this.getCombiningFactory(); if (other.getName().equals(this.getName()) && combiningFactory.equals(other.getCombiningFactory())) { return combiningFactory; } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && other.getClass() == this.getClass()) { JavaScriptAggregatorFactory castedOther = (JavaScriptAggregatorFactory) other; if (this.fnCombine.equals(castedOther.fnCombine) && this.fnReset.equals(castedOther.fnReset)) { return getCombiningFactory(); } } throw new AggregatorFactoryNotMergeableException(this, other); }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && this.getClass() == other.getClass()) { return getCombiningFactory(); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && this.getClass() == other.getClass()) { return getCombiningFactory(); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && this.getClass() == other.getClass()) { return getCombiningFactory(); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && this.getClass() == other.getClass()) { return getCombiningFactory(); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && other instanceof DoublesSketchAggregatorFactory) { // DoublesUnion supports inputs with different k. // The result will have effective k between the specified k and the minimum k from all input sketches // to achieve higher accuracy as much as possible. return new DoublesSketchMergeAggregatorFactory(name, Math.max(k, ((DoublesSketchAggregatorFactory) other).k)); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && other instanceof ApproximateHistogramAggregatorFactory) { ApproximateHistogramAggregatorFactory castedOther = (ApproximateHistogramAggregatorFactory) other; return new ApproximateHistogramFoldingAggregatorFactory( name, name, Math.max(resolution, castedOther.resolution), numBuckets, Math.min(lowerLimit, castedOther.lowerLimit), Math.max(upperLimit, castedOther.upperLimit) ); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
@Override public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { if (other.getName().equals(this.getName()) && other instanceof SketchMergeAggregatorFactory) { SketchMergeAggregatorFactory castedOther = (SketchMergeAggregatorFactory) other; return new SketchMergeAggregatorFactory( name, name, Math.max(size, castedOther.size), shouldFinalize, false, errorBoundsStdDev ); } else { throw new AggregatorFactoryNotMergeableException(this, other); } }
/** * Returns an AggregatorFactory that can be used to merge the output of aggregators from this factory and * other factory. * This method is relevant only for AggregatorFactory which can be used at ingestion time. * * @return a new Factory that can be used for merging the output of aggregators from this factory and other. */ public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException { final AggregatorFactory combiningFactory = this.getCombiningFactory(); if (other.getName().equals(this.getName()) && combiningFactory.equals(other.getCombiningFactory())) { return combiningFactory; } else { throw new AggregatorFactoryNotMergeableException(this, other); } }