You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by mi...@apache.org on 2023/04/17 12:59:43 UTC

[kafka] branch trunk updated: MINOR: Add JmxTool wrapper scripts and redirection (KIP-906) (#13195)

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

mimaison 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 57d6a881ca0 MINOR: Add JmxTool wrapper scripts and redirection (KIP-906) (#13195)
57d6a881ca0 is described below

commit 57d6a881ca00afc81f6df104e2c51161cf7de44a
Author: Federico Valeri <fe...@gmail.com>
AuthorDate: Mon Apr 17 14:59:35 2023 +0200

    MINOR: Add JmxTool wrapper scripts and redirection (KIP-906) (#13195)
    
    
    Reviewers: Mickael Maison <mi...@gmail.com>

, 
David Jacot <dj...@confluent.io>, Christo Lolov <ch...@gmail.com>, Alexandre Dupriez <al...@gmail.com>
---
 bin/kafka-jmx.sh                              | 17 ++++++++++++++
 bin/windows/kafka-jmx.bat                     | 17 ++++++++++++++
 core/src/main/scala/kafka/tools/JmxTool.scala | 29 +++++++++++++++++++++++
 docs/upgrade.html                             | 34 ++++++++++++++++-----------
 4 files changed, 83 insertions(+), 14 deletions(-)

diff --git a/bin/kafka-jmx.sh b/bin/kafka-jmx.sh
new file mode 100755
index 00000000000..88b387485de
--- /dev/null
+++ b/bin/kafka-jmx.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# 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.
+
+exec $(dirname $0)/kafka-run-class.sh org.apache.kafka.tools.JmxTool "$@"
diff --git a/bin/windows/kafka-jmx.bat b/bin/windows/kafka-jmx.bat
new file mode 100644
index 00000000000..72eb8faec9b
--- /dev/null
+++ b/bin/windows/kafka-jmx.bat
@@ -0,0 +1,17 @@
+@echo off
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+"%~dp0kafka-run-class.bat" org.apache.kafka.tools.JmxTool %*
diff --git a/core/src/main/scala/kafka/tools/JmxTool.scala b/core/src/main/scala/kafka/tools/JmxTool.scala
new file mode 100644
index 00000000000..90ffb510aed
--- /dev/null
+++ b/core/src/main/scala/kafka/tools/JmxTool.scala
@@ -0,0 +1,29 @@
+/*
+ * 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.tools
+
+@deprecated(since = "3.5")
+object JmxTool {
+  def main(args: Array[String]): Unit = {
+    println("WARNING: The 'kafka.tools' package is deprecated and will change to 'org.apache.kafka.tools' in the next major release.")
+    val toolClass = Class.forName("org.apache.kafka.tools.JmxTool")
+    val toolMethod = toolClass.getDeclaredMethod("main", classOf[Array[String]])
+    toolMethod.invoke(null, args)
+  }
+}
diff --git a/docs/upgrade.html b/docs/upgrade.html
index 4d979a02612..15ddca52078 100644
--- a/docs/upgrade.html
+++ b/docs/upgrade.html
@@ -19,20 +19,26 @@
 
 <script id="upgrade-template" type="text/x-handlebars-template">
 
-<h5><a id="upgrade_350_notable" href="#upgrade_350_notable">Notable changes in 3.5.0</a></h5>
-<ul>
-    <li>Kafka Streams has introduced a new state store type, versioned key-value stores,
-        for storing multiple record versions per key, thereby enabling timestamped retrieval
-        operations to return the latest record (per key) as of a specified timestamp.
-        See <a href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-889%3A+Versioned+State+Stores">KIP-889</a>
-        for more details.
-    </li>
-    <li>MirrorMaker now uses incrementalAlterConfigs API by default to synchronize topic configurations instead of the deprecated alterConfigs API.
-        A new settings called <code>use.incremental.alter.configs</code> is introduced to allow users to control which API to use.
-        This new setting is marked deprecated and will be removed in the next major release when incrementalAlterConfigs API is always used.
-        See <a href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-894%3A+Use+incrementalAlterConfigs+API+for+syncing+topic+configurations">KIP-894</a> for more details.
-    </li>
-</ul>
+<h4><a id="upgrade_3_5_0" href="#upgrade_3_5_0">Upgrading to 3.5.0 from any version 0.8.x through 3.4.x</a></h4>
+
+    <h5><a id="upgrade_350_notable" href="#upgrade_350_notable">Notable changes in 3.5.0</a></h5>
+    <ul>
+        <li>Kafka Streams has introduced a new state store type, versioned key-value stores,
+            for storing multiple record versions per key, thereby enabling timestamped retrieval
+            operations to return the latest record (per key) as of a specified timestamp.
+            See <a href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-889%3A+Versioned+State+Stores">KIP-889</a>
+            for more details.
+        </li>
+        <li>MirrorMaker now uses incrementalAlterConfigs API by default to synchronize topic configurations instead of the deprecated alterConfigs API.
+            A new settings called <code>use.incremental.alter.configs</code> is introduced to allow users to control which API to use.
+            This new setting is marked deprecated and will be removed in the next major release when incrementalAlterConfigs API is always used.
+            See <a href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-894%3A+Use+incrementalAlterConfigs+API+for+syncing+topic+configurations">KIP-894</a> for more details.
+        </li>
+        <li>The JmxTool has been migrated to the tools module.
+            The 'kafka.tools' package is deprecated and will change to 'org.apache.kafka.tools' in the next major release.
+            See <a href="https://issues.apache.org/jira/browse/KAFKA-14525">KAFKA-14525</a> for more details.
+        </li>
+    </ul>
 
 <h4><a id="upgrade_3_4_0" href="#upgrade_3_4_0">Upgrading to 3.4.0 from any version 0.8.x through 3.3.x</a></h4>