Skip to content

Commit

Permalink
[Improve][Connector-V2] Add comment for the param of method
Browse files Browse the repository at this point in the history
  • Loading branch information
dailai committed Jun 27, 2024
1 parent 31f52c5 commit 479fb8f
Showing 1 changed file with 40 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,10 @@ default String convertType(String columnName, String columnType) {
/**
* Refresh physical table schema by schema change event
*
* @param sourceDialectName
* @param event
* @param jdbcConnectionProvider
* @param sinkTablePath
* @param sourceDialectName source dialect name
* @param event schema change event
* @param jdbcConnectionProvider jdbc connection provider
* @param sinkTablePath sink table path
*/
default void refreshTableSchemaBySchemaChangeEvent(
String sourceDialectName,
Expand All @@ -454,9 +454,9 @@ default void refreshTableSchemaBySchemaChangeEvent(
/**
* generate alter table sql
*
* @param sourceDialectName
* @param event
* @param sinkTablePath
* @param sourceDialectName source dialect name
* @param event schema change event
* @param sinkTablePath the table path of sink
* @return
*/
default String generateAlterTableSql(
Expand Down Expand Up @@ -512,11 +512,13 @@ default String generateAlterTableSql(
/**
* build alter table sql
*
* @param alterOperation
* @param newColumn
* @param tableName
* @param oldColumnName
* @return
* @param sourceDialectName source dialect name
* @param sourceColumnType source column type
* @param alterOperation alter operation of ddl
* @param newColumn new column after ddl
* @param tableName table name of sink table
* @param oldColumnName old column name before ddl
* @return alter table sql for sink table after schema change
*/
default String buildAlterTableSql(
String sourceDialectName,
Expand Down Expand Up @@ -552,9 +554,9 @@ default String buildAlterTableSql(
/**
* build the body of alter table sql
*
* @param alterOperation
* @param tableName
* @return
* @param alterOperation alter operation of ddl
* @param tableName table name of sink table
* @return basic sql of alter table for sink table
*/
default String buildAlterTableBasicSql(String alterOperation, String tableName) {
StringBuilder sql =
Expand All @@ -570,14 +572,14 @@ default String buildAlterTableBasicSql(String alterOperation, String tableName)
/**
* decorate the sql with column name and type
*
* @param sourceDialectName
* @param sourceColumnType
* @param basicSql
* @param alterOperation
* @param newColumn
* @param oldColumnName
* @param columnType
* @return
* @param sourceDialectName source dialect name
* @param sourceColumnType source column type
* @param basicSql basic sql of alter table for sink table
* @param alterOperation alter operation of ddl
* @param newColumn new column after ddl
* @param oldColumnName old column name before ddl
* @param columnType column type of new column
* @return basic sql with column name and type of alter table for sink table
*/
default String decorateWithColumnNameAndType(
String sourceDialectName,
Expand Down Expand Up @@ -610,9 +612,9 @@ default String decorateWithColumnNameAndType(
/**
* decorate with nullable
*
* @param basicSql
* @param typeBasicTypeDefine
* @return
* @param basicSql alter table sql for sink table
* @param typeBasicTypeDefine type basic type define of new column
* @return alter table sql with nullable for sink table
*/
default String decorateWithNullable(
String basicSql, BasicTypeDefine<MysqlType> typeBasicTypeDefine) {
Expand All @@ -628,9 +630,9 @@ default String decorateWithNullable(
/**
* decorate with default value
*
* @param basicSql
* @param typeBasicTypeDefine
* @return
* @param basicSql alter table sql for sink table
* @param typeBasicTypeDefine type basic type define of new column
* @return alter table sql with default value for sink table
*/
default String decorateWithDefaultValue(
String basicSql, BasicTypeDefine<MysqlType> typeBasicTypeDefine) {
Expand All @@ -650,9 +652,9 @@ && needsQuotesWithDefaultValue(typeBasicTypeDefine.getColumnType())
/**
* decorate with comment
*
* @param basicSql
* @param typeBasicTypeDefine
* @return
* @param basicSql alter table sql for sink table
* @param typeBasicTypeDefine type basic type define of new column
* @return alter table sql with comment for sink table
*/
default String decorateWithComment(
String basicSql, BasicTypeDefine<MysqlType> typeBasicTypeDefine) {
Expand All @@ -667,8 +669,8 @@ default String decorateWithComment(
/**
* whether quotes with default value
*
* @param sqlType
* @return
* @param sqlType sql type of column
* @return whether needs quotes with the type
*/
default boolean needsQuotesWithDefaultValue(String sqlType) {
return false;
Expand All @@ -677,8 +679,8 @@ default boolean needsQuotesWithDefaultValue(String sqlType) {
/**
* whether is special default value e.g. current_timestamp
*
* @param defaultValue
* @return
* @param defaultValue default value of column
* @return whether is special default value e.g current_timestamp
*/
default boolean isSpecialDefaultValue(Object defaultValue) {
return false;
Expand All @@ -687,8 +689,8 @@ default boolean isSpecialDefaultValue(Object defaultValue) {
/**
* quotes default value
*
* @param defaultValue
* @return
* @param defaultValue default value of column
* @return quoted default value
*/
default String quotesDefaultValue(Object defaultValue) {
return "'" + defaultValue + "'";
Expand Down

0 comments on commit 479fb8f

Please sign in to comment.