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 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. val brokerRequestBatch: ControllerBrokerRequestBatch

  8. def clone(): AnyRef

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

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

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

    Definition Classes
    Logging
  12. def electLeaderForPartition(topic: String, partition: Int, leaderSelector: PartitionLeaderSelector): Unit

    Invoked on the OfflinePartition->OnlinePartition state change.

    Invoked on the OfflinePartition->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.)

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

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

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

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

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

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

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

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

    Definition Classes
    Logging
  21. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  23. def handleStateChanges(partitions: Set[TopicAndPartition], targetState: PartitionState, leaderSelector: PartitionLeaderSelector = noOpPartitionLeaderSelector): 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

  24. def hashCode(): Int

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

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

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

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

    Definition Classes
    Any
  29. var logIdent: String

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

    Definition Classes
    Logging
  31. val loggerName: String

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

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

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

    Definition Classes
    AnyRef
  35. var partitionState: Map[TopicAndPartition, PartitionState]

  36. def registerListeners(): Unit

  37. def registerPartitionChangeListener(topic: String): Unit

  38. def shutdown(): Unit

    Invoked on controller shutdown.

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

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  47. def toString(): String

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

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

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

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

  52. final def wait(): Unit

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

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

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

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

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

    Definition Classes
    Logging

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped