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 PreferredReplicaLeaderElectionPath: String

  12. val ReassignPartitionsPath: String

  13. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  14. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  15. def conditionalUpdatePersistentPath(client: ZkClient, path: String, data: String, expectVersion: Int): (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)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Definition Classes
    Logging
  35. def finalize(): Unit

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

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

  38. def getAllReplicasOnBroker(zkClient: ZkClient, topics: Seq[String], brokerIds: Seq[Int]): Set[PartitionAndReplica]

  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): Map[String, List[String]]

  48. def getController(zkClient: ZkClient): Int

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

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

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

  51. def getLastPart(path: String): String

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

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

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

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

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

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

  58. def getPartitionsAssignedToBroker(zkClient: ZkClient, topics: Seq[String], brokerId: Int): Seq[(String, Int)]

  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 getReplicaAssignmentFromPartitionAssignment(topicPartitionAssignment: Map[String, Map[Int, Seq[Int]]]): Map[(String, Int), Seq[Int]]

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

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

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

  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 isPartitionOnBroker(zkClient: ZkClient, topic: String, partition: Int, brokerId: Int): Boolean

  76. def leaderAndIsrZkData(leaderAndIsr: LeaderAndIsr, controllerEpoch: Int): String

  77. var logIdent: String

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

    Definition Classes
    Logging
  79. val loggerName: String

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

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

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

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

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

    Definition Classes
    AnyRef
  85. def parseLeaderAndIsr(leaderAndIsrStr: String, topic: String, partition: Int, stat: Stat): Option[LeaderIsrAndControllerEpoch]

  86. def parsePartitionReassignmentData(jsonData: String): Map[TopicAndPartition, Seq[Int]]

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

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

    Check if the given path exists

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

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

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

  92. def replicaAssignmentZkdata(map: Map[String, Seq[Int]]): String

    Get JSON partition to replica map from zookeeper.

  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