Skip to content

Commit c018cbf

Browse files
committed
Remove redundant code
1 parent 55df666 commit c018cbf

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

flink-connector-clickhouse-base/src/test/java/org/apache/flink/connector/test/embedded/clickhouse/ClickHouseServerForTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static void setUp() throws InterruptedException, ExecutionException {
5757
boolean isLive = false;
5858
int counter = 0;
5959
while (counter < 5) {
60-
isLive = ClickHouseTestHelpers.ping(isCloud, host, port, isSSL, username, password);
60+
isLive = ClickHouseTestHelpers.ping(host, port, isSSL, username, password);
6161
if (isLive) {
6262
String createDatabase = String.format("CREATE DATABASE IF NOT EXISTS `%s`", database);
6363
executeSql(createDatabase);
@@ -78,13 +78,13 @@ public static void tearDown() {
7878
public static String getDataBase() { return database; }
7979

8080
public static void executeSql(String sql) throws ExecutionException, InterruptedException {
81-
Client client = ClickHouseTestHelpers.getClient(isCloud, host, port, isSSL, username, password);
81+
Client client = ClickHouseTestHelpers.getClient(host, port, isSSL, username, password);
8282
client.execute(sql).get();
8383
}
8484

8585
public static int countRows(String table) throws ExecutionException, InterruptedException {
8686
String countSql = String.format("SELECT COUNT(*) FROM `%s`.`%s`", database, table);
87-
Client client = ClickHouseTestHelpers.getClient(isCloud, host, port, isSSL, username, password);
87+
Client client = ClickHouseTestHelpers.getClient(host, port, isSSL, username, password);
8888
List<GenericRecord> countResult = client.queryAll(countSql);
8989
return countResult.get(0).getInteger(1);
9090
}

flink-connector-clickhouse-base/src/test/java/org/apache/flink/connector/test/embedded/clickhouse/ClickHouseTestHelpers.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ public static boolean isCloud() {
3535
return clickHouseVersion != null && clickHouseVersion.equalsIgnoreCase("cloud");
3636
}
3737

38-
public static Client getClient(boolean isCloud, String host, int port, boolean ssl, String username, String password) {
38+
public static Client getClient(String host, int port, boolean ssl, String username, String password) {
3939
return new Client.Builder().addEndpoint(Protocol.HTTP, host, port, ssl)
4040
.setUsername(username)
4141
.setPassword(password)
4242
.setConnectTimeout(TIMEOUT_VALUE, TIMEOUT_UNIT.toChronoUnit())
4343
.build();
4444
}
4545

46-
public static boolean ping(boolean isCloud, String host, int port, boolean ssl, String username, String password) {
47-
Client client = getClient(isCloud(), host, port, ssl, username, password);
46+
public static boolean ping(String host, int port, boolean ssl, String username, String password) {
47+
Client client = getClient(host, port, ssl, username, password);
4848
return client.ping();
4949
}
5050

0 commit comments

Comments
 (0)