Skip to content

Commit d0866bb

Browse files
committed
add enmu DatastoreBackend, add javadoc
1 parent c96a47e commit d0866bb

File tree

4 files changed

+23
-17
lines changed

4 files changed

+23
-17
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* You may obtain a copy of the License at
5+
*
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
14+
package io.trino.gateway.ha.config;
15+
16+
public enum DataStoreBackend {
17+
ORACLE,
18+
MYSQL,
19+
POSTGRES,
20+
H2
21+
}

gateway-ha/src/main/java/io/trino/gateway/ha/config/DataStoreConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public MySqlConfiguration getMySqlConfiguration()
111111
return mySqlConfiguration;
112112
}
113113

114-
public void setMysqlConfiguration(MySqlConfiguration mySqlConfig)
114+
public void setMySqlConfiguration(MySqlConfiguration mySqlConfig)
115115
{
116116
this.mySqlConfiguration = mySqlConfig;
117117
}

gateway-ha/src/main/java/io/trino/gateway/ha/config/HaGatewayConfiguration.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public class HaGatewayConfiguration
4343
private List<String> statementPaths = ImmutableList.of(V1_STATEMENT_PATH);
4444
private boolean includeClusterHostInResponse;
4545
private ProxyResponseConfiguration proxyResponseConfiguration = new ProxyResponseConfiguration();
46-
private boolean oracleBackend;
4746

4847
private RequestAnalyzerConfig requestAnalyzerConfig = new RequestAnalyzerConfig();
4948

@@ -298,14 +297,4 @@ public HaGatewayConfigurationException(String message)
298297
super(message);
299298
}
300299
}
301-
302-
public boolean isOracleBackend()
303-
{
304-
return oracleBackend;
305-
}
306-
307-
public void setOracleBackend(boolean oracleBackend)
308-
{
309-
this.oracleBackend = oracleBackend;
310-
}
311300
}

gateway-ha/src/test/java/io/trino/gateway/ha/router/BaseTestQueryHistoryManager.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
package io.trino.gateway.ha.router;
1515

1616
import io.trino.gateway.ha.config.DataStoreConfiguration;
17-
import io.trino.gateway.ha.config.HaGatewayConfiguration;
1817
import io.trino.gateway.ha.domain.response.DistributionResponse;
1918
import io.trino.gateway.ha.persistence.FlywayMigration;
2019
import io.trino.gateway.ha.persistence.JdbcConnectionManager;
@@ -51,10 +50,7 @@ void setUp()
5150
true);
5251
FlywayMigration.migrate(config);
5352
JdbcConnectionManager jdbcConnectionManager = createTestingJdbcConnectionManager(container, config);
54-
HaGatewayConfiguration haGatewayConfiguration = new HaGatewayConfiguration();
55-
haGatewayConfiguration.setDataStore(config);
56-
haGatewayConfiguration.setOracleBackend(container.getJdbcUrl().startsWith("jdbc:oracle"));
57-
queryHistoryManager = new HaQueryHistoryManager(jdbcConnectionManager.getJdbi(), config);
53+
queryHistoryManager = new HaQueryHistoryManager(jdbcConnectionManager.getJdbi(), jdbcConnectionManager.getConfiguration());
5854
}
5955

6056
@AfterAll

0 commit comments

Comments
 (0)