kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nehanarkh...@apache.org
Subject git commit: KAFKA-1444 kafka.javaapi.TopicMetadata and PartitionMetadata doesn't forward the toString method; reviewed by Neha Narkhede
Date Tue, 27 May 2014 17:21:18 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 547ccedcf -> 01ea4eb42


KAFKA-1444 kafka.javaapi.TopicMetadata and PartitionMetadata doesn't forward the toString
method; reviewed by Neha Narkhede


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/01ea4eb4
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/01ea4eb4
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/01ea4eb4

Branch: refs/heads/trunk
Commit: 01ea4eb42dfea5f47586e2f12be2344f7910fee0
Parents: 547cced
Author: Neha Narkhede <neha.narkhede@gmail.com>
Authored: Tue May 27 10:21:16 2014 -0700
Committer: Neha Narkhede <neha.narkhede@gmail.com>
Committed: Tue May 27 10:21:16 2014 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/javaapi/TopicMetadata.scala    |  5 ++++-
 .../main/scala/kafka/javaapi/TopicMetadataResponse.scala | 11 +++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/01ea4eb4/core/src/main/scala/kafka/javaapi/TopicMetadata.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/javaapi/TopicMetadata.scala b/core/src/main/scala/kafka/javaapi/TopicMetadata.scala
index d08c3f4..f384e04 100644
--- a/core/src/main/scala/kafka/javaapi/TopicMetadata.scala
+++ b/core/src/main/scala/kafka/javaapi/TopicMetadata.scala
@@ -44,6 +44,8 @@ class TopicMetadata(private val underlying: kafka.api.TopicMetadata) {
   def errorCode: Short = underlying.errorCode
 
   def sizeInBytes: Int = underlying.sizeInBytes
+
+  override def toString = underlying.toString
 }
 
 
@@ -68,5 +70,6 @@ class PartitionMetadata(private val underlying: kafka.api.PartitionMetadata)
{
   def errorCode: Short = underlying.errorCode
 
   def sizeInBytes: Int = underlying.sizeInBytes
-}
 
+  override def toString = underlying.toString
+}

http://git-wip-us.apache.org/repos/asf/kafka/blob/01ea4eb4/core/src/main/scala/kafka/javaapi/TopicMetadataResponse.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/javaapi/TopicMetadataResponse.scala b/core/src/main/scala/kafka/javaapi/TopicMetadataResponse.scala
index 252a0c9..3359060 100644
--- a/core/src/main/scala/kafka/javaapi/TopicMetadataResponse.scala
+++ b/core/src/main/scala/kafka/javaapi/TopicMetadataResponse.scala
@@ -23,4 +23,15 @@ class TopicMetadataResponse(private val underlying: kafka.api.TopicMetadataRespo
     import kafka.javaapi.MetadataListImplicits._
     underlying.topicsMetadata
   }
+
+  override def equals(other: Any) = canEqual(other) && {
+    val otherTopicMetadataResponse = other.asInstanceOf[kafka.javaapi.TopicMetadataResponse]
+    this.underlying.equals(otherTopicMetadataResponse.underlying)
+  }
+
+  def canEqual(other: Any) = other.isInstanceOf[kafka.javaapi.TopicMetadataResponse]
+
+  override def hashCode = underlying.hashCode
+
+  override def toString = underlying.toString
 }


Mime
View raw message