Class AggregatorInfo

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable, Formatable, TypedFormat

    public class AggregatorInfo
    extends java.lang.Object
    implements Formatable
    This is a simple class used to store the run time information needed to invoke an aggregator. This class is serializable because it is stored with the plan. It is serializable rather than externalizable because it isn't particularly complicated and presumbably we don't need version control on plans.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      AggregatorInfo()
      Niladic constructor for Formattable
      AggregatorInfo​(java.lang.String aggregateName, java.lang.String aggregatorClassName, int inputColNum, int outputColNum, int aggregatorColNum, boolean isDistinct, ResultDescription rd)
      Consructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAggregateName()
      Get the name of the aggergate (e.g.
      java.lang.String getAggregatorClassName()
      Get the name of the class that implements the user aggregator for this class.
      int getAggregatorColNum()
      Get the column number for the aggregator column.
      int getInputColNum()
      Get the column number for the input (addend) column.
      int getOutputColNum()
      Get the column number for the output (result) column.
      ResultDescription getResultDescription()
      Get the result description for the input value to this aggregate.
      int getTypeFormatId()
      Get the formatID which corresponds to this class.
      boolean isDistinct()
      Is the aggergate distinct
      void readExternal​(java.io.ObjectInput in)
      Read this object from a stream of stored objects.
      java.lang.String toString()
      Get a string for the object
      void writeExternal​(java.io.ObjectOutput out)
      Write this object out
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • aggregateName

        java.lang.String aggregateName
        This class implements Formatable. That means that it can write itself to and from a formatted stream. If you add more fields to this class, make sure that you also write/read them with the writeExternal()/readExternal() methods. If, inbetween releases, you add more fields to this class, then you should bump the version number emitted by the getTypeFormatId() method. OR, since this is something that is used in stored prepared statements, it is ok to change it if you make sure that stored prepared statements are invalidated across releases.
      • inputColumn

        int inputColumn
      • outputColumn

        int outputColumn
      • aggregatorColumn

        int aggregatorColumn
      • aggregatorClassName

        java.lang.String aggregatorClassName
      • isDistinct

        boolean isDistinct
    • Constructor Detail

      • AggregatorInfo

        public AggregatorInfo()
        Niladic constructor for Formattable
      • AggregatorInfo

        public AggregatorInfo​(java.lang.String aggregateName,
                              java.lang.String aggregatorClassName,
                              int inputColNum,
                              int outputColNum,
                              int aggregatorColNum,
                              boolean isDistinct,
                              ResultDescription rd)
        Consructor
        Parameters:
        aggregateName - the name of the aggregate. Not actually used anywhere except diagnostics. Should be the names as found in the language (e.g. MAX).
        aggregatorClassName - the name of the aggregator used to process this aggregate. Aggregator expected to have a null arg constructor and implement Aggregator.
        inputColNum - the input column number
        outputColNum - the output column number
        aggregatorColNum - the column number in which the aggregator is stored.
        isDistinct - if it is a distinct aggregate
        rd - the result description
    • Method Detail

      • getAggregateName

        public java.lang.String getAggregateName()
        Get the name of the aggergate (e.g. MAX)
        Returns:
        the aggeregate name
      • getAggregatorClassName

        public java.lang.String getAggregatorClassName()
        Get the name of the class that implements the user aggregator for this class.
        Returns:
        the aggeregator class name
      • getAggregatorColNum

        public int getAggregatorColNum()
        Get the column number for the aggregator column.
        Returns:
        the aggeregator colid
      • getInputColNum

        public int getInputColNum()
        Get the column number for the input (addend) column.
        Returns:
        the aggeregator colid
      • getOutputColNum

        public int getOutputColNum()
        Get the column number for the output (result) column.
        Returns:
        the aggeregator colid
      • isDistinct

        public boolean isDistinct()
        Is the aggergate distinct
        Returns:
        whether it is distinct
      • getResultDescription

        public ResultDescription getResultDescription()
        Get the result description for the input value to this aggregate.
        Returns:
        the rd
      • toString

        public java.lang.String toString()
        Get a string for the object
        Overrides:
        toString in class java.lang.Object
        Returns:
        string
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Write this object out
        Specified by:
        writeExternal in interface java.io.Externalizable
        Parameters:
        out - write bytes here
        Throws:
        java.io.IOException - thrown on error
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Read this object from a stream of stored objects.
        Specified by:
        readExternal in interface java.io.Externalizable
        Parameters:
        in - read this.
        Throws:
        java.io.IOException - thrown on error
        java.lang.ClassNotFoundException - thrown on error
      • getTypeFormatId

        public int getTypeFormatId()
        Get the formatID which corresponds to this class.
        Specified by:
        getTypeFormatId in interface TypedFormat
        Returns:
        the formatID of this class