kafka.utils

ZkUtils

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

  7. val BrokerTopicsPath: String

  8. val ConsumersPath: String

  9. val ControllerEpochPath: String

  10. val ControllerPath: String

  11. val DeleteTopicsPath: String

  12. val PreferredReplicaLeaderElectionPath: String

  13. val ReassignPartitionsPath: String

  14. val TopicConfigChangesPath: String

  15. val TopicConfigPath: String

  16. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  17. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. 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.

    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.

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

    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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Definition Classes
    Logging
  38. def finalize(): Unit

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

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

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

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

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

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

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

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

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

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

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

  50. def getController(zkClient: ZkClient): Int

  51. def getDeleteTopicPath(topic: String): String

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  65. def getTopicConfigPath(topic: String): String

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

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

  68. def getTopicPartitionsPath(topic: String): String

  69. def getTopicPath(topic: String): String

  70. def hashCode(): Int

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

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

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

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

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

  76. var logIdent: String

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

    Definition Classes
    Logging
  78. val loggerName: String

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

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

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

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

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

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

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

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

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

    Check if the given path exists

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

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

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

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

    Get JSON partition to replica map from zookeeper.

  92. def setupCommonPaths(zkClient: ZkClient): Unit

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  100. def toString(): String

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

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

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

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

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

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

  107. final def wait(): Unit

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

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

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

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

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

    Definition Classes
    Logging

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped