Skip to main content

Class CreateTriggerByAreaRequest

java.lang.Object
com.gpudb.protocol.CreateTriggerByAreaRequest
All Implemented Interfaces:
org.apache.avro.generic.GenericContainer, org.apache.avro.generic.IndexedRecord

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

Sets up an area trigger mechanism for two column_names for one or more tables. (This function is essentially the two-dimensional version of GPUdb.createTriggerByRange.) Once the trigger has been activated, any record added to the listed tables(s) via GPUdb.insertRecords with the chosen columns’ values falling within the specified region 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 Details

    • CreateTriggerByAreaRequest

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

      public CreateTriggerByAreaRequest(String requestId, List<String> tableNames, String xColumnName, List<Double> xVector, String yColumnName, List<Double> yVector, Map<String,String> options)
      Constructs a CreateTriggerByAreaRequest 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 - Names of the tables on which the trigger will be activated and maintained, each in [schema_name.]table_name format, using standard name resolution rules.
      xColumnName - Name of a numeric column on which the trigger is activated. Usually ‘x’ for geospatial data points.
      xVector - The respective coordinate values for the region on which the trigger is activated. This usually translates to the x-coordinates of a geospatial region.
      yColumnName - Name of a second numeric column on which the trigger is activated. Usually ‘y’ for geospatial data points.
      yVector - The respective coordinate values for the region on which the trigger is activated. This usually translates to the y-coordinates of a geospatial region. Must be the same length as xvals.
      options - Optional parameters. The default value is an empty Map.
  • Method Details

    • 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 CreateTriggerByAreaRequest 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()
      Names of the tables on which the trigger will be activated and maintained, each in [schema_name.]table_name format, using standard name resolution rules.
      Returns:
      The current value of tableNames.
    • setTableNames

      public CreateTriggerByAreaRequest setTableNames(List<String> tableNames)
      Names of the tables on which the trigger will be activated and maintained, 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.
    • getXColumnName

      public String getXColumnName()
      Name of a numeric column on which the trigger is activated. Usually ‘x’ for geospatial data points.
      Returns:
      The current value of xColumnName.
    • setXColumnName

      public CreateTriggerByAreaRequest setXColumnName(String xColumnName)
      Name of a numeric column on which the trigger is activated. Usually ‘x’ for geospatial data points.
      Parameters:
      xColumnName - The new value for xColumnName.
      Returns:
      this to mimic the builder pattern.
    • getXVector

      public List<Double> getXVector()
      The respective coordinate values for the region on which the trigger is activated. This usually translates to the x-coordinates of a geospatial region.
      Returns:
      The current value of xVector.
    • setXVector

      public CreateTriggerByAreaRequest setXVector(List<Double> xVector)
      The respective coordinate values for the region on which the trigger is activated. This usually translates to the x-coordinates of a geospatial region.
      Parameters:
      xVector - The new value for xVector.
      Returns:
      this to mimic the builder pattern.
    • getYColumnName

      public String getYColumnName()
      Name of a second numeric column on which the trigger is activated. Usually ‘y’ for geospatial data points.
      Returns:
      The current value of yColumnName.
    • setYColumnName

      public CreateTriggerByAreaRequest setYColumnName(String yColumnName)
      Name of a second numeric column on which the trigger is activated. Usually ‘y’ for geospatial data points.
      Parameters:
      yColumnName - The new value for yColumnName.
      Returns:
      this to mimic the builder pattern.
    • getYVector

      public List<Double> getYVector()
      The respective coordinate values for the region on which the trigger is activated. This usually translates to the y-coordinates of a geospatial region. Must be the same length as xvals.
      Returns:
      The current value of yVector.
    • setYVector

      public CreateTriggerByAreaRequest setYVector(List<Double> yVector)
      The respective coordinate values for the region on which the trigger is activated. This usually translates to the y-coordinates of a geospatial region. Must be the same length as xvals.
      Parameters:
      yVector - The new value for yVector.
      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 CreateTriggerByAreaRequest 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:
    • 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:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object