kafka.utils

ZkUtils

class 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

Instance Constructors

  1. new ZkUtils(zkClient: ZkClient, zkConnection: ZkConnection, isSecure: Boolean)

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 DefaultAcls: List[ACL]

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def close(): Unit

  10. def conditionalUpdatePersistentPath(path: String, data: String, expectVersion: Int, optionalChecker: Option[(ZkUtils, 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.

  11. def conditionalUpdatePersistentPathIfExists(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

  12. def createEphemeralPathExpectConflict(path: String, data: String, acls: List[ACL] = DefaultAcls): 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.

  13. def createPersistentPath(path: String, data: String = "", acls: List[ACL] = DefaultAcls): 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.

  14. def createSequentialPersistentPath(path: String, data: String = "", acls: List[ACL] = DefaultAcls): String

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

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

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

    Definition Classes
    Logging
  18. def deletePartition(brokerId: Int, topic: String): Unit

  19. def deletePath(path: String): Boolean

  20. def deletePathRecursive(path: String): Unit

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

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

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

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

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

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

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

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

    Definition Classes
    Logging
  29. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  30. def getAllBrokerEndPointsForChannel(protocolType: SecurityProtocol): Seq[BrokerEndPoint]

  31. def getAllBrokersInCluster(): Seq[Broker]

  32. def getAllConsumerGroupsForTopic(topic: String): Set[String]

  33. def getAllEntitiesWithConfig(entityType: String): Seq[String]

    Returns all the entities whose configs have been overridden.

  34. def getAllPartitions(): Set[TopicAndPartition]

  35. def getAllTopics(): Seq[String]

  36. def getBrokerInfo(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

    brokerId

    The broker id

    returns

    An optional Broker object encapsulating the broker metadata

  37. def getBrokerSequenceId(MaxReservedBrokerId: Int): Int

    returns a sequence id generated by updating BrokerSequenceIdPath in Zk.

    returns a sequence id generated by updating BrokerSequenceIdPath in Zk. users can provide brokerId in the config , inorder to avoid conflicts between zk generated seqId and config.brokerId we increment zk seqId by KafkaConfig.MaxReservedBrokerId.

  38. def getChildren(path: String): Seq[String]

  39. def getChildrenParentMayNotExist(path: String): Seq[String]

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

    Definition Classes
    AnyRef → Any
  41. def getCluster(): Cluster

  42. def getConsumerGroups(): Seq[String]

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

  44. def getConsumersInGroup(group: String): Seq[String]

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

  46. def getController(): Int

  47. def getEpochForPartition(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.

  48. def getInSyncReplicasForPartition(topic: String, partition: Int): Seq[Int]

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

  49. def getLeaderAndIsrForPartition(topic: String, partition: Int): Option[LeaderAndIsr]

  50. def getLeaderForPartition(topic: String, partition: Int): Option[Int]

  51. def getPartitionAssignmentForTopics(topics: Seq[String]): Map[String, Map[Int, Seq[Int]]]

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

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

  54. def getPartitionsBeingReassigned(): Map[TopicAndPartition, ReassignedPartitionsContext]

  55. def getPartitionsForTopics(topics: Seq[String]): Map[String, Seq[Int]]

  56. def getPartitionsUndergoingPreferredReplicaElection(): Set[TopicAndPartition]

  57. def getReplicaAssignmentForTopics(topics: Seq[String]): Map[TopicAndPartition, Seq[Int]]

  58. def getReplicasForPartition(topic: String, partition: Int): Seq[Int]

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

  59. def getSequenceId(path: String, acls: List[ACL] = DefaultAcls): Int

    This API produces a sequence number by creating / updating given path in zookeeper It uses the stat returned by the zookeeper and return the version.

    This API produces a sequence number by creating / updating given path in zookeeper It uses the stat returned by the zookeeper and return the version. Every time client updates the path stat.version gets incremented

  60. def getSortedBrokerList(): Seq[Int]

  61. def getTopicsByConsumerGroup(consumerGroup: String): Seq[String]

  62. def hashCode(): Int

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

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

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

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

    Definition Classes
    Any
  67. val isSecure: Boolean

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

  69. var logIdent: String

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

    Definition Classes
    Logging
  71. val loggerName: String

    Definition Classes
    Logging
  72. def makeSurePersistentPathExists(path: String, acls: List[ACL] = DefaultAcls): Unit

    make sure a persistent path exists in ZK.

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

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

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

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

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

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

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

  79. def pathExists(path: String): Boolean

    Check if the given path exists

  80. val persistentZkPaths: Seq[String]

  81. def readData(path: String): (String, Stat)

  82. def readDataMaybeNull(path: String): (Option[String], Stat)

  83. def registerBrokerInZk(id: Int, host: String, port: Int, advertisedEndpoints: Map[SecurityProtocol, EndPoint], jmxPort: Int): Unit

    Register brokers with v2 json format (which includes multiple endpoints).

    Register brokers with v2 json format (which includes multiple endpoints). This format also includes default endpoints for compatibility with older clients.

    id
    advertisedEndpoints
    jmxPort

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

    Get JSON partition to replica map from zookeeper.

  85. val securePersistentZkPaths: Seq[String]

  86. def setupCommonPaths(): Unit

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  94. def toString(): String

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

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

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

    Definition Classes
    Logging
  98. def updateEphemeralPath(path: String, data: String, acls: List[ACL] = DefaultAcls): 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.

  99. def updatePartitionReassignmentData(partitionsToBeReassigned: Map[TopicAndPartition, Seq[Int]]): Unit

  100. def updatePersistentPath(path: String, data: String, acls: List[ACL] = DefaultAcls): 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

  101. final def wait(): Unit

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

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

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

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

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

    Definition Classes
    Logging
  107. val zkClient: ZkClient

  108. val zkConnection: ZkConnection

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped