kafka.utils

ZkUtils

Related Doc: package utils

object ZkUtils extends Logging

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

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. val BrokerIdsPath: String

  5. val BrokerTopicsPath: String

  6. val ConsumersPath: String

  7. val ControllerEpochPath: String

  8. val ControllerPath: String

  9. val DeleteTopicsPath: String

  10. val PreferredReplicaLeaderElectionPath: String

  11. val ReassignPartitionsPath: String

  12. val TopicConfigChangesPath: String

  13. val TopicConfigPath: String

  14. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  15. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. def conditionalUpdatePersistentPath(client: ZkClient, path: String, data: String, expectVersion: Int, optionalChecker: Option[(ZkClient, String, String) ⇒ (Boolean, Int)] = None): (Boolean, Int)

    Conditional update the persistent path data, return (true, newVersion) if it succeeds, otherwise (the path doesn't exist, the current version is not the expected version, etc.) return (false, -1)

    Conditional update the persistent path data, return (true, newVersion) if it succeeds, otherwise (the path doesn't exist, the current version is not the expected version, etc.) return (false, -1)

    When there is a ConnectionLossException during the conditional update, zkClient will retry the update and may fail since the previous update may have succeeded (but the stored zkVersion no longer matches the expected one). In this case, we will run the optionalChecker to further check if the previous write did indeed succeeded.

  17. def conditionalUpdatePersistentPathIfExists(client: ZkClient, path: String, data: String, expectVersion: Int): (Boolean, Int)

    Conditional update the persistent path data, return (true, newVersion) if it succeeds, otherwise (the current version is not the expected version, etc.) return (false, -1).

    Conditional update the persistent path data, return (true, newVersion) if it succeeds, otherwise (the current version is not the expected version, etc.) return (false, -1). If path doesn't exist, throws ZkNoNodeException

  18. def createEphemeralPathExpectConflict(client: ZkClient, path: String, data: String): Unit

    Create an ephemeral node with the given path and data.

    Create an ephemeral node with the given path and data. Throw NodeExistException if node already exists.

  19. def createEphemeralPathExpectConflictHandleZKBug(zkClient: ZkClient, path: String, data: String, expectedCallerData: Any, checker: (String, Any) ⇒ Boolean, backoffTime: Int): Unit

    Create an ephemeral node with the given path and data.

    Create an ephemeral node with the given path and data. Throw NodeExistsException if node already exists. Handles the following ZK session timeout bug:

    https://issues.apache.org/jira/browse/ZOOKEEPER-1740

    Upon receiving a NodeExistsException, read the data from the conflicted path and trigger the checker function comparing the read data and the expected data, If the checker function returns true then the above bug might be encountered, back off and retry; otherwise re-throw the exception

  20. def createPersistentPath(client: ZkClient, path: String, data: String = ""): Unit

    Create an persistent node with the given path and data.

    Create an persistent node with the given path and data. Create parents if necessary.

  21. def createSequentialPersistentPath(client: ZkClient, path: String, data: String = ""): String

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

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

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

    Definition Classes
    Logging
  25. def deletePartition(zkClient: ZkClient, brokerId: Int, topic: String): Unit

  26. def deletePath(client: ZkClient, path: String): Boolean

  27. def deletePathRecursive(client: ZkClient, path: String): Unit

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

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

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

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

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

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

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

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

    Definition Classes
    Logging
  36. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  37. def getAllBrokersInCluster(zkClient: ZkClient): Seq[Broker]

  38. def getAllPartitions(zkClient: ZkClient): Set[TopicAndPartition]

  39. def getAllTopics(zkClient: ZkClient): Seq[String]

  40. def getBrokerInfo(zkClient: ZkClient, brokerId: Int): Option[Broker]

    This API takes in a broker id, queries zookeeper for the broker metadata and returns the metadata for that broker or throws an exception if the broker dies before the query to zookeeper finishes

    This API takes in a broker id, queries zookeeper for the broker metadata and returns the metadata for that broker or throws an exception if the broker dies before the query to zookeeper finishes

    zkClient

    The zookeeper client connection

    brokerId

    The broker id

    returns

    An optional Broker object encapsulating the broker metadata

  41. def getChildren(client: ZkClient, path: String): Seq[String]

  42. def getChildrenParentMayNotExist(client: ZkClient, path: String): Seq[String]

  43. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  44. def getCluster(zkClient: ZkClient): Cluster

  45. def getConsumerPartitionOwnerPath(group: String, topic: String, partition: Int): String

  46. def getConsumersInGroup(zkClient: ZkClient, group: String): Seq[String]

  47. def getConsumersPerTopic(zkClient: ZkClient, group: String, excludeInternalTopics: Boolean): Map[String, List[ConsumerThreadId]]

  48. def getController(zkClient: ZkClient): Int

  49. def getDeleteTopicPath(topic: String): String

  50. def getEpochForPartition(zkClient: ZkClient, topic: String, partition: Int): Int

    This API should read the epoch in the ISR path.

    This API should read the epoch in the ISR path. It is sufficient to read the epoch in the ISR path, since if the leader fails after updating epoch in the leader path and before updating epoch in the ISR path, effectively some other broker will retry becoming leader with the same new epoch value.

  51. def getInSyncReplicasForPartition(zkClient: ZkClient, topic: String, partition: Int): Seq[Int]

    Gets the in-sync replicas (ISR) for a specific topic and partition

  52. def getLeaderAndIsrForPartition(zkClient: ZkClient, topic: String, partition: Int): Option[LeaderAndIsr]

  53. def getLeaderForPartition(zkClient: ZkClient, topic: String, partition: Int): Option[Int]

  54. def getPartitionAssignmentForTopics(zkClient: ZkClient, topics: Seq[String]): Map[String, Map[Int, Seq[Int]]]

  55. def getPartitionLeaderAndIsrForTopics(zkClient: ZkClient, topicAndPartitions: Set[TopicAndPartition]): Map[TopicAndPartition, LeaderIsrAndControllerEpoch]

  56. def getPartitionReassignmentZkData(partitionsToBeReassigned: Map[TopicAndPartition, Seq[Int]]): String

  57. def getPartitionsBeingReassigned(zkClient: ZkClient): Map[TopicAndPartition, ReassignedPartitionsContext]

  58. def getPartitionsForTopics(zkClient: ZkClient, topics: Seq[String]): Map[String, Seq[Int]]

  59. def getPartitionsUndergoingPreferredReplicaElection(zkClient: ZkClient): Set[TopicAndPartition]

  60. def getReplicaAssignmentForTopics(zkClient: ZkClient, topics: Seq[String]): Map[TopicAndPartition, Seq[Int]]

  61. def getReplicasForPartition(zkClient: ZkClient, topic: String, partition: Int): Seq[Int]

    Gets the assigned replicas (AR) for a specific topic and partition

  62. def getSortedBrokerList(zkClient: ZkClient): Seq[Int]

  63. def getTopicConfigPath(topic: String): String

  64. def getTopicPartitionLeaderAndIsrPath(topic: String, partitionId: Int): String

  65. def getTopicPartitionPath(topic: String, partitionId: Int): String

  66. def getTopicPartitionsPath(topic: String): String

  67. def getTopicPath(topic: String): String

  68. def hashCode(): Int

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

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

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

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

    Definition Classes
    Any
  73. def leaderAndIsrZkData(leaderAndIsr: LeaderAndIsr, controllerEpoch: Int): String

  74. var logIdent: String

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

    Definition Classes
    Logging
  76. val loggerName: String

    Definition Classes
    Logging
  77. def makeSurePersistentPathExists(client: ZkClient, path: String): Unit

    make sure a persistent path exists in ZK.

    make sure a persistent path exists in ZK. Create the path if not exist.

  78. def maybeDeletePath(zkUrl: String, dir: String): Unit

  79. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  82. def parsePartitionReassignmentData(jsonData: String): Map[TopicAndPartition, Seq[Int]]

  83. def parsePartitionReassignmentDataWithoutDedup(jsonData: String): Seq[(TopicAndPartition, Seq[Int])]

  84. def parseTopicsData(jsonData: String): Seq[String]

  85. def pathExists(client: ZkClient, path: String): Boolean

    Check if the given path exists

  86. def readData(client: ZkClient, path: String): (String, Stat)

  87. def readDataMaybeNull(client: ZkClient, path: String): (Option[String], Stat)

  88. def registerBrokerInZk(zkClient: ZkClient, id: Int, host: String, port: Int, timeout: Int, jmxPort: Int): Unit

  89. def replicaAssignmentZkData(map: Map[String, Seq[Int]]): String

    Get JSON partition to replica map from zookeeper.

  90. def setupCommonPaths(zkClient: ZkClient): Unit

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  98. def toString(): String

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

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

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

    Definition Classes
    Logging
  102. def updateEphemeralPath(client: ZkClient, path: String, data: String): Unit

    Update the value of a persistent node with the given path and data.

    Update the value of a persistent node with the given path and data. create parrent directory if necessary. Never throw NodeExistException.

  103. def updatePartitionReassignmentData(zkClient: ZkClient, partitionsToBeReassigned: Map[TopicAndPartition, Seq[Int]]): Unit

  104. def updatePersistentPath(client: ZkClient, path: String, data: String): Unit

    Update the value of a persistent node with the given path and data.

    Update the value of a persistent node with the given path and data. create parrent directory if necessary. Never throw NodeExistException. Return the updated path zkVersion

  105. final def wait(): Unit

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

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

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

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

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

    Definition Classes
    Logging

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped