jolshan commented on code in PR #15685:
URL: https://github.com/apache/kafka/pull/15685#discussion_r1594884853


##########
server-common/src/main/java/org/apache/kafka/server/common/FeatureVersion.java:
##########
@@ -0,0 +1,110 @@
+/*
+ * 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 org.apache.kafka.server.common;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Optional;
+
+/**
+ * This is an interface for the various features implemented for Kafka 
clusters.
+ * KIP-584: Versioning Scheme for Features introduced the idea of various 
features, but only added one feature -- MetadataVersion.
+ * KIP-1022: Formatting and Updating Features allowed for more features to be 
added. In order to set and update features,
+ * they need to be specified via the StorageTool or FeatureCommand tools.
+ * <br>
+ * Having a unified interface for the features that will use a shared type in 
the API used to set and update them
+ * makes it easier to process these features.
+ */
+public interface FeatureVersion {
+
+    /**
+     * Features currently used in production. If a feature is included in this 
list, it will also be specified when
+     * formatting a cluster via the StorageTool. MetadataVersion is handled 
separately, so it is not included here.
+     *
+     * When a feature is added here, make sure it has a mapping in {@link 
#defaultValue} and {@link #createFeature}.
+     * See {@link TestFeatureVersion} as an example.
+     */
+    List<String> PRODUCTION_FEATURES = Arrays.asList();

Review Comment:
   I can take a look at that approach. One thing that I tried to do is get the 
existing MetadataVersion to implement the interface. It is already defined as 
an enum though. Maybe though if we think it is not worthwhile to include 
MetadataVersion in this set, we can design something from the ground up that is 
less clunky.



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