deeppatel710 commented on code in PR #18127:
URL: https://github.com/apache/pinot/pull/18127#discussion_r3069186481
##########
pinot-controller/src/main/java/org/apache/pinot/controller/validation/RealtimeOffsetAutoResetManager.java:
##########
@@ -214,13 +215,11 @@ private RealtimeOffsetAutoResetHandler
getOrConstructHandler(TableConfig tableCo
try {
Class<?> clazz = Class.forName(className);
if (!RealtimeOffsetAutoResetHandler.class.isAssignableFrom(clazz)) {
- String exceptionMessage = "Custom analyzer must be a child of "
- + RealtimeOffsetAutoResetHandler.class.getCanonicalName();
- throw new ReflectiveOperationException(exceptionMessage);
+ throw new ReflectiveOperationException("Custom handler must implement "
+ + RealtimeOffsetAutoResetHandler.class.getCanonicalName());
}
- handler = (RealtimeOffsetAutoResetHandler) clazz.getConstructor(
- PinotLLCRealtimeSegmentManager.class,
PinotHelixResourceManager.class).newInstance(
- _llcRealtimeSegmentManager, _pinotHelixResourceManager);
+ handler = (RealtimeOffsetAutoResetHandler)
clazz.getConstructor().newInstance();
Review Comment:
@xiangfu0 Thanks for catching this! You're right — the loading change would
break existing handlers that only have the 2-arg constructor.
Fix: getOrConstructHandler() now tries the new no-arg + init() pattern
first, and falls back to the deprecated 2-arg constructor (with a WARN log
prompting migration) if no no-arg constructor is found.
RealtimeOffsetAutoResetKafkaHandler also has the 2-arg constructor
restored as @Deprecated so existing subclasses remain source-compatible. Added
a test that exercises this fallback path end-to-end.
--
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]