Search in sources :

Example 26 with RuntimeShapeInspector

use of org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector in project druid by druid-io.

the class AndFilter method makeMatcher.

private static ValueMatcher makeMatcher(final ValueMatcher[] baseMatchers) {
    Preconditions.checkState(baseMatchers.length > 0);
    if (baseMatchers.length == 1) {
        return baseMatchers[0];
    }
    return new ValueMatcher() {

        @Override
        public boolean matches() {
            for (ValueMatcher matcher : baseMatchers) {
                if (!matcher.matches()) {
                    return false;
                }
            }
            return true;
        }

        @Override
        public void inspectRuntimeShape(RuntimeShapeInspector inspector) {
            inspector.visit("firstBaseMatcher", baseMatchers[0]);
            inspector.visit("secondBaseMatcher", baseMatchers[1]);
        // Don't inspect the 3rd and all consequent baseMatchers, cut runtime shape combinations at this point.
        // Anyway if the filter is so complex, Hotspot won't inline all calls because of the inline limit.
        }
    };
}
Also used : VectorValueMatcher(org.apache.druid.query.filter.vector.VectorValueMatcher) ValueMatcher(org.apache.druid.query.filter.ValueMatcher) BaseVectorValueMatcher(org.apache.druid.query.filter.vector.BaseVectorValueMatcher) RuntimeShapeInspector(org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector)

Aggregations

RuntimeShapeInspector (org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector)26 ValueMatcher (org.apache.druid.query.filter.ValueMatcher)19 IndexedInts (org.apache.druid.segment.data.IndexedInts)11 BooleanValueMatcher (org.apache.druid.segment.filter.BooleanValueMatcher)8 Nullable (javax.annotation.Nullable)7 Predicate (com.google.common.base.Predicate)5 ArrayBasedIndexedInts (org.apache.druid.segment.data.ArrayBasedIndexedInts)5 BitSet (java.util.BitSet)4 IdLookup (org.apache.druid.segment.IdLookup)4 DimensionSpec (org.apache.druid.query.dimension.DimensionSpec)3 ColumnSelectorFactory (org.apache.druid.segment.ColumnSelectorFactory)3 ColumnHolder (org.apache.druid.segment.column.ColumnHolder)3 Test (org.junit.Test)3 InputRow (org.apache.druid.data.input.InputRow)2 MapBasedInputRow (org.apache.druid.data.input.MapBasedInputRow)2 ISE (org.apache.druid.java.util.common.ISE)2 ExtractionFn (org.apache.druid.query.extraction.ExtractionFn)2 AbstractDimensionSelector (org.apache.druid.segment.AbstractDimensionSelector)2 ColumnValueSelector (org.apache.druid.segment.ColumnValueSelector)2 RowBasedColumnSelectorFactory (org.apache.druid.segment.RowBasedColumnSelectorFactory)2