Class SafeHelixManager

java.lang.Object
com.linkedin.venice.helix.SafeHelixManager

public class SafeHelixManager extends Object
A wrapper around HelixManager which disables the unsafe functionality. Venice should never use a HelixManager directly. All uses of this class should always be wrapped in a SafeHelixManager. In order to ensure a compile-time guarantee that only safe APIs are called, we explicitly choose to remove the unsafe APIs from the interface. Therefore, we do not actually implement the HelixManager interface. Only one unsafe API is removed: - HelixManager.getHelixDataAccessor() It is replaced by a similar function that returns a SafeHelixDataAccessor instead. Besides the unsafe APIs, this class also takes away all of the APIs which Helix itself declares to be deprecated. These are the removed deprecated APIs: - HelixManager.addIdealStateChangeListener(org.apache.helix.IdealStateChangeListener) - HelixManager.addLiveInstanceChangeListener(org.apache.helix.LiveInstanceChangeListener) - HelixManager.addConfigChangeListener(ConfigChangeListener) - HelixManager.addInstanceConfigChangeListener(org.apache.helix.InstanceConfigChangeListener) - HelixManager.addConfigChangeListener(org.apache.helix.ScopedConfigChangeListener, HelixConfigScope.ConfigScopeProperty) - HelixManager.addMessageListener(org.apache.helix.MessageListener, String) - HelixManager.addCurrentStateChangeListener(org.apache.helix.CurrentStateChangeListener, String, String) - HelixManager.addExternalViewChangeListener(org.apache.helix.ExternalViewChangeListener) - HelixManager.addControllerListener(org.apache.helix.ControllerChangeListener) - HelixManager.addControllerMessageListener(org.apache.helix.MessageListener) TODO: Review the rest of the functions and determine if more should be culled.
  • Constructor Details

    • SafeHelixManager

      public SafeHelixManager(org.apache.helix.HelixManager helixManager)
  • Method Details

    • connect

      public void connect() throws Exception
      Throws:
      Exception
    • isConnected

      public boolean isConnected()
    • disconnect

      public void disconnect()
    • addIdealStateChangeListener

      public void addIdealStateChangeListener(org.apache.helix.api.listeners.IdealStateChangeListener listener) throws Exception
      Throws:
      Exception
    • addLiveInstanceChangeListener

      public void addLiveInstanceChangeListener(org.apache.helix.api.listeners.LiveInstanceChangeListener listener) throws Exception
      Throws:
      Exception
    • addInstanceConfigChangeListener

      public void addInstanceConfigChangeListener(org.apache.helix.api.listeners.InstanceConfigChangeListener listener) throws Exception
      Throws:
      Exception
    • addResourceConfigChangeListener

      public void addResourceConfigChangeListener(org.apache.helix.api.listeners.ResourceConfigChangeListener listener) throws Exception
      Throws:
      Exception
    • addClusterfigChangeListener

      public void addClusterfigChangeListener(org.apache.helix.api.listeners.ClusterConfigChangeListener listener) throws Exception
      Throws:
      Exception
    • addConfigChangeListener

      public void addConfigChangeListener(org.apache.helix.api.listeners.ScopedConfigChangeListener listener, org.apache.helix.model.HelixConfigScope.ConfigScopeProperty scope) throws Exception
      Throws:
      Exception
    • addMessageListener

      public void addMessageListener(org.apache.helix.api.listeners.MessageListener listener, String instanceName) throws Exception
      Throws:
      Exception
    • addCurrentStateChangeListener

      public void addCurrentStateChangeListener(org.apache.helix.api.listeners.CurrentStateChangeListener listener, String instanceName, String sessionId) throws Exception
      Throws:
      Exception
    • addExternalViewChangeListener

      public void addExternalViewChangeListener(org.apache.helix.api.listeners.ExternalViewChangeListener listener) throws Exception
      Throws:
      Exception
    • addTargetExternalViewChangeListener

      public void addTargetExternalViewChangeListener(org.apache.helix.api.listeners.ExternalViewChangeListener listener) throws Exception
      Throws:
      Exception
    • addControllerListener

      public void addControllerListener(org.apache.helix.api.listeners.ControllerChangeListener listener)
    • addControllerMessageListener

      public void addControllerMessageListener(org.apache.helix.api.listeners.MessageListener listener)
    • removeListener

      public boolean removeListener(org.apache.helix.PropertyKey key, Object listener)
    • getHelixDataAccessor

      public SafeHelixDataAccessor getHelixDataAccessor()
      This function is incompatible with the HelixManager interface, since the return type of SafeHelixDataAccessor is not compatible with the return of the unsafe interface, which is a HelixDataAccessor.
    • getConfigAccessor

      public org.apache.helix.ConfigAccessor getConfigAccessor()
    • getClusterName

      public String getClusterName()
    • getInstanceName

      public String getInstanceName()
    • getSessionId

      public String getSessionId()
    • getLastNotificationTime

      public long getLastNotificationTime()
    • getClusterManagmentTool

      public org.apache.helix.HelixAdmin getClusterManagmentTool()
    • getHelixPropertyStore

      public org.apache.helix.store.zk.ZkHelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> getHelixPropertyStore()
    • getMessagingService

      public org.apache.helix.ClusterMessagingService getMessagingService()
    • getInstanceType

      public org.apache.helix.InstanceType getInstanceType()
    • getVersion

      public String getVersion()
    • getProperties

      public org.apache.helix.HelixManagerProperties getProperties()
    • getStateMachineEngine

      public org.apache.helix.participant.StateMachineEngine getStateMachineEngine()
    • getSessionStartTime

      public Long getSessionStartTime()
    • isLeader

      public boolean isLeader()
    • startTimerTasks

      public void startTimerTasks()
    • stopTimerTasks

      public void stopTimerTasks()
    • addPreConnectCallback

      public void addPreConnectCallback(org.apache.helix.PreConnectCallback callback)
    • setLiveInstanceInfoProvider

      public void setLiveInstanceInfoProvider(org.apache.helix.LiveInstanceInfoProvider liveInstanceInfoProvider)
    • getHealthReportCollector

      public org.apache.helix.healthcheck.ParticipantHealthReportCollector getHealthReportCollector()
    • getOriginalManager

      public org.apache.helix.HelixManager getOriginalManager()