Class GenericConfigSubscriber

java.lang.Object
com.yahoo.config.subscription.ConfigSubscriber
com.yahoo.config.subscription.impl.GenericConfigSubscriber
All Implemented Interfaces:
AutoCloseable

public class GenericConfigSubscriber extends ConfigSubscriber
A subscriber that can subscribe without the class. Used by config proxy.
Author:
Vegard Havdal
  • Constructor Details

  • Method Details

    • subscribe

      public GenericConfigHandle subscribe(ConfigKey<RawConfig> key, List<String> defContent, TimingValues timingValues)
      Subscribes to config without using the class. For internal use in config proxy.
      Parameters:
      key - the to subscribe to
      defContent - the config definition content for the config to subscribe to
      timingValues - TimingValues
      Returns:
      generic handle
    • subscribe

      public <T extends com.yahoo.config.ConfigInstance> ConfigHandle<T> subscribe(Class<T> configClass, String configId)
      Description copied from class: ConfigSubscriber
      Subscribes on the given type of ConfigInstance with the given config id. The method blocks until the first config is ready to be fetched with ConfigSubscriber.nextConfig(boolean).
      Overrides:
      subscribe in class ConfigSubscriber
      Parameters:
      configClass - The class, typically generated from a def-file using config-class-plugin
      configId - Identifies the service in vespa-services.xml, or null if you are using a local ConfigSource which does not use config id. Also supported: raw:, file:, dir: or jar: config id which addresses config locally in the same way.
      Returns:
      a ConfigHandle
    • subscribe

      public <T extends com.yahoo.config.ConfigInstance> ConfigHandle<T> subscribe(Class<T> configClass, String configId, long timeoutMillis)
      Description copied from class: ConfigSubscriber
      Subscribes on the given type of ConfigInstance with the given config id and subscribe timeout. The method blocks until the first config is ready to be fetched with ConfigSubscriber.nextConfig(boolean).
      Overrides:
      subscribe in class ConfigSubscriber
      Parameters:
      configClass - The class, typically generated from a def-file using config-class-plugin
      configId - Identifies the service in vespa-services.xml, or possibly raw:, file:, dir: or jar: type config which addresses config locally.
      timeoutMillis - The time to wait for a config to become available, in milliseconds
      Returns:
      a ConfigHandle
    • subscribe

      public <T extends com.yahoo.config.ConfigInstance> ConfigHandle<T> subscribe(ConfigSubscriber.SingleSubscriber<T> singleSubscriber, Class<T> configClass, String configId)
      Description copied from class: ConfigSubscriber
      Convenience method that can be used if you only want to subscribe to one config, and want generic error handling. Implement ConfigSubscriber.SingleSubscriber and pass it to this method. You will get initial config, and a config thread will be started. The method will throw in your thread if initial configuration fails, and the config thread will print a generic error message (but continue) if it fails thereafter. The config thread will stop if you ConfigSubscriber.close() this ConfigSubscriber.
      Overrides:
      subscribe in class ConfigSubscriber
      Type Parameters:
      T - ConfigInstance type
      Parameters:
      singleSubscriber - The object to receive config
      configClass - The class, typically generated from a def-file using config-class-plugin
      configId - Identifies the service in vespa-services.xml
      Returns:
      The handle of the config
      See Also:
    • closeRequesters

      public void closeRequesters()
      Do nothing, since we share requesters