saurabhd336 commented on code in PR #10184:
URL: https://github.com/apache/pinot/pull/10184#discussion_r1153012256
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/nullvalue/NullValueVectorCreator.java:
##########
@@ -19,23 +19,44 @@
package org.apache.pinot.segment.local.segment.creator.impl.nullvalue;
import com.google.common.annotations.VisibleForTesting;
-import java.io.Closeable;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import org.apache.pinot.segment.spi.V1Constants;
+import org.apache.pinot.segment.spi.index.IndexCreator;
import org.roaringbitmap.buffer.ImmutableRoaringBitmap;
import org.roaringbitmap.buffer.MutableRoaringBitmap;
/**
* Used to persist the null bitmap on disk. This is used by SegmentCreator
while indexing rows.
+ *
+ * Although this class implements {@link IndexCreator}, it is not intended to
be used as a normal IndexCreator.
+ * Specifically, neither {@link #add(Object, int)} or {@link #add(Object[],
int[])} should be called on this object.
+ * In order to make sure these methods are not being called, they throw
exceptions in this class.
+ *
+ * This requirement is a corollary from the fact that the {@link IndexCreator}
contract assumes the value will never be
+ * null, which is true for all index creators types unless this one.
*/
-public class NullValueVectorCreator implements Closeable {
+public class NullValueVectorCreator implements IndexCreator {
private final MutableRoaringBitmap _nullBitmap = new MutableRoaringBitmap();
private final File _nullValueVectorFile;
+ @Override
+ public void add(@Nonnull Object value, int dictId)
Review Comment:
Will it become usable if we had `add(Object value, int dictId, int docId)`
instead?
--
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]