Class VeniceMetadataZkClient

java.lang.Object
com.linkedin.venice.controller.VeniceMetadataZkClient
All Implemented Interfaces:
Closeable, AutoCloseable

public class VeniceMetadataZkClient extends Object implements Closeable
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:

  1. Helix cluster coordination (owned by Helix APIs) — see ZkHelixAdminClient and VeniceHelixAdmin's dedicated helixZkClient.
  2. 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 Details

    • VeniceMetadataZkClient

      public VeniceMetadataZkClient(String zkAddress, io.tehuti.metrics.MetricsRepository metricsRepository, String statsNamePrefix)
  • Method Details

    • getZkClient

      public org.apache.helix.zookeeper.impl.client.ZkClient getZkClient()
      Returns:
      the underlying ZkClient connected to the Venice-metadata ZK ensemble, for the Venice-metadata accessor classes to consume directly.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable