Class InstanceConfigToDataNodeConfigAdapter

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class InstanceConfigToDataNodeConfigAdapter
    extends java.lang.Object
    An implementation of DataNodeConfigSource that converts between InstanceConfigs received by an InstanceConfigChangeListener and DataNodeConfigs.
    • Constructor Detail

      • InstanceConfigToDataNodeConfigAdapter

        public InstanceConfigToDataNodeConfigAdapter​(org.apache.helix.HelixManager helixManager,
                                                     com.github.ambry.config.ClusterMapConfig clusterMapConfig)
        Parameters:
        helixManager - the HelixManager to use as the source of truth for InstanceConfigs.
        clusterMapConfig - the ClusterMapConfig to use.
    • Method Detail

      • addDataNodeConfigChangeListener

        public void addDataNodeConfigChangeListener​(DataNodeConfigChangeListener listener)
                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • set

        public boolean set​(com.github.ambry.clustermap.DataNodeConfig config)
      • get

        public com.github.ambry.clustermap.DataNodeConfig get​(java.lang.String instanceName)
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable