Skip to content

Commit

Permalink
remove baseDescription
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Kinard <[email protected]>
  • Loading branch information
Polber committed Dec 20, 2024
1 parent 10f7eaf commit 8320792
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class JdbcReadSchemaTransformProvider

@Override
public String description() {
return baseDescription("JDBC")
return "Read from a JDBC source using a SQL query or by directly accessing a single table.\n"
+ "\n"
+ "This transform can be used to read from a JDBC source using either a given JDBC driver jar "
+ "and class name, or by using one of the default packaged drivers given a `jdbc_type`.\n"
Expand Down Expand Up @@ -111,16 +111,11 @@ public String description() {
+ "All properties should be semi-colon-delimited (e.g. \"key1=value1;key2=value2;\")\n";
}

protected String baseDescription(String jdbcType) {
return String.format(
"Read from a %s source using a SQL query or by directly accessing " + "a single table.\n",
jdbcType);
}

protected String inheritedDescription(
String prettyName, String transformName, String databaseSchema, int defaultJdbcPort) {
return String.format(
"\n"
"Read from a %s source using a SQL query or by directly accessing a single table.\n"
+ "\n"
+ "This is a special case of ReadFromJdbc that includes the "
+ "necessary %s Driver and classes.\n"
+ "\n"
Expand All @@ -145,6 +140,7 @@ protected String inheritedDescription(
+ "transform. If that is the case, see ReadFromJdbc which "
+ "allows for more custom configuration.",
prettyName,
prettyName,
transformName,
transformName,
databaseSchema,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class JdbcWriteSchemaTransformProvider

@Override
public String description() {
return baseDescription("JDBC")
return "Write to a JDBC sink using a SQL query or by directly accessing a single table.\n"
+ "\n"
+ "This transform can be used to write to a JDBC sink using either a given JDBC driver jar "
+ "and class name, or by using one of the default packaged drivers given a `jdbc_type`.\n"
Expand Down Expand Up @@ -116,16 +116,11 @@ public String description() {
+ "All properties should be semi-colon-delimited (e.g. \"key1=value1;key2=value2;\")\n";
}

protected String baseDescription(String jdbcType) {
return String.format(
"Write to a %s sink using a SQL query or by directly accessing " + "a single table.\n",
jdbcType);
}

protected String inheritedDescription(
String prettyName, String transformName, String prefix, int port) {
return String.format(
"\n"
"Write to a %s sink using a SQL query or by directly accessing a single table.\n"
+ "\n"
+ "This is a special case of WriteToJdbc that includes the "
+ "necessary %s Driver and classes.\n"
+ "\n"
Expand All @@ -149,7 +144,15 @@ protected String inheritedDescription(
+ "It might be necessary to use a custom JDBC driver that is not packaged with this "
+ "transform. If that is the case, see WriteToJdbc which "
+ "allows for more custom configuration.",
prettyName, transformName, transformName, prefix, port, transformName, prefix, port);
prettyName,
prettyName,
transformName,
transformName,
prefix,
port,
transformName,
prefix,
port);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class ReadFromMySqlSchemaTransformProvider extends JdbcReadSchemaTransfor

@Override
public String description() {
return baseDescription("MySQL") + inheritedDescription("MySQL", "ReadFromMySql", "mysql", 3306);
return inheritedDescription("MySQL", "ReadFromMySql", "mysql", 3306);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public class ReadFromOracleSchemaTransformProvider extends JdbcReadSchemaTransfo

@Override
public String description() {
return baseDescription("Oracle")
+ inheritedDescription("Oracle", "ReadFromOracle", "oracle", 1521);
return inheritedDescription("Oracle", "ReadFromOracle", "oracle", 1521);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public class ReadFromPostgresSchemaTransformProvider extends JdbcReadSchemaTrans

@Override
public String description() {
return baseDescription("PostgreSQL")
+ inheritedDescription("Postgres", "ReadFromPostgres", "postgresql", 5432);
return inheritedDescription("Postgres", "ReadFromPostgres", "postgresql", 5432);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public class ReadFromSqlServerSchemaTransformProvider extends JdbcReadSchemaTran

@Override
public String description() {
return baseDescription("Sql Server (Microsoft SQL)")
+ inheritedDescription("SQL Server", "ReadFromSqlServer", "sqlserver", 1433);
return inheritedDescription("SQL Server", "ReadFromSqlServer", "sqlserver", 1433);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class WriteToMySqlSchemaTransformProvider extends JdbcWriteSchemaTransfor

@Override
public String description() {
return baseDescription("MySQL") + inheritedDescription("MySQL", "WriteToMySql", "mysql", 3306);
return inheritedDescription("MySQL", "WriteToMySql", "mysql", 3306);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public class WriteToOracleSchemaTransformProvider extends JdbcWriteSchemaTransfo

@Override
public String description() {
return baseDescription("Oracle")
+ inheritedDescription("Oracle", "WriteToOracle", "oracle", 1521);
return inheritedDescription("Oracle", "WriteToOracle", "oracle", 1521);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public class WriteToPostgresSchemaTransformProvider extends JdbcWriteSchemaTrans

@Override
public String description() {
return baseDescription("PostgreSQL")
+ inheritedDescription("Postgres", "WriteToPostgres", "postgresql", 5432);
return inheritedDescription("Postgres", "WriteToPostgres", "postgresql", 5432);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public class WriteToSqlServerSchemaTransformProvider extends JdbcWriteSchemaTran

@Override
public String description() {
return baseDescription("Sql Server (Microsoft SQL)")
+ inheritedDescription("SQL Server", "WriteToSqlServer", "sqlserver", 1433);
return inheritedDescription("SQL Server", "WriteToSqlServer", "sqlserver", 1433);
}

@Override
Expand Down

0 comments on commit 8320792

Please sign in to comment.