Class/Object

kafka.utils

ZkUtils

Related Docs: object ZkUtils | package utils

Permalink

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
Visibility
  1. Public
  2. All

Instance Constructors

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

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val DefaultAcls: List[ACL]

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

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

    Permalink
  8. def conditionalUpdatePersistentPath(path: String, data: String, expectVersion: Int, optionalChecker: Option[(ZkUtils, String, String) ⇒ (Boolean, Int)] = None): (Boolean, Int)

    Permalink

    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.

  9. def conditionalUpdatePersistentPathIfExists(path: String, data: String, expectVersion: Int): (Boolean, Int)

    Permalink

    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

  10. def createEphemeralPathExpectConflict(path: String, data: String, acls: List[ACL] = DefaultAcls): Unit

    Permalink

    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.

  11. def createPersistentPath(path: String, data: String = "", acls: List[ACL] = DefaultAcls): Unit

    Permalink

    Create an persistent node with the given path and data.

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

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

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

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

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

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

    Permalink
  17. def deletePath(path: String): Boolean

    Permalink
  18. def deletePathRecursive(path: String): Unit

    Permalink
  19. final def eq(arg0: AnyRef): Boolean

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    Logging
  27. def finalize(): Unit

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

    Permalink
  29. def getAllBrokersInCluster(): Seq[Broker]

    Permalink
  30. def getAllConsumerGroupsForTopic(topic: String): Set[String]

    Permalink
  31. def getAllEntitiesWithConfig(entityType: String): Seq[String]

    Permalink

    Returns all the entities whose configs have been overridden.

  32. def getAllPartitions(): Set[TopicAndPartition]

    Permalink
  33. def getAllTopics(): Seq[String]

    Permalink
  34. def getBrokerInfo(brokerId: Int): Option[Broker]

    Permalink

    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

  35. def getBrokerSequenceId(MaxReservedBrokerId: Int): Int

    Permalink

    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.

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

    Permalink
  37. def getChildrenParentMayNotExist(path: String): Seq[String]

    Permalink
  38. final def getClass(): Class[_]

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

    Permalink
  40. def getConsumerGroups(): Seq[String]

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

    Permalink
  42. def getConsumersInGroup(group: String): Seq[String]

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

    Permalink
  44. def getController(): Int

    Permalink
  45. def getEpochForPartition(topic: String, partition: Int): Int

    Permalink

    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.

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

    Permalink

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

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

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

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

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

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

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

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

    Permalink
  54. def getPartitionsUndergoingPreferredReplicaElection(): Set[TopicAndPartition]

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

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

    Permalink

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

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

    Permalink

    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

  58. def getSortedBrokerList(): Seq[Int]

    Permalink
  59. def getTopicsByConsumerGroup(consumerGroup: String): Seq[String]

    Permalink
  60. def hashCode(): Int

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

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

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

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

    Permalink
    Definition Classes
    Any
  65. val isSecure: Boolean

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

    Permalink
  67. var logIdent: String

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  68. lazy val logger: Logger

    Permalink
    Definition Classes
    Logging
  69. val loggerName: String

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

    Permalink

    make sure a persistent path exists in ZK.

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

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

    Permalink
    Definition Classes
    AnyRef
  72. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  73. final def notifyAll(): Unit

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

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

    Permalink
  76. def parseTopicsData(jsonData: String): Seq[String]

    Permalink
  77. def pathExists(path: String): Boolean

    Permalink

    Check if the given path exists

  78. val persistentZkPaths: Seq[String]

    Permalink
  79. def readData(path: String): (String, Stat)

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

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

    Permalink

    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.

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

    Permalink

    Get JSON partition to replica map from zookeeper.

  83. val securePersistentZkPaths: Seq[String]

    Permalink
  84. def setupCommonPaths(): Unit

    Permalink
  85. def swallow(action: ⇒ Unit): Unit

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  92. def toString(): String

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

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

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

    Permalink
    Definition Classes
    Logging
  96. def updateEphemeralPath(path: String, data: String, acls: List[ACL] = DefaultAcls): Unit

    Permalink

    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.

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

    Permalink
  98. def updatePersistentPath(path: String, data: String, acls: List[ACL] = DefaultAcls): Unit

    Permalink

    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

  99. final def wait(): Unit

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

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

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

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

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

    Permalink
    Definition Classes
    Logging
  105. val zkClient: ZkClient

    Permalink
  106. val zkConnection: ZkConnection

    Permalink

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped