public class StarRocksCatalog extends Object implements Serializable
| Constructor and Description |
|---|
StarRocksCatalog(String jdbcUrl,
String username,
String password) |
| Modifier and Type | Method and Description |
|---|---|
void |
alterAddColumns(String databaseName,
String tableName,
List<StarRocksColumn> addColumns,
long timeoutSecond)
Add columns to a table.
|
void |
alterDropColumns(String databaseName,
String tableName,
List<String> dropColumns,
long timeoutSecond)
Drop columns of a table.
|
void |
close()
Close the catalog when it is no longer needed and release any resource that it might be
holding.
|
void |
createDatabase(String databaseName,
boolean ignoreIfExists)
Create a database.
|
void |
createTable(StarRocksTable table,
boolean ignoreIfExists)
Creates a table.
|
boolean |
databaseExists(String databaseName)
Check if a database exists in this catalog.
|
Optional<StarRocksTable> |
getTable(String databaseName,
String tableName)
Returns a
StarRocksTable identified by the given databaseName and tableName. |
void |
open()
Open the catalog.
|
public void open()
throws StarRocksCatalogException
StarRocksCatalogException - in case of any runtime exceptionpublic void close()
throws StarRocksCatalogException
StarRocksCatalogException - in case of any runtime exceptionpublic boolean databaseExists(String databaseName) throws StarRocksCatalogException
databaseName - Name of the databaseStarRocksCatalogException - in case of any runtime exceptionpublic void createDatabase(String databaseName, boolean ignoreIfExists) throws StarRocksCatalogException
databaseName - Name of the databaseignoreIfExists - Flag to specify behavior when a database with the given name already
exists: if set to false, throw a StarRocksCatalogException, if set to true, do nothing.StarRocksCatalogException - in case of any runtime exceptionpublic Optional<StarRocksTable> getTable(String databaseName, String tableName) throws StarRocksCatalogException
StarRocksTable identified by the given databaseName and tableName.databaseName - Name of the databasetableName - Name of the tableStarRocksCatalogException - in case of any runtime exceptionpublic void createTable(StarRocksTable table, boolean ignoreIfExists) throws StarRocksCatalogException
table - the table definitionignoreIfExists - flag to specify behavior when a table already exists. if set to false,
it throws a TableAlreadyExistException, if set to true, do nothing.StarRocksCatalogException - in case of any runtime exceptionpublic void alterAddColumns(String databaseName, String tableName, List<StarRocksColumn> addColumns, long timeoutSecond) throws StarRocksCatalogException
databaseName - Name of the databasetableName - Name of the tableaddColumns - Columns to addtimeoutSecond - Timeout for a schema change on StarRocks sideStarRocksCatalogException - in case of any runtime exceptionpublic void alterDropColumns(String databaseName, String tableName, List<String> dropColumns, long timeoutSecond) throws StarRocksCatalogException
databaseName - Name of the databasetableName - Name of the tabledropColumns - Columns to droptimeoutSecond - Timeout for a schema change on StarRocks sideStarRocksCatalogException - in case of any runtime exceptionCopyright © 2023. All rights reserved.