Class DataNotSortedException

  • All Implemented Interfaces:
    Serializable

    public class DataNotSortedException
    extends DRException

    Unchecked exception thrown to indicate that an input flow contains rows that are out of order.

    See Also:
    Sort, Serialized Form
    • Constructor Detail

      • DataNotSortedException

        public DataNotSortedException​(String prefix)
        Constructs a DataNotSortedException with the specified message prefix. The out-of-order data values are not needed in the prefix: they can be supplied by setCurrent(String) and setPrevious(String).
        Parameters:
        prefix - the error message about sort order
      • DataNotSortedException

        public DataNotSortedException​(String prefix,
                                      TokenValued currentTV,
                                      TokenValued previousTV,
                                      int position)
        Constructs a DataNotSortedException.
        Parameters:
        prefix - the error message about sort order
        currentTV - the current token value
        previousTV - the previous token value
        position - the position of the current token value
    • Method Detail

      • getMessage

        public String getMessage()
        Gets a message containing the prefix passed at construction time and any additional information supplied by setter methods, such as positional details on the specific field in a record (composite) type
        Overrides:
        getMessage in class Throwable
        Returns:
        the constructed error message
      • getCurrent

        public String getCurrent()
        Gets a string representation of the current row's keys at the point in the input flow where the incorrect row ordering was discovered.
        Returns:
        current row's key values
      • setCurrent

        public DataNotSortedException setCurrent​(String current)
        Sets a string representation of the current row's keys at the point in the input flow where incorrect row ordering was discovered.
        Parameters:
        current - current row's key values
        Returns:
        a reference to this exception
      • getPrevious

        public String getPrevious()
        Gets a string representation of the previous row's keys at the point in the input flow where the incorrect row ordering was discovered.
        Returns:
        previous row's key values
      • setPrevious

        public DataNotSortedException setPrevious​(String previous)
        Sets a string representation of the previous row's keys at the point in the input flow where incorrect row ordering was discovered.
        Parameters:
        previous - previous row's key values
        Returns:
        a reference to this exception
      • getPosition

        public int getPosition()
        Returns:
        the position
      • setPosition

        public DataNotSortedException setPosition​(int position)
        Parameters:
        position - the position to set
        Returns:
        a reference to this exception
      • getCurrentTValue

        public TokenValued getCurrentTValue()
        Return the token value where the sort order discrepancy occurred.
        Returns:
        the currentTValue
      • setCurrentTValue

        public DataNotSortedException setCurrentTValue​(TokenValued currentTValue)
        Internal use only: set the current token value where the sort order discrepancy occurred.
        Parameters:
        currentTValue - the currentTValue to set
        Returns:
        a reference to this exception
      • getPreviousTValue

        public TokenValued getPreviousTValue()
        Return the previous token value before the sort order discrepancy occurred.
        Returns:
        the previousTValue
      • setPreviousTValue

        public DataNotSortedException setPreviousTValue​(TokenValued previousTValue)
        Internal use only: set the previous token value where the sort order discrepancy occurred.
        Parameters:
        previousTValue - the previousTValue to set
        Returns:
        a reference to this exception
      • getRowNumber

        public long getRowNumber()
        Returns the row number where the exception occurred, or -1 if not available.
        Returns:
        the row number where the exception occurred, or -1 if not available.
      • setRowNumber

        public DataNotSortedException setRowNumber​(long rowNumber)
        Sets the row number where the exception occurred, or -1 if not available.
        Parameters:
        rowNumber - the row number where the exception occurred, or -1 if not available.
        Returns:
        a reference to this exception