Search in sources :

Example 6 with MySqlExecutor

use of com.hortonworks.registries.storage.impl.jdbc.provider.mysql.factory.MySqlExecutor in project registry by hortonworks.

the class MySqlStorageManagerNoCacheIntegrationTest method setFields.

private void setFields(ConnectionBuilder connectionBuilder, Database db) {
    JdbcStorageManagerIntegrationTest.connectionBuilder = connectionBuilder;
    jdbcStorageManager = createJdbcStorageManager(new MySqlExecutor(new ExecutionConfig(-1), connectionBuilder));
    database = db;
}
Also used : MySqlExecutor(com.hortonworks.registries.storage.impl.jdbc.provider.mysql.factory.MySqlExecutor) ExecutionConfig(com.hortonworks.registries.storage.impl.jdbc.config.ExecutionConfig)

Example 7 with MySqlExecutor

use of com.hortonworks.registries.storage.impl.jdbc.provider.mysql.factory.MySqlExecutor in project registry by hortonworks.

the class QueryExecutorFactory method get.

public static QueryExecutor get(String type, Map<String, Object> dbProperties) {
    HikariCPConnectionBuilder connectionBuilder = getHikariCPConnnectionBuilder(dbProperties);
    ExecutionConfig executionConfig = getExecutionConfig(dbProperties);
    QueryExecutor queryExecutor = null;
    switch(type) {
        case "mysql":
            queryExecutor = new MySqlExecutor(executionConfig, connectionBuilder);
            break;
        case "postgresql":
            queryExecutor = new PostgresqlExecutor(executionConfig, connectionBuilder);
            break;
        case "oracle":
            queryExecutor = new OracleExecutor(executionConfig, connectionBuilder);
            break;
        default:
            throw new IllegalArgumentException("Unsupported storage provider type: " + type);
    }
    return queryExecutor;
}
Also used : HikariCPConnectionBuilder(com.hortonworks.registries.storage.impl.jdbc.connection.HikariCPConnectionBuilder) MySqlExecutor(com.hortonworks.registries.storage.impl.jdbc.provider.mysql.factory.MySqlExecutor) PostgresqlExecutor(com.hortonworks.registries.storage.impl.jdbc.provider.postgresql.factory.PostgresqlExecutor) QueryExecutor(com.hortonworks.registries.storage.impl.jdbc.provider.sql.factory.QueryExecutor) OracleExecutor(com.hortonworks.registries.storage.impl.jdbc.provider.oracle.factory.OracleExecutor) ExecutionConfig(com.hortonworks.registries.storage.impl.jdbc.config.ExecutionConfig)

Aggregations

ExecutionConfig (com.hortonworks.registries.storage.impl.jdbc.config.ExecutionConfig)7 MySqlExecutor (com.hortonworks.registries.storage.impl.jdbc.provider.mysql.factory.MySqlExecutor)7 HikariCPConnectionBuilder (com.hortonworks.registries.storage.impl.jdbc.connection.HikariCPConnectionBuilder)3 StorageManager (com.hortonworks.registries.storage.StorageManager)2 JdbcStorageManager (com.hortonworks.registries.storage.impl.jdbc.JdbcStorageManager)2 Before (org.junit.Before)2 OracleExecutor (com.hortonworks.registries.storage.impl.jdbc.provider.oracle.factory.OracleExecutor)1 PostgresqlExecutor (com.hortonworks.registries.storage.impl.jdbc.provider.postgresql.factory.PostgresqlExecutor)1 QueryExecutor (com.hortonworks.registries.storage.impl.jdbc.provider.sql.factory.QueryExecutor)1