Interface CopyableValue<T>

    • Method Detail

      • getBinaryLength

        int getBinaryLength()
        Gets the length of the data type when it is serialized, in bytes.
        Returns:
        The length of the data type, or -1, if variable length.
      • copyTo

        void copyTo​(T target)
        Performs a deep copy of this object into the target instance.
        Parameters:
        target - Object to copy into.
      • copy

        T copy()
        Performs a deep copy of this object into a new instance.

        This method is useful for generic user-defined functions to clone a CopyableValue when storing multiple objects. With object reuse a deep copy must be created and type erasure prevents calling new.

        Returns:
        New object with copied fields.
      • copy

        void copy​(DataInputView source,
                  DataOutputView target)
           throws IOException
        Copies the next serialized instance from source to target.

        This method is equivalent to calling IOReadableWritable.read(DataInputView) followed by IOReadableWritable.write(DataOutputView) but does not require intermediate deserialization.

        Parameters:
        source - Data source for serialized instance.
        target - Data target for serialized instance.
        Throws:
        IOException
        See Also:
        IOReadableWritable