Class ConfigSet

java.lang.Object
io.confluent.remote.config.poller.kubernetes.ConfigSet

public class ConfigSet extends Object

This class is used to parse the ConfigMap returned from the Kubernetes API. The ConfigMap will be parsed into a set of ConfigSetEntries. The client will then use the ConfigSet to find the compatible configuration version for the client's API schema version.

Ensure that we only have atmost one minor versions for a major version. This ensures that we better keep track of configurations and avoid any confusion because we would be sure which higher minor version could be used for a schema version.

  • Method Details

    • parseConfigYaml

      public static ConfigSet parseConfigYaml(String configs) throws com.fasterxml.jackson.core.JsonProcessingException
      We need to provide this convoluted way of parsing configs returned from the ConfigMap because k8s only allows us to specify ConfigMaps of Map<String, String>; so we're unable to interpret the yaml directly. We use Jackson to deserialize the set of ConfigSetEntries and pass it to the ConfigSet constructor.
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • getCompatibleConfigVersion

      public <T> Optional<T> getCompatibleConfigVersion(String schemaVersion, Class<T> typeParameterClass)
      The ConfigMap will hold 1 remote configuration objects for each major API schema version. The client needs to find the compatible API schema version out of the available configs.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object