Make Filter.getBitmapResult() abstract (#4481)

This commit is contained in:
Roman Leventov 2017-07-11 22:39:32 +03:00 committed by Slim
parent 6d2df2a542
commit ad76f7a1ab
1 changed files with 3 additions and 10 deletions

View File

@ -25,12 +25,6 @@ import io.druid.query.DefaultBitmapResultFactory;
import io.druid.segment.ColumnSelector; import io.druid.segment.ColumnSelector;
import io.druid.segment.ColumnSelectorFactory; import io.druid.segment.ColumnSelectorFactory;
/**
* {@link #getBitmapIndex} and {@link #getBitmapResult} methods both have default implementations, delegating to each
* other. Every implementation of {@link Filter} should override {@link #getBitmapResult}, currently it has a default
* implementation for compatibility with Filters in extensions. In Druid 0.11 {@link #getBitmapResult} is going to
* become an abstract method without a default implementation.
*/
public interface Filter public interface Filter
{ {
/** /**
@ -38,6 +32,8 @@ public interface Filter
* {@link #supportsBitmapIndex(BitmapIndexSelector)} returns true. Behavior in the case that * {@link #supportsBitmapIndex(BitmapIndexSelector)} returns true. Behavior in the case that
* {@link #supportsBitmapIndex(BitmapIndexSelector)} returns false is undefined. * {@link #supportsBitmapIndex(BitmapIndexSelector)} returns false is undefined.
* *
* This method is OK to be called, but generally should not be overridden, override {@link #getBitmapResult} instead.
*
* @param selector Object used to retrieve bitmap indexes * @param selector Object used to retrieve bitmap indexes
* *
* @return A bitmap indicating rows that match this filter. * @return A bitmap indicating rows that match this filter.
@ -60,10 +56,7 @@ public interface Filter
* *
* @see Filter#estimateSelectivity(BitmapIndexSelector) * @see Filter#estimateSelectivity(BitmapIndexSelector)
*/ */
default <T> T getBitmapResult(BitmapIndexSelector selector, BitmapResultFactory<T> bitmapResultFactory) <T> T getBitmapResult(BitmapIndexSelector selector, BitmapResultFactory<T> bitmapResultFactory);
{
return bitmapResultFactory.wrapUnknown(getBitmapIndex(selector));
}
/** /**
* Estimate selectivity of this filter. * Estimate selectivity of this filter.