kafka.controller

ReplicaStateMachine

class ReplicaStateMachine extends Logging

This class represents the state machine for replicas. It defines the states that a replica can be in, and transitions to move the replica to another legal state. The different states that a replica can be in are - 1. NewReplica : The controller can create new replicas during partition reassignment. In this state, a replica can only get become follower state change request. Valid previous state is NonExistentReplica 2. OnlineReplica : Once a replica is started and part of the assigned replicas for its partition, it is in this state. In this state, it can get either become leader or become follower state change requests. Valid previous state are NewReplica, OnlineReplica or OfflineReplica 3. OfflineReplica : If a replica dies, it moves to this state. This happens when the broker hosting the replica is down. Valid previous state are NewReplica, OnlineReplica 4. NonExistentReplica: If a replica is deleted, it is moved to this state. Valid previous state is OfflineReplica

Linear Supertypes
Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ReplicaStateMachine
  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 ReplicaStateMachine(controller: KafkaController)

Type Members

  1. class BrokerChangeListener extends IZkChildListener with Logging

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

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. 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 getPartitionsAssignedToBroker(topics: Seq[String], brokerId: Int): Seq[TopicAndPartition]

  23. def handleStateChange(topic: String, partition: Int, replicaId: Int, targetState: ReplicaState): Unit

    This API exercises the replica's state machine.

    This API exercises the replica's state machine. It ensures that every state transition happens from a legal previous state to the target state.

    topic

    The topic of the replica for which the state transition is invoked

    partition

    The partition of the replica for which the state transition is invoked

    replicaId

    The replica for which the state transition is invoked

    targetState

    The end state that the replica should be moved to

  24. def handleStateChanges(replicas: Set[PartitionAndReplica], targetState: ReplicaState): Unit

    This API is invoked by the broker change controller callbacks and the startup API of the state machine

    This API is invoked by the broker change controller callbacks and the startup API of the state machine

    replicas

    The list of replicas (brokers) that need to be transitioned to the target state

    targetState

    The state that the replicas should be moved to The controller's allLeaders cache should have been updated before this

  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 registerListeners(): Unit

  37. var replicaState: Map[(String, Int, Int), ReplicaState]

  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 broker change listener since that triggers all state transitions for replicas. Initializes the state of replicas for all partitions by reading from zookeeper. Then triggers the OnlineReplica state change for all replicas.

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