Class SchemaEntry

  • Direct Known Subclasses:

    public class SchemaEntry
    extends java.lang.Object
    SchemaEntry is composed of a schema and its corresponding id. Internally, this class will maintain a parsed Schema
    • Constructor Detail

      • SchemaEntry

        public SchemaEntry​(int id,
                           java.lang.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 Detail

      • getSchemaStr

        public java.lang.String getSchemaStr()
      • getCanonicalSchemaStr

        public java.lang.String getCanonicalSchemaStr()
      • getId

        public int getId()
        the id
      • getSchema

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

        public int hashCode()
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        equals in class java.lang.Object
      • clone

        public SchemaEntry clone()
        clone in class java.lang.Object
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • toString

        public java.lang.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 {@param expectedCompatibilityType}. 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+
        true if compatible, false otherwise