Search in sources :

Example 1 with JdbcMetadataHandler

use of com.amazonaws.athena.connectors.jdbc.manager.JdbcMetadataHandler in project aws-athena-query-federation by awslabs.

the class HiveMuxMetadataHandlerTest method maxCatalogTest.

@Test
public void maxCatalogTest() {
    Map<String, JdbcMetadataHandler> metadataHandlersMap = new HashMap<String, JdbcMetadataHandler>();
    for (int jdbcMetadataHandlerCount = 0; jdbcMetadataHandlerCount <= 100; jdbcMetadataHandlerCount++) {
        metadataHandlersMap.put("metaHive" + jdbcMetadataHandlerCount, this.hiveMetadataHandler);
    }
    DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog1", HiveConstants.HIVE_NAME, "hive2://jdbc:hive2://54.89.6.2:10000/authena;AuthMech=3;${testSecret}", "testSecret");
    try {
        new HiveMuxMetadataHandler(this.secretsManager, this.athena, this.jdbcConnectionFactory, metadataHandlersMap, databaseConnectionConfig);
    } catch (Exception e) {
        e.getMessage();
        Assert.assertTrue(e.getMessage().contains("Max 100 catalogs supported in multiplexer."));
    }
}
Also used : HashMap(java.util.HashMap) DatabaseConnectionConfig(com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig) JdbcMetadataHandler(com.amazonaws.athena.connectors.jdbc.manager.JdbcMetadataHandler) Test(org.junit.Test)

Example 2 with JdbcMetadataHandler

use of com.amazonaws.athena.connectors.jdbc.manager.JdbcMetadataHandler in project aws-athena-query-federation by awslabs.

the class HiveMuxMetadataHandlerTest method maxCatalogTest.

@Test
public void maxCatalogTest() {
    Map<String, JdbcMetadataHandler> metadataHandlersMap = new HashMap<String, JdbcMetadataHandler>();
    for (int jdbcMetadataHandlerCount = 0; jdbcMetadataHandlerCount <= 100; jdbcMetadataHandlerCount++) {
        metadataHandlersMap.put("metaHive" + jdbcMetadataHandlerCount, this.hiveMetadataHandler);
    }
    DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog1", HiveConstants.HIVE_NAME, "hive2://jdbc:hive2://54.89.6.2:10000/authena;AuthMech=3;${testSecret}", "testSecret");
    try {
        new HiveMuxMetadataHandler(this.secretsManager, this.athena, this.jdbcConnectionFactory, metadataHandlersMap, databaseConnectionConfig);
    } catch (Exception e) {
        e.getMessage();
        Assert.assertTrue(e.getMessage().contains("Max 100 catalogs supported in multiplexer."));
    }
}
Also used : HashMap(java.util.HashMap) DatabaseConnectionConfig(com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig) JdbcMetadataHandler(com.amazonaws.athena.connectors.jdbc.manager.JdbcMetadataHandler) Test(org.junit.Test)

Example 3 with JdbcMetadataHandler

use of com.amazonaws.athena.connectors.jdbc.manager.JdbcMetadataHandler in project aws-athena-query-federation by awslabs.

the class ImpalaMuxMetadataHandlerTest method maxCatalogTest.

@Test
public void maxCatalogTest() {
    Map<String, JdbcMetadataHandler> metadataHandlersMap = new HashMap<String, JdbcMetadataHandler>();
    for (int jdbcMetadataHandlerCount = 0; jdbcMetadataHandlerCount <= 100; jdbcMetadataHandlerCount++) {
        metadataHandlersMap.put("metaHive" + jdbcMetadataHandlerCount, this.impalaMetadataHandler);
    }
    DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog1", ImpalaConstants.IMPALA_NAME, "hive2://jdbc:hive2://54.89.6.2:10000/authena;AuthMech=3;${testSecret}", "testSecret");
    try {
        new ImpalaMuxMetadataHandler(this.secretsManager, this.athena, this.jdbcConnectionFactory, metadataHandlersMap, databaseConnectionConfig);
    } catch (Exception e) {
        e.getMessage();
        Assert.assertTrue(e.getMessage().contains("Max 100 catalogs supported in multiplexer."));
    }
}
Also used : HashMap(java.util.HashMap) DatabaseConnectionConfig(com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig) JdbcMetadataHandler(com.amazonaws.athena.connectors.jdbc.manager.JdbcMetadataHandler) Test(org.junit.Test)

Aggregations

DatabaseConnectionConfig (com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig)3 JdbcMetadataHandler (com.amazonaws.athena.connectors.jdbc.manager.JdbcMetadataHandler)3 HashMap (java.util.HashMap)3 Test (org.junit.Test)3