Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4511#discussion_r24452877
  
    --- Diff: 
external/kafka/src/main/scala/org/apache/spark/streaming/kafka/Broker.scala ---
    @@ -17,41 +17,54 @@
     
     package org.apache.spark.streaming.kafka
     
    -import kafka.common.TopicAndPartition
    -
     import org.apache.spark.annotation.Experimental
     
     /**
      * :: Experimental ::
    - * Represent the host info for the leader of a Kafka partition.
    + * Represent the host and port info for a Kafka broker.
    + * Differs from the Kafka project's internal kafka.cluster.Broker, which 
contains a server ID
      */
     @Experimental
    -final class Leader private(
    -    /** Kafka topic name */
    -    val topic: String,
    -    /** Kafka partition id */
    -    val partition: Int,
    -    /** Leader's hostname */
    +final class Broker private(
    +    /** Broker's hostname */
         val host: String,
    -    /** Leader's port */
    -    val port: Int) extends Serializable
    +    /** Broker's port */
    +    val port: Int) extends Serializable {
    +
    +  override def equals(obj: Any): Boolean = obj match {
    +    case that: Broker =>
    +      this.host == that.host &&
    +      this.port == that.port
    +    case _ => false
    +  }
    +
    +  override def hashCode: Int = {
    +    41 * (41 + host.hashCode) + port
    +  }
    +
    +  override def toString(): String = {
    +    s"Broker($host, $port)"
    +  }
    +
    --- End diff --
    
    nit: extra space


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to