SYSTEM$WAIT_FOR_OPENFLOW_CONNECTOR_STATUS

Waits until each named connector reaches one of the statuses you specify. Use this function when you know the expected status after an ALTER command. When you only need to wait until the connector settles, use SYSTEM$WAIT_FOR_STABLE_OPENFLOW_CONNECTORS instead.

See also:

SYSTEM$WAIT_FOR_STABLE_OPENFLOW_DEPLOYMENTS, SYSTEM$WAIT_FOR_OPENFLOW_DEPLOYMENT_STATUS, SYSTEM$WAIT_FOR_STABLE_OPENFLOW_RUNTIMES, SYSTEM$WAIT_FOR_OPENFLOW_RUNTIME_STATUS, SYSTEM$WAIT_FOR_STABLE_OPENFLOW_CONNECTORS

Syntax

SELECT SYSTEM$WAIT_FOR_OPENFLOW_CONNECTOR_STATUS(
  <timeout_seconds>,
  '<allowed_statuses>',
  '<connector_name>' [ , '<connector_name>' ... ]
);

Arguments

timeout_seconds

Maximum time to wait, in seconds.

'allowed_statuses'

Comma-separated list of acceptable statuses, for example 'RUNNING' or 'RUNNING,STOPPED'.

'connector_name'

One or more connector names. Use the fully qualified name <database>.<schema>.<name>. With USE DATABASE and USE SCHEMA set, a simple name resolves in the current session.

Common status values for connectors:

  • STOPPED — after STOP or COMMIT
  • RUNNING — after START
  • TERMINATED — after TERMINATE

Returns

Returns 'OK' on success. Raises an error if the timeout elapses or if a connector enters a failed state.

Access control

Requires any privilege on the named connector.

Usage notes

  • The Openflow UI performs equivalent polling internally.
  • Connector startup typically takes 1–3 minutes. A timeout of 300 seconds is a reasonable default.
  • If the function times out, the underlying operation continues. Re-run the wait function with a fresh timeout.

Examples

Wait for a connector to reach RUNNING after starting it:

ALTER OPENFLOW CONNECTOR my_db.my_schema.my_connector START;

SELECT SYSTEM$WAIT_FOR_OPENFLOW_CONNECTOR_STATUS(
  600,
  'RUNNING',
  'my_db.my_schema.my_connector'
);