public class CreateTableMonitorRequest extends Object implements org.apache.avro.generic.IndexedRecord
GPUdb.createTableMonitor(CreateTableMonitorRequest)
.
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 returned topicId
on 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
using typeSchema
. The monitor will continue to run (regardless of
whether or not there are any subscribers) until deactivated with
GPUdb.clearTableMonitor(ClearTableMonitorRequest)
.
For more information on table monitors, see Table Monitors.
Modifier and Type | Class and Description |
---|---|
static class |
CreateTableMonitorRequest.Options
Optional parameters.
|
Constructor and Description |
---|
CreateTableMonitorRequest()
Constructs a CreateTableMonitorRequest object with default parameters.
|
CreateTableMonitorRequest(String tableName,
Map<String,String> options)
Constructs a CreateTableMonitorRequest object with the specified
parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Object |
get(int index)
This method supports the Avro framework and is not intended to be called
directly by the user.
|
static org.apache.avro.Schema |
getClassSchema()
This method supports the Avro framework and is not intended to be called
directly by the user.
|
Map<String,String> |
getOptions() |
org.apache.avro.Schema |
getSchema()
This method supports the Avro framework and is not intended to be called
directly by the user.
|
String |
getTableName() |
int |
hashCode() |
void |
put(int index,
Object value)
This method supports the Avro framework and is not intended to be called
directly by the user.
|
CreateTableMonitorRequest |
setOptions(Map<String,String> options) |
CreateTableMonitorRequest |
setTableName(String tableName) |
String |
toString() |
public CreateTableMonitorRequest()
public CreateTableMonitorRequest(String tableName, Map<String,String> options)
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 one
DATASINK_NAME
: Name of an existing data sink to send change data
notifications to
DESTINATION
: 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
if destination
in options
is specified
and is a Kafka broker
INCREASING_COLUMN
: Column on subscribed table that will
increase for new records (e.g., TIMESTAMP).
EXPRESSION
: Filter expression to limit records for
notification
REFRESH_METHOD
: Method controlling when the table
monitor reports changes to the tableName
.
Supported values:
ON_CHANGE
: Report changes as they occur.
PERIODIC
: Report changes periodically at rate specified
by refresh_period
.
ON_CHANGE
.
REFRESH_PERIOD
: When refresh_method
is periodic
, specifies the period in seconds at which
changes are reported.
REFRESH_START_TIME
: When refresh_method
is
periodic
, specifies the first time at which
changes are reported. Value is a datetime string with
format 'YYYY-MM-DD HH:MM:SS'.
Map
.public static org.apache.avro.Schema getClassSchema()
public String getTableName()
public CreateTableMonitorRequest setTableName(String tableName)
tableName
- Name of the table to monitor, in
[schema_name.]table_name format, using standard name resolution rules.this
to mimic the builder pattern.public Map<String,String> getOptions()
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 one
DATASINK_NAME
: Name of an existing data
sink to send change data notifications to
DESTINATION
: 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 if
destination
in options
is specified and is a
Kafka broker
INCREASING_COLUMN
: Column on subscribed table that will
increase for new records (e.g., TIMESTAMP).
EXPRESSION
: Filter expression to limit records for notification
REFRESH_METHOD
: Method controlling when the table monitor
reports changes to the tableName
.
Supported values:
ON_CHANGE
: Report changes as they occur.
PERIODIC
: Report changes periodically at rate specified by
refresh_period
.
ON_CHANGE
.
REFRESH_PERIOD
: When refresh_method
is periodic
, specifies the period in seconds at which changes are
reported.
REFRESH_START_TIME
: When refresh_method
is periodic
, specifies the first time at which changes are
reported. Value is a datetime string with format 'YYYY-MM-DD
HH:MM:SS'.
Map
.public CreateTableMonitorRequest setOptions(Map<String,String> options)
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 one
DATASINK_NAME
: Name of an existing data sink to send change data
notifications to
DESTINATION
: 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
if destination
in options
is specified
and is a Kafka broker
INCREASING_COLUMN
: Column on subscribed table that will
increase for new records (e.g., TIMESTAMP).
EXPRESSION
: Filter expression to limit records for
notification
REFRESH_METHOD
: Method controlling when the table
monitor reports changes to the tableName
.
Supported values:
ON_CHANGE
: Report changes as they occur.
PERIODIC
: Report changes periodically at rate specified
by refresh_period
.
ON_CHANGE
.
REFRESH_PERIOD
: When refresh_method
is periodic
, specifies the period in seconds at which
changes are reported.
REFRESH_START_TIME
: When refresh_method
is
periodic
, specifies the first time at which
changes are reported. Value is a datetime string with
format 'YYYY-MM-DD HH:MM:SS'.
Map
.this
to mimic the builder pattern.public org.apache.avro.Schema getSchema()
getSchema
in interface org.apache.avro.generic.GenericContainer
public Object get(int index)
get
in interface org.apache.avro.generic.IndexedRecord
index
- the position of the field to getIndexOutOfBoundsException
public void put(int index, Object value)
put
in interface org.apache.avro.generic.IndexedRecord
index
- the position of the field to setvalue
- the value to setIndexOutOfBoundsException
Copyright © 2024. All rights reserved.