xiangfu0 commented on code in PR #20112:
URL: https://github.com/apache/pinot/pull/20112#discussion_r4486121113
##########
pinot-plugins/pinot-stream-ingestion/pinot-kafka-base/src/main/java/org/apache/pinot/plugin/stream/kafka/KafkaConfigUtils.java:
##########
@@ -48,15 +59,94 @@ private KafkaConfigUtils() {
public static Properties filterAndValidateKafkaProperties(Properties
properties, Set<String> validConfigNames) {
Properties filteredProperties = new Properties();
for (String key : properties.stringPropertyNames()) {
- if (validConfigNames.contains(key) ||
key.equals(AbstractConfig.CONFIG_PROVIDERS_CONFIG)
+ if (validConfigNames.contains(key) ||
(key.equals(AUTO_INCLUDE_JMX_REPORTER_CONFIG)
+ &&
validConfigNames.contains(CommonClientConfigs.METRIC_REPORTER_CLASSES_CONFIG))
+ || key.equals(AbstractConfig.CONFIG_PROVIDERS_CONFIG)
|| key.startsWith(CONFIG_PROVIDERS_PREFIX)) {
filteredProperties.put(key, properties.get(key));
}
}
validateConfigProviderReferences(filteredProperties);
+ normalizeLegacyProperties(filteredProperties);
return filteredProperties;
}
+ private static void normalizeLegacyProperties(Properties properties) {
+ boolean hasJmxSettings =
properties.containsKey(AUTO_INCLUDE_JMX_REPORTER_CONFIG)
+ ||
properties.containsKey(CommonClientConfigs.METRIC_REPORTER_CLASSES_CONFIG);
+ List<String> compatibilityKeys = new ArrayList<>();
Review Comment:
Fixed in 10fe73e086. Reused one immutable list of the three compatibility
keys and extracted JMX/OAuth helpers. The flow now resolves restricted
references, normalizes JMX under its presence guard, then normalizes OAuth.
Provider validation, copy semantics and default/explicit-false JMX behavior are
preserved; all 28 configuration cases pass.
##########
pinot-spi/src/main/java/org/apache/pinot/spi/plugin/PluginManager.java:
##########
@@ -228,7 +233,8 @@ public HashMap<String, File> getPluginsToLoad(String
pluginsDirectories, String
FileUtils.listFiles(new File(pluginsDirectory), new
String[]{JAR_FILE_EXTENSION}, true);
List<String> pluginsToLoad = null;
if (!StringUtils.isEmpty(pluginsInclude)) {
Review Comment:
Fixed in 10fe73e086. The configured include list is now split and
alias-resolved once before the directory loop, then reused across directories.
First matching directory selection and historical Kafka include names are
preserved. All 36 PluginManager cases pass.
##########
pinot-spi/src/main/java/org/apache/pinot/spi/plugin/PluginManager.java:
##########
@@ -526,6 +534,26 @@ public void registerRecordReaderClass(String inputFormat,
String recordReaderCla
}
}
+ private String getBackwardCompatiblePluginName(String pluginName) {
+ return _backwardCompatiblePluginNames.getOrDefault(pluginName, pluginName);
+ }
+
+ /// Registers a direct alias for a renamed plugin, including
`plugins.include` and plugin-qualified class names.
+ /// Call during bootstrap, before creating plugin instances. If eager
initialization already skipped the replacement
+ /// because only the old name was included, loads that replacement now.
Repeated registration is harmless.
+ public synchronized void registerBackwardCompatiblePluginName(String
oldPluginName, String newPluginName) {
+ String previousName = _backwardCompatiblePluginNames.put(oldPluginName,
newPluginName);
+ if (newPluginName.equals(previousName) ||
StringUtils.isEmpty(_pluginsDirectories)
Review Comment:
Fixed in 10fe73e086. Kept the synchronized public registration API and
extracted loadReplacementPluginIfNeeded. The unchanged-mapping,
configured-include and already-loaded guard groups are separate; the subsequent
scan/load still recovers replacements skipped by eager initialization.
Concurrent maps and late-loading coverage are retained; all 36 PluginManager
cases pass.
--
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]