@Override public int getMaxIntermediateSize() { return delegate.getMaxIntermediateSize(); }
/** * Returns the maximum size that this aggregator will require in bytes for intermediate storage of results. * Implementations of {@link AggregatorFactory} which need to Support Nullable Aggregations are encouraged * to extend {@link NullableAggregatorFactory} instead of overriding this method. * Default implementation calls {@link #makeAggregateCombiner()} for backwards compatibility. * * @return the maximum number of bytes that an aggregator of this type will require for intermediate result storage. */ public int getMaxIntermediateSizeWithNulls() { return getMaxIntermediateSize(); }
@Test public void testStringLastBufferAggregator() { BufferAggregator agg = stringLastAggFactory.factorizeBuffered( colSelectorFactory); ByteBuffer buffer = ByteBuffer.wrap(new byte[stringLastAggFactory.getMaxIntermediateSize()]); agg.init(buffer, 0); aggregate(agg, buffer, 0); aggregate(agg, buffer, 0); aggregate(agg, buffer, 0); aggregate(agg, buffer, 0); Pair<Long, String> result = (Pair<Long, String>) agg.get(buffer, 0); Assert.assertEquals(strings[0], result.rhs); }
@Test public void testStringLastBufferAggregator() { BufferAggregator agg = stringLastAggFactory.factorizeBuffered( colSelectorFactory); ByteBuffer buffer = ByteBuffer.wrap(new byte[stringLastAggFactory.getMaxIntermediateSize()]); agg.init(buffer, 0); aggregate(agg, buffer, 0); aggregate(agg, buffer, 0); aggregate(agg, buffer, 0); aggregate(agg, buffer, 0); Pair<Long, String> result = (Pair<Long, String>) agg.get(buffer, 0); Assert.assertEquals(strings[2], result.rhs); }
@Test public void testStringLastCombiningBufferAggregator() { BufferAggregator agg = combiningAggFactory.factorizeBuffered( colSelectorFactory); ByteBuffer buffer = ByteBuffer.wrap(new byte[stringLastAggFactory.getMaxIntermediateSize()]); agg.init(buffer, 0); aggregate(agg, buffer, 0); aggregate(agg, buffer, 0); aggregate(agg, buffer, 0); aggregate(agg, buffer, 0); Pair<Long, String> result = (Pair<Long, String>) agg.get(buffer, 0); Pair<Long, String> expected = pairs[2]; Assert.assertEquals(expected.lhs, result.lhs); Assert.assertEquals(expected.rhs, result.rhs); }
@Test public void testStringFirstCombiningBufferAggregator() { BufferAggregator agg = combiningAggFactory.factorizeBuffered( colSelectorFactory); ByteBuffer buffer = ByteBuffer.wrap(new byte[stringLastAggFactory.getMaxIntermediateSize()]); agg.init(buffer, 0); aggregate(agg, buffer, 0); aggregate(agg, buffer, 0); aggregate(agg, buffer, 0); aggregate(agg, buffer, 0); Pair<Long, String> result = (Pair<Long, String>) agg.get(buffer, 0); Pair<Long, String> expected = pairs[3]; Assert.assertEquals(expected.lhs, result.lhs); Assert.assertEquals(expected.rhs, result.rhs); }
/** * Returns the maximum size that this aggregator will require in bytes for intermediate storage of results. * Implementations of {@link AggregatorFactory} which need to Support Nullable Aggregations are encouraged * to extend {@link NullableAggregatorFactory} instead of overriding this method. * Default implementation calls {@link #makeAggregateCombiner()} for backwards compatibility. * * @return the maximum number of bytes that an aggregator of this type will require for intermediate result storage. */ public int getMaxIntermediateSizeWithNulls() { return getMaxIntermediateSize(); }
@Override public int getMaxIntermediateSize() { return delegate.getMaxIntermediateSize(); }