Package com.linkedin.venice.controller
Class VeniceMetadataZkClient
java.lang.Object
com.linkedin.venice.controller.VeniceMetadataZkClient
- All Implemented Interfaces:
Closeable,AutoCloseable
Owns the single
ZkClient used for Venice metadata (System #2): Stores, Schemas, StoreConfig,
OfflinePushStatus, AdminTopicMetadata, StoreGraveyard, Personas, etc.
ZooKeeper is used by the controller for two distinct systems:
- Helix cluster coordination (owned by Helix APIs) — see
ZkHelixAdminClientandVeniceHelixAdmin's dedicatedhelixZkClient. - Venice metadata (owned by Venice code) — owned by this class.
Giving the Venice-metadata ZK connection a single, explicit owner keeps its lifecycle (construction,
connection-status stats, close) in one place, and creates the seam a later HA change needs: repointing
Venice metadata at a separate/backup ZK ensemble will only require changing the address passed to this
class's constructor, rather than touching any of the Venice-metadata accessor classes (e.g.
ZkAllowlistAccessor, ZkExecutionIdAccessor, HelixReadOnlyStoreConfigRepository,
HelixStoreGraveyard) that all consume the ZkClient returned by getZkClient().
-
Constructor Summary
ConstructorsConstructorDescriptionVeniceMetadataZkClient(String zkAddress, io.tehuti.metrics.MetricsRepository metricsRepository, String statsNamePrefix) -
Method Summary
-
Constructor Details
-
VeniceMetadataZkClient
-
-
Method Details
-
getZkClient
public org.apache.helix.zookeeper.impl.client.ZkClient getZkClient()- Returns:
- the underlying
ZkClientconnected to the Venice-metadata ZK ensemble, for the Venice-metadata accessor classes to consume directly.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-