Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions processing/src/main/java/io/druid/query/filter/Filter.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,15 @@
import io.druid.segment.ColumnSelector;
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
{
/**
* Get a bitmap index, indicating rows that match this filter. Do not call this method unless
* {@link #supportsBitmapIndex(BitmapIndexSelector)} returns true. Behavior in the case that
* {@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
*
* @return A bitmap indicating rows that match this filter.
Expand All @@ -60,10 +56,7 @@ default ImmutableBitmap getBitmapIndex(BitmapIndexSelector selector)
*
* @see Filter#estimateSelectivity(BitmapIndexSelector)
*/
default <T> T getBitmapResult(BitmapIndexSelector selector, BitmapResultFactory<T> bitmapResultFactory)
{
return bitmapResultFactory.wrapUnknown(getBitmapIndex(selector));
}
<T> T getBitmapResult(BitmapIndexSelector selector, BitmapResultFactory<T> bitmapResultFactory);

/**
* Estimate selectivity of this filter.
Expand Down