kafka.controller

KafkaController

class KafkaController extends Logging with KafkaMetricsGroup with KafkaControllerMBean

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. KafkaController
  2. KafkaControllerMBean
  3. KafkaMetricsGroup
  4. Logging
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new KafkaController(config: KafkaConfig, zkClient: ZkClient)

Type Members

  1. class SessionExpirationListener extends IZkStateListener with Logging

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clientId: String

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. val config: KafkaConfig

  10. val controllerContext: ControllerContext

  11. def debug(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  12. def debug(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  13. def debug(msg: ⇒ String): Unit

    Definition Classes
    Logging
  14. def epoch: Int

  15. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  17. def error(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  18. def error(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  19. def error(msg: ⇒ String): Unit

    Definition Classes
    Logging
  20. def fatal(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  21. def fatal(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  22. def fatal(msg: ⇒ String): Unit

    Definition Classes
    Logging
  23. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  25. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  26. def incrementControllerEpoch(zkClient: ZkClient): Unit

  27. def info(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  28. def info(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  29. def info(msg: ⇒ String): Unit

    Definition Classes
    Logging
  30. def isActive(): Boolean

    Returns true if this broker is the current controller.

  31. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  32. var logIdent: String

    Attributes
    protected
    Definition Classes
    Logging
  33. lazy val logger: Logger

    Definition Classes
    Logging
  34. val loggerName: String

    Definition Classes
    Logging
  35. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  36. def newGauge[T](name: String, metric: Gauge[T]): Gauge[T]

    Definition Classes
    KafkaMetricsGroup
  37. def newHistogram(name: String, biased: Boolean = true): Histogram

    Definition Classes
    KafkaMetricsGroup
  38. def newMeter(name: String, eventType: String, timeUnit: TimeUnit): Meter

    Definition Classes
    KafkaMetricsGroup
  39. def newTimer(name: String, durationUnit: TimeUnit, rateUnit: TimeUnit): Timer

    Definition Classes
    KafkaMetricsGroup
  40. final def notify(): Unit

    Definition Classes
    AnyRef
  41. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  42. val offlinePartitionSelector: OfflinePartitionLeaderSelector

  43. def onBrokerFailure(deadBrokers: Seq[Int]): Unit

    This callback is invoked by the replica state machine's broker change listener with the list of failed brokers as input.

    This callback is invoked by the replica state machine's broker change listener with the list of failed brokers as input. It does the following - 1. Mark partitions with dead leaders as offline 2. Triggers the OnlinePartition state change for all new/offline partitions 3. Invokes the OfflineReplica state change on the input list of newly started brokers

    Note that we don't need to refresh the leader/isr cache for all topic/partitions at this point. This is because the partition state machine will refresh our cache for us when performing leader election for all new/offline partitions coming online.

  44. def onBrokerStartup(newBrokers: Seq[Int]): Unit

    This callback is invoked by the replica state machine's broker change listener, with the list of newly started brokers as input.

    This callback is invoked by the replica state machine's broker change listener, with the list of newly started brokers as input. It does the following - 1. Triggers the OnlinePartition state change for all new/offline partitions 2. It checks whether there are reassigned replicas assigned to any newly started brokers. If so, it performs the reassignment logic for each topic/partition.

    Note that we don't need to refresh the leader/isr cache for all topic/partitions at this point for two reasons: 1. The partition state machine, when triggering online state change, will refresh leader and ISR for only those partitions currently new or offline (rather than every partition this controller is aware of) 2. Even if we do refresh the cache, there is no guarantee that by the time the leader and ISR request reaches every broker that it is still valid. Brokers check the leader epoch to determine validity of the request.

  45. def onControllerFailover(): Unit

    This callback is invoked by the zookeeper leader elector on electing the current broker as the new controller.

    This callback is invoked by the zookeeper leader elector on electing the current broker as the new controller. It does the following things on the become-controller state change - 1. Register controller epoch changed listener 2. Increments the controller epoch 3. Initializes the controller's context object that holds cache objects for current topics, live brokers and leaders for all existing partitions. 4. Starts the controller's channel manager 5. Starts the replica state machine 6. Starts the partition state machine If it encounters any unexpected exception/error while becoming controller, it resigns as the current controller. This ensures another controller election will be triggered and there will always be an actively serving controller

  46. def onNewPartitionCreation(newPartitions: Set[TopicAndPartition]): Unit

    This callback is invoked by the topic change callback with the list of failed brokers as input.

    This callback is invoked by the topic change callback with the list of failed brokers as input. It does the following - 1. Move the newly created partitions to the NewPartition state 2. Move the newly created partitions from NewPartition->OnlinePartition state

  47. def onNewTopicCreation(topics: Set[String], newPartitions: Set[TopicAndPartition]): Unit

    This callback is invoked by the partition state machine's topic change listener with the list of failed brokers as input.

    This callback is invoked by the partition state machine's topic change listener with the list of failed brokers as input. It does the following - 1. Registers partition change listener. This is not required until KAFKA-347 2. Invokes the new partition callback

  48. def onPartitionReassignment(topicAndPartition: TopicAndPartition, reassignedPartitionContext: ReassignedPartitionsContext): Unit

    This callback is invoked by the reassigned partitions listener.

    This callback is invoked by the reassigned partitions listener. When an admin command initiates a partition reassignment, it creates the /admin/reassign_partitions path that triggers the zookeeper listener. Reassigning replicas for a partition goes through a few stages - RAR = Reassigned replicas AR = Original list of replicas for partition 1. Register listener for ISR changes to detect when the RAR is a subset of the ISR 2. Start new replicas RAR - AR. 3. Wait until new replicas are in sync with the leader 4. If the leader is not in RAR, elect a new leader from RAR 5. Stop old replicas AR - RAR 6. Write new AR 7. Remove partition from the /admin/reassign_partitions path

  49. def onPreferredReplicaElection(partitions: Set[TopicAndPartition]): Unit

  50. def removePartitionFromReassignedPartitions(topicAndPartition: TopicAndPartition): Unit

  51. def removePartitionsFromPreferredReplicaElection(partitionsToBeRemoved: Set[TopicAndPartition]): Unit

  52. def removeReplicaFromIsr(topic: String, partition: Int, replicaId: Int): Option[LeaderIsrAndControllerEpoch]

    Removes a given partition replica from the ISR; if it is not the current leader and there are sufficient remaining replicas in ISR.

    Removes a given partition replica from the ISR; if it is not the current leader and there are sufficient remaining replicas in ISR.

    topic

    topic

    partition

    partition

    replicaId

    replica Id

    returns

    the new leaderAndIsr (with the replica removed if it was present), or None if leaderAndIsr is empty.

  53. def sendRequest(brokerId: Int, request: RequestOrResponse, callback: (RequestOrResponse) ⇒ Unit = null): Unit

  54. def shutdown(): Unit

    Invoked when the controller module of a Kafka server is shutting down.

    Invoked when the controller module of a Kafka server is shutting down. If the broker was the current controller, it shuts down the partition and replica state machines. If not, those are a no-op. In addition to that, it also shuts down the controller channel manager, if one exists (i.e. if it was the current controller)

  55. def shutdownBroker(id: Int): Set[TopicAndPartition]

    On clean shutdown, the controller first determines the partitions that the shutting down broker leads, and moves leadership of those partitions to another broker that is in that partition's ISR.

    On clean shutdown, the controller first determines the partitions that the shutting down broker leads, and moves leadership of those partitions to another broker that is in that partition's ISR.

    id

    Id of the broker to shutdown.

    returns

    The number of partitions that the broker still leads.

    Definition Classes
    KafkaControllerKafkaControllerMBean
  56. def startup(): Unit

    Invoked when the controller module of a Kafka server is started up.

    Invoked when the controller module of a Kafka server is started up. This does not assume that the current broker is the controller. It merely registers the session expiration listener and starts the controller leader elector

  57. def swallow(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  58. def swallowDebug(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  59. def swallowError(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  60. def swallowInfo(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  61. def swallowTrace(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  62. def swallowWarn(action: ⇒ Unit): Unit

    Definition Classes
    Logging
  63. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  64. def toString(): String

    Definition Classes
    AnyRef → Any
  65. def trace(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  66. def trace(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  67. def trace(msg: ⇒ String): Unit

    Definition Classes
    Logging
  68. def updateAssignedReplicasForPartition(topicAndPartition: TopicAndPartition, newReplicaAssignmentForTopic: Map[TopicAndPartition, Seq[Int]]): Unit

  69. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  70. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  71. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  72. def warn(msg: ⇒ String, e: ⇒ Throwable): Unit

    Definition Classes
    Logging
  73. def warn(e: ⇒ Throwable): Any

    Definition Classes
    Logging
  74. def warn(msg: ⇒ String): Unit

    Definition Classes
    Logging

Inherited from KafkaControllerMBean

Inherited from KafkaMetricsGroup

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped