mirror of https://github.com/apache/nifi.git
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:
parent
9238fdb493
commit
fb925fc182
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -133,5 +133,6 @@ public class HiveConnectionPoolTest {
|
|||
assertEquals(PASS, basicDataSource.getPassword());
|
||||
assertEquals(MAX_CONN, basicDataSource.getMaxActive());
|
||||
assertEquals(10000L, basicDataSource.getMaxWait());
|
||||
assertEquals(URL, hiveConnectionPool.getConnectionURL());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue