Class SchemaIdAndSubjects

java.lang.Object
io.confluent.kafka.schemaregistry.storage.SchemaIdAndSubjects

public class SchemaIdAndSubjects extends Object
Kafka schema registry maintains a few in memory indices to facilitate schema lookups. One such index is the md5 index that maps MD5 -> SchemaIdAndSubjects. This index is used to do 2 things. Firstly, to prevent the same schema string from being registered multiple times. So, if the MD5 of the canonicalized schema is present in the registry, we simply return the id. However, the same schema string can be registered under multiple subjects. And if so, it may be assigned different version ids per subject that it registers under
  • Constructor Details

    • SchemaIdAndSubjects

      public SchemaIdAndSubjects(int id)
    • SchemaIdAndSubjects

      public SchemaIdAndSubjects(int id, Map<String,Integer> subjectsAndVersions)
  • Method Details

    • addSubjectAndVersion

      public void addSubjectAndVersion(String subject, int version)
    • hasSubject

      public boolean hasSubject(String subject)
    • getVersion

      public int getVersion(String subject)
    • getSchemaId

      public int getSchemaId()
    • isEmpty

      public boolean isEmpty()
    • findAny

      public SchemaKey findAny(Predicate<SchemaKey> filter)
    • allSubjects

      public Set<String> allSubjects()
    • allSubjectVersions

      public Map<String,Integer> allSubjectVersions()
    • removeIf

      public void removeIf(Predicate<SchemaKey> filter)
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object