Yunyung commented on code in PR #19068: URL: https://github.com/apache/kafka/pull/19068#discussion_r2021366719
########## core/src/main/scala/kafka/server/ClientQuotaManager.scala: ########## @@ -137,23 +138,30 @@ object ClientQuotaManager { * @param quotaType Quota type of this quota manager * @param time @Time object to use * @param threadNamePrefix The thread prefix to use - * @param clientQuotaCallback An optional @ClientQuotaCallback + * @param clientQuotaCallbackPlugin An optional @ClientQuotaCallback and + * wrap it in a {@link org.apache.kafka.common.internals.Plugin} */ class ClientQuotaManager(private val config: ClientQuotaManagerConfig, private val metrics: Metrics, private val quotaType: QuotaType, private val time: Time, private val threadNamePrefix: String, - private val clientQuotaCallback: Option[ClientQuotaCallback] = None) extends Logging { + private val clientQuotaCallbackPlugin: Option[Plugin[ClientQuotaCallback]] = None) extends Logging { private val lock = new ReentrantReadWriteLock() private val sensorAccessor = new SensorAccess(lock, metrics) - private val quotaCallback = clientQuotaCallback.getOrElse(new DefaultQuotaCallback) + private val quotaCallback = clientQuotaCallbackPlugin match { + case Some(plugin) => plugin.get() + case None => new DefaultQuotaCallback + } private val clientQuotaType = QuotaType.toClientQuotaType(quotaType) @volatile - private var quotaTypesEnabled = clientQuotaCallback match { - case Some(_) => QuotaTypes.CustomQuotas + private var quotaTypesEnabled = clientQuotaCallbackPlugin match { + case Some(plugin) => if (plugin.get() == null) Review Comment: Follow the line change 154 https://github.com/apache/kafka/pull/19068#discussion_r2018507516, is plugin.get() i.e., clientQuotaCallback could be null? -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org