Class CreateTriggerByRangeRequest

  • All Implemented Interfaces:
    org.apache.avro.generic.GenericContainer, org.apache.avro.generic.IndexedRecord

    public class CreateTriggerByRangeRequest
    extends Object
    implements org.apache.avro.generic.IndexedRecord
    A set of parameters for GPUdb.createTriggerByRange.

    Sets up a simple range trigger for a column_name for one or more tables. Once the trigger has been activated, any record added to the listed tables(s) via GPUdb.insertRecords with the chosen column_name's value falling within the specified range will trip the trigger. All such records will be queued at the trigger port (by default '9001' but able to be retrieved via GPUdb.showSystemStatus) for any listening client to collect. Active triggers can be cancelled by using the GPUdb.clearTrigger endpoint or by clearing all relevant tables.

    The output returns the trigger handle as well as indicating success or failure of the trigger activation.

    • Constructor Detail

      • CreateTriggerByRangeRequest

        public CreateTriggerByRangeRequest()
        Constructs a CreateTriggerByRangeRequest object with default parameters.
      • CreateTriggerByRangeRequest

        public CreateTriggerByRangeRequest​(String requestId,
                                           List<String> tableNames,
                                           String columnName,
                                           double min,
                                           double max,
                                           Map<String,​String> options)
        Constructs a CreateTriggerByRangeRequest object with the specified parameters.
        Parameters:
        requestId - User-created ID for the trigger. The ID can be alphanumeric, contain symbols, and must contain at least one character.
        tableNames - Tables on which the trigger will be active, each in [schema_name.]table_name format, using standard name resolution rules.
        columnName - Name of a numeric column_name on which the trigger is activated.
        min - The lower bound (inclusive) for the trigger range.
        max - The upper bound (inclusive) for the trigger range.
        options - Optional parameters. The default value is an empty Map.
    • Method Detail

      • getClassSchema

        public static org.apache.avro.Schema getClassSchema()
        This method supports the Avro framework and is not intended to be called directly by the user.
        Returns:
        The schema for the class.
      • getRequestId

        public String getRequestId()
        User-created ID for the trigger. The ID can be alphanumeric, contain symbols, and must contain at least one character.
        Returns:
        The current value of requestId.
      • setRequestId

        public CreateTriggerByRangeRequest setRequestId​(String requestId)
        User-created ID for the trigger. The ID can be alphanumeric, contain symbols, and must contain at least one character.
        Parameters:
        requestId - The new value for requestId.
        Returns:
        this to mimic the builder pattern.
      • getTableNames

        public List<String> getTableNames()
        Tables on which the trigger will be active, each in [schema_name.]table_name format, using standard name resolution rules.
        Returns:
        The current value of tableNames.
      • setTableNames

        public CreateTriggerByRangeRequest setTableNames​(List<String> tableNames)
        Tables on which the trigger will be active, each in [schema_name.]table_name format, using standard name resolution rules.
        Parameters:
        tableNames - The new value for tableNames.
        Returns:
        this to mimic the builder pattern.
      • getColumnName

        public String getColumnName()
        Name of a numeric column_name on which the trigger is activated.
        Returns:
        The current value of columnName.
      • setColumnName

        public CreateTriggerByRangeRequest setColumnName​(String columnName)
        Name of a numeric column_name on which the trigger is activated.
        Parameters:
        columnName - The new value for columnName.
        Returns:
        this to mimic the builder pattern.
      • getMin

        public double getMin()
        The lower bound (inclusive) for the trigger range.
        Returns:
        The current value of min.
      • setMin

        public CreateTriggerByRangeRequest setMin​(double min)
        The lower bound (inclusive) for the trigger range.
        Parameters:
        min - The new value for min.
        Returns:
        this to mimic the builder pattern.
      • getMax

        public double getMax()
        The upper bound (inclusive) for the trigger range.
        Returns:
        The current value of max.
      • setMax

        public CreateTriggerByRangeRequest setMax​(double max)
        The upper bound (inclusive) for the trigger range.
        Parameters:
        max - The new value for max.
        Returns:
        this to mimic the builder pattern.
      • getOptions

        public Map<String,​String> getOptions()
        Optional parameters. The default value is an empty Map.
        Returns:
        The current value of options.
      • setOptions

        public CreateTriggerByRangeRequest setOptions​(Map<String,​String> options)
        Optional parameters. The default value is an empty Map.
        Parameters:
        options - The new value for options.
        Returns:
        this to mimic the builder pattern.
      • getSchema

        public org.apache.avro.Schema getSchema()
        This method supports the Avro framework and is not intended to be called directly by the user.
        Specified by:
        getSchema in interface org.apache.avro.generic.GenericContainer
        Returns:
        The schema object describing this class.
      • get

        public Object get​(int index)
        This method supports the Avro framework and is not intended to be called directly by the user.
        Specified by:
        get in interface org.apache.avro.generic.IndexedRecord
        Parameters:
        index - the position of the field to get
        Returns:
        value of the field with the given index.
        Throws:
        IndexOutOfBoundsException
      • put

        public void put​(int index,
                        Object value)
        This method supports the Avro framework and is not intended to be called directly by the user.
        Specified by:
        put in interface org.apache.avro.generic.IndexedRecord
        Parameters:
        index - the position of the field to set
        value - the value to set
        Throws:
        IndexOutOfBoundsException
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object