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.
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
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.
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
Create an persistent node with the given path and data.
Create an persistent node with the given path and data. Create parents if necessary.
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
The zookeeper client connection
The broker id
An optional Broker object encapsulating the broker metadata
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.
Gets the in-sync replicas (ISR) for a specific topic and partition
Gets the assigned replicas (AR) for a specific topic and partition
make sure a persistent path exists in ZK.
make sure a persistent path exists in ZK. Create the path if not exist.
Check if the given path exists
Get JSON partition to replica map from zookeeper.
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.
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