Class TupleSerializerBase<T>

    • Field Detail

      • tupleClass

        protected final Class<T> tupleClass
      • arity

        protected final int arity
    • Constructor Detail

      • TupleSerializerBase

        public TupleSerializerBase​(Class<T> tupleClass,
                                   TypeSerializer<?>[] fieldSerializers)
    • Method Detail

      • getTupleClass

        public Class<T> getTupleClass()
      • isImmutableType

        public boolean isImmutableType()
        Description copied from class: TypeSerializer
        Gets whether the type is an immutable type.
        Specified by:
        isImmutableType in class TypeSerializer<T>
        Returns:
        True, if the type is immutable.
      • getLength

        public int getLength()
        Description copied from class: TypeSerializer
        Gets the length of the data type, if it is a fix length data type.
        Specified by:
        getLength in class TypeSerializer<T>
        Returns:
        The length of the data type, or -1 for variable length data types.
      • getArity

        public int getArity()
      • createInstance

        public abstract T createInstance​(Object[] fields)
      • createOrReuseInstance

        public abstract T createOrReuseInstance​(Object[] fields,
                                                T reuse)
      • copy

        public void copy​(DataInputView source,
                         DataOutputView target)
                  throws IOException
        Description copied from class: TypeSerializer
        Copies exactly one record from the source input view to the target output view. Whether this operation works on binary data or partially de-serializes the record to determine its length (such as for records of variable length) is up to the implementer. Binary copies are typically faster. A copy of a record containing two integer numbers (8 bytes total) is most efficiently implemented as target.write(source, 8);.
        Specified by:
        copy in class TypeSerializer<T>
        Parameters:
        source - The input view from which to read the record.
        target - The target output view to which to write the record.
        Throws:
        IOException - Thrown if any of the two views raises an exception.