kafka.controller

PartitionStateMachine

class PartitionStateMachine extends Logging

This class represents the state machine for partitions. It defines the states that a partition can be in, and transitions to move the partition to another legal state. The different states that a partition can be in are - 1. NonExistentPartition: This state indicates that the partition was either never created or was created and then deleted. Valid previous state, if one exists, is OfflinePartition 2. NewPartition : After creation, the partition is in the NewPartition state. In this state, the partition should have replicas assigned to it, but no leader/isr yet. Valid previous states are NonExistentPartition 3. OnlinePartition : Once a leader is elected for a partition, it is in the OnlinePartition state. Valid previous states are NewPartition/OfflinePartition 4. OfflinePartition : If, after successful leader election, the leader for partition dies, then the partition moves to the OfflinePartition state. Valid previous states are NewPartition/OnlinePartition

Linear Supertypes
Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. PartitionStateMachine
  2. Logging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PartitionStateMachine(controller: KafkaController)

Type Members

  1. class AddPartitionsListener extends IZkDataListener with Logging

  2. class DeleteTopicsListener extends IZkChildListener with Logging

    Delete topics includes the following operations - 1.

  3. class TopicChangeListener extends IZkChildListener with Logging

    This is the zookeeper listener that triggers all the state transitions for a partition

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 clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def debug(msg: ⇒ String, e: ⇒ Throwable): Unit

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

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

    Definition Classes
    Logging
  11. def deregisterListeners(): Unit

  12. def deregisterPartitionChangeListener(topic: String): Option[AddPartitionsListener]

  13. def electLeaderForPartition(topic: String, partition: Int, leaderSelector: PartitionLeaderSelector): Unit

    Invoked on the OfflinePartition,OnlinePartition->OnlinePartition state change.

    Invoked on the OfflinePartition,OnlinePartition->OnlinePartition state change. It invokes the leader election API to elect a leader for the input offline partition

    topic

    The topic of the offline partition

    partition

    The offline partition

    leaderSelector

    Specific leader selector (e.g., offline/reassigned/etc.)

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

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

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

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

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

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

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

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

    Definition Classes
    Logging
  22. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  24. def handleStateChanges(partitions: Set[TopicAndPartition], targetState: PartitionState, leaderSelector: PartitionLeaderSelector = noOpPartitionLeaderSelector, callbacks: Callbacks = new CallbackBuilder).build): Unit

    This API is invoked by the partition change zookeeper listener

    This API is invoked by the partition change zookeeper listener

    partitions

    The list of partitions that need to be transitioned to the target state

    targetState

    The state that the partitions should be moved to

  25. def hashCode(): Int

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

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

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

    Definition Classes
    Logging
  29. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  30. var logIdent: String

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

    Definition Classes
    Logging
  32. val loggerName: String

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

    Definition Classes
    AnyRef
  34. final def notify(): Unit

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

    Definition Classes
    AnyRef
  36. def partitionsInState(state: PartitionState): Set[TopicAndPartition]

  37. def registerListeners(): Unit

  38. def registerPartitionChangeListener(topic: String): Unit

  39. def shutdown(): Unit

    Invoked on controller shutdown.

  40. def startup(): Unit

    Invoked on successful controller election.

    Invoked on successful controller election. First registers a topic change listener since that triggers all state transitions for partitions. Initializes the state of partitions by reading from zookeeper. Then triggers the OnlinePartition state change for all new or offline partitions.

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  48. def toString(): String

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

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

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

    Definition Classes
    Logging
  52. def triggerOnlinePartitionStateChange(): Unit

    This API invokes the OnlinePartition state change on all partitions in either the NewPartition or OfflinePartition state.

    This API invokes the OnlinePartition state change on all partitions in either the NewPartition or OfflinePartition state. This is called on a successful controller election and on broker changes

  53. final def wait(): Unit

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

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

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

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

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

    Definition Classes
    Logging

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped