Class SchemaEntry

java.lang.Object
com.linkedin.venice.schema.SchemaEntry
Direct Known Subclasses:
GeneratedSchemaEntry

public class SchemaEntry extends Object
SchemaEntry is composed of a schema and its corresponding id. Internally, this class will maintain a parsed Schema
  • Field Details

  • Constructor Details

    • SchemaEntry

      public SchemaEntry(int id, String schemaStr)
      Primary constructor taking a literal id and schema.
    • SchemaEntry

      public SchemaEntry(int id, org.apache.avro.Schema schema)
    • SchemaEntry

      public SchemaEntry(int id, byte[] bytes)
  • Method Details

    • getSchemaStr

      public String getSchemaStr()
    • getCanonicalSchemaStr

      public String getCanonicalSchemaStr()
    • getId

      public int getId()
      Returns:
      the id
    • getSchema

      public org.apache.avro.Schema getSchema()
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • clone

      public SchemaEntry clone()
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(boolean pretty)
    • getSchemaBytes

      public byte[] getSchemaBytes()
    • isNewSchemaCompatible

      public boolean isNewSchemaCompatible(SchemaEntry newSchemaEntry, DirectionalSchemaCompatibilityType expectedCompatibilityType)
      This function will check whether a new schema is compatible with this one according to the passed in . Right now, this function is using the util function provided by avro-1.7+ to check compatibility. We need to remove the util class manually copied when venice is able to use avro-1.7+
      Returns:
      true if compatible, false otherwise