cmccabe commented on a change in pull request #11677:
URL: https://github.com/apache/kafka/pull/11677#discussion_r784440277



##########
File path: 
core/src/main/scala/kafka/server/metadata/MetadataVersionManager.scala
##########
@@ -0,0 +1,104 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package kafka.server.metadata
+
+import kafka.utils.Logging
+import org.apache.kafka.common.utils.LogContext
+import org.apache.kafka.metadata.{MetadataVersionProvider, MetadataVersions}
+
+import scala.collection.mutable
+
+
+/**
+ * This class holds the broker's view of the current metadata.version. 
Listeners can be registered with this class to
+ * get a synchronous callback when version has changed.
+ */
+class MetadataVersionManager extends MetadataVersionProvider with Logging {

Review comment:
       I don't think this should be a Scala class because non-scala code may 
need to use it.
   
   I also think we'll need some way to integrate this with IBP so that only one 
thing has to be checked. We don't want two "if statements" every time we're 
checking for IBP.
   
   Another question is whether we want some kind of callback framework where 
objects can register to know when IBP changes. It's more complicated but the 
performance could be higher than checking a volatile all the time.




-- 
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


Reply via email to