Enum DirectionalSchemaCompatibilityType

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BACKWARD
      Clients using the new schema should be able to read data written with the old schema.
      FORWARD
      Clients using the old schema should be able to read data written with the new schema.
      FULL
      Both backward and forward compatible.
      NONE
      Anything goes.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static DirectionalSchemaCompatibilityType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static DirectionalSchemaCompatibilityType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • 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 Detail

      • values

        public static DirectionalSchemaCompatibilityType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DirectionalSchemaCompatibilityType c : DirectionalSchemaCompatibilityType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DirectionalSchemaCompatibilityType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null