Class CreateTableMonitorRequest
- java.lang.Object
-
- com.gpudb.protocol.CreateTableMonitorRequest
-
- All Implemented Interfaces:
org.apache.avro.generic.GenericContainer,org.apache.avro.generic.IndexedRecord
public class CreateTableMonitorRequest extends Object implements org.apache.avro.generic.IndexedRecord
A set of parameters forGPUdb.createTableMonitor.Creates a monitor that watches for a single table modification event type (insert, update, or delete) on a particular table (identified by
tableName) and forwards event notifications to subscribers via ZMQ. After this call completes, subscribe to the returnedtopicIdon the ZMQ table monitor port (default 9002). Each time an operation of the given type on the table completes, a multipart message is published for that topic; the first part contains only the topic ID, and each subsequent part contains one binary-encoded Avro object that corresponds to the event and can be decoded usingtypeSchema. The monitor will continue to run (regardless of whether or not there are any subscribers) until deactivated withGPUdb.clearTableMonitor.For more information on table monitors, see Table Monitors.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCreateTableMonitorRequest.OptionsA set of string constants for theCreateTableMonitorRequestparameteroptions.
-
Constructor Summary
Constructors Constructor Description CreateTableMonitorRequest()Constructs a CreateTableMonitorRequest object with default parameters.CreateTableMonitorRequest(String tableName, Map<String,String> options)Constructs a CreateTableMonitorRequest object with the specified parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Objectget(int index)This method supports the Avro framework and is not intended to be called directly by the user.static org.apache.avro.SchemagetClassSchema()This method supports the Avro framework and is not intended to be called directly by the user.Map<String,String>getOptions()Optional parameters.org.apache.avro.SchemagetSchema()This method supports the Avro framework and is not intended to be called directly by the user.StringgetTableName()Name of the table to monitor, in [schema_name.]table_name format, using standard name resolution rules.inthashCode()voidput(int index, Object value)This method supports the Avro framework and is not intended to be called directly by the user.CreateTableMonitorRequestsetOptions(Map<String,String> options)Optional parameters.CreateTableMonitorRequestsetTableName(String tableName)Name of the table to monitor, in [schema_name.]table_name format, using standard name resolution rules.StringtoString()
-
-
-
Constructor Detail
-
CreateTableMonitorRequest
public CreateTableMonitorRequest()
Constructs a CreateTableMonitorRequest object with default parameters.
-
CreateTableMonitorRequest
public CreateTableMonitorRequest(String tableName, Map<String,String> options)
Constructs a CreateTableMonitorRequest object with the specified parameters.- Parameters:
tableName- Name of the table to monitor, in [schema_name.]table_name format, using standard name resolution rules.options- Optional parameters.EVENT: Type of modification event on the target table to be monitored by this table monitor. Supported values:INSERT: Get notifications of new record insertions. The new row images are forwarded to the subscribers.UPDATE: Get notifications of update operations. The modified row count information is forwarded to the subscribers.DELETE: Get notifications of delete operations. The deleted row count information is forwarded to the subscribers.
INSERT.MONITOR_ID: ID to use for this monitor instead of a randomly generated oneDATASINK_NAME: Name of an existing data sink to send change data notifications toDESTINATION: Destination for the output data in format 'destination_type://path[:port]'. Supported destination types are 'http', 'https' and 'kafka'.KAFKA_TOPIC_NAME: Name of the Kafka topic to publish to ifDESTINATIONinoptionsis specified and is a Kafka brokerINCREASING_COLUMN: Column on subscribed table that will increase for new records (e.g., TIMESTAMP).EXPRESSION: Filter expression to limit records for notificationJOIN_TABLE_NAMES: A comma-separated list of tables (optionally with aliases) to include in the join. The monitored tabletableNamemust be included, representing only the newly inserted rows (deltas) since the last notification. Other tables can be any existing tables or views. Aliases can be used with the 'table_name as alias' syntax.JOIN_COLUMN_NAMES: A comma-separated list of columns or expressions to include from the joined tables. Column references can use table names or aliases defined in 'join_table_names'. Each column can optionally be aliased using 'as'. The selected columns will also appear in the notification output.JOIN_EXPRESSIONS: Optional filter or join expressions to apply when combining the tables. Expressions are standard SQL-style conditions and can reference any table or alias listed in 'join_table_names'. This corresponds to the WHERE clause of the underlying join, and can include conditions to filter the delta rows.REFRESH_METHOD: Method controlling when the table monitor reports changes to thetableName. Supported values:ON_CHANGE: Report changes as they occur.PERIODIC: Report changes periodically at rate specified byREFRESH_PERIOD.
ON_CHANGE.REFRESH_PERIOD: WhenREFRESH_METHODisPERIODIC, specifies the period in seconds at which changes are reported.REFRESH_START_TIME: WhenREFRESH_METHODisPERIODIC, specifies the first time at which changes are reported. Value is a datetime string with format 'YYYY-MM-DD HH:MM:SS'.
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.
-
getTableName
public String getTableName()
Name of the table to monitor, in [schema_name.]table_name format, using standard name resolution rules.- Returns:
- The current value of
tableName.
-
setTableName
public CreateTableMonitorRequest setTableName(String tableName)
Name of the table to monitor, in [schema_name.]table_name format, using standard name resolution rules.- Parameters:
tableName- The new value fortableName.- Returns:
thisto mimic the builder pattern.
-
getOptions
public Map<String,String> getOptions()
Optional parameters.EVENT: Type of modification event on the target table to be monitored by this table monitor. Supported values:INSERT: Get notifications of new record insertions. The new row images are forwarded to the subscribers.UPDATE: Get notifications of update operations. The modified row count information is forwarded to the subscribers.DELETE: Get notifications of delete operations. The deleted row count information is forwarded to the subscribers.
INSERT.MONITOR_ID: ID to use for this monitor instead of a randomly generated oneDATASINK_NAME: Name of an existing data sink to send change data notifications toDESTINATION: Destination for the output data in format 'destination_type://path[:port]'. Supported destination types are 'http', 'https' and 'kafka'.KAFKA_TOPIC_NAME: Name of the Kafka topic to publish to ifDESTINATIONinoptionsis specified and is a Kafka brokerINCREASING_COLUMN: Column on subscribed table that will increase for new records (e.g., TIMESTAMP).EXPRESSION: Filter expression to limit records for notificationJOIN_TABLE_NAMES: A comma-separated list of tables (optionally with aliases) to include in the join. The monitored tabletableNamemust be included, representing only the newly inserted rows (deltas) since the last notification. Other tables can be any existing tables or views. Aliases can be used with the 'table_name as alias' syntax.JOIN_COLUMN_NAMES: A comma-separated list of columns or expressions to include from the joined tables. Column references can use table names or aliases defined in 'join_table_names'. Each column can optionally be aliased using 'as'. The selected columns will also appear in the notification output.JOIN_EXPRESSIONS: Optional filter or join expressions to apply when combining the tables. Expressions are standard SQL-style conditions and can reference any table or alias listed in 'join_table_names'. This corresponds to the WHERE clause of the underlying join, and can include conditions to filter the delta rows.REFRESH_METHOD: Method controlling when the table monitor reports changes to thetableName. Supported values:ON_CHANGE: Report changes as they occur.PERIODIC: Report changes periodically at rate specified byREFRESH_PERIOD.
ON_CHANGE.REFRESH_PERIOD: WhenREFRESH_METHODisPERIODIC, specifies the period in seconds at which changes are reported.REFRESH_START_TIME: WhenREFRESH_METHODisPERIODIC, specifies the first time at which changes are reported. Value is a datetime string with format 'YYYY-MM-DD HH:MM:SS'.
Map.- Returns:
- The current value of
options.
-
setOptions
public CreateTableMonitorRequest setOptions(Map<String,String> options)
Optional parameters.EVENT: Type of modification event on the target table to be monitored by this table monitor. Supported values:INSERT: Get notifications of new record insertions. The new row images are forwarded to the subscribers.UPDATE: Get notifications of update operations. The modified row count information is forwarded to the subscribers.DELETE: Get notifications of delete operations. The deleted row count information is forwarded to the subscribers.
INSERT.MONITOR_ID: ID to use for this monitor instead of a randomly generated oneDATASINK_NAME: Name of an existing data sink to send change data notifications toDESTINATION: Destination for the output data in format 'destination_type://path[:port]'. Supported destination types are 'http', 'https' and 'kafka'.KAFKA_TOPIC_NAME: Name of the Kafka topic to publish to ifDESTINATIONinoptionsis specified and is a Kafka brokerINCREASING_COLUMN: Column on subscribed table that will increase for new records (e.g., TIMESTAMP).EXPRESSION: Filter expression to limit records for notificationJOIN_TABLE_NAMES: A comma-separated list of tables (optionally with aliases) to include in the join. The monitored tabletableNamemust be included, representing only the newly inserted rows (deltas) since the last notification. Other tables can be any existing tables or views. Aliases can be used with the 'table_name as alias' syntax.JOIN_COLUMN_NAMES: A comma-separated list of columns or expressions to include from the joined tables. Column references can use table names or aliases defined in 'join_table_names'. Each column can optionally be aliased using 'as'. The selected columns will also appear in the notification output.JOIN_EXPRESSIONS: Optional filter or join expressions to apply when combining the tables. Expressions are standard SQL-style conditions and can reference any table or alias listed in 'join_table_names'. This corresponds to the WHERE clause of the underlying join, and can include conditions to filter the delta rows.REFRESH_METHOD: Method controlling when the table monitor reports changes to thetableName. Supported values:ON_CHANGE: Report changes as they occur.PERIODIC: Report changes periodically at rate specified byREFRESH_PERIOD.
ON_CHANGE.REFRESH_PERIOD: WhenREFRESH_METHODisPERIODIC, specifies the period in seconds at which changes are reported.REFRESH_START_TIME: WhenREFRESH_METHODisPERIODIC, specifies the first time at which changes are reported. Value is a datetime string with format 'YYYY-MM-DD HH:MM:SS'.
Map.- Parameters:
options- The new value foroptions.- Returns:
thisto 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:
getSchemain interfaceorg.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:
getin interfaceorg.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:
putin interfaceorg.apache.avro.generic.IndexedRecord- Parameters:
index- the position of the field to setvalue- the value to set- Throws:
IndexOutOfBoundsException
-
-