Class WritableTypeInfo<T extends org.apache.hadoop.io.Writable>

  • Type Parameters:
    T - The type of the class represented by this type information.
    All Implemented Interfaces:
    Serializable, AtomicType<T>

    @Public
    public class WritableTypeInfo<T extends org.apache.hadoop.io.Writable>
    extends TypeInformation<T>
    implements AtomicType<T>
    Type information for data types that extend Hadoop's Writable interface. The Writable interface defines the serialization and deserialization routines for the data type.
    See Also:
    Serialized Form
    • Method Detail

      • createComparator

        @PublicEvolving
        public TypeComparator<T> createComparator​(boolean sortOrderAscending,
                                                  ExecutionConfig executionConfig)
        Description copied from interface: AtomicType
        Creates a comparator for this type.
        Specified by:
        createComparator in interface AtomicType<T extends org.apache.hadoop.io.Writable>
        Parameters:
        sortOrderAscending - True, if the comparator should define the order to be ascending, false, if the comparator should define the order to be descending.
        executionConfig - The config from which the comparator will be parametrized. Parametrization includes for example registration of class tags for frameworks like Kryo.
        Returns:
        A comparator for this type.
      • isBasicType

        @PublicEvolving
        public boolean isBasicType()
        Description copied from class: TypeInformation
        Checks if this type information represents a basic type. Basic types are defined in BasicTypeInfo and are primitives, their boxing types, Strings, Date, Void, ...
        Specified by:
        isBasicType in class TypeInformation<T extends org.apache.hadoop.io.Writable>
        Returns:
        True, if this type information describes a basic type, false otherwise.
      • isTupleType

        @PublicEvolving
        public boolean isTupleType()
        Description copied from class: TypeInformation
        Checks if this type information represents a Tuple type. Tuple types are subclasses of the Java API tuples.
        Specified by:
        isTupleType in class TypeInformation<T extends org.apache.hadoop.io.Writable>
        Returns:
        True, if this type information describes a tuple type, false otherwise.
      • getArity

        @PublicEvolving
        public int getArity()
        Description copied from class: TypeInformation
        Gets the arity of this type - the number of fields without nesting.
        Specified by:
        getArity in class TypeInformation<T extends org.apache.hadoop.io.Writable>
        Returns:
        Gets the number of fields in this type without nesting.
      • getTotalFields

        @PublicEvolving
        public int getTotalFields()
        Description copied from class: TypeInformation
        Gets the number of logical fields in this type. This includes its nested and transitively nested fields, in the case of composite types. In the example above, the OuterType type has three fields in total.

        The total number of fields must be at least 1.

        Specified by:
        getTotalFields in class TypeInformation<T extends org.apache.hadoop.io.Writable>
        Returns:
        The number of fields in this type, including its sub-fields (for composite types)
      • getTypeClass

        @PublicEvolving
        public Class<T> getTypeClass()
        Description copied from class: TypeInformation
        Gets the class of the type represented by this type information.
        Specified by:
        getTypeClass in class TypeInformation<T extends org.apache.hadoop.io.Writable>
        Returns:
        The class of the type represented by this type information.
      • isKeyType

        @PublicEvolving
        public boolean isKeyType()
        Description copied from class: TypeInformation
        Checks whether this type can be used as a key. As a bare minimum, types have to be hashable and comparable to be keys.
        Specified by:
        isKeyType in class TypeInformation<T extends org.apache.hadoop.io.Writable>
        Returns:
        True, if the type can be used as a key, false otherwise.
      • createSerializer

        @PublicEvolving
        public TypeSerializer<T> createSerializer​(SerializerConfig serializerConfig)
        Description copied from class: TypeInformation
        Creates a serializer for the type. The serializer may use the ExecutionConfig for parameterization.
        Specified by:
        createSerializer in class TypeInformation<T extends org.apache.hadoop.io.Writable>
        Parameters:
        serializerConfig - The config used to parameterize the serializer.
        Returns:
        A serializer for this type.
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in class TypeInformation<T extends org.apache.hadoop.io.Writable>
      • canEqual

        public boolean canEqual​(Object obj)
        Description copied from class: TypeInformation
        Returns true if the given object can be equaled with this object. If not, it returns false.
        Specified by:
        canEqual in class TypeInformation<T extends org.apache.hadoop.io.Writable>
        Parameters:
        obj - Object which wants to take part in the equality relation
        Returns:
        true if obj can be equaled with this, otherwise false