Repository: ambari Updated Branches: refs/heads/trunk 71e384dbb -> 428321159
AMBARI-21000. Ambari does not work with PGBouncer/PostgreSQL. (Robert Yokota via swagle) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/42832115 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/42832115 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/42832115 Branch: refs/heads/trunk Commit: 4283211592c6813e02d74b7ef801da39711042cb Parents: 71e384d Author: Siddharth Wagle <swa...@hortonworks.com> Authored: Fri Jun 2 10:47:09 2017 -0700 Committer: Siddharth Wagle <swa...@hortonworks.com> Committed: Fri Jun 2 10:47:09 2017 -0700 ---------------------------------------------------------------------- .../ambari/server/configuration/Configuration.java | 11 +++++++++++ .../ambari/server/scheduler/ExecutionSchedulerImpl.java | 2 ++ 2 files changed, 13 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/42832115/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java index 114046f..d3b8cc5 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java @@ -1741,6 +1741,13 @@ public class Configuration { "server.execution.scheduler.maxDbConnections", "5"); /** + * The maximum number of prepared statements cached per database connection. + */ + @Markdown(description = "The maximum number of prepared statements cached per database connection.") + public static final ConfigurationProperty<String> EXECUTION_SCHEDULER_MAX_STATEMENTS_PER_CONNECTION = new ConfigurationProperty<>( + "server.execution.scheduler.maxStatementsPerConnection", "120"); + + /** * The tolerance, in {@link TimeUnit#MINUTES}, that Quartz will allow a misfired job to run. */ @Markdown(description = "The time, in minutes, that a scheduled job can be run after its missed scheduled execution time.") @@ -4554,6 +4561,10 @@ public class Configuration { return getProperty(EXECUTION_SCHEDULER_CONNECTIONS); } + public String getExecutionSchedulerMaxStatementsPerConnection() { + return getProperty(EXECUTION_SCHEDULER_MAX_STATEMENTS_PER_CONNECTION); + } + public Long getExecutionSchedulerMisfireToleration() { return Long.parseLong(getProperty(EXECUTION_SCHEDULER_MISFIRE_TOLERATION)); } http://git-wip-us.apache.org/repos/asf/ambari/blob/42832115/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionSchedulerImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionSchedulerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionSchedulerImpl.java index cd210b5..6dae349 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionSchedulerImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionSchedulerImpl.java @@ -117,6 +117,8 @@ public class ExecutionSchedulerImpl implements ExecutionScheduler { configuration.getDatabasePassword()); properties.setProperty("org.quartz.dataSource.myDS.maxConnections", configuration.getExecutionSchedulerConnections()); + properties.setProperty("org.quartz.dataSource.myDS.maxCachedStatementsPerConnection", + configuration.getExecutionSchedulerMaxStatementsPerConnection()); properties.setProperty("org.quartz.dataSource.myDS.validationQuery", subProps[1]);