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.

    Delete topics includes the following operations - 1. Add the topic to be deleted to the delete topics cache, only if the topic exists 2. If there are topics to be deleted, it signals the delete topic thread

  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: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

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

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

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

    Definition Classes
    Logging
  9. def deregisterListeners(): Unit

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

  11. 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.)

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

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

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

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

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

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

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

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

    Definition Classes
    Logging
  20. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  22. 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

  23. def hashCode(): Int

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

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

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

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

    Definition Classes
    Any
  28. var logIdent: String

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

    Definition Classes
    Logging
  30. val loggerName: String

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

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

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

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

  35. def registerListeners(): Unit

  36. def registerPartitionChangeListener(topic: String): Unit

  37. def shutdown(): Unit

    Invoked on controller shutdown.

  38. 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.

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  46. def toString(): String

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

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

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

    Definition Classes
    Logging
  50. 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

  51. final def wait(): Unit

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

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

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

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

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

    Definition Classes
    Logging

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped