You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ch...@apache.org on 2024/08/15 10:59:46 UTC

(kafka) branch trunk updated: KAFKA-17326 The LIST_OFFSET request is removed from the "Api Keys" page (#16870)

This is an automated email from the ASF dual-hosted git repository.

chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new b767c655279 KAFKA-17326 The LIST_OFFSET request is removed from the "Api Keys" page (#16870)
b767c655279 is described below

commit b767c655279083c0a7e958e3f319fe2cead13ddc
Author: Ken Huang <s7...@gmail.com>
AuthorDate: Thu Aug 15 18:59:38 2024 +0800

    KAFKA-17326 The LIST_OFFSET request is removed from the "Api Keys" page (#16870)
    
    Reviewers: Chia-Ping Tsai <ch...@gmail.com>
---
 clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java | 2 +-
 .../src/test/java/org/apache/kafka/common/protocol/ApiKeysTest.java | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java b/clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java
index e8d35f93f5b..e95882be699 100644
--- a/clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java
+++ b/clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java
@@ -286,7 +286,7 @@ public enum ApiKeys {
         b.append("<th>Key</th>\n");
         b.append("</tr>");
         clientApis().stream()
-            .filter(apiKey -> !apiKey.messageType.latestVersionUnstable())
+            .filter(apiKey -> apiKey.toApiVersion(false).isPresent())
             .forEach(apiKey -> {
                 b.append("<tr>\n");
                 b.append("<td>");
diff --git a/clients/src/test/java/org/apache/kafka/common/protocol/ApiKeysTest.java b/clients/src/test/java/org/apache/kafka/common/protocol/ApiKeysTest.java
index f3e725a6e54..a4b785a908f 100644
--- a/clients/src/test/java/org/apache/kafka/common/protocol/ApiKeysTest.java
+++ b/clients/src/test/java/org/apache/kafka/common/protocol/ApiKeysTest.java
@@ -92,10 +92,10 @@ public class ApiKeysTest {
     public void testHtmlOnlyHaveStableApi() {
         String html = ApiKeys.toHtml();
         for (ApiKeys apiKeys : ApiKeys.clientApis()) {
-            if (apiKeys.messageType.latestVersionUnstable()) {
-                assertFalse(html.contains("The_Messages_" + apiKeys.name), "Html should not contain unstable api: " + apiKeys.name);
-            } else {
+            if (apiKeys.toApiVersion(false).isPresent()) {
                 assertTrue(html.contains("The_Messages_" + apiKeys.name), "Html should contain stable api: " + apiKeys.name);
+            } else {
+                assertFalse(html.contains("The_Messages_" + apiKeys.name), "Html should not contain unstable api: " + apiKeys.name);
             }
         }
     }