Class ConfluentTools
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncollectChangelog(Table table) Executes the given table transformations on Confluent Cloud and returns the results locally as a list of changelog rows.collectChangelog(Table table, int stopAfter) Executes the given table transformations on Confluent Cloud and returns the results locally as a list of changelog rows.collectChangelog(TableResult tableResult) Returns the given table results locally as a list of changelog rows.collectChangelog(TableResult tableResult, int stopAfter) Returns the given table results locally as a list of changelog rows.collectMaterialized(Table table) Executes the given table transformations on Confluent Cloud and returns the results locally as a materialized changelog.collectMaterialized(Table table, int stopAfter) Executes the given table transformations on Confluent Cloud and returns the results locally as a materialized changelog.collectMaterialized(TableResult tableResult) Returns the given results locally as a materialized changelog.collectMaterialized(TableResult tableResult, int stopAfter) Returns the given results locally as a materialized changelog.static voiddeleteArtifact(TableEnvironment env, String artifactId) Deletes the artifact with the given id (e.g.static voiddeleteStatement(TableEnvironment env, String statementName) Deletes the statement behind the given statement name, blocking until the deletion completes or the configured timeout (client.timeout) elapses.static voiddeleteStatement(TableEnvironment env, String statementName, boolean await) Deletes the statement behind the given statement name, optionally waiting for the deletion to complete before returning.static StatementHandlegetStatementHandle(TableEnvironment env, String statementName) Returns aStatementHandleto manage a submitted Flink SQL statement on Confluent Cloud.static StatementHandlegetStatementHandle(TableResult tableResult) Returns aStatementHandleto manage a submitted Flink SQL statement on Confluent Cloud.static StringgetStatementName(TableResult tableResult) Returns the statement name behind the given table result.static voidprintChangelog(Table table) Executes the given table transformations on Confluent Cloud and prints the results locally as a table prefixed with a change flag column.static voidprintChangelog(Table table, int stopAfter) Executes the given table transformations on Confluent Cloud and prints the results locally as a table prefixed with a change flag column.static voidprintChangelog(TableResult tableResult) Prints the results locally as a table prefixed with a change flag column.static voidprintChangelog(TableResult tableResult, int stopAfter) Prints the given table results locally as a table prefixed with a change flag column.static voidprintMaterialized(Table table) Executes the given table transformations on Confluent Cloud and prints the results locally as a materialized changelog.static voidprintMaterialized(Table table, int stopAfter) Executes the given table transformations on Confluent Cloud and prints the results locally as a materialized changelog.static voidprintMaterialized(TableResult tableResult) Prints the given table results locally as a materialized changelog.static voidprintMaterialized(TableResult tableResult, int stopAfter) Prints the given table results locally as a materialized changelog.static voidresumeStatement(TableEnvironment env, String statementName) Resumes the statement behind the given statement name, blocking until the statement resumes or the configured timeout (client.timeout) elapses.static voidresumeStatement(TableEnvironment env, String statementName, boolean await) Resumes the statement behind the given statement name, optionally waiting for the statement to resume before returning.static voidsetStatementName(TableEnvironment env, String name) Sets the statement name for the next statement submission.static voidstopStatement(TableEnvironment env, String statementName) Stops the statement behind the given statement name, blocking until the statement reaches a stopped state or the configured timeout (client.timeout) elapses.static voidstopStatement(TableEnvironment env, String statementName, boolean await) Stops the statement behind the given statement name, optionally waiting for the statement to reach a stopped state before returning.static voidstopStatement(TableResult tableResult) Stops the statement behind the given table result, blocking until the statement reaches a stopped state or the configured timeout (client.timeout) elapses.static voidstopStatement(TableResult tableResult, boolean await) Stops the statement behind the given table result, optionally waiting for the statement to reach a stopped state before returning.
-
Constructor Details
-
ConfluentTools
public ConfluentTools()
-
-
Method Details
-
setStatementName
Sets the statement name for the next statement submission.A statement name must be unique within an environment and cloud region for a given organization. By default, statement names are auto-generated using a UUID.
Important: If you configured an application name via
ConfluentSettings.Builder.setApplicationName(String), it will be automatically prefixed to the statement name you provide here. For example, if your application name is"myapp"and you set the statement name to"query1", the final statement name will be"myapp-query1".If you did not configure an application name and use this method to set an explicit statement name, the statement name you provide will be used as-is (fully qualified).
The name you set here applies only to the next statement submission; it is automatically reset afterward. Submissions without an explicit name auto-generate a unique name.
To simply run multiple statements without managing names, configure an application name via
ConfluentSettings.Builder.setApplicationName(String)once; every statement then receives a unique, namespaced{applicationName}-<generated>name. Use this method only when a specific statement needs a stable name so it can be stopped, resumed, or replaced across runs, calling it again before each such submission — auto-generated names are unique but differ on every run.Naming constraints:
- Must contain only lowercase alphanumeric characters and hyphens
- Must start and end with an alphanumeric character (not a hyphen)
- Maximum length: 100 characters (including the application name prefix if configured)
- Parameters:
env- the table environmentname- the statement name (will be prefixed with application name if configured)
-
collectChangelog
Executes the given table transformations on Confluent Cloud and returns the results locally as a list of changelog rows.This method performs
table.execute().collect()under the hood and consumes all rows from the returned iterator.Note: The method assumes that all input tables are finite. If the pipeline is potentially unbounded, use
collectChangelog(Table, int)for stop fetching after the desired amount of rows has been reached. -
collectChangelog
Returns the given table results locally as a list of changelog rows.- See Also:
-
collectChangelog
Executes the given table transformations on Confluent Cloud and returns the results locally as a list of changelog rows.This method performs
table.execute().collect()under the hood and consumes a fixed amount of rows from the returned iterator.Note: The method can work on both finite and infinite input tables. If the pipeline is potentially unbounded, it will stop fetching after the desired amount of rows has been reached.
-
collectChangelog
Returns the given table results locally as a list of changelog rows.- See Also:
-
collectMaterialized
Executes the given table transformations on Confluent Cloud and returns the results locally as a materialized changelog. In other words: Changes are applied to an in-memory table and returned as a list of insert-only rows.This method performs
table.execute().collect()under the hood and consumes all rows from the returned iterator.Note: The method assumes that all input tables are finite. If the pipeline is potentially unbounded, use
collectMaterialized(Table, int)for stop fetching after the desired amount of rows has been reached. -
collectMaterialized
Returns the given results locally as a materialized changelog. In other words: Changes are applied to an in-memory table and returned as a list of insert-only rows.- See Also:
-
collectMaterialized
Executes the given table transformations on Confluent Cloud and returns the results locally as a materialized changelog. In other words: Changes are applied to an in-memory table and returned as a list of insert-only rows.This method performs
table.execute().collect()under the hood and consumes a fixed amount of rows from the returned iterator.Note: The method can work on both finite and infinite input tables. If the pipeline is potentially unbounded, it will stop fetching after the desired amount of rows has been reached.
-
collectMaterialized
Returns the given results locally as a materialized changelog. In other words: Changes are applied to an in-memory table and returned as a list of insert-only rows.- See Also:
-
printChangelog
Executes the given table transformations on Confluent Cloud and prints the results locally as a table prefixed with a change flag column.This method performs
table.execute().collect()under the hood and consumes all rows from the returned iterator.Note: The method assumes that all input tables are finite. If the pipeline is potentially unbounded, use
printChangelog(Table, int)for stop fetching after the desired amount of rows has been reached. -
printChangelog
Prints the results locally as a table prefixed with a change flag column.- See Also:
-
printChangelog
Executes the given table transformations on Confluent Cloud and prints the results locally as a table prefixed with a change flag column.This method performs
table.execute().collect()under the hood and consumes a fixed amount of rows from the returned iterator.Note: The method can work on both finite and infinite input tables. If the pipeline is potentially unbounded, it will stop fetching after the desired amount of rows has been reached.
-
printChangelog
Prints the given table results locally as a table prefixed with a change flag column.- See Also:
-
printMaterialized
Executes the given table transformations on Confluent Cloud and prints the results locally as a materialized changelog. In other words: Changes are applied to an in-memory table and printed.This method performs
table.execute().collect()under the hood and consumes all rows from the returned iterator.Note: The method assumes that all input tables are finite. If the pipeline is potentially unbounded, use
printMaterialized(Table, int)for stop fetching after the desired amount of rows has been reached. -
printMaterialized
Prints the given table results locally as a materialized changelog. In other words: Changes are applied to an in-memory table and printed.- See Also:
-
printMaterialized
Executes the given table transformations on Confluent Cloud and prints the results locally as a materialized changelog. In other words: Changes are applied to an in-memory table and printed.This method performs
table.execute().collect()under the hood and consumes a fixed amount of rows from the returned iterator.Note: The method can work on both finite and infinite input tables. If the pipeline is potentially unbounded, it will stop fetching after the desired amount of rows has been reached.
-
printMaterialized
Prints the given table results locally as a materialized changelog. In other words: Changes are applied to an in-memory table and printed.- See Also:
-
getStatementName
Returns the statement name behind the given table result. -
stopStatement
Stops the statement behind the given table result, blocking until the statement reaches a stopped state or the configured timeout (client.timeout) elapses. -
stopStatement
Stops the statement behind the given table result, optionally waiting for the statement to reach a stopped state before returning. -
resumeStatement
Resumes the statement behind the given statement name, blocking until the statement resumes or the configured timeout (client.timeout) elapses. -
resumeStatement
Resumes the statement behind the given statement name, optionally waiting for the statement to resume before returning. -
stopStatement
Stops the statement behind the given statement name, blocking until the statement reaches a stopped state or the configured timeout (client.timeout) elapses. -
stopStatement
Stops the statement behind the given statement name, optionally waiting for the statement to reach a stopped state before returning. -
deleteStatement
Deletes the statement behind the given statement name, blocking until the deletion completes or the configured timeout (client.timeout) elapses. -
deleteStatement
Deletes the statement behind the given statement name, optionally waiting for the deletion to complete before returning. -
deleteArtifact
Deletes the artifact with the given id (e.g.cfa-...) from Confluent Cloud.Requires artifact credentials (a global API key/secret or a dedicated Artifact API key/secret).
-
getStatementHandle
Returns aStatementHandleto manage a submitted Flink SQL statement on Confluent Cloud. -
getStatementHandle
Returns aStatementHandleto manage a submitted Flink SQL statement on Confluent Cloud.
-