NIFI-3867: Fixed issue with getConnectionURL in HiveConnectionPool using Expression Language

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes #1847.
This commit is contained in:
Matt Burgess 2017-05-23 15:21:10 -04:00 committed by Pierre Villard
parent 9238fdb493
commit fb925fc182
2 changed files with 3 additions and 4 deletions

View File

@ -213,8 +213,6 @@ public class HiveConnectionPool extends AbstractControllerService implements Hiv
@OnEnabled
public void onConfigured(final ConfigurationContext context) throws InitializationException {
connectionUrl = context.getProperty(DATABASE_URL).getValue();
ComponentLog log = getLogger();
final String configFiles = context.getProperty(HIVE_CONFIGURATION_RESOURCES).evaluateAttributeExpressions().getValue();
@ -251,7 +249,7 @@ public class HiveConnectionPool extends AbstractControllerService implements Hiv
dataSource = new BasicDataSource();
dataSource.setDriverClassName(drv);
final String dburl = context.getProperty(DATABASE_URL).evaluateAttributeExpressions().getValue();
connectionUrl = context.getProperty(DATABASE_URL).evaluateAttributeExpressions().getValue();
dataSource.setMaxWait(maxWaitMillis);
dataSource.setMaxActive(maxTotal);
@ -261,7 +259,7 @@ public class HiveConnectionPool extends AbstractControllerService implements Hiv
dataSource.setTestOnBorrow(true);
}
dataSource.setUrl(dburl);
dataSource.setUrl(connectionUrl);
dataSource.setUsername(user);
dataSource.setPassword(passw);
}

View File

@ -133,5 +133,6 @@ public class HiveConnectionPoolTest {
assertEquals(PASS, basicDataSource.getPassword());
assertEquals(MAX_CONN, basicDataSource.getMaxActive());
assertEquals(10000L, basicDataSource.getMaxWait());
assertEquals(URL, hiveConnectionPool.getConnectionURL());
}
}