clintropolis commented on code in PR #16039:
URL: https://github.com/apache/druid/pull/16039#discussion_r1534864533


##########
processing/src/main/java/org/apache/druid/segment/index/semantic/ValueSetIndexes.java:
##########
@@ -0,0 +1,273 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.segment.index.semantic;
+
+import com.google.common.base.Supplier;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.PeekingIterator;
+import org.apache.druid.collections.bitmap.BitmapFactory;
+import org.apache.druid.collections.bitmap.ImmutableBitmap;
+import org.apache.druid.segment.column.TypeSignature;
+import org.apache.druid.segment.column.ValueType;
+import org.apache.druid.segment.data.Indexed;
+import org.apache.druid.segment.index.BitmapColumnIndex;
+import 
org.apache.druid.segment.index.SimpleImmutableBitmapDelegatingIterableIndex;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+
+public interface ValueSetIndexes
+{
+  double SORTED_MERGE_RATIO_THRESHOLD = 0.12D;
+  int SIZE_WORTH_CHECKING_MIN = 8;
+
+  /**
+   * Get the wrapped {@link ImmutableBitmap} corresponding to the specified 
set of values (if they are contained in the
+   * underlying column). The set must be sorted using the comparator of the 
supplied matchValueType.
+   *
+   * @param sortedValues   values to match, sorted in matchValueType order
+   * @param matchValueType type of the value to match, used to assist 
conversion from the match value type to the column
+   *                       value type
+   * @return               {@link ImmutableBitmap} corresponding to the rows 
which match the values, or null if an index
+   *                       connot be computed for the supplied value type
+   */
+  @Nullable
+  BitmapColumnIndex forSortedValues(@Nonnull List<?> sortedValues, 
TypeSignature<ValueType> matchValueType);
+
+  static <T> BitmapColumnIndex getIndexFromSortedIteratorSortedMerged(

Review Comment:
   renamed stuff and added javadocs to explain the relation between these three 
functions and when to use them



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to