Jackie-Jiang commented on code in PR #15526:
URL: https://github.com/apache/pinot/pull/15526#discussion_r2074186208
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/forward/ForwardIndexReaderFactory.java:
##########
@@ -68,10 +68,33 @@ public static ForwardIndexReaderFactory getInstance() {
protected ForwardIndexReader createIndexReader(PinotDataBuffer dataBuffer,
ColumnMetadata metadata,
ForwardIndexConfig indexConfig)
throws IndexReaderConstraintException {
+ if (indexConfig != null &&
indexConfig.getConfigs().containsKey(ForwardIndexType.FORWARD_INDEX_READER_CLASS_NAME))
{
+ String className =
indexConfig.getConfigs().get(ForwardIndexType.FORWARD_INDEX_READER_CLASS_NAME).toString();
+ try {
+ return (ForwardIndexReader)
Class.forName(className).getConstructor(PinotDataBuffer.class,
ColumnMetadata.class)
+ .newInstance(dataBuffer, metadata);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to create ForwardIndexReader", e);
+ }
+ }
+ return createIndexReader(dataBuffer, metadata);
+ }
+
+ public static ForwardIndexReader createIndexReader(PinotDataBuffer
dataBuffer, ForwardIndexConfig indexConfig,
Review Comment:
I think we can just remove the `static` one and always use
`ForwardIndexReaderFactory.getInstance().createIndexReader()`
--
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]