Class ProtocolVersionAutoDetectionService

java.lang.Object
com.linkedin.venice.service.AbstractVeniceService
com.linkedin.venice.controller.ProtocolVersionAutoDetectionService
All Implemented Interfaces:
Closeable, AutoCloseable

public class ProtocolVersionAutoDetectionService extends AbstractVeniceService
This service is responsible for auto-detecting the admin operation protocol version for one cluster periodically. ProtocolVersionAutoDetectionService is a background scheduled executor, each attempt it will: 1. Get the current admin operation protocol versions from all controllers (parent + child) in the current cluster and find the smallest version - good version to use. 2. Get the admin operation protocol version from ZK. 3. If the version in ZK is different from the current version, update the version in ZK. To disable step 3, set the admin version for the cluster in ZK as -1.
  • Constructor Details

  • Method Details

    • startInner

      public boolean startInner() throws Exception
      Specified by:
      startInner in class AbstractVeniceService
      Returns:
      true if the service is completely started, false if it is still starting asynchronously (in this case, it is the implementer's responsibility to set AbstractVeniceService.serviceState to AbstractVeniceService.ServiceState.STARTED upon completion of the async work).
      Throws:
      Exception
    • stopInner

      public void stopInner() throws Exception
      Specified by:
      stopInner in class AbstractVeniceService
      Throws:
      Exception
    • getSmallestLocalAdminOperationProtocolVersionForAllConsumers

      public long getSmallestLocalAdminOperationProtocolVersionForAllConsumers(String clusterName)
      Get the smallest local admin operation protocol version for all consumers in the given cluster. This will help to ensure that, during re-balancing process, the version we use is still a good version, and we won't send in bad admin message that consumers cannot deserialize.
      Parameters:
      clusterName - The name of the cluster to check.
      Returns:
      The smallest local admin operation protocol version for all consumers (parent + child controllers) in the cluster.