Enum Class DirectionalSchemaCompatibilityType

java.lang.Object
java.lang.Enum<DirectionalSchemaCompatibilityType>
com.linkedin.venice.schema.avro.DirectionalSchemaCompatibilityType
All Implemented Interfaces:
Serializable, Comparable<DirectionalSchemaCompatibilityType>, Constable

public enum DirectionalSchemaCompatibilityType extends Enum<DirectionalSchemaCompatibilityType>
  • Enum Constant Details

    • FULL

      public static final DirectionalSchemaCompatibilityType FULL
      Both backward and forward compatible. The following changes are fully compatible: - Adding a new field with a default value. If having a default value seems cumbersome, remember that the new field can be made optional (with a type made up of a union of "null" and another type, e.g.: "type": ["null", "int"]) and the default value can be set to "null". - Removing an existing field which previously had a default value. - Renaming a field and keeping the old name as an alias. - Re-ordering fields.
    • BACKWARD

      public static final DirectionalSchemaCompatibilityType BACKWARD
      Clients using the new schema should be able to read data written with the old schema. The following changes are backward compatible only: - Adding a value to an enum. - Changing the type of a field to another type which the original can be promoted to: - int is promotable to long, float, or double - long is promotable to float or double - float is promotable to double - string is promotable to bytes - bytes is promotable to string - Removing a field which did not previously contain a default value.
    • FORWARD

      public static final DirectionalSchemaCompatibilityType FORWARD
      Clients using the old schema should be able to read data written with the new schema. The following changes are forward compatible only: - Removing a value from an enum. - Changing the type of a field to another type which the original can be promoted from (the inverse of the type promotion mappings mentioned in BACKWARD. - Adding a new mandatory field with no default value.
    • NONE

      public static final DirectionalSchemaCompatibilityType NONE
      Anything goes. The following changes are NOT compatible: - Changing the type of a field to another which does not support promotion (e.g.: int to record, etc.). - Changing field names without keeping the old name as an alias. - Making "structural changes" to the nested parts of your schema. For example, moving a field from `value.nestedRecord.fieldX` to `value.fieldX`. TODO: Confirm whether this is really incompatible
  • Method Details

    • values

      public static DirectionalSchemaCompatibilityType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DirectionalSchemaCompatibilityType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null