Class VeniceHelixAdmin

java.lang.Object
com.linkedin.venice.controller.VeniceHelixAdmin
All Implemented Interfaces:
Admin, StoreCleaner, Closeable, AutoCloseable

public class VeniceHelixAdmin extends Object implements Admin, StoreCleaner
Helix Admin based on 0.8.4.215 APIs.

After using controller as service mode. There are two levels of cluster and controllers. Each venice controller will hold a level1 helix controller which will keep connecting to Helix, there is a cluster only used for all of these level1 controllers(controller's cluster). The second level is our venice clusters. Like prod cluster, dev cluster etc. Each of cluster will be Helix resource in the controller's cluster. Helix will choose one of level1 controller becoming the leader of our venice cluster. In our distributed controllers state transition handler, a level2 controller will be initialized to manage this venice cluster only. If this level1 controller is chosen as the leader controller of multiple Venice clusters, multiple level2 controller will be created based on cluster specific config.

Admin is shared by multiple cluster's controllers running in one physical Venice controller instance.

  • Field Details

    • RETRY_FAILURE_TYPES

      public static final List<Class<? extends Throwable>> RETRY_FAILURE_TYPES
    • INTERNAL_STORE_GET_RRT_TOPIC_ATTEMPTS

      protected static final int INTERNAL_STORE_GET_RRT_TOPIC_ATTEMPTS
      See Also:
    • INTERNAL_STORE_RTT_RETRY_BACKOFF_MS

      protected static final long INTERNAL_STORE_RTT_RETRY_BACKOFF_MS
    • pubSubTopicRepository

      protected final PubSubTopicRepository pubSubTopicRepository
  • Constructor Details

  • Method Details

    • startInstanceMonitor

      public void startInstanceMonitor(String clusterName)
      Specified by:
      startInstanceMonitor in interface Admin
    • getLiveInstanceMonitor

      public LiveInstanceMonitor getLiveInstanceMonitor(String clusterName)
    • clearInstanceMonitor

      public void clearInstanceMonitor(String clusterName)
      Specified by:
      clearInstanceMonitor in interface Admin
    • getZkClient

      public org.apache.helix.zookeeper.impl.client.ZkClient getZkClient()
    • getExecutionIdAccessor

      public ExecutionIdAccessor getExecutionIdAccessor()
    • getAdapterSerializer

      public HelixAdapterSerializer getAdapterSerializer()
    • initStorageCluster

      public void initStorageCluster(String clusterName)
      Create and configure the Venice storage cluster with required properties in Helix and waits the resource's (partial) partition to appear in the external view.
      Specified by:
      initStorageCluster in interface Admin
      Parameters:
      clusterName - Venice cluster name.
    • isResourceStillAlive

      public boolean isResourceStillAlive(String resourceName)
      Test if a given helix resource is still alive (existent in ZK).
      Specified by:
      isResourceStillAlive in interface Admin
      Parameters:
      resourceName - Helix resource name.
      Returns:
      true if resource exists; false otherwise.
    • isClusterValid

      public boolean isClusterValid(String clusterName)
      Test if a cluster is valid (in Helix cluster list).
      Specified by:
      isClusterValid in interface Admin
      Parameters:
      clusterName - Venice cluster name.
      Returns:
      true if input cluster is in Helix cluster list; false otherwise.
    • getHelixAdmin

      protected org.apache.helix.HelixAdmin getHelixAdmin()
    • createStore

      public void createStore(String clusterName, String storeName, String owner, String keySchema, String valueSchema, boolean isSystemStore, Optional<String> accessPermissions)
      Create a new ZK store and its configuration in the store repository and create schemas in the schema repository.
      Specified by:
      createStore in interface Admin
      Parameters:
      clusterName - Venice cluster where the store locates.
      storeName - name of the store.
      owner - owner of the store.
      keySchema - key schema of the store.
      valueSchema - value schema of the store.
      isSystemStore - if the store is a system store.
      accessPermissions - json string representing the access-permissions.
    • deleteStore

      public void deleteStore(String clusterName, String storeName, boolean isAbortMigrationCleanup, int largestUsedVersionNumber, boolean waitOnRTTopicDeletion)
      This method will delete store data, metadata, version and rt topics One exception is for stores with isMigrating flag set. In that case, the corresponding kafka topics and storeConfig will not be deleted so that they are still available for the cloned store.
      Specified by:
      deleteStore in interface Admin
    • deleteStore

      public void deleteStore(String clusterName, String storeName, int largestUsedVersionNumber, boolean waitOnRTTopicDeletion)
    • cleanupAclsForStore

      protected void cleanupAclsForStore(Store store, String storeName, String clusterName)
      Deletes the acls associated with a store.
      Parameters:
      store - The Store object representing the store whose ACLs are to be deleted.
      storeName - The name of the store.
      clusterName - The name of the cluster where the store resides.
    • sendPushJobDetails

      public void sendPushJobDetails(PushJobStatusRecordKey key, PushJobDetails value)
      Lazy initialize a Venice writer for an internal real time topic store of push job details records. Use this writer to put a pair of push job detail record (key and value).
      Specified by:
      sendPushJobDetails in interface Admin
      Parameters:
      key - key with which the specified value is to be associated.
      value - value to be associated with the specified key.
    • getPushJobDetails

      public PushJobDetails getPushJobDetails(@Nonnull PushJobStatusRecordKey key)
      Specified by:
      getPushJobDetails in interface Admin
      Returns:
      the value to which the specified key is mapped from the Venice internal real time topic store.
    • getBatchJobHeartbeatValue

      public BatchJobHeartbeatValue getBatchJobHeartbeatValue(@Nonnull BatchJobHeartbeatKey batchJobHeartbeatKey)
      Specified by:
      getBatchJobHeartbeatValue in interface Admin
      Returns:
      the value to which the specified key is mapped from the Venice internal BATCH_JOB_HEARTBEAT_STORE topic store.
    • writeEndOfPush

      public void writeEndOfPush(String clusterName, String storeName, int versionNumber, boolean alsoWriteStartOfPush)
      Create a local Venice writer based on store version info and, for each partition, use the writer to send END_OF_PUSH and END_OF_SEGMENT control messages to Kafka.
      Specified by:
      writeEndOfPush in interface Admin
      Parameters:
      clusterName - name of the Venice cluster.
      storeName - name of the store.
      versionNumber - store version number.
      alsoWriteStartOfPush - if Venice writer sends a START_OF_PUSH control message first.
    • writeEndOfPush

      public void writeEndOfPush(String clusterName, String storeName, int versionNumber, boolean alsoWriteStartOfPush, Map<Integer,Long> partitionRecordCounts)
      Specified by:
      writeEndOfPush in interface Admin
    • whetherEnableBatchPushFromAdmin

      public boolean whetherEnableBatchPushFromAdmin(String clusterName, String storeName)
      Test if a store is allowed for a batch push.
      Specified by:
      whetherEnableBatchPushFromAdmin in interface Admin
      Parameters:
      storeName - name of a store.
      Returns:
      true is the store is a participant system store or if Venice is running in single-region mode
    • isStoreMigrationAllowed

      public boolean isStoreMigrationAllowed(String clusterName)
      Test if the store migration is allowed for a cluster. It reads the value "allow.store.migration" from the "/clusterName/ClusterConfig" znode.
      Specified by:
      isStoreMigrationAllowed in interface Admin
      Parameters:
      clusterName - name of Venice cluster.
      Returns:
      true if store migration is allowed for the input cluster; false otherwise.
    • isAdminOperationSystemStoreEnabled

      public boolean isAdminOperationSystemStoreEnabled()
    • migrateStore

      public void migrateStore(String srcClusterName, String destClusterName, String storeName)
      Main implementation for migrating a store from its source cluster to a new destination cluster. A new store (with same properties, e.g. name, owner, key schema, value schema) is created at the destination cluster and its StoreInfo is also cloned. For a store with enabled meta system store or enabled davinci push status, those system stores are also migrated. Different store versions are evaluated for the migration. For those versions to be migrated, it triggers the ADD_VERSION and starts ingestion at the destination cluster.
      Specified by:
      migrateStore in interface Admin
      Parameters:
      srcClusterName - name of the source cluster.
      destClusterName - name of the destination cluster.
      storeName - name of the target store.
    • clearIngestionKillMessageAndVerify

      public void clearIngestionKillMessageAndVerify(String clusterName, String versionTopicName)
      Clear KILL messages from a participant system store.
    • getControllerClientMap

      public Map<String,ControllerClient> getControllerClientMap(String clusterName)
    • completeMigration

      public void completeMigration(String srcClusterName, String destClusterName, String storeName)
      Specified by:
      completeMigration in interface Admin
      See Also:
    • abortMigration

      public void abortMigration(String srcClusterName, String destClusterName, String storeName)
      Abort store migration by resetting migration flag at the source cluster, resetting storeConfig, and updating "cluster" in "/storeConfigs" znode back to the source cluster.
      Specified by:
      abortMigration in interface Admin
      Parameters:
      srcClusterName - name of the source cluster.
      destClusterName - name of the destination cluster.
      storeName - name of the store in migration.
    • updateClusterDiscovery

      public void updateClusterDiscovery(String storeName, String oldCluster, String newCluster, String initiatingCluster)
      Description copied from interface: Admin
      Update the cluster discovery of a given store by writing to the StoreConfig ZNode.
      Specified by:
      updateClusterDiscovery in interface Admin
      Parameters:
      storeName - of the store.
      oldCluster - for the store.
      newCluster - for the store.
      initiatingCluster - that is making the update. This is needed because in the case of store migration sometimes the update is not made by the leader of the current cluster but instead the leader of the source cluster.
      See Also:
    • validateStoreDeleted

      public StoreDeletedValidation validateStoreDeleted(String clusterName, String storeName)
      Validates that a store has been completely deleted from the Venice cluster. This method performs comprehensive checks across multiple subsystems to ensure no lingering resources remain that would prevent safe store recreation. Resources checked: 1. Store configuration in ZooKeeper 2. Store metadata in store repository 3. System stores (only those that were enabled for the original store) 4. Kafka topics (version, RT, and system store topics) 5. Helix resources
      Specified by:
      validateStoreDeleted in interface Admin
      Parameters:
      clusterName - the name of the cluster to check (must not be null or empty)
      storeName - the name of the store to validate deletion for (must not be null or empty)
      Returns:
      StoreDeletedResult indicating whether the store is fully deleted or what resources remain
      Throws:
      IllegalArgumentException - if clusterName or storeName is null or empty
    • checkPreConditionForCreateStore

      protected void checkPreConditionForCreateStore(String clusterName, String storeName, String keySchema, String valueSchema, boolean allowSystemStore, boolean skipLingeringResourceCheck)
      Check whether Controller should block the incoming store creation. Inside this function, there is a logic to check whether there are any lingering resources since the requested store could be just deleted recently. This check should be skipped in Child Controller, but only enabled in Parent Controller because of the following reasons: 1. Parent Controller has the strict order that the system store must be created before the host Venice store. 2. Child Controller doesn't have this strict order since the admin messages of Child Controller could be executed in parallel since they are different store names. So when such kind of race condition happens, it will cause a dead loop: a. The version creation of system store will create a RT topic in Parent Cluster. b. The RT topic will be mirrored by KMM to the Child Cluster. c. The version creation admin message of system store will be blocked in Child Controller since the host Venice store doesn't exist. d. The store creation admin message of the host Venice store will be blocked in Child Controller because of lingering resource check (RT topic of its system store already exists, which is created by KMM). TODO: Evaluate if this code needs to change now that KMM has been deprecated. In the future, once Venice gets rid of KMM, the topic won't be automatically created by KMM, and this race condition will be addressed. So far, Child Controller will skip lingering resource check when handling store creation admin message.
    • addVersionAndStartIngestion

      public void addVersionAndStartIngestion(String clusterName, String storeName, String pushJobId, int versionNumber, int numberOfPartitions, Version.PushType pushType, String remoteKafkaBootstrapServers, long rewindTimeInSecondsOverride, int replicationMetadataVersionId, boolean versionSwapDeferred, int repushSourceVersion, int repushTtlSeconds)
      This function is only being used by store migration parent controllers, which write add version admin message. We use Version.DEFAULT_RT_VERSION_NUMBER here that does not change anything in the version and the migrated version copies whatever is there in the source version.
      Specified by:
      addVersionAndStartIngestion in interface Admin
    • addVersionAndStartIngestion

      public void addVersionAndStartIngestion(String clusterName, String storeName, String pushJobId, int versionNumber, int numberOfPartitions, Version.PushType pushType, String remoteKafkaBootstrapServers, long rewindTimeInSecondsOverride, int replicationMetadataVersionId, boolean versionSwapDeferred, String targetedRegions, int repushSourceVersion, int currentRTVersionNumber, int repushTtlSeconds)
      This is a wrapper for VeniceHelixAdmin#addVersion but performs additional operations needed for add version invoked from the admin channel. Therefore, this method is mainly invoked from the admin task upon processing an add version message.
    • replicateAddVersionAndStartIngestion

      public void replicateAddVersionAndStartIngestion(String clusterName, String storeName, String pushJobId, int versionNumber, int numberOfPartitions, Version.PushType pushType, String remoteKafkaBootstrapServers, long rewindTimeInSecondsOverride, int replicationMetadataVersionId)
      This method is invoked in parent controllers to replicate new version signals for migrating store.
    • addVersionAndTopicOnly

      public Pair<Boolean,Version> addVersionAndTopicOnly(String clusterName, String storeName, String pushJobId, int versionNumber, int numberOfPartitions, int replicationFactor, boolean sendStartOfPush, boolean sorted, Version.PushType pushType, String compressionDictionary, String remoteKafkaBootstrapServers, Optional<String> sourceGridFabric, long rewindTimeInSecondsOverride, int replicationMetadataVersionId, Optional<String> emergencySourceRegion, boolean versionSwapDeferred, String targetedRegions, int repushSourceVersion, int largestUsedRTVersionNumber, int repushTtlSeconds)
      A wrapper to invoke VeniceHelixAdmin#addVersion to only increment the version and create the topic(s) needed without starting ingestion.
    • addVersionOnly

      public Version addVersionOnly(String clusterName, String storeName, String pushJobId, int versionNumber, int numberOfPartitions, Version.PushType pushType, String remoteKafkaBootstrapServers, long rewindTimeInSecondsOverride, int replicationMetadataVersionId, int largestUsedRTVersionNumber)
      Only add version to the store without creating the topic or start ingestion. Used to sync version metadata in the parent fabric during store migration.
    • addSpecificVersion

      public boolean addSpecificVersion(String clusterName, String storeName, Version version)
      TODO refactor addVersion to these broken down methods instead of doing everything in one giant method. Perform add version to a given store with the provided Version
    • createSpecificVersionTopic

      public void createSpecificVersionTopic(String clusterName, String storeName, Version version)
      Create the corresponding version topic based on the provided Version
    • createHelixResourceAndStartMonitoring

      public void createHelixResourceAndStartMonitoring(String clusterName, String storeName, Version version)
      Create Helix-resources for a given storage node cluster and starts monitoring a new push.
    • incrementVersionIdempotent

      public Version incrementVersionIdempotent(String clusterName, String storeName, String pushJobId, int numberOfPartitions, int replicationFactor, Version.PushType pushType, boolean sendStartOfPush, boolean sorted, String compressionDictionary, Optional<String> sourceGridFabric, Optional<X509Certificate> requesterCert, long rewindTimeInSecondsOverride, Optional<String> emergencySourceRegion, boolean versionSwapDeferred, String targetedRegions, int repushSourceVersion, int repushTtlSeconds)
      Note: this currently use the pushID to guarantee idempotence, unexpected behavior may result if multiple batch jobs push to the same store at the same time.
      Specified by:
      incrementVersionIdempotent in interface Admin
    • getReplicationMetadataSchema

      public Optional<org.apache.avro.Schema> getReplicationMetadataSchema(String clusterName, String storeName, int valueSchemaID, int rmdVersionID)
      Specified by:
      getReplicationMetadataSchema in interface Admin
      Returns:
      replication metadata schema for a store in a cluster with specified schema ID and RMD protocol version ID.
    • getReferenceVersionForStreamingWrites

      public Version getReferenceVersionForStreamingWrites(String clusterName, String storeName, String pushJobId)
      Specified by:
      getReferenceVersionForStreamingWrites in interface Admin
    • getIncrementalPushVersion

      public Version getIncrementalPushVersion(String clusterName, String storeName, String pushJobId)
      Specified by:
      getIncrementalPushVersion in interface Admin
    • getCurrentVersion

      public int getCurrentVersion(String clusterName, String storeName)
      Specified by:
      getCurrentVersion in interface Admin
      Returns:
      The current version number of an input store in the specified Venice cluster or Store.NON_EXISTING_VERSION if none exists.
    • getFutureVersion

      public int getFutureVersion(String clusterName, String storeName)
      Specified by:
      getFutureVersion in interface Admin
      Returns:
      Returns the online (completed, but not yet swapped) or future version with ongoing ingestion else if none exists returns Store.NON_EXISTING_VERSION
    • getBackupVersion

      public int getBackupVersion(String clusterName, String storeName)
      Specified by:
      getBackupVersion in interface Admin
    • getFutureVersionWithStatus

      public int getFutureVersionWithStatus(String clusterName, String storeName, VersionStatus status)
    • getCurrentVersionsForMultiColos

      public Map<String,Integer> getCurrentVersionsForMultiColos(String clusterName, String storeName)
      Specified by:
      getCurrentVersionsForMultiColos in interface Admin
    • getRepushInfo

      public RepushInfo getRepushInfo(String clusterName, String storeName, Optional<String> fabricName)
      Specified by:
      getRepushInfo in interface Admin
      Returns:
      a new RepushInfo object with specified store info.
    • getFutureVersionsForMultiColos

      public Map<String,String> getFutureVersionsForMultiColos(String clusterName, String storeName)
      Specified by:
      getFutureVersionsForMultiColos in interface Admin
      See Also:
    • getBackupVersionsForMultiColos

      public Map<String,String> getBackupVersionsForMultiColos(String clusterName, String storeName)
      Specified by:
      getBackupVersionsForMultiColos in interface Admin
    • deleteAllVersionsInStore

      public List<Version> deleteAllVersionsInStore(String clusterName, String storeName)
      Description copied from interface: Admin
      Delete all of venice versions in given store(including venice resource, kafka topic, offline pushs and all related resources).
      Specified by:
      deleteAllVersionsInStore in interface Admin
      See Also:
    • deleteOldVersionInStore

      public void deleteOldVersionInStore(String clusterName, String storeName, int versionNum)
      Description copied from interface: Admin
      Delete the given version from the store. If the given version is the current version, an exception will be thrown.
      Specified by:
      deleteOldVersionInStore in interface Admin
      See Also:
    • deleteOneStoreVersion

      public void deleteOneStoreVersion(String clusterName, String storeName, int versionNumber)
      Delete version from cluster, removing all related resources
      Specified by:
      deleteOneStoreVersion in interface StoreCleaner
    • shouldSkipTruncatingTopic

      public boolean shouldSkipTruncatingTopic(String clusterName)
      Check if we should skip truncating topic. If it's parent fabrics and the topic write is NOT needed, return true; Otherwise, return false.
      Parameters:
      clusterName - the cluster name to check
      Returns:
      true if topic truncation should be skipped, false otherwise
    • isRTTopicDeletionPermittedByAllControllers

      public boolean isRTTopicDeletionPermittedByAllControllers(String clusterName, String rtTopicName)
      Specified by:
      isRTTopicDeletionPermittedByAllControllers in interface Admin
    • retireOldStoreVersions

      public void retireOldStoreVersions(String clusterName, String storeName, boolean deleteBackupOnStartPush, int currentVersionBeforePush)
      For a given store, determine its versions to delete based on the BackupStrategy settings and execute the deletion in the cluster (including all its resources). It also truncates Kafka topics and Helix resources.
      Specified by:
      retireOldStoreVersions in interface StoreCleaner
      Parameters:
      clusterName - name of a cluster.
      storeName - name of the store to retire.
      deleteBackupOnStartPush - indicate if it is called in a start-of-push workflow.
      currentVersionBeforePush - current version before a new push.
    • topicCleanupWhenPushComplete

      public void topicCleanupWhenPushComplete(String clusterName, String storeName, int versionNumber)
      In this function, Controller will setup proper compaction strategy when the push job is full completed, and here are the reasons to set it up after the job completes: 1. For batch push jobs to batch-only store, there is no impact. There could still be duplicate entries because of speculative executions in map-reduce job, but we are not planning to clean them up now. 2. For batch push jobs to hybrid/incremental stores, if the compaction is enabled at the beginning of the job, Kafka compaction could kick in during push job, and storage node could detect DIV error, such as missing messages, checksum mismatch, because speculative execution could produce duplicate entries, and we don't want to fail the push in this scenario and we still want to perform the strong DIV validation in batch push, so we could only enable compaction after the batch push completes. 3. For GF jobs to hybrid store, it is similar as #2, and it contains duplicate entries because there is no de-dedup happening anywhere. With this way, when load rebalance happens for hybrid/incremental stores, DIV error could be detected during ingestion at any phase since compaction might be enabled long-time ago. So in storage node, we need to add one more safeguard before throwing the DIV exception to check whether the topic is compaction-enabled or not. Since Venice is not going to change the compaction policy between non-compact and compact back and forth, checking whether topic is compaction-enabled or not when encountering DIV error should be good enough.
      Specified by:
      topicCleanupWhenPushComplete in interface StoreCleaner
    • isTopicTruncated

      public boolean isTopicTruncated(String kafkaTopicName)
      Check if a kafka topic is absent or truncated.
      Specified by:
      isTopicTruncated in interface Admin
      See Also:
    • isTopicTruncatedBasedOnRetention

      public boolean isTopicTruncatedBasedOnRetention(long retention)
      Test if retention is less than the configured DEPRECATED_TOPIC_MAX_RETENTION_MS value.
      Specified by:
      isTopicTruncatedBasedOnRetention in interface Admin
      Returns:
      true if the specified retention is below the configuration; false otherwise.
      See Also:
    • isTopicTruncatedBasedOnRetention

      public boolean isTopicTruncatedBasedOnRetention(String kafkaTopicName, long retentionTime)
      Topic should also be considered to get cleaned up if: retention is less than the configured ConfigKeys.DEPRECATED_TOPIC_MAX_RETENTION_MS value. or 1. Topic retention equals fatalDataValidationFailureRetentionMs. 2. Topic is a version topic. 3. fatalDataValidationFailureRetentionMs has already passed since its creation.
      Specified by:
      isTopicTruncatedBasedOnRetention in interface Admin
    • getMinNumberOfUnusedKafkaTopicsToPreserve

      public int getMinNumberOfUnusedKafkaTopicsToPreserve()
      Specified by:
      getMinNumberOfUnusedKafkaTopicsToPreserve in interface Admin
      Returns:
      the controller configuration value for MIN_NUMBER_OF_UNUSED_KAFKA_TOPICS_TO_PRESERVE.
      See Also:
    • truncateKafkaTopic

      public boolean truncateKafkaTopic(String kafkaTopicName)
      We don't actually truncate any Kafka topic here; we just update the retention time.
      Specified by:
      truncateKafkaTopic in interface Admin
      Parameters:
      kafkaTopicName -
      Returns:
    • truncateKafkaTopic

      public boolean truncateKafkaTopic(String topicName, long retentionTime)
      Description copied from interface: Admin
      Truncate a Kafka topic by setting its retention time to the input value.
      Specified by:
      truncateKafkaTopic in interface Admin
      Parameters:
      topicName - the name of the topic to truncate.
      retentionTime - the retention time in milliseconds to set for the topic.
      Returns:
      true if truncating this topic successfully. false otherwise.
      See Also:
    • versionsForStore

      public List<Version> versionsForStore(String clusterName, String storeName)
      Specified by:
      versionsForStore in interface Admin
      Returns:
      all versions of the specified store from a cluster.
    • getAllStores

      public List<Store> getAllStores(String clusterName)
      Specified by:
      getAllStores in interface Admin
      Returns:
      all stores in the specified cluster.
    • getAllStoreStatuses

      public Map<String,String> getAllStoreStatuses(String clusterName)
      Description copied from interface: Admin
      Get the statuses of all stores. The store status is decided by the current version. For example, if one partition only have 2 ONLINE replicas in the current version, we say this store is under replicated. Refer to StoreStatus for the definition of each status.
      Specified by:
      getAllStoreStatuses in interface Admin
      Returns:
      a map whose key is store name and value is store's status.
      See Also:
    • hasStore

      public boolean hasStore(String clusterName, String storeName)
      Test if the input store exists in a cluster.
      Specified by:
      hasStore in interface Admin
      Parameters:
      clusterName - name of a cluster.
      storeName - name of a store.
      Returns:
      ture if store exists in the cluster. false otherwise.
    • getStore

      public Store getStore(String clusterName, String storeName)
      Specified by:
      getStore in interface Admin
      Returns:
      Store object reference from the input store name.
    • setStoreCurrentVersion

      public void setStoreCurrentVersion(String clusterName, String storeName, int versionNumber)
      Update the current version of a specified store.
      Specified by:
      setStoreCurrentVersion in interface Admin
    • setStoreCurrentVersion

      public void setStoreCurrentVersion(String clusterName, String storeName, int versionNumber, boolean allowedInParent)
      In most cases, parent region should not update the current version. This is only allowed via an update-store call where the region filter list only contains one region, which is the region of the parent controller
    • rollForwardToFutureVersion

      public void rollForwardToFutureVersion(String clusterName, String storeName, String regionFilter)
      Specified by:
      rollForwardToFutureVersion in interface Admin
    • rollbackToBackupVersion

      public void rollbackToBackupVersion(String clusterName, String storeName, String regionFilter)
      Set backup version as current version in a child region.
      Specified by:
      rollbackToBackupVersion in interface Admin
    • setStoreLargestUsedVersion

      public void setStoreLargestUsedVersion(String clusterName, String storeName, int versionNumber)
      Update the largest used version number of a specified store.
      Specified by:
      setStoreLargestUsedVersion in interface Admin
    • setStoreLargestUsedRTVersion

      public void setStoreLargestUsedRTVersion(String clusterName, String storeName, int versionNumber)
      Update the largest used RT version number of a specified store.
      Specified by:
      setStoreLargestUsedRTVersion in interface Admin
    • setStoreOwner

      public void setStoreOwner(String clusterName, String storeName, String owner)
      Update the owner of a specified store.
      Specified by:
      setStoreOwner in interface Admin
    • setStorePartitionCount

      public void setStorePartitionCount(String clusterName, String storeName, int partitionCount)
      Since partition check/calculation only happens when adding new store version, setStorePartitionCount(String, String, int) would only change the number of partition for the following pushes. Current version would not be changed.
      Specified by:
      setStorePartitionCount in interface Admin
    • preCheckStorePartitionCountUpdate

      public void preCheckStorePartitionCountUpdate(String clusterName, Store store, int newPartitionCount)
    • setStorePartitionerConfig

      public void setStorePartitionerConfig(String clusterName, String storeName, PartitionerConfig partitionerConfig)
    • setStoreWriteability

      public void setStoreWriteability(String clusterName, String storeName, boolean desiredWriteability)
      Update the writability of a specified store.
      Specified by:
      setStoreWriteability in interface Admin
    • setStoreReadability

      public void setStoreReadability(String clusterName, String storeName, boolean desiredReadability)
      Update the readability of a specified store.
      Specified by:
      setStoreReadability in interface Admin
    • setStoreReadWriteability

      public void setStoreReadWriteability(String clusterName, String storeName, boolean isAccessible)
      Update both readability and writability of a specified store.
      Specified by:
      setStoreReadWriteability in interface Admin
    • setStoreStorageQuota

      public void setStoreStorageQuota(String clusterName, String storeName, long storageQuotaInByte)
      We will not expose this interface to Spark server. Updating quota can only be done by #updateStore TODO: remove all store attribute setters.
    • setStoreReadQuota

      public void setStoreReadQuota(String clusterName, String storeName, long readQuotaInCU)
    • setAccessControl

      public void setAccessControl(String clusterName, String storeName, boolean accessControlled)
    • getMetaStoreValue

      public StoreMetaValue getMetaStoreValue(StoreMetaKey metaKey, String storeName)
      Specified by:
      getMetaStoreValue in interface Admin
    • getInUseValueSchemaIds

      public Set<Integer> getInUseValueSchemaIds(String clusterName, String storeName)
      Specified by:
      getInUseValueSchemaIds in interface Admin
    • deleteValueSchemas

      public void deleteValueSchemas(String clusterName, String storeName, Set<Integer> unusedValueSchemaIds)
      Description copied from interface: Admin
      Deletes a store's values schema with ids `except` the ids passed in the argument inuseValueSchemaIds
      Specified by:
      deleteValueSchemas in interface Admin
    • setStoreCompressionStrategy

      public void setStoreCompressionStrategy(String clusterName, String storeName, CompressionStrategy compressionStrategy)
    • setClientDecompressionEnabled

      public void setClientDecompressionEnabled(String clusterName, String storeName, boolean clientDecompressionEnabled)
    • setChunkingEnabled

      public void setChunkingEnabled(String clusterName, String storeName, boolean chunkingEnabled)
    • setRmdChunkingEnabled

      public void setRmdChunkingEnabled(String clusterName, String storeName, boolean rmdChunkingEnabled)
    • setIncrementalPushEnabled

      public void setIncrementalPushEnabled(String clusterName, String storeName, boolean incrementalPushEnabled)
    • setSeparateRealTimeTopicEnabled

      public void setSeparateRealTimeTopicEnabled(String clusterName, String storeName, boolean separateRealTimeTopicEnabled)
    • setReplicationFactor

      public void setReplicationFactor(String clusterName, String storeName, int replicaFactor)
    • setBatchGetLimit

      public void setBatchGetLimit(String clusterName, String storeName, int batchGetLimit)
    • setNumVersionsToPreserve

      public void setNumVersionsToPreserve(String clusterName, String storeName, int numVersionsToPreserve)
    • setStoreMigration

      public void setStoreMigration(String clusterName, String storeName, boolean migrating)
    • setMigrationDuplicateStore

      public void setMigrationDuplicateStore(String clusterName, String storeName, boolean migrationDuplicateStore)
    • setWriteComputationEnabled

      public void setWriteComputationEnabled(String clusterName, String storeName, boolean writeComputationEnabled)
    • setReplicationMetadataVersionID

      public void setReplicationMetadataVersionID(String clusterName, String storeName, int rmdVersion)
    • setReadComputationEnabled

      public void setReadComputationEnabled(String clusterName, String storeName, boolean computationEnabled)
    • setBootstrapToOnlineTimeoutInHours

      public void setBootstrapToOnlineTimeoutInHours(String clusterName, String storeName, int bootstrapToOnlineTimeoutInHours)
    • setNativeReplicationEnabled

      public void setNativeReplicationEnabled(String clusterName, String storeName, boolean nativeReplicationEnabled)
    • setPushStreamSourceAddress

      public void setPushStreamSourceAddress(String clusterName, String storeName, String pushStreamSourceAddress)
    • addStoreViews

      public void addStoreViews(String clusterName, String storeName, Map<String,String> viewConfigMap)
    • setBackupStrategy

      public void setBackupStrategy(String clusterName, String storeName, BackupStrategy backupStrategy)
    • setStoreLifecycleHooks

      public void setStoreLifecycleHooks(String clusterName, String storeName, List<LifecycleHooksRecord> storeLifecycleHooks)
    • setAutoSchemaRegisterPushJobEnabled

      public void setAutoSchemaRegisterPushJobEnabled(String clusterName, String storeName, boolean autoSchemaRegisterPushJobEnabled)
    • setHybridStoreDiskQuotaEnabled

      public void setHybridStoreDiskQuotaEnabled(String clusterName, String storeName, boolean hybridStoreDiskQuotaEnabled)
    • setBackupVersionRetentionMs

      public void setBackupVersionRetentionMs(String clusterName, String storeName, long backupVersionRetentionMs)
    • setNativeReplicationSourceFabric

      public void setNativeReplicationSourceFabric(String clusterName, String storeName, String nativeReplicationSourceFabric)
    • setActiveActiveReplicationEnabled

      public void setActiveActiveReplicationEnabled(String clusterName, String storeName, boolean activeActiveReplicationEnabled)
    • disableMetaSystemStore

      public void disableMetaSystemStore(String clusterName, String storeName)
    • disableDavinciPushStatusStore

      public void disableDavinciPushStatusStore(String clusterName, String storeName)
    • setLatestSupersetSchemaId

      public void setLatestSupersetSchemaId(String clusterName, String storeName, int latestSupersetSchemaId)
    • setStorageNodeReadQuotaEnabled

      public void setStorageNodeReadQuotaEnabled(String clusterName, String storeName, boolean storageNodeReadQuotaEnabled)
    • updateStore

      public void updateStore(String clusterName, String storeName, UpdateStoreQueryParams params)
      TODO: some logics are in parent controller VeniceParentHelixAdmin #updateStore and some are in the child controller here. Need to unify them in the future.
      Specified by:
      updateStore in interface Admin
    • updateClusterConfig

      public void updateClusterConfig(String clusterName, UpdateClusterConfigQueryParams params)
      Update the LiveClusterConfig at runtime for a specified cluster.
      Specified by:
      updateClusterConfig in interface Admin
      Parameters:
      clusterName - name of the Venice cluster.
      params - parameters to update.
    • updateDarkClusterConfig

      public void updateDarkClusterConfig(String clusterName, UpdateDarkClusterConfigQueryParams params)
      Specified by:
      updateDarkClusterConfig in interface Admin
    • markDatacenterDegraded

      public void markDatacenterDegraded(String clusterName, String datacenterName, int timeoutMinutes, String operatorId)
      Description copied from interface: Admin
      Mark a datacenter as degraded for a given cluster. Pushes will auto-exclude this DC.
      Specified by:
      markDatacenterDegraded in interface Admin
    • unmarkDatacenterDegraded

      public void unmarkDatacenterDegraded(String clusterName, String datacenterName)
      Description copied from interface: Admin
      Unmark a datacenter as degraded. Triggers recovery for affected stores.
      Specified by:
      unmarkDatacenterDegraded in interface Admin
    • isDegradedModeEnabled

      public boolean isDegradedModeEnabled(String clusterName)
      Description copied from interface: Admin
      Check if degraded mode is enabled for a cluster.
      Specified by:
      isDegradedModeEnabled in interface Admin
    • getDegradedDcStates

      public DegradedDcStates getDegradedDcStates(String clusterName)
      Description copied from interface: Admin
      Get the current degraded datacenter states for a cluster.
      Specified by:
      getDegradedDcStates in interface Admin
    • isFabricInActiveList

      public static boolean isFabricInActiveList(List<String> activeFabrics, String localFabric)
      Returns true if localFabric is permitted by an ETL active-fabrics allowlist. null or empty list means "no restriction; permit every fabric" (default behavior). A non-empty list permits only listed fabrics.
    • onboardETLForExistingStoreVersion

      public void onboardETLForExistingStoreVersion(Store store)
    • offboardETLForExistingStoreVersion

      public void offboardETLForExistingStoreVersion(Store store)
    • enableHybridModeOrUpdateSettings

      public void enableHybridModeOrUpdateSettings(String clusterName, String storeName)
      Enabling hybrid mode for incremental push store is moved into VeniceParentHelixAdmin.updateStore(String, String, UpdateStoreQueryParams) TODO: Remove the method and its usage after the deployment of parent controller updateStore change.
    • replicateUpdateStore

      public void replicateUpdateStore(String clusterName, String storeName, UpdateStoreQueryParams params)
      This method is invoked in parent controllers for store migration.
    • addNewViewConfigsIntoOldConfigs

      public static Map<String,StoreViewConfigRecord> addNewViewConfigsIntoOldConfigs(Store oldStore, String viewClass, ViewConfig viewConfig) throws VeniceException
      Throws:
      VeniceException
    • removeViewConfigFromStoreViewConfigMap

      public static Map<String,StoreViewConfigRecord> removeViewConfigFromStoreViewConfigMap(Store oldStore, String viewClass) throws VeniceException
      Throws:
      VeniceException
    • storeMetadataUpdate

      public void storeMetadataUpdate(String clusterName, String storeName, VeniceHelixAdmin.StoreMetadataOperation operation)
      Update the store metadata by applying provided operation.
      Parameters:
      clusterName - name of the cluster.
      storeName - name of the to be updated store.
      operation - the defined operation that update the store.
    • getStorageEngineOverheadRatio

      public double getStorageEngineOverheadRatio(String clusterName)
      Specified by:
      getStorageEngineOverheadRatio in interface Admin
      Returns:
      the configuration value for ConfigKeys.STORAGE_ENGINE_OVERHEAD_RATIO
    • containsHelixResource

      public boolean containsHelixResource(String clusterName, String kafkaTopic)
      Description copied from interface: StoreCleaner
      This purpose of the function is to check if the given resource exists in the Helix cluster.
      Specified by:
      containsHelixResource in interface StoreCleaner
      Parameters:
      clusterName - The Venice cluster that the resource belongs to.
      kafkaTopic - it's usually the store version name (version topic name).
      Returns:
    • deleteHelixResource

      public void deleteHelixResource(String clusterName, String kafkaTopic)
      Description copied from interface: StoreCleaner
      This purpose of the function is to delete the given resource from the Helix cluster. Different from StoreCleaner.deleteOneStoreVersion(String, String, int), this function will not check whether the store version is still a valid version inside Venice backend, and it will send the delete request to Helix cluster directly. Do enough sanity check before calling this function.
      Specified by:
      deleteHelixResource in interface StoreCleaner
      Parameters:
      clusterName - The Venice cluster that the resource belongs to.
      kafkaTopic - It's usually the store version name (version topic name).
    • enableDisabledPartition

      public void enableDisabledPartition(String clusterName, String kafkaTopic, boolean enableAll)
    • getKeySchema

      public SchemaEntry getKeySchema(String clusterName, String storeName)
      Specified by:
      getKeySchema in interface Admin
      Returns:
      the key schema for the specified store.
    • getValueSchemas

      public Collection<SchemaEntry> getValueSchemas(String clusterName, String storeName)
      Specified by:
      getValueSchemas in interface Admin
      Returns:
      the value schema for the specified store.
    • getDerivedSchemas

      public Collection<DerivedSchemaEntry> getDerivedSchemas(String clusterName, String storeName)
      Specified by:
      getDerivedSchemas in interface Admin
      Returns:
      the derived schema for the specified store.
    • getValueSchemaId

      public int getValueSchemaId(String clusterName, String storeName, String valueSchemaStr)
      Specified by:
      getValueSchemaId in interface Admin
      Returns:
      the schema id for the specified store and value schema.
    • getDerivedSchemaId

      public GeneratedSchemaID getDerivedSchemaId(String clusterName, String storeName, String schemaStr)
      Specified by:
      getDerivedSchemaId in interface Admin
      Returns:
      the derived schema id for the specified store and derived schema.
    • getValueSchema

      public SchemaEntry getValueSchema(String clusterName, String storeName, int id)
      Specified by:
      getValueSchema in interface Admin
      Returns:
      the derived schema for the specified store and id.
    • addValueSchema

      public SchemaEntry addValueSchema(String clusterName, String storeName, String valueSchemaStr, DirectionalSchemaCompatibilityType expectedCompatibilityType)
      Specified by:
      addValueSchema in interface Admin
      See Also:
    • addValueSchema

      public SchemaEntry addValueSchema(String clusterName, String storeName, String valueSchemaStr, int schemaId, DirectionalSchemaCompatibilityType compatibilityType)
      Add a new value schema for the given store with all specified properties and return a new SchemaEntry object containing the schema and its id.
      Specified by:
      addValueSchema in interface Admin
      Returns:
      an SchemaEntry object composed of a schema and its corresponding id.
    • addDerivedSchema

      public DerivedSchemaEntry addDerivedSchema(String clusterName, String storeName, int valueSchemaId, String derivedSchemaStr)
      Add a new derived schema for the given store with all specified properties and return a new DerivedSchemaEntry object containing the schema and its id.
      Specified by:
      addDerivedSchema in interface Admin
      Returns:
      an DerivedSchemaEntry object composed of specified properties.
    • addDerivedSchema

      public DerivedSchemaEntry addDerivedSchema(String clusterName, String storeName, int valueSchemaId, int derivedSchemaId, String derivedSchemaStr)
      Add a new derived schema for the given store with all specified properties.
      Specified by:
      addDerivedSchema in interface Admin
      Returns:
      an DerivedSchemaEntry object composed of specified properties.
    • removeDerivedSchema

      public DerivedSchemaEntry removeDerivedSchema(String clusterName, String storeName, int valueSchemaId, int derivedSchemaId)
      Description copied from interface: Admin
      Remove an existing derived schema
      Specified by:
      removeDerivedSchema in interface Admin
      Returns:
      the derived schema that is deleted or null if the schema doesn't exist
      See Also:
    • addSupersetSchema

      public SchemaEntry addSupersetSchema(String clusterName, String storeName, String valueSchema, int valueSchemaId, String supersetSchemaStr, int supersetSchemaId)
      Add a new superset schema for the given store with all specified properties.

      Generate the superset schema off the current schema and latest superset schema (if any, if not pick the latest value schema) existing in the store. If the newly generated superset schema is unique add it to the store and update latestSuperSetValueSchemaId of the store.

      Specified by:
      addSupersetSchema in interface Admin
    • getReplicationMetadataSchemas

      public Collection<RmdSchemaEntry> getReplicationMetadataSchemas(String clusterName, String storeName)
      Specified by:
      getReplicationMetadataSchemas in interface Admin
      Returns:
      a collection of ReplicationMetadataSchemaEntry object for the given store and cluster.
    • addReplicationMetadataSchema

      public RmdSchemaEntry addReplicationMetadataSchema(String clusterName, String storeName, int valueSchemaId, int replicationMetadataVersionId, String replicationMetadataSchemaStr)
      Create a new ReplicationMetadataSchemaEntry object with the given properties and add it into schema repository if no duplication.
      Specified by:
      addReplicationMetadataSchema in interface Admin
      Returns:
      ReplicationMetadataSchemaEntry object reference.
    • validateAndMaybeRetrySystemStoreAutoCreation

      public void validateAndMaybeRetrySystemStoreAutoCreation(String clusterName, String storeName, VeniceSystemStoreType systemStoreType)
      Check the creation results of a user store's system store. If the system store's current version is in error state, re-issue a new empty push and waits for the empty push to complete.
      Specified by:
      validateAndMaybeRetrySystemStoreAutoCreation in interface Admin
    • getStorageNodes

      public List<String> getStorageNodes(String clusterName)
      Specified by:
      getStorageNodes in interface Admin
      Returns:
      a list of storage node instance names for a given cluster.
    • getHelixAdminClient

      public HelixAdminClient getHelixAdminClient()
    • getDisabledPartitionStats

      public DisabledPartitionStats getDisabledPartitionStats(String clusterName)
    • getStorageNodesStatus

      public Map<String,String> getStorageNodesStatus(String clusterName, boolean enableReplica)
      Specified by:
      getStorageNodesStatus in interface Admin
      Returns:
      a map containing the storage node name and its connectivity status (InstanceStatus).
    • removeStorageNode

      public void removeStorageNode(String clusterName, String instanceId)
      Remove one storage node from the given cluster.

      It removes the given helix nodeId from the allowlist in ZK and its associated resource in Helix.

      Specified by:
      removeStorageNode in interface Admin
    • stop

      public void stop(String clusterName)
      Description copied from interface: Admin
      Stop the helix controller for a single cluster.
      Specified by:
      stop in interface Admin
      See Also:
    • stopVeniceController

      public void stopVeniceController()
      Description copied from interface: Admin
      Stop the entire controller but not only the helix controller for a single cluster.
      Specified by:
      stopVeniceController in interface Admin
      See Also:
    • getOffLinePushStatus

      public Admin.OfflinePushStatusInfo getOffLinePushStatus(String clusterName, String kafkaTopic)
      Description copied from interface: Admin
      Query the status of the offline push by given kafka topic. TODO We use kafka topic to tracking the status now but in the further we should use jobId instead of kafka TODO topic. Right now each kafka topic only have one offline job. But in the further one kafka topic could be TODO assigned multiple jobs like data migration job etc.
      Specified by:
      getOffLinePushStatus in interface Admin
      Returns:
      the status of current offline push for the passed kafka topic
      See Also:
    • getOffLinePushStatus

      public Admin.OfflinePushStatusInfo getOffLinePushStatus(String clusterName, String kafkaTopic, Optional<String> incrementalPushVersion, String region, String targetedRegions, boolean isTargetRegionPushWithDeferredSwap)
      Specified by:
      getOffLinePushStatus in interface Admin
    • getOffLinePushStatus

      public Admin.OfflinePushStatusInfo getOffLinePushStatus(String clusterName, String kafkaTopic, Optional<String> incrementalPushVersion, String region, String targetedRegions)
    • updateIdealState

      public boolean updateIdealState(String clusterName, String resourceName, int minReplica)
    • getIdealState

      public org.apache.helix.model.IdealState getIdealState(String clusterName, String resourceName)
    • getKafkaBootstrapServers

      public String getKafkaBootstrapServers(boolean isSSL)
      Description copied from interface: Admin
      Return the ssl or non-ssl bootstrap servers based on the given flag.
      Specified by:
      getKafkaBootstrapServers in interface Admin
      Returns:
      kafka bootstrap servers url, if there are multiple will be comma separated.
      See Also:
    • getRegionName

      public String getRegionName()
      Description copied from interface: Admin
      Return the region name of this Admin
      Specified by:
      getRegionName in interface Admin
      Returns:
      the region name of this controller
    • getPubSubBootstrapServersForRegion

      public String getPubSubBootstrapServersForRegion(String sourceRegion)
      Specified by:
      getPubSubBootstrapServersForRegion in interface Admin
      Returns:
      PubSub address for the given region.
      See Also:
    • getNativeReplicationSourceFabric

      public String getNativeReplicationSourceFabric(String clusterName, Store store, Optional<String> sourceGridFabric, Optional<String> emergencySourceRegion, String targetedRegions)
      Source fabric selection priority: 1. Parent controller emergency source fabric config. 2. VPJ plugin targeted region config, however it will compute all selections based on the criteria below to select the source region. 3. VPJ plugin source grid fabric config. 4. Store level source fabric config. 5. Cluster level source fabric config.
      Specified by:
      getNativeReplicationSourceFabric in interface Admin
      Returns:
      the selected source fabric for a given store.
    • isSSLEnabledForPush

      public boolean isSSLEnabledForPush(String clusterName, String storeName)
      Description copied from interface: Admin
      Return whether ssl is enabled for the given store for push.
      Specified by:
      isSSLEnabledForPush in interface Admin
      See Also:
    • isSslToKafka

      public boolean isSslToKafka()
      Test if ssl is enabled to Kafka.
      Specified by:
      isSslToKafka in interface Admin
      See Also:
    • getTopicManager

      public TopicManager getTopicManager()
      Specified by:
      getTopicManager in interface Admin
      See Also:
    • getTopicManager

      public TopicManager getTopicManager(String pubSubServerAddress)
      Specified by:
      getTopicManager in interface Admin
      See Also:
    • isLeaderControllerFor

      public boolean isLeaderControllerFor(String clusterName)
      Description copied from interface: Admin
      Check if this controller itself is the leader controller for a given cluster or not. Note that the controller can be either a parent controller or a child controller since a cluster must have a leader child controller and a leader parent controller. The point is not to be confused the concept of leader-standby with parent-child controller architecture.
      Specified by:
      isLeaderControllerFor in interface Admin
      See Also:
    • getAggregatedHealthStatus

      public InstanceRemovableStatuses getAggregatedHealthStatus(String cluster, List<String> instances, List<String> toBeStoppedInstances, boolean isSSLEnabled)
      Specified by:
      getAggregatedHealthStatus in interface Admin
    • calculateNumberOfPartitions

      public int calculateNumberOfPartitions(String clusterName, String storeName)
      Calculate number of partition for given store.
      Specified by:
      calculateNumberOfPartitions in interface Admin
    • getReplicationFactor

      public int getReplicationFactor(String clusterName, String storeName)
      Specified by:
      getReplicationFactor in interface Admin
      Returns:
      the replication factor of the given store.
    • getReplicas

      public List<Replica> getReplicas(String clusterName, String kafkaTopic)
      Specified by:
      getReplicas in interface Admin
      Returns:
      a list of Replica created for the given resource.
    • getReplicasOfStorageNode

      public List<Replica> getReplicasOfStorageNode(String cluster, String instanceId)
      Specified by:
      getReplicasOfStorageNode in interface Admin
      See Also:
    • isDeferredVersionSwapForEmptyPushEnabled

      public boolean isDeferredVersionSwapForEmptyPushEnabled(String storeName)
      Specified by:
      isDeferredVersionSwapForEmptyPushEnabled in interface Admin
    • getDeferredVersionSwapRegionRollforwardOrder

      public String getDeferredVersionSwapRegionRollforwardOrder(String storeName)
      Specified by:
      getDeferredVersionSwapRegionRollforwardOrder in interface Admin
    • isInstanceRemovable

      public NodeRemovableResult isInstanceRemovable(String clusterName, String helixNodeId, List<String> lockedNodes)
      Description copied from interface: Admin
      Assuming all hosts identified by lockedNodes and their corresponding resources are unusable, is the given instance able to be removed out from the given cluster. For example, if there is only one online replica alive in this cluster which is hosted on the given instance. This instance should not be removed out of cluster, otherwise Venice will lose data. For detail criteria please refer to InstanceStatusDecider
      Specified by:
      isInstanceRemovable in interface Admin
      Parameters:
      clusterName - The cluster were the hosts belong.
      helixNodeId - nodeId of helix participant. HOST_PORT.
      lockedNodes - A list of helix nodeIds whose resources are assumed to be unusable (stopped).
      See Also:
    • getLeaderController

      public Instance getLeaderController(String clusterName)
      Description copied from interface: Admin
      Get instance of leader controller. If there is no leader controller for the given cluster, throw a VeniceException.
      Specified by:
      getLeaderController in interface Admin
      See Also:
    • getControllersByHelixState

      public List<Instance> getControllersByHelixState(String clusterName, String helixState)
      Get controllers instance based on the given helix state. We look at the external view of the controller cluster to find the venice controller by the wanted state.
    • getAllLiveInstanceControllers

      public List<Instance> getAllLiveInstanceControllers()
      Get all live instance controllers from ZK /LIVEINSTANCES
    • addInstanceToAllowlist

      public void addInstanceToAllowlist(String clusterName, String helixNodeId)
      Add the given helix nodeId into the allowlist in ZK.
      Specified by:
      addInstanceToAllowlist in interface Admin
    • removeInstanceFromAllowList

      public void removeInstanceFromAllowList(String clusterName, String helixNodeId)
      Remove the given helix nodeId from the allowlist in ZK.
      Specified by:
      removeInstanceFromAllowList in interface Admin
    • getAllowlist

      public Set<String> getAllowlist(String clusterName)
      Specified by:
      getAllowlist in interface Admin
      Returns:
      a list of all helix nodeIds in the allowlist for the given cluster from ZK.
    • killOfflinePush

      public void killOfflinePush(String clusterName, String kafkaTopic, boolean isForcedKill)
      Description copied from interface: Admin
      Kill an offline push if it ran into errors or the corresponding version is being retired.
      Specified by:
      killOfflinePush in interface Admin
      isForcedKill - should be set to true when killing the push job for retiring the corresponding version.
      See Also:
    • deleteParticipantStoreKillMessage

      public void deleteParticipantStoreKillMessage(String clusterName, String kafkaTopic)
      Compose a ParticipantMessageKey message and execute a delete operation on the key to the cluster's participant store.
    • sendKillMessageToParticipantStore

      public void sendKillMessageToParticipantStore(String clusterName, String kafkaTopic)
    • getStorageNodesStatus

      public StorageNodeStatus getStorageNodesStatus(String clusterName, String instanceId)
      Description copied from interface: Admin
      Query and return the current status of the given storage node. The "storage node status" is composed by "status" of all replicas in that storage node. "status" is an integer value of Helix state:
      • DROPPED=1
      • ERROR=2
      • OFFLINE=3
      • BOOTSTRAP=4
      • ONLINE=5
      So this method will return a map, the key is the replica name which is composed by resource name and partitionId, and the value is the "status" of this replica.
      Specified by:
      getStorageNodesStatus in interface Admin
      See Also:
    • isStorageNodeNewerOrEqualTo

      public boolean isStorageNodeNewerOrEqualTo(String clusterName, String instanceId, StorageNodeStatus oldStatus)
      Description copied from interface: Admin
      Compare the current storage node status and the given storage node status to check is the current one is "Newer" or "Equal" to the given one. Compare will go through each of replica in this storage node, if all their statuses values were larger or equal than the statuses value in the given storage node status, We say current storage node status is "Newer" or "Equal " to the given one.
      Specified by:
      isStorageNodeNewerOrEqualTo in interface Admin
      See Also:
    • setAdminConsumerService

      public void setAdminConsumerService(String clusterName, AdminConsumerService service)
      Specified by:
      setAdminConsumerService in interface Admin
      See Also:
    • skipAdminMessage

      public void skipAdminMessage(String clusterName, String typeIdAndBase64PositionBytes, boolean skipDIV, long executionId)
      Description copied from interface: Admin
      The admin consumption task tries to deal with failures to process an admin message by retrying. If there is a message that cannot be processed for some reason, we will need to forcibly skip that message in order to unblock the task from consuming subsequent messages.
      Specified by:
      skipAdminMessage in interface Admin
      skipDIV - tries to skip only the DIV check for the blocking message.
      See Also:
    • getLastSucceedExecutionId

      public Long getLastSucceedExecutionId(String clusterName)
      Description copied from interface: Admin
      Get the id of the last succeed execution in this controller.
      Specified by:
      getLastSucceedExecutionId in interface Admin
      See Also:
    • getLastSucceededExecutionId

      public Long getLastSucceededExecutionId(String clusterName, String storeName)
      Get last succeeded execution id for a given store; if storeName is null, return the last succeeded execution id for the cluster
      Parameters:
      clusterName -
      storeName -
      Returns:
      the last succeeded execution id or null if the cluster/store is invalid or the admin consumer service for the given cluster is not up and running yet.
    • getAdminCommandExecutionTracker

      public Optional<AdminCommandExecutionTracker> getAdminCommandExecutionTracker(String clusterName)
      Description copied from interface: Admin
      Get the tracker used to track the execution of the admin command for the given cluster.
      Specified by:
      getAdminCommandExecutionTracker in interface Admin
      See Also:
    • getAdminTopicMetadata

      public AdminMetadata getAdminTopicMetadata(String clusterName, Optional<String> storeName)
      Specified by:
      getAdminTopicMetadata in interface Admin
      Returns:
      cluster-level execution id, offset, upstream offset, and admin operation protocol version. If store name is specified, it returns store-level execution id.
    • updateAdminTopicMetadata

      public void updateAdminTopicMetadata(String clusterName, long executionId, Optional<String> storeName, Optional<PubSubPositionGrpcWireFormat> position, Optional<PubSubPositionGrpcWireFormat> upstreamPosition)
      Update cluster-level execution id, offset and upstream offset. If store name is specified, it updates the store-level execution id.
      Specified by:
      updateAdminTopicMetadata in interface Admin
    • updateAdminOperationProtocolVersion

      public void updateAdminOperationProtocolVersion(String clusterName, Long adminOperationProtocolVersion)
      Update AdminOperationProtocolVersion in metadata
      Specified by:
      updateAdminOperationProtocolVersion in interface Admin
    • getAdminOperationVersionFromControllers

      public Map<String,Long> getAdminOperationVersionFromControllers(String clusterName)
      Get the admin operation protocol versions from all controllers for specific cluster.
      Specified by:
      getAdminOperationVersionFromControllers in interface Admin
      Parameters:
      clusterName - : the cluster name
      Returns:
      map (controllerName: version). Example: {localhost_1234=1, localhost_1235=1}
    • getLocalAdminOperationProtocolVersion

      public long getLocalAdminOperationProtocolVersion()
      Get the local admin operation protocol version.
      Specified by:
      getLocalAdminOperationProtocolVersion in interface Admin
    • getRoutersClusterConfig

      public RoutersClusterConfig getRoutersClusterConfig(String clusterName)
      Description copied from interface: Admin
      Get the cluster level config for all routers.
      Specified by:
      getRoutersClusterConfig in interface Admin
      See Also:
    • updateRoutersClusterConfig

      public void updateRoutersClusterConfig(String clusterName, Optional<Boolean> isThrottlingEnable, Optional<Boolean> isQuotaRebalancedEnable, Optional<Boolean> isMaxCapacityProtectionEnabled, Optional<Integer> expectedRouterCount)
      Description copied from interface: Admin
      Update the cluster level for all routers.
      Specified by:
      updateRoutersClusterConfig in interface Admin
      See Also:
    • getAllStorePushStrategyForMigration

      public Map<String,String> getAllStorePushStrategyForMigration()
      Unsupported operation in the child controller.
      Specified by:
      getAllStorePushStrategyForMigration in interface Admin
    • setStorePushStrategyForMigration

      public void setStorePushStrategyForMigration(String voldemortStoreName, String strategy)
      Unsupported operation in the child controller.
      Specified by:
      setStorePushStrategyForMigration in interface Admin
    • discoverCluster

      public String discoverCluster(String storeName)
      Description copied from interface: Admin
      Find the cluster which the given store belongs to. Return the pair of the cluster name and the d2 service associated with that cluster.
      Specified by:
      discoverCluster in interface Admin
      See Also:
    • getRouterD2Service

      public String getRouterD2Service(String clusterName)
      Description copied from interface: Admin
      Find the router d2 service associated with a given cluster name.
      Specified by:
      getRouterD2Service in interface Admin
      See Also:
    • getServerD2Service

      public String getServerD2Service(String clusterName)
      Description copied from interface: Admin
      Find the server d2 service associated with a given cluster name.
      Specified by:
      getServerD2Service in interface Admin
      See Also:
    • findAllBootstrappingVersions

      public Map<String,String> findAllBootstrappingVersions(String clusterName)
      Description copied from interface: Admin
      Find the store versions which have at least one bootstrap replica.
      Specified by:
      findAllBootstrappingVersions in interface Admin
      See Also:
    • getVeniceWriterFactory

      public VeniceWriterFactory getVeniceWriterFactory()
      Specified by:
      getVeniceWriterFactory in interface Admin
      Returns:
      a VeniceWriterFactory object used by the Venice controller to create the venice writer.
    • getPubSubSSLProperties

      public VeniceProperties getPubSubSSLProperties(String pubSubBrokerAddress)
      Specified by:
      getPubSubSSLProperties in interface Admin
    • getAdminConsumerService

      public AdminConsumerService getAdminConsumerService(String clusterName)
      Specified by:
      getAdminConsumerService in interface Admin
    • stopMonitorOfflinePush

      public void stopMonitorOfflinePush(String clusterName, String topic, boolean deletePushStatus, boolean isForcedDelete)
    • close

      public void close()
      Cause VeniceHelixAdmin and its associated services to stop executing.
      Specified by:
      close in interface Admin
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • getHelixVeniceClusterResources

      public HelixVeniceClusterResources getHelixVeniceClusterResources(String cluster)
      Specified by:
      getHelixVeniceClusterResources in interface Admin
      Returns:
      the aggregate resources required by controller to manage a Venice cluster.
    • getControllerName

      public String getControllerName()
      Specified by:
      getControllerName in interface Admin
    • getStoreConfigRepo

      public HelixReadOnlyStoreConfigRepository getStoreConfigRepo()
      Description copied from interface: Admin
      Return a shared store config repository.
      Specified by:
      getStoreConfigRepo in interface Admin
    • isLeaderControllerOfControllerCluster

      public boolean isLeaderControllerOfControllerCluster()
      This function is used to detect whether current node is the leader controller of controller cluster. Be careful to use this function since it will talk to Zookeeper directly every time.
      Specified by:
      isLeaderControllerOfControllerCluster in interface Admin
      Returns:
    • setStoreConfigForMigration

      public void setStoreConfigForMigration(String storeName, String srcClusterName, String destClusterName)
      Update "migrationDestCluster" and "migrationSrcCluster" fields of the "/storeConfigs/storeName" znode.
      Parameters:
      storeName - name of the store.
      srcClusterName - name of the source cluster.
      destClusterName - name of the destination cluster.
    • updateAclForStore

      public void updateAclForStore(String clusterName, String storeName, String accessPermissions)
      Description copied from interface: Admin
      Provision a new set of ACL for a venice store and its associated kafka topic.
      Specified by:
      updateAclForStore in interface Admin
      See Also:
    • getAclForStore

      public String getAclForStore(String clusterName, String storeName)
      Description copied from interface: Admin
      Fetch the current set of ACL provisioned for a venice store and its associated kafka topic.
      Specified by:
      getAclForStore in interface Admin
      Returns:
      The string representation of the accessPermissions. It will return empty string in case store is not present.
      See Also:
    • deleteAclForStore

      public void deleteAclForStore(String clusterName, String storeName)
      Description copied from interface: Admin
      Delete the current set of ACL provisioned for a venice store and its associated kafka topic.
      Specified by:
      deleteAclForStore in interface Admin
      See Also:
    • getClusterStores

      public ArrayList<StoreInfo> getClusterStores(String clusterName)
      Description copied from interface: Admin
      Return all stores in a cluster.
      Specified by:
      getClusterStores in interface Admin
      Returns:
      a list of StoreInfo of all stores in the specified cluster.
    • getClusterStaleStores

      public Map<String,StoreDataAudit> getClusterStaleStores(String clusterName)
      Specified by:
      getClusterStaleStores in interface Admin
    • getStoresForCompaction

      public List<StoreInfo> getStoresForCompaction(String clusterName)
      - intermediary between LogCompactionService and CompactionManager - injects the child controller's ControllerClient into the function CompactionManager.getStoresForCompaction(String, Map) - serves as API endpoint to query stores ready for log compaction
      Specified by:
      getStoresForCompaction in interface Admin
      Parameters:
      clusterName -
      Returns:
      a list of StoreInfo of stores in clusterName that are ready for log compaction.
    • repushStore

      public RepushJobResponse repushStore(RepushJobRequest repushJobRequest) throws Exception
      triggers repush for storeName for log compaction of store topic

      - intermediary between LogCompactionService and CompactionManager - serves as API endpoint to trigger scheduled & adhoc log compaction

      Specified by:
      repushStore in interface Admin
      Parameters:
      repushJobRequest -
      Returns:
      Throws:
      Exception
    • getCompactionManager

      public CompactionManager getCompactionManager()
      Specified by:
      getCompactionManager in interface Admin
    • listStorePushInfo

      public Map<String,RegionPushDetails> listStorePushInfo(String clusterName, String storeName, boolean isPartitionDetailEnabled)
      Specified by:
      listStorePushInfo in interface Admin
    • preFetchDeadStoreStats

      public void preFetchDeadStoreStats(String clusterName, List<StoreInfo> storeInfos)
    • getDeadStores

      public List<StoreInfo> getDeadStores(String clusterName, String storeName, Map<String,String> params)
      Specified by:
      getDeadStores in interface Admin
      params - Parameters for dead store detection including: - "includeSystemStores": boolean (default: false) - "lookBackMS": long (optional) - Future extension points
      Returns:
      list of stores infos that are considered dead. A store is considered dead if it exists but has no user traffic in it's read or write path.
      See Also:
    • getRegionPushDetails

      public RegionPushDetails getRegionPushDetails(String clusterName, String storeName, boolean isPartitionDetailAdded)
      Specified by:
      getRegionPushDetails in interface Admin
      Returns:
      RegionPushDetails object containing the specified store's push status.
    • retrievePushStatus

      public OfflinePushStatus retrievePushStatus(String clusterName, StoreInfo store)
    • checkResourceCleanupBeforeStoreCreation

      public void checkResourceCleanupBeforeStoreCreation(String clusterName, String storeName)
      Description copied from interface: Admin
      Check whether there are any resource left for the store creation in cluster: If there is any, this function should throw Exception.
      Specified by:
      checkResourceCleanupBeforeStoreCreation in interface Admin
      See Also:
    • wipeCluster

      public void wipeCluster(String clusterName, String fabric, Optional<String> storeName, Optional<Integer> versionNum)
      Delete stores from the cluster including both store data and metadata.

      The API provides the flexibility to delete a single store or a single version. Cluster name and fabric are required parameters, but store name and version number are optional. If store name is empty, all stores in the cluster are deleted.

      Specified by:
      wipeCluster in interface Admin
      Parameters:
      clusterName - name of the Venice cluster.
      fabric - name of the fabric.
      storeName - name of the to be deleted store, if value is absent, all stores in the cluster are deleted.
      versionNum - the number of the version to be deleted, if present, only the specified version is deleted.
    • compareStore

      public StoreComparisonInfo compareStore(String clusterName, String storeName, String fabricA, String fabricB)
      Description copied from interface: Admin
      Compare store metadata and version states between two fabrics.
      Specified by:
      compareStore in interface Admin
      See Also:
    • copyOverStoreSchemasAndConfigs

      public StoreInfo copyOverStoreSchemasAndConfigs(String clusterName, String srcFabric, String destFabric, String storeName)
      Specified by:
      copyOverStoreSchemasAndConfigs in interface Admin
      See Also:
    • isParent

      public boolean isParent()
      Description copied from interface: Admin
      Check whether the controller works as a parent controller
      Specified by:
      isParent in interface Admin
      Returns:
      true if it works as a parent controller. Otherwise, return false.
      See Also:
    • getParentControllerRegionState

      public ParentControllerRegionState getParentControllerRegionState()
      Description copied from interface: Admin
      Return the state of the region of the parent controller.
      Specified by:
      getParentControllerRegionState in interface Admin
      Returns:
      ParentControllerRegionState.ACTIVE which means that the parent controller in the region is serving requests. Otherwise, return ParentControllerRegionState.PASSIVE
      See Also:
    • getChildDataCenterControllerUrlMap

      public Map<String,String> getChildDataCenterControllerUrlMap(String clusterName)
      Description copied from interface: Admin
      Get child datacenter to child controller url mapping.
      Specified by:
      getChildDataCenterControllerUrlMap in interface Admin
      Returns:
      A map of child datacenter -> child controller url
      See Also:
    • getChildDataCenterControllerD2Map

      public Map<String,String> getChildDataCenterControllerD2Map(String clusterName)
      Description copied from interface: Admin
      Get child datacenter to child controller d2 zk host mapping
      Specified by:
      getChildDataCenterControllerD2Map in interface Admin
      Returns:
      A map of child datacenter -> child controller d2 zk host
      See Also:
    • getChildControllerD2ServiceName

      public String getChildControllerD2ServiceName(String clusterName)
      Description copied from interface: Admin
      Get child datacenter controller d2 service name
      Specified by:
      getChildControllerD2ServiceName in interface Admin
      Returns:
      d2 service name
      See Also:
    • getReadOnlyZKSharedSystemStoreRepository

      public HelixReadOnlyZKSharedSystemStoreRepository getReadOnlyZKSharedSystemStoreRepository()
      Description copied from interface: Admin
      Return a shared read only store repository for zk shared stores.
      Specified by:
      getReadOnlyZKSharedSystemStoreRepository in interface Admin
      See Also:
    • getReadOnlyZKSharedSchemaRepository

      public HelixReadOnlyZKSharedSchemaRepository getReadOnlyZKSharedSchemaRepository()
      Description copied from interface: Admin
      Return a shared read only schema repository for zk shared stores.
      Specified by:
      getReadOnlyZKSharedSchemaRepository in interface Admin
      See Also:
    • getMetaStoreWriter

      public MetaStoreWriter getMetaStoreWriter()
      Description copied from interface: Admin
      Return a MetaStoreWriter, which can be shared across different Venice clusters.
      Specified by:
      getMetaStoreWriter in interface Admin
      See Also:
    • getMetaStoreReader

      public MetaStoreReader getMetaStoreReader()
      Specified by:
      getMetaStoreReader in interface Admin
    • getEmergencySourceRegion

      public Optional<String> getEmergencySourceRegion(@Nonnull String clusterName)
      Description copied from interface: Admin
      Return the emergency source region configuration.
      Specified by:
      getEmergencySourceRegion in interface Admin
      See Also:
    • getAggregateRealTimeTopicSource

      public Optional<String> getAggregateRealTimeTopicSource(String clusterName)
      Description copied from interface: Admin
      Return the source Kafka boostrap server url for aggregate real-time topic updates
      Specified by:
      getAggregateRealTimeTopicSource in interface Admin
      See Also:
    • isActiveActiveReplicationEnabledInAllRegion

      public boolean isActiveActiveReplicationEnabledInAllRegion(String clusterName, String storeName, boolean checkCurrentVersion)
      Description copied from interface: Admin
      Returns true if A/A replication is enabled in all child controller and parent controller. This is implemented only in parent controller. Otherwise, return false.
      Specified by:
      isActiveActiveReplicationEnabledInAllRegion in interface Admin
      See Also:
    • getClustersLeaderOf

      public List<String> getClustersLeaderOf()
      Description copied from interface: Admin
      Get a list of clusters this controller is a leader of.
      Specified by:
      getClustersLeaderOf in interface Admin
      Returns:
      a list of clusters this controller is a leader of.
      See Also:
    • getBackupVersionDefaultRetentionMs

      public long getBackupVersionDefaultRetentionMs()
      Description copied from interface: Admin
      Returns default backup version retention time.
      Specified by:
      getBackupVersionDefaultRetentionMs in interface Admin
      See Also:
    • getDefaultMaxRecordSizeBytes

      public int getDefaultMaxRecordSizeBytes(String clusterName)
      Specified by:
      getDefaultMaxRecordSizeBytes in interface Admin
      Returns:
      The default value of VeniceWriter.maxRecordSizeBytes for the given cluster. This resolves the correct per-cluster config instead of using the common config which may return the config from an arbitrary cluster in a multi-cluster setup.
      See Also:
    • nodeReplicaReadiness

      public Pair<NodeReplicasReadinessState,List<Replica>> nodeReplicaReadiness(String cluster, String helixNodeId)
      Description copied from interface: Admin
      helixNodeId nodeId of helix participant. HOST_PORT. Returns ture, if all current version replicas of the input node are ready to serve. false and all unready replicas otherwise.
      Specified by:
      nodeReplicaReadiness in interface Admin
      See Also:
    • initiateDataRecovery

      public void initiateDataRecovery(String clusterName, String storeName, int version, String sourceFabric, String destinationFabric, boolean copyAllVersionConfigs, Optional<Version> sourceFabricVersion)
      Description copied from interface: Admin
      Initiate data recovery for a store version given a source fabric.
      Specified by:
      initiateDataRecovery in interface Admin
      Parameters:
      clusterName - of the store.
      storeName - of the store.
      version - of the store.
      sourceFabric - to be used as the source for data recovery.
      copyAllVersionConfigs - a boolean to indicate whether all version configs should be copied from the source fabric or only the essential version configs and generate the rest based on destination fabric's Store configs.
      sourceFabricVersion - source fabric's Version configs used to configure the recovering version in the destination fabric.
      See Also:
    • prepareDataRecovery

      public void prepareDataRecovery(String clusterName, String storeName, int version, String sourceFabric, String destinationFabric, Optional<Integer> sourceAmplificationFactor)
      Description copied from interface: Admin
      Prepare for data recovery in the destination fabric. The interested store version might have lingering states and resources in the destination fabric from previous failed attempts. Perform some basic checks to make sure the store version in the destination fabric is capable of performing data recovery and cleanup any lingering states and resources.
      Specified by:
      prepareDataRecovery in interface Admin
      See Also:
    • isStoreVersionReadyForDataRecovery

      public Pair<Boolean,String> isStoreVersionReadyForDataRecovery(String clusterName, String storeName, int version, String sourceFabric, String destinationFabric, Optional<Integer> sourceAmplificationFactor)
      Description copied from interface: Admin
      Check if the store version's previous states and resources are cleaned up and ready to start data recovery.
      Specified by:
      isStoreVersionReadyForDataRecovery in interface Admin
      Returns:
      whether is ready to start data recovery and the reason if it's not ready.
      See Also:
    • isAdminTopicConsumptionEnabled

      public boolean isAdminTopicConsumptionEnabled(String clusterName)
      Description copied from interface: Admin
      Return whether the admin consumption task is enabled for the passed cluster.
      Specified by:
      isAdminTopicConsumptionEnabled in interface Admin
      See Also:
    • getLargestUsedVersionFromStoreGraveyard

      public int getLargestUsedVersionFromStoreGraveyard(String clusterName, String storeName)
      Description copied from interface: Admin
      Deprecated but remain here to keep compatibility until Admin.getLargestUsedVersion(String, String) is used.
      Specified by:
      getLargestUsedVersionFromStoreGraveyard in interface Admin
    • getLargestUsedVersion

      public int getLargestUsedVersion(String clusterName, String storeName)
      Specified by:
      getLargestUsedVersion in interface Admin
    • createStoragePersona

      public void createStoragePersona(String clusterName, String name, long quotaNumber, Set<String> storesToEnforce, Set<String> owners)
      Specified by:
      createStoragePersona in interface Admin
      See Also:
    • getStoragePersona

      public StoragePersona getStoragePersona(String clusterName, String name)
      Specified by:
      getStoragePersona in interface Admin
      See Also:
    • deleteStoragePersona

      public void deleteStoragePersona(String clusterName, String name)
      Specified by:
      deleteStoragePersona in interface Admin
      See Also:
    • updateStoragePersona

      public void updateStoragePersona(String clusterName, String name, UpdateStoragePersonaQueryParams queryParams)
      Specified by:
      updateStoragePersona in interface Admin
      See Also:
    • getPersonaAssociatedWithStore

      public StoragePersona getPersonaAssociatedWithStore(String clusterName, String storeName)
      Specified by:
      getPersonaAssociatedWithStore in interface Admin
      See Also:
    • getClusterStoragePersonas

      public List<StoragePersona> getClusterStoragePersonas(String clusterName)
      Specified by:
      getClusterStoragePersonas in interface Admin
    • cleanupInstanceCustomizedStates

      public List<String> cleanupInstanceCustomizedStates(String clusterName)
      Description copied from interface: Admin
      Scan through instance level customized states and remove any lingering ZNodes that are no longer relevant. This operation shouldn't be needed under normal circumstances. It's intended to cleanup ZNodes that failed to be deleted due to bugs and errors.
      Specified by:
      cleanupInstanceCustomizedStates in interface Admin
      Parameters:
      clusterName - to perform the cleanup.
      Returns:
      list of deleted ZNode paths.
    • getStoreGraveyard

      public StoreGraveyard getStoreGraveyard()
      Specified by:
      getStoreGraveyard in interface Admin
    • removeStoreFromGraveyard

      public void removeStoreFromGraveyard(String clusterName, String storeName)
      Specified by:
      removeStoreFromGraveyard in interface Admin
    • getPushStatusStoreReader

      public PushStatusStoreReader getPushStatusStoreReader()
      Specified by:
      getPushStatusStoreReader in interface Admin
    • getPushStatusStoreWriter

      public PushStatusStoreWriter getPushStatusStoreWriter()
      Specified by:
      getPushStatusStoreWriter in interface Admin
    • sendHeartbeatToSystemStore

      public void sendHeartbeatToSystemStore(String clusterName, String storeName, long heartbeatTimeStamp)
      Description copied from interface: Admin
      Send a heartbeat timestamp to targeted system store.
      Specified by:
      sendHeartbeatToSystemStore in interface Admin
    • getHeartbeatFromSystemStore

      public long getHeartbeatFromSystemStore(String clusterName, String systemStoreName)
      Description copied from interface: Admin
      Read the latest heartbeat timestamp from system store. If it failed to read from system store, this method should return -1.
      Specified by:
      getHeartbeatFromSystemStore in interface Admin
    • autoMigrateStore

      public void autoMigrateStore(String srcClusterName, String destClusterName, String storeName, Optional<Integer> currStep, Optional<Integer> pauseAfterStep, Optional<Boolean> abortOnFailure)
      Specified by:
      autoMigrateStore in interface Admin
    • getParentControllerClient

      public ControllerClient getParentControllerClient(String clusterName, String sourceCluster)
    • getSslFactory

      public Optional<SSLFactory> getSslFactory()
    • isClusterWipeAllowed

      public boolean isClusterWipeAllowed(String clusterName)
    • getMultiClusterConfigs

      public VeniceControllerMultiClusterConfig getMultiClusterConfigs()
    • getExternalETLService

      public Optional<ExternalETLService> getExternalETLService()
    • getControllerConfig

      public VeniceControllerClusterConfig getControllerConfig(String clusterName)
      Specified by:
      getControllerConfig in interface Admin
    • setPushJobDetailsStoreClient

      public void setPushJobDetailsStoreClient(AvroSpecificStoreClient<PushJobStatusRecordKey,PushJobDetails> client)
    • getPubSubTopicRepository

      public PubSubTopicRepository getPubSubTopicRepository()
      Specified by:
      getPubSubTopicRepository in interface Admin
    • getLogContext

      public LogContext getLogContext()
      Specified by:
      getLogContext in interface Admin