Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 1.1.0
    • 1.1.1, 2.0.0
    • core, zkclient
    • None

    Description

      Currently , KafkaZkClient could print data: Array[Byte] in debug log , we should print data as String .

      Attachments

        1. [KAFKA-6930]_Update_KafkaZkClient_debug_log.patch
          2 kB
          darion yaphet
        2. snapshot.png
          71 kB
          darion yaphet

        Issue Links

          Activity

            githubbot ASF GitHub Bot added a comment -

            darionyaphet opened a new pull request #5061: KAFKA-6930 Update KafkaZkClient debug log
            URL: https://github.com/apache/kafka/pull/5061

            [KAFKA-6930 | Update KafkaZkClient debug log](https://issues.apache.org/jira/browse/KAFKA-6930)

                1. Committer Checklist (excluded from commit message)
            • [ ] Verify design and implementation
            • [ ] Verify test coverage and CI build status
            • [ ] Verify documentation (including upgrade notes)

            ----------------------------------------------------------------
            This is an automated message from the Apache Git Service.
            To respond to the message, please log on GitHub and use the
            URL above to go to the specific comment.

            For queries about this service, please contact Infrastructure at:
            users@infra.apache.org

            githubbot ASF GitHub Bot added a comment - darionyaphet opened a new pull request #5061: KAFKA-6930 Update KafkaZkClient debug log URL: https://github.com/apache/kafka/pull/5061 [KAFKA-6930 | Update KafkaZkClient debug log] ( https://issues.apache.org/jira/browse/KAFKA-6930 ) Committer Checklist (excluded from commit message) [ ] Verify design and implementation [ ] Verify test coverage and CI build status [ ] Verify documentation (including upgrade notes) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org
            githubbot ASF GitHub Bot added a comment -

            ijuma closed pull request #5061: KAFKA-6930 Update KafkaZkClient debug log
            URL: https://github.com/apache/kafka/pull/5061

            This is a PR merged from a forked repository.
            As GitHub hides the original diff on merge, it is displayed below for
            the sake of provenance:

            As this is a foreign pull request (from a fork), the diff is supplied
            below (as it won't show otherwise due to GitHub magic):

            diff --git a/core/src/main/scala/kafka/zk/KafkaZkClient.scala b/core/src/main/scala/kafka/zk/KafkaZkClient.scala
            index a65128ad98a..42f352bb368 100644
            — a/core/src/main/scala/kafka/zk/KafkaZkClient.scala
            +++ b/core/src/main/scala/kafka/zk/KafkaZkClient.scala
            @@ -32,7 +32,7 @@ import kafka.utils.Logging
            import kafka.zookeeper._
            import org.apache.kafka.common.TopicPartition
            import org.apache.kafka.common.security.token.delegation.

            {DelegationToken, TokenInformation}

            -import org.apache.kafka.common.utils.Time
            +import org.apache.kafka.common.utils.

            {Time, Utils}

            import org.apache.zookeeper.KeeperException.

            {Code, NodeExistsException}

            import org.apache.zookeeper.data.

            {ACL, Stat}

            import org.apache.zookeeper.

            {CreateMode, KeeperException, ZooKeeper}

            @@ -597,7 +597,7 @@ class KafkaZkClient private (zooKeeperClient: ZooKeeperClient, isSecure: Boolean
            setDataResponse.resultCode match

            { case Code.OK => debug("Conditional update of path %s with value %s and expected version %d succeeded, returning the new version: %d" - .format(path, data, expectVersion, setDataResponse.stat.getVersion)) + .format(path, Utils.utf8(data), expectVersion, setDataResponse.stat.getVersion)) (true, setDataResponse.stat.getVersion) case Code.BADVERSION => @@ -606,18 +606,18 @@ class KafkaZkClient private (zooKeeperClient: ZooKeeperClient, isSecure: Boolean case _ => debug("Checker method is not passed skipping zkData match") debug("Conditional update of path %s with data %s and expected version %d failed due to %s" - .format(path, data, expectVersion, setDataResponse.resultException.get.getMessage)) + .format(path, Utils.utf8(data), expectVersion, setDataResponse.resultException.get.getMessage)) (false, ZkVersion.NoVersion) }

            case Code.NONODE =>

            • debug("Conditional update of path %s with data %s and expected version %d failed due to %s".format(path, data,
            • expectVersion, setDataResponse.resultException.get.getMessage))
              + debug("Conditional update of path %s with data %s and expected version %d failed due to %s".format(path,
              + Utils.utf8(data), expectVersion, setDataResponse.resultException.get.getMessage))
              (false, ZkVersion.NoVersion)

            case _ =>

            • debug("Conditional update of path %s with data %s and expected version %d failed due to %s".format(path, data,
            • expectVersion, setDataResponse.resultException.get.getMessage))
              + debug("Conditional update of path %s with data %s and expected version %d failed due to %s".format(path,
              + Utils.utf8(data), expectVersion, setDataResponse.resultException.get.getMessage))
              throw setDataResponse.resultException.get
              }
              }

            ----------------------------------------------------------------
            This is an automated message from the Apache Git Service.
            To respond to the message, please log on GitHub and use the
            URL above to go to the specific comment.

            For queries about this service, please contact Infrastructure at:
            users@infra.apache.org

            githubbot ASF GitHub Bot added a comment - ijuma closed pull request #5061: KAFKA-6930 Update KafkaZkClient debug log URL: https://github.com/apache/kafka/pull/5061 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/core/src/main/scala/kafka/zk/KafkaZkClient.scala b/core/src/main/scala/kafka/zk/KafkaZkClient.scala index a65128ad98a..42f352bb368 100644 — a/core/src/main/scala/kafka/zk/KafkaZkClient.scala +++ b/core/src/main/scala/kafka/zk/KafkaZkClient.scala @@ -32,7 +32,7 @@ import kafka.utils.Logging import kafka.zookeeper._ import org.apache.kafka.common.TopicPartition import org.apache.kafka.common.security.token.delegation. {DelegationToken, TokenInformation} -import org.apache.kafka.common.utils.Time +import org.apache.kafka.common.utils. {Time, Utils} import org.apache.zookeeper.KeeperException. {Code, NodeExistsException} import org.apache.zookeeper.data. {ACL, Stat} import org.apache.zookeeper. {CreateMode, KeeperException, ZooKeeper} @@ -597,7 +597,7 @@ class KafkaZkClient private (zooKeeperClient: ZooKeeperClient, isSecure: Boolean setDataResponse.resultCode match { case Code.OK => debug("Conditional update of path %s with value %s and expected version %d succeeded, returning the new version: %d" - .format(path, data, expectVersion, setDataResponse.stat.getVersion)) + .format(path, Utils.utf8(data), expectVersion, setDataResponse.stat.getVersion)) (true, setDataResponse.stat.getVersion) case Code.BADVERSION => @@ -606,18 +606,18 @@ class KafkaZkClient private (zooKeeperClient: ZooKeeperClient, isSecure: Boolean case _ => debug("Checker method is not passed skipping zkData match") debug("Conditional update of path %s with data %s and expected version %d failed due to %s" - .format(path, data, expectVersion, setDataResponse.resultException.get.getMessage)) + .format(path, Utils.utf8(data), expectVersion, setDataResponse.resultException.get.getMessage)) (false, ZkVersion.NoVersion) } case Code.NONODE => debug("Conditional update of path %s with data %s and expected version %d failed due to %s".format(path, data, expectVersion, setDataResponse.resultException.get.getMessage)) + debug("Conditional update of path %s with data %s and expected version %d failed due to %s".format(path, + Utils.utf8(data), expectVersion, setDataResponse.resultException.get.getMessage)) (false, ZkVersion.NoVersion) case _ => debug("Conditional update of path %s with data %s and expected version %d failed due to %s".format(path, data, expectVersion, setDataResponse.resultException.get.getMessage)) + debug("Conditional update of path %s with data %s and expected version %d failed due to %s".format(path, + Utils.utf8(data), expectVersion, setDataResponse.resultException.get.getMessage)) throw setDataResponse.resultException.get } } ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org

            People

              Unassigned Unassigned
              darion darion yaphet
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: