ambari git commit: AMBARI-15133. Functionality to purge operational logs from the ambari database. (Laszlo Puskas via stoader)

2016-03-01 Thread stoader
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 859345bad -> 267d60778


AMBARI-15133. Functionality to purge operational logs from the ambari database. 
(Laszlo Puskas via stoader)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/267d6077
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/267d6077
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/267d6077

Branch: refs/heads/branch-2.2
Commit: 267d60778fab840d3c2d629313810c30342d8fec
Parents: 859345b
Author: Toader, Sebastian 
Authored: Wed Mar 2 06:34:26 2016 +0100
Committer: Toader, Sebastian 
Committed: Wed Mar 2 07:19:27 2016 +0100

--
 ambari-server/pom.xml   |   5 +
 ambari-server/sbin/ambari-server|  10 +-
 .../server/cleanup/ClasspathScannerUtils.java   | 129 +++
 .../ambari/server/cleanup/CleanupDriver.java| 117 ++
 .../ambari/server/cleanup/CleanupModule.java|  76 +
 .../ambari/server/cleanup/CleanupService.java   |  33 
 .../server/cleanup/CleanupServiceImpl.java  |  67 
 .../ambari/server/cleanup/PurgePolicy.java  |  33 
 .../server/cleanup/TimeBasedCleanupPolicy.java  |  62 +++
 .../apache/ambari/server/orm/dao/AlertsDAO.java |  91 ++-
 .../apache/ambari/server/orm/dao/Cleanable.java |  39 +
 .../server/orm/entities/AlertCurrentEntity.java |   4 +-
 .../server/orm/entities/AlertHistoryEntity.java |   4 +-
 .../server/orm/entities/AlertNoticeEntity.java  |   4 +-
 ambari-server/src/main/python/ambari-server.py  |   9 +-
 .../src/main/python/ambari_server/dbCleanup.py  | 117 ++
 .../main/python/ambari_server/setupActions.py   |   1 +
 .../cleanup/CleanupServiceFunctionalTest.java   | 161 +++
 .../server/cleanup/CleanupServiceImplTest.java  |  82 ++
 .../ddl-func-test/ddl-cleanup-test-data.sql |   6 +
 20 files changed, 1040 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/267d6077/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 87ddd19..45e2bdd 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -1994,6 +1994,11 @@
   hadoop-auth
   ${hadoop.version}
 
+
+  commons-cli
+  commons-cli
+  1.3.1
+
   
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/267d6077/ambari-server/sbin/ambari-server
--
diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server
index e676cbc..ef4344c 100755
--- a/ambari-server/sbin/ambari-server
+++ b/ambari-server/sbin/ambari-server
@@ -142,10 +142,14 @@ case "$1" in
 echo -e "Checking database"
 $PYTHON /usr/sbin/ambari-server.py $@
 ;;
+  db-cleanup)
+echo -e "Cleanup database..."
+$PYTHON /usr/sbin/ambari-server.py $@
+;;
   *)
-echo "Usage: /usr/sbin/ambari-server
-
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|refresh-stack-hash|backup|restore|update-host-names|check-database}
 [options]
-Use usr/sbin/ambari-server  --help to get details on options 
available.
+echo "Usage: $AMBARI_PYTHON_EXECUTABLE
+
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|setup-sso|refresh-stack-hash|backup|restore|update-host-names|check-database|db-cleanup}
 [options]
+Use $AMBARI_PYTHON_EXECUTABLE  --help to get details on 
options available.
 Or, simply invoke ambari-server.py --help to print the options."
 exit 1
 esac

http://git-wip-us.apache.org/repos/asf/ambari/blob/267d6077/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
new file mode 100644
index 000..4c12a62
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
@@ -0,0 +1,129 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+

ambari git commit: AMBARI-15133. Functionality to purge operational logs from the ambari database. (Laszlo Puskas via stoader)

2016-03-01 Thread stoader
Repository: ambari
Updated Branches:
  refs/heads/trunk cc4c73984 -> 271412882


AMBARI-15133. Functionality to purge operational logs from the ambari database. 
(Laszlo Puskas via stoader)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/27141288
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/27141288
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/27141288

Branch: refs/heads/trunk
Commit: 271412882b03950b66bf04e69c92731e6fbf9421
Parents: cc4c739
Author: Toader, Sebastian 
Authored: Wed Mar 2 06:55:59 2016 +0100
Committer: Toader, Sebastian 
Committed: Wed Mar 2 06:55:59 2016 +0100

--
 ambari-server/pom.xml   |   5 +
 ambari-server/sbin/ambari-server|  10 +-
 .../server/cleanup/ClasspathScannerUtils.java   | 129 +++
 .../ambari/server/cleanup/CleanupDriver.java| 117 ++
 .../ambari/server/cleanup/CleanupModule.java|  76 +
 .../ambari/server/cleanup/CleanupService.java   |  33 
 .../server/cleanup/CleanupServiceImpl.java  |  67 
 .../ambari/server/cleanup/PurgePolicy.java  |  33 
 .../server/cleanup/TimeBasedCleanupPolicy.java  |  62 +++
 .../apache/ambari/server/orm/dao/AlertsDAO.java |  91 ++-
 .../apache/ambari/server/orm/dao/Cleanable.java |  39 +
 .../server/orm/entities/AlertCurrentEntity.java |   4 +-
 .../server/orm/entities/AlertHistoryEntity.java |   4 +-
 .../server/orm/entities/AlertNoticeEntity.java  |   4 +-
 ambari-server/src/main/python/ambari-server.py  |   8 +-
 .../src/main/python/ambari_server/dbCleanup.py  | 117 ++
 .../main/python/ambari_server/setupActions.py   |   3 +-
 .../cleanup/CleanupServiceFunctionalTest.java   | 161 +++
 .../server/cleanup/CleanupServiceImplTest.java  |  82 ++
 .../ddl-func-test/ddl-cleanup-test-data.sql |   6 +
 20 files changed, 1041 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/27141288/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index e3409b9..f691fad 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -1262,6 +1262,11 @@
   jetty-util-ajax
   ${jetty.version}
 
+
+  commons-cli
+  commons-cli
+  1.3.1
+
   
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/27141288/ambari-server/sbin/ambari-server
--
diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server
index 5b31d73..c77b2e9 100755
--- a/ambari-server/sbin/ambari-server
+++ b/ambari-server/sbin/ambari-server
@@ -155,11 +155,15 @@ case "$1" in
 ;;
   setup-sso)
 echo -e "Setting up SSO authentication properties..."
-$PYTHON /usr/sbin/ambari-server.py $@
-;;
+$PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
+;;
+  db-cleanup)
+echo -e "Cleanup database..."
+$PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
+;;
   *)
 echo "Usage: $AMBARI_PYTHON_EXECUTABLE
-
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|setup-sso|refresh-stack-hash|backup|restore|update-host-names|enable-stack|check-database}
 [options]
+
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|setup-sso|refresh-stack-hash|backup|restore|update-host-names|enable-stack|check-database|db-cleanup}
 [options]
 Use $AMBARI_PYTHON_EXECUTABLE  --help to get details on 
options available.
 Or, simply invoke ambari-server.py --help to print the options."
 exit 1

http://git-wip-us.apache.org/repos/asf/ambari/blob/27141288/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
new file mode 100644
index 000..4c12a62
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
@@ -0,0 +1,129 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a cop

ambari git commit: Revert "AMBARI-15133. Functionality to purge operational logs from the ambari database. (Laszlo Puskas via stoader)"

2016-03-01 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/trunk 9979e429e -> cc4c73984


Revert "AMBARI-15133. Functionality to purge operational logs from the ambari 
database. (Laszlo Puskas via stoader)"

This reverts commit c871f286d90119b2b606b266204ba3e7eae08f8a.


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cc4c7398
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cc4c7398
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cc4c7398

Branch: refs/heads/trunk
Commit: cc4c739845f587cbbe8b746f537ba1a149270da5
Parents: 9979e42
Author: Yusaku Sako 
Authored: Tue Mar 1 18:46:34 2016 -0800
Committer: Yusaku Sako 
Committed: Tue Mar 1 18:46:43 2016 -0800

--
 ambari-server/pom.xml   |   5 -
 ambari-server/sbin/ambari-server|  10 +-
 .../server/cleanup/ClasspathScannerUtils.java   | 129 ---
 .../ambari/server/cleanup/CleanupDriver.java| 117 --
 .../ambari/server/cleanup/CleanupModule.java|  76 -
 .../ambari/server/cleanup/CleanupService.java   |  33 
 .../server/cleanup/CleanupServiceImpl.java  |  67 
 .../ambari/server/cleanup/PurgePolicy.java  |  33 
 .../server/cleanup/TimeBasedCleanupPolicy.java  |  62 ---
 .../apache/ambari/server/orm/dao/AlertsDAO.java |  91 +--
 .../apache/ambari/server/orm/dao/Cleanable.java |  39 -
 .../server/orm/entities/AlertCurrentEntity.java |   4 +-
 .../server/orm/entities/AlertHistoryEntity.java |   4 +-
 .../server/orm/entities/AlertNoticeEntity.java  |   4 +-
 ambari-server/src/main/python/ambari-server.py  |   8 +-
 .../src/main/python/ambari_server/dbCleanup.py  | 117 --
 .../main/python/ambari_server/setupActions.py   |   3 +-
 .../cleanup/CleanupServiceFunctionalTest.java   | 161 ---
 .../server/cleanup/CleanupServiceImplTest.java  |  82 --
 .../ddl-func-test/ddl-cleanup-test-data.sql |   6 -
 20 files changed, 10 insertions(+), 1041 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/cc4c7398/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index f691fad..e3409b9 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -1262,11 +1262,6 @@
   jetty-util-ajax
   ${jetty.version}
 
-
-  commons-cli
-  commons-cli
-  1.3.1
-
   
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/cc4c7398/ambari-server/sbin/ambari-server
--
diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server
index c77b2e9..5b31d73 100755
--- a/ambari-server/sbin/ambari-server
+++ b/ambari-server/sbin/ambari-server
@@ -155,15 +155,11 @@ case "$1" in
 ;;
   setup-sso)
 echo -e "Setting up SSO authentication properties..."
-$PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
-;;
-  db-cleanup)
-echo -e "Cleanup database..."
-$PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
-;;
+$PYTHON /usr/sbin/ambari-server.py $@
+;;
   *)
 echo "Usage: $AMBARI_PYTHON_EXECUTABLE
-
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|setup-sso|refresh-stack-hash|backup|restore|update-host-names|enable-stack|check-database|db-cleanup}
 [options]
+
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|setup-sso|refresh-stack-hash|backup|restore|update-host-names|enable-stack|check-database}
 [options]
 Use $AMBARI_PYTHON_EXECUTABLE  --help to get details on 
options available.
 Or, simply invoke ambari-server.py --help to print the options."
 exit 1

http://git-wip-us.apache.org/repos/asf/ambari/blob/cc4c7398/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
deleted file mode 100644
index 4c12a62..000
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file 

ambari git commit: AMBARI-15258. Make Hive Server Interactive component as hidden till the point "Turn on Interactive Query" from UI is turned ON. (jaimin)

2016-03-01 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/trunk fa38d29a1 -> 9979e429e


AMBARI-15258. Make Hive Server Interactive component as hidden till the point 
"Turn on Interactive Query" from UI is turned ON. (jaimin)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9979e429
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9979e429
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9979e429

Branch: refs/heads/trunk
Commit: 9979e429e628cb146533977136a0b85319377f1b
Parents: fa38d29
Author: Jaimin Jetly 
Authored: Tue Mar 1 18:45:41 2016 -0800
Committer: Jaimin Jetly 
Committed: Tue Mar 1 18:45:41 2016 -0800

--
 .../HIVE/configuration/llap-daemon-log4j.xml| 126 +++
 .../services/HIVE/configuration/llap-env.xml|  72 +++
 .../stacks/HDP/2.4/services/HIVE/metainfo.xml   |   9 +-
 .../HDP/2.4/services/HIVE/themes/theme.json |  76 +++
 ambari-web/app/controllers.js   |   1 +
 .../wizard/step7/assign_master_controller.js| 107 
 .../app/controllers/wizard/step7_controller.js  |  15 ++-
 .../app/controllers/wizard/step8_controller.js  |  20 +--
 ambari-web/app/messages.js  |   3 +
 .../mixins/wizard/assign_master_components.js   |  18 ++-
 ambari-web/app/models.js|   1 +
 .../app/models/configs/theme/config_action.js   |  57 +
 .../app/models/stack_service_component.js   |   2 +-
 .../common/assign_master_components.hbs |   4 +-
 ambari-web/app/utils/configs/theme/theme.js |  45 ++-
 ambari-web/app/views.js |   1 +
 .../common/assign_master_components_view.js |   2 +
 .../views/wizard/step7/assign_master_view.js|  44 +++
 .../test/controllers/wizard/step8_test.js   |   3 +-
 19 files changed, 585 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/configuration/llap-daemon-log4j.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/configuration/llap-daemon-log4j.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/configuration/llap-daemon-log4j.xml
new file mode 100644
index 000..1c60285
--- /dev/null
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/configuration/llap-daemon-log4j.xml
@@ -0,0 +1,126 @@
+
+
+
+
+
+  
+  content
+  Custom log4j.properties
+  
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+status = WARN
+name = LlapDaemonLog4j2
+packages = org.apache.hadoop.hive.ql.log
+
+# list of properties
+property.llap.daemon.log.level = WARN
+property.llap.daemon.root.logger = console
+property.llap.daemon.log.dir = .
+property.llap.daemon.log.file = llapdaemon.log
+property.llap.daemon.historylog.file = llapdaemon_history.log
+property.llap.daemon.log.maxfilesize = 256MB
+property.llap.daemon.log.maxbackupindex = 20
+
+# list of all appenders
+appenders = console, RFA, HISTORYAPPENDER
+
+# console appender
+appender.console.type = Console
+appender.console.name = console
+appender.console.target = SYSTEM_ERR
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d{yy/MM/dd HH:mm:ss} [%t%x] %p %c{2} : %m%n
+
+# rolling file appender
+appender.RFA.type = RollingFile
+appender.RFA.name = RFA
+appender.RFA.fileName = ${sys:llap.daemon.log.dir}/${sys:llap.daemon.log.file}
+appender.RFA.filePattern = 
${sys:llap.daemon.log.dir}/${sys:llap.daemon.log.file}_%i
+appender.RFA.layout.type = PatternLayout
+appender.RFA.layout.pattern = %d{ISO8601} %-5p [%t%x]: %c{2} (%F:%M(%L)) - %m%n
+appender.RFA.policies.type = Policies
+appender.RFA.policies.size.type = SizeBasedTriggeringPolicy
+appender.RFA.policies.size.size = ${sys:llap.daemon.log.maxfilesize}
+appender.RFA.strategy.type = DefaultRolloverStrategy
+appender.RFA.strategy.max = ${sys:llap.daemon.log.maxbackupindex}
+
+# history file appender
+appender.H

[1/2] ambari git commit: Revert "AMBARI-15133. Functionality to purge operational logs from the ambari database. (Laszlo Puskas via stoader)"

2016-03-01 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 93aba403c -> 859345bad


http://git-wip-us.apache.org/repos/asf/ambari/blob/859345ba/ambari-server/test.result
--
diff --git a/ambari-server/test.result b/ambari-server/test.result
deleted file mode 100644
index c5384be..000
--- a/ambari-server/test.result
+++ /dev/null
@@ -1,5154 +0,0 @@
-[INFO] Scanning for projects...
-[WARNING] 
-[WARNING] Some problems were encountered while building the effective model 
for org.apache.ambari:ambari-server:jar:2.0.0.0-SNAPSHOT
-[WARNING] 'build.plugins.plugin.version' for 
org.codehaus.mojo:properties-maven-plugin is missing. @ line 334, column 15
-[WARNING] 
-[WARNING] It is highly recommended to fix these problems because they threaten 
the stability of your build.
-[WARNING] 
-[WARNING] For this reason, future Maven versions might no longer support 
building such malformed projects.
-[WARNING] 
-[INFO] 
-[INFO] 
-[INFO] Building Ambari Server 2.0.0.0-SNAPSHOT
-[INFO] 
-[WARNING] The POM for org.glassfish:javax.el:jar:3.0.1-b06-SNAPSHOT is 
missing, no dependency information available
-[WARNING] The POM for org.glassfish:javax.el:jar:3.0.1-b07-SNAPSHOT is 
missing, no dependency information available
-[WARNING] The POM for org.glassfish:javax.el:jar:3.0.1-b08-SNAPSHOT is 
missing, no dependency information available
-Downloading: 
https://oss.sonatype.org/content/groups/staging/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.pom
-
Downloading: 
http://repo.spring.io/milestone/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.pom
-
Downloading: 
https://repository.apache.org/content/groups/staging/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.pom
-4/11 KB   
8/11 KB   
8/11 KB   
11/11 KB   
   
Downloaded: 
https://repository.apache.org/content/groups/staging/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.pom
 (11 KB at 3.5 KB/sec)
-Downloading: 
https://oss.sonatype.org/content/groups/staging/org/apache/commons/commons-parent/37/commons-parent-37.pom
-   
Downloading: 
http://repo.spring.io/milestone/org/apache/commons/commons-parent/37/commons-parent-37.pom
-   
Downloading: 
https://repository.apache.org/content/groups/staging/org/apache/commons/commons-parent/37/commons-parent-37.pom
-4/62 KB
8/62 KB   
8/62 KB   
12/62 KB   
14/62 KB   
16/62 KB   
20/62 KB   
22/62 KB   
24/62 KB   
28/62 KB   
30/62 KB   
32/62 KB   
36/62 KB   
38/62 KB   
40/62 KB   
44/62 KB   
45/62 KB   
48/62 KB   
52/62 KB   
53/62 KB   
56/62 KB   
60/62 KB   
61/62 KB   
62/62 KB   
   
Downloaded: 
https://repository.apache.org/content/groups/staging/org/apache/commons/commons-parent/37/commons-parent-37.pom
 (62 KB at 26.5 KB/sec)
-Downloading: 
https://oss.sonatype.org/content/groups/staging/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.jar
-   
Downloading: 
http://repo.spring.io/milestone/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.jar
-   
Downloading: 
https://repository.apache.org/content/groups/staging/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.jar
-4/52 KB
8/52 KB   
8/52 KB   
12/52 KB   
14/52 KB   
16/52 KB   
20/52 KB   
22/52 KB   
24/52 KB   
28/52 KB   
30/52 KB   
32/52 KB   
36/52 KB   
38/52 KB   
40/52 KB   
44/52 KB   
45/52 KB   
48/52 KB   
52/52 KB   
   
Downloaded: 
https://repository.apache.org/content/groups/staging/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.jar
 (52 KB at 9.7 KB/sec)
-[INFO] 
-[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ ambari-server ---
-[INFO] Deleting 
/Users/stoader/Projects/Hortonworks/apache/ambari-commits/ambari/ambari-server/target
-[INFO] Deleting 
/Users/stoader/Projects/Hortonworks/apache/ambari-commits/ambari/ambari-server 
(includes = [**/*.pyc], excludes = [])
-[INFO] 
-[INFO] --- build-helper-maven-plugin:1.8:regex-property 
(parse-package-version) @ ambari-server ---
-[INFO] 
-[INFO] --- build-helper-maven-plugin:1.8:regex-property 
(parse-package-release) @ ambari-server ---
-[INFO] 
-[INFO] --- build-helper-maven-plugin:1.8:parse-version (parse-version) @ 
ambari-server ---
-[INFO] 
-[INFO] --- build-helper-maven-plugin:1.8:regex-property (regex-property) @ 
ambari-server ---
-[INFO] 
-[INFO] --- build-helper-maven-plugin:1.8:regex-property (regex-schema-version) 
@ ambari-server ---
-[INFO] 
-[INFO] --- buildnumber-maven-plugin:1.2:create (default) @ ambari-server ---
-[INFO] Checking for local modifications: skipped.
-[INFO] Updating project files from SCM: skipped.
-[INFO] Executing: /bin/sh -c cd 
/Users/stoader/Projects/Hortonworks/apache/ambari-commits/ambari/ambari-server 
&& git rev-parse --verify HEAD
-[INFO] Working directory: 
/Users/stoader/Projects/Hortonworks/apache/amba

[2/2] ambari git commit: Revert "AMBARI-15133. Functionality to purge operational logs from the ambari database. (Laszlo Puskas via stoader)"

2016-03-01 Thread yusaku
Revert "AMBARI-15133. Functionality to purge operational logs from the ambari 
database. (Laszlo Puskas via stoader)"

This reverts commit b33fba7b5a49e3664094b7aaedf6b7e5ed69a732.


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/859345ba
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/859345ba
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/859345ba

Branch: refs/heads/branch-2.2
Commit: 859345badb4e0fb81b1b4f780ac00c89c8beef1f
Parents: 93aba40
Author: Yusaku Sako 
Authored: Tue Mar 1 18:22:53 2016 -0800
Committer: Yusaku Sako 
Committed: Tue Mar 1 18:22:58 2016 -0800

--
 ambari-server/pom.xml   |5 -
 ambari-server/sbin/ambari-server|   10 +-
 .../server/cleanup/ClasspathScannerUtils.java   |  129 -
 .../ambari/server/cleanup/CleanupDriver.java|  117 -
 .../ambari/server/cleanup/CleanupModule.java|   76 -
 .../ambari/server/cleanup/CleanupService.java   |   33 -
 .../server/cleanup/CleanupServiceImpl.java  |   67 -
 .../ambari/server/cleanup/PurgePolicy.java  |   33 -
 .../server/cleanup/TimeBasedCleanupPolicy.java  |   62 -
 .../apache/ambari/server/orm/dao/AlertsDAO.java |   91 +-
 .../apache/ambari/server/orm/dao/Cleanable.java |   39 -
 .../server/orm/entities/AlertCurrentEntity.java |4 +-
 .../server/orm/entities/AlertHistoryEntity.java |4 +-
 .../server/orm/entities/AlertNoticeEntity.java  |4 +-
 ambari-server/src/main/python/ambari-server.py  |9 +-
 .../src/main/python/ambari_server/dbCleanup.py  |  117 -
 .../main/python/ambari_server/setupActions.py   |1 -
 .../cleanup/CleanupServiceFunctionalTest.java   |  161 -
 .../server/cleanup/CleanupServiceImplTest.java  |   82 -
 .../ddl-func-test/ddl-cleanup-test-data.sql |6 -
 ambari-server/test.result   | 5154 --
 21 files changed, 10 insertions(+), 6194 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/859345ba/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 45e2bdd..87ddd19 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -1994,11 +1994,6 @@
   hadoop-auth
   ${hadoop.version}
 
-
-  commons-cli
-  commons-cli
-  1.3.1
-
   
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/859345ba/ambari-server/sbin/ambari-server
--
diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server
index ef4344c..e676cbc 100755
--- a/ambari-server/sbin/ambari-server
+++ b/ambari-server/sbin/ambari-server
@@ -142,14 +142,10 @@ case "$1" in
 echo -e "Checking database"
 $PYTHON /usr/sbin/ambari-server.py $@
 ;;
-  db-cleanup)
-echo -e "Cleanup database..."
-$PYTHON /usr/sbin/ambari-server.py $@
-;;
   *)
-echo "Usage: $AMBARI_PYTHON_EXECUTABLE
-
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|setup-sso|refresh-stack-hash|backup|restore|update-host-names|check-database|db-cleanup}
 [options]
-Use $AMBARI_PYTHON_EXECUTABLE  --help to get details on 
options available.
+echo "Usage: /usr/sbin/ambari-server
+
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|refresh-stack-hash|backup|restore|update-host-names|check-database}
 [options]
+Use usr/sbin/ambari-server  --help to get details on options 
available.
 Or, simply invoke ambari-server.py --help to print the options."
 exit 1
 esac

http://git-wip-us.apache.org/repos/asf/ambari/blob/859345ba/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
deleted file mode 100644
index 4c12a62..000
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/

ambari git commit: AMBARI-15227: Move HAWQMASTER above HAWQSTANDBY in Assign Masters page (mithmatt via jaoki)

2016-03-01 Thread jaoki
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 8d9495455 -> 93aba403c


AMBARI-15227: Move HAWQMASTER above HAWQSTANDBY in Assign Masters page 
(mithmatt via jaoki)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/93aba403
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/93aba403
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/93aba403

Branch: refs/heads/branch-2.2
Commit: 93aba403cbbfbdb9830cb13cbc7bc80decc10704
Parents: 8d94954
Author: Jun Aoki 
Authored: Tue Mar 1 16:34:10 2016 -0800
Committer: Jun Aoki 
Committed: Tue Mar 1 16:34:10 2016 -0800

--
 .../mixins/wizard/assign_master_components.js   |  3 ++
 ambari-web/app/models/stack_service.js  |  5 +-
 .../test/controllers/wizard/step5_test.js   | 28 --
 .../wizard/assign_master_components_test.js | 55 
 4 files changed, 62 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/93aba403/ambari-web/app/mixins/wizard/assign_master_components.js
--
diff --git a/ambari-web/app/mixins/wizard/assign_master_components.js 
b/ambari-web/app/mixins/wizard/assign_master_components.js
index efcb02e..6fcf335 100644
--- a/ambari-web/app/mixins/wizard/assign_master_components.js
+++ b/ambari-web/app/mixins/wizard/assign_master_components.js
@@ -900,8 +900,11 @@ App.AssignMasterComponents = Em.Mixin.create({
*/
   sortComponentsByServiceName: function(components) {
 var displayOrder = App.StackService.displayOrder;
+var componentsOrderForService = App.StackService.componentsOrderForService;
 var indexForUnordered = Math.max(displayOrder.length, components.length);
 return components.sort(function (a, b) {
+  if(a.serviceId === b.serviceId && a.serviceId in 
componentsOrderForService)
+return 
componentsOrderForService[a.serviceId].indexOf(a.component_name) - 
componentsOrderForService[b.serviceId].indexOf(b.component_name);
   var aValue = displayOrder.indexOf(a.serviceId) != -1 ? 
displayOrder.indexOf(a.serviceId) : indexForUnordered;
   var bValue = displayOrder.indexOf(b.serviceId) != -1 ? 
displayOrder.indexOf(b.serviceId) : indexForUnordered;
   return aValue - bValue;

http://git-wip-us.apache.org/repos/asf/ambari/blob/93aba403/ambari-web/app/models/stack_service.js
--
diff --git a/ambari-web/app/models/stack_service.js 
b/ambari-web/app/models/stack_service.js
index 2453514..1580b67 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -214,12 +214,15 @@ App.StackService.displayOrder = [
   'FLUME'
 ];
 
+App.StackService.componentsOrderForService = {
+  'HAWQ': ['HAWQMASTER', 'HAWQSTANDBY']
+};
+
 //@TODO: Write unit test for no two keys in the object should have any 
intersecting elements in their values
 App.StackService.coSelected = {
   'YARN': ['MAPREDUCE2']
 };
 
-
 App.StackService.reviewPageHandlers = {
   'HIVE': {
 'Database': 'loadHiveDbValue'

http://git-wip-us.apache.org/repos/asf/ambari/blob/93aba403/ambari-web/test/controllers/wizard/step5_test.js
--
diff --git a/ambari-web/test/controllers/wizard/step5_test.js 
b/ambari-web/test/controllers/wizard/step5_test.js
index b5e0ddb..995f19c 100644
--- a/ambari-web/test/controllers/wizard/step5_test.js
+++ b/ambari-web/test/controllers/wizard/step5_test.js
@@ -1164,32 +1164,4 @@ describe('App.WizardStep5Controller', function () {
 });
 
   });
-
-  describe('#sortComponentsByServiceName', function () {
-
-var components = [{
-  "component_name": "METRICS_COLLECTOR",
-  "serviceId": "AMBARI_METRICS"
-}, {"component_name": "ZOOKEEPER_SERVER", "serviceId": "ZOOKEEPER"}, {
-  "component_name": "NAMENODE",
-  "serviceId": "HDFS"
-}, {"component_name": "DRPC_SERVER", "serviceId": "STORM"}, {
-  "component_name": "APP_TIMELINE_SERVER",
-  "serviceId": "YARN"
-}, {"component_name": "RESOURCEMANAGER", "serviceId": "YARN"}, {
-  "component_name": "SECONDARY_NAMENODE",
-  "serviceId": "HDFS"
-}, {"component_name": "ZOOKEEPER_SERVER", "serviceId": "ZOOKEEPER"}, {
-  "component_name": "HISTORYSERVER",
-  "serviceId": "MAPREDUCE2"
-}, {"component_name": "NIMBUS", "serviceId": "STORM"}, {"component_name": 
"STORM_UI_SERVER", "serviceId": "STORM"}];
-
-it('ZKS should be one after anothert', function () {
-  var sorted = c.sortComponentsByServiceName(components);
-  
expect(sorted.mapProperty('component_name').join('|').contains('ZOOKEEPER_SERVER|ZOOKEEPER_SERVER')).to.be.true;
-});
-
-
-  });
-
 });

http://git-wip-us.apache.org/re

ambari git commit: AMBARI-15227: Move HAWQMASTER above HAWQSTANDBY in Assign Masters page (mithmatt via jaoki)

2016-03-01 Thread jaoki
Repository: ambari
Updated Branches:
  refs/heads/trunk 874d4d577 -> fa38d29a1


AMBARI-15227: Move HAWQMASTER above HAWQSTANDBY in Assign Masters page 
(mithmatt via jaoki)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fa38d29a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fa38d29a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fa38d29a

Branch: refs/heads/trunk
Commit: fa38d29a13fe26625f7225d249f72d05e997fa3b
Parents: 874d4d5
Author: Jun Aoki 
Authored: Tue Mar 1 16:32:49 2016 -0800
Committer: Jun Aoki 
Committed: Tue Mar 1 16:32:49 2016 -0800

--
 .../mixins/wizard/assign_master_components.js   |  3 ++
 ambari-web/app/models/stack_service.js  |  4 ++
 .../test/controllers/wizard/step5_test.js   | 27 --
 .../wizard/assign_master_components_test.js | 56 
 4 files changed, 63 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fa38d29a/ambari-web/app/mixins/wizard/assign_master_components.js
--
diff --git a/ambari-web/app/mixins/wizard/assign_master_components.js 
b/ambari-web/app/mixins/wizard/assign_master_components.js
index c1c4d0e..0500014 100644
--- a/ambari-web/app/mixins/wizard/assign_master_components.js
+++ b/ambari-web/app/mixins/wizard/assign_master_components.js
@@ -897,8 +897,11 @@ App.AssignMasterComponents = Em.Mixin.create({
*/
   sortComponentsByServiceName: function(components) {
 var displayOrder = App.StackService.displayOrder;
+var componentsOrderForService = App.StackService.componentsOrderForService;
 var indexForUnordered = Math.max(displayOrder.length, components.length);
 return components.sort(function (a, b) {
+  if(a.serviceId === b.serviceId && a.serviceId in 
componentsOrderForService)
+return 
componentsOrderForService[a.serviceId].indexOf(a.component_name) - 
componentsOrderForService[b.serviceId].indexOf(b.component_name);
   var aValue = displayOrder.indexOf(a.serviceId) != -1 ? 
displayOrder.indexOf(a.serviceId) : indexForUnordered;
   var bValue = displayOrder.indexOf(b.serviceId) != -1 ? 
displayOrder.indexOf(b.serviceId) : indexForUnordered;
   return aValue - bValue;

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa38d29a/ambari-web/app/models/stack_service.js
--
diff --git a/ambari-web/app/models/stack_service.js 
b/ambari-web/app/models/stack_service.js
index a8ce241..dbfabc0 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -204,6 +204,10 @@ App.StackService.displayOrder = [
   'FLUME'
 ];
 
+App.StackService.componentsOrderForService = {
+  'HAWQ': ['HAWQMASTER', 'HAWQSTANDBY']
+};
+
 //@TODO: Write unit test for no two keys in the object should have any 
intersecting elements in their values
 App.StackService.coSelected = {
   'YARN': ['MAPREDUCE2']

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa38d29a/ambari-web/test/controllers/wizard/step5_test.js
--
diff --git a/ambari-web/test/controllers/wizard/step5_test.js 
b/ambari-web/test/controllers/wizard/step5_test.js
index a2bc687..4140210 100644
--- a/ambari-web/test/controllers/wizard/step5_test.js
+++ b/ambari-web/test/controllers/wizard/step5_test.js
@@ -1261,33 +1261,6 @@ describe('App.WizardStep5Controller', function () {
 
   });
 
-  describe('#sortComponentsByServiceName', function () {
-
-var components = [{
-  "component_name": "METRICS_COLLECTOR",
-  "serviceId": "AMBARI_METRICS"
-}, {"component_name": "ZOOKEEPER_SERVER", "serviceId": "ZOOKEEPER"}, {
-  "component_name": "NAMENODE",
-  "serviceId": "HDFS"
-}, {"component_name": "DRPC_SERVER", "serviceId": "STORM"}, {
-  "component_name": "APP_TIMELINE_SERVER",
-  "serviceId": "YARN"
-}, {"component_name": "RESOURCEMANAGER", "serviceId": "YARN"}, {
-  "component_name": "SECONDARY_NAMENODE",
-  "serviceId": "HDFS"
-}, {"component_name": "ZOOKEEPER_SERVER", "serviceId": "ZOOKEEPER"}, {
-  "component_name": "HISTORYSERVER",
-  "serviceId": "MAPREDUCE2"
-}, {"component_name": "NIMBUS", "serviceId": "STORM"}, {"component_name": 
"STORM_UI_SERVER", "serviceId": "STORM"}];
-
-it('ZKS should be one after anothert', function () {
-  var sorted = c.sortComponentsByServiceName(components);
-  
expect(sorted.mapProperty('component_name').join('|').contains('ZOOKEEPER_SERVER|ZOOKEEPER_SERVER')).to.be.true;
-});
-
-
-  });
-
   describe('#submit',function(){
 it('if Next button is clicked multiple times before the next step renders, 
it must not be processed',function(){
 

ambari git commit: AMBARI-15240. Move PXF right under HAWQ in service display order(mithmatt via odiachenko).

2016-03-01 Thread odiachenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 19e29fd4d -> 874d4d577


AMBARI-15240. Move PXF right under HAWQ in service display order(mithmatt via 
odiachenko).


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/874d4d57
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/874d4d57
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/874d4d57

Branch: refs/heads/trunk
Commit: 874d4d57795c11001919ed7de9289863e32d0036
Parents: 19e29fd
Author: Oleksandr Diachenko 
Authored: Tue Mar 1 16:14:44 2016 -0800
Committer: Oleksandr Diachenko 
Committed: Tue Mar 1 16:14:44 2016 -0800

--
 ambari-web/app/models/stack_service.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/874d4d57/ambari-web/app/models/stack_service.js
--
diff --git a/ambari-web/app/models/stack_service.js 
b/ambari-web/app/models/stack_service.js
index 14af448..a8ce241 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -193,9 +193,9 @@ App.StackService.displayOrder = [
   'GANGLIA',
   'HIVE',
   'HAWQ',
+  'PXF',
   'HBASE',
   'PIG',
-  'PXF',
   'SQOOP',
   'OOZIE',
   'ZOOKEEPER',



ambari git commit: AMBARI-15240. Move PXF right under HAWQ in service display order(mithmatt via odiachenko).

2016-03-01 Thread odiachenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 9ed989027 -> 8d9495455


AMBARI-15240. Move PXF right under HAWQ in service display order(mithmatt via 
odiachenko).


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8d949545
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8d949545
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8d949545

Branch: refs/heads/branch-2.2
Commit: 8d949545518534460b230349b8da4e7f7d819bc1
Parents: 9ed9890
Author: Oleksandr Diachenko 
Authored: Tue Mar 1 16:13:09 2016 -0800
Committer: Oleksandr Diachenko 
Committed: Tue Mar 1 16:13:20 2016 -0800

--
 ambari-web/app/models/stack_service.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8d949545/ambari-web/app/models/stack_service.js
--
diff --git a/ambari-web/app/models/stack_service.js 
b/ambari-web/app/models/stack_service.js
index e71b599..2453514 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -203,9 +203,9 @@ App.StackService.displayOrder = [
   'GANGLIA',
   'HIVE',
   'HAWQ',
+  'PXF',
   'HBASE',
   'PIG',
-  'PXF',
   'SQOOP',
   'OOZIE',
   'ZOOKEEPER',



ambari git commit: AMBARI-15257. Query Editor Hosts Fix for Grafana. (Prajwal Rao via yusaku)

2016-03-01 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 b33fba7b5 -> 9ed989027


AMBARI-15257. Query Editor Hosts Fix for Grafana. (Prajwal Rao via yusaku)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9ed98902
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9ed98902
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9ed98902

Branch: refs/heads/branch-2.2
Commit: 9ed9890273fe6f79dd8cd1192b52bfda23f8526f
Parents: b33fba7
Author: Yusaku Sako 
Authored: Tue Mar 1 16:07:06 2016 -0800
Committer: Yusaku Sako 
Committed: Tue Mar 1 16:08:08 2016 -0800

--
 .../ambari-metrics/datasource.js | 19 ---
 .../ambari-metrics/queryCtrl.js  |  2 +-
 2 files changed, 17 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9ed98902/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
--
diff --git a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js 
b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
index ca7ea65..49fef8d 100644
--- a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
+++ b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
@@ -295,15 +295,28 @@ define([
  *
  * Query Hosts on the cluster.
  */
-AmbariMetricsDatasource.prototype.suggestHosts = function (query) {
+AmbariMetricsDatasource.prototype.suggestHosts = function (query, app) 
{
   console.log(query);
   return this.doAmbariRequest({method: 'GET', url: 
'/ws/v1/timeline/metrics/hosts'})
 .then(function (results) {
+  var compToHostMap = {};
   //Remove fakehostname from the list of hosts on the cluster.
   var fake = "fakehostname"; delete results.data[fake];
-  return _.map(Object.keys(results.data), function (hostName) {
-return {text: hostName};
+  //Query hosts based on component name
+  _.forEach(results.data, function (comp, hostName) {
+comp.forEach(function (component) {
+  if (!compToHostMap[component]){
+compToHostMap[component] = [];
+  }
+  compToHostMap[component].push(hostName);
+});
+  });
+  var compHosts = compToHostMap[app];
+  compHosts = _.map(compHosts, function (h) {
+return {text: h};
   });
+  compHosts = _.sortBy(compHosts, function (i) { return 
i.text.toLowerCase(); });
+  return $q.when(compHosts);
 });
 };
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/9ed98902/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js
--
diff --git a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js 
b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js
index d6e93a8..494ae16 100644
--- a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js
+++ b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js
@@ -65,7 +65,7 @@ define([
 };
 
 $scope.suggestHosts = function(query, callback) {
-  $scope.datasource.suggestHosts(query)
+  $scope.datasource.suggestHosts(query, $scope.target.app)
 .then($scope.getTextValues)
 .then(callback);
 };



ambari git commit: AMBARI-15257. Query Editor Hosts Fix for Grafana. (Prajwal Rao via yusaku)

2016-03-01 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/trunk e6fde445c -> 19e29fd4d


AMBARI-15257. Query Editor Hosts Fix for Grafana. (Prajwal Rao via yusaku)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/19e29fd4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/19e29fd4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/19e29fd4

Branch: refs/heads/trunk
Commit: 19e29fd4da65f559b00ab2d60b799cfff2a25fc1
Parents: e6fde44
Author: Yusaku Sako 
Authored: Tue Mar 1 16:07:06 2016 -0800
Committer: Yusaku Sako 
Committed: Tue Mar 1 16:07:06 2016 -0800

--
 .../ambari-metrics/datasource.js | 19 ---
 .../ambari-metrics/queryCtrl.js  |  2 +-
 2 files changed, 17 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/19e29fd4/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
--
diff --git a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js 
b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
index ca7ea65..49fef8d 100644
--- a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
+++ b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
@@ -295,15 +295,28 @@ define([
  *
  * Query Hosts on the cluster.
  */
-AmbariMetricsDatasource.prototype.suggestHosts = function (query) {
+AmbariMetricsDatasource.prototype.suggestHosts = function (query, app) 
{
   console.log(query);
   return this.doAmbariRequest({method: 'GET', url: 
'/ws/v1/timeline/metrics/hosts'})
 .then(function (results) {
+  var compToHostMap = {};
   //Remove fakehostname from the list of hosts on the cluster.
   var fake = "fakehostname"; delete results.data[fake];
-  return _.map(Object.keys(results.data), function (hostName) {
-return {text: hostName};
+  //Query hosts based on component name
+  _.forEach(results.data, function (comp, hostName) {
+comp.forEach(function (component) {
+  if (!compToHostMap[component]){
+compToHostMap[component] = [];
+  }
+  compToHostMap[component].push(hostName);
+});
+  });
+  var compHosts = compToHostMap[app];
+  compHosts = _.map(compHosts, function (h) {
+return {text: h};
   });
+  compHosts = _.sortBy(compHosts, function (i) { return 
i.text.toLowerCase(); });
+  return $q.when(compHosts);
 });
 };
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/19e29fd4/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js
--
diff --git a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js 
b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js
index d6e93a8..494ae16 100644
--- a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js
+++ b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js
@@ -65,7 +65,7 @@ define([
 };
 
 $scope.suggestHosts = function(query, callback) {
-  $scope.datasource.suggestHosts(query)
+  $scope.datasource.suggestHosts(query, $scope.target.app)
 .then($scope.getTextValues)
 .then(callback);
 };



[2/2] ambari git commit: AMBARI-15133. Functionality to purge operational logs from the ambari database. (Laszlo Puskas via stoader)

2016-03-01 Thread stoader
AMBARI-15133. Functionality to purge operational logs from the ambari database. 
(Laszlo Puskas via stoader)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b33fba7b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b33fba7b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b33fba7b

Branch: refs/heads/branch-2.2
Commit: b33fba7b5a49e3664094b7aaedf6b7e5ed69a732
Parents: 479f213
Author: Toader, Sebastian 
Authored: Tue Mar 1 22:48:11 2016 +0100
Committer: Toader, Sebastian 
Committed: Wed Mar 2 01:01:28 2016 +0100

--
 ambari-server/pom.xml   |5 +
 ambari-server/sbin/ambari-server|   10 +-
 .../server/cleanup/ClasspathScannerUtils.java   |  129 +
 .../ambari/server/cleanup/CleanupDriver.java|  117 +
 .../ambari/server/cleanup/CleanupModule.java|   76 +
 .../ambari/server/cleanup/CleanupService.java   |   33 +
 .../server/cleanup/CleanupServiceImpl.java  |   67 +
 .../ambari/server/cleanup/PurgePolicy.java  |   33 +
 .../server/cleanup/TimeBasedCleanupPolicy.java  |   62 +
 .../apache/ambari/server/orm/dao/AlertsDAO.java |   91 +-
 .../apache/ambari/server/orm/dao/Cleanable.java |   39 +
 .../server/orm/entities/AlertCurrentEntity.java |4 +-
 .../server/orm/entities/AlertHistoryEntity.java |4 +-
 .../server/orm/entities/AlertNoticeEntity.java  |4 +-
 ambari-server/src/main/python/ambari-server.py  |9 +-
 .../src/main/python/ambari_server/dbCleanup.py  |  117 +
 .../main/python/ambari_server/setupActions.py   |1 +
 .../cleanup/CleanupServiceFunctionalTest.java   |  161 +
 .../server/cleanup/CleanupServiceImplTest.java  |   82 +
 .../ddl-func-test/ddl-cleanup-test-data.sql |6 +
 ambari-server/test.result   | 5154 ++
 21 files changed, 6194 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b33fba7b/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 87ddd19..45e2bdd 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -1994,6 +1994,11 @@
   hadoop-auth
   ${hadoop.version}
 
+
+  commons-cli
+  commons-cli
+  1.3.1
+
   
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/b33fba7b/ambari-server/sbin/ambari-server
--
diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server
index e676cbc..ef4344c 100755
--- a/ambari-server/sbin/ambari-server
+++ b/ambari-server/sbin/ambari-server
@@ -142,10 +142,14 @@ case "$1" in
 echo -e "Checking database"
 $PYTHON /usr/sbin/ambari-server.py $@
 ;;
+  db-cleanup)
+echo -e "Cleanup database..."
+$PYTHON /usr/sbin/ambari-server.py $@
+;;
   *)
-echo "Usage: /usr/sbin/ambari-server
-
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|refresh-stack-hash|backup|restore|update-host-names|check-database}
 [options]
-Use usr/sbin/ambari-server  --help to get details on options 
available.
+echo "Usage: $AMBARI_PYTHON_EXECUTABLE
+
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|setup-sso|refresh-stack-hash|backup|restore|update-host-names|check-database|db-cleanup}
 [options]
+Use $AMBARI_PYTHON_EXECUTABLE  --help to get details on 
options available.
 Or, simply invoke ambari-server.py --help to print the options."
 exit 1
 esac

http://git-wip-us.apache.org/repos/asf/ambari/blob/b33fba7b/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
new file mode 100644
index 000..4c12a62
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
@@ -0,0 +1,129 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed 

[1/2] ambari git commit: AMBARI-15133. Functionality to purge operational logs from the ambari database. (Laszlo Puskas via stoader)

2016-03-01 Thread stoader
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 479f21327 -> b33fba7b5


http://git-wip-us.apache.org/repos/asf/ambari/blob/b33fba7b/ambari-server/test.result
--
diff --git a/ambari-server/test.result b/ambari-server/test.result
new file mode 100644
index 000..c5384be
--- /dev/null
+++ b/ambari-server/test.result
@@ -0,0 +1,5154 @@
+[INFO] Scanning for projects...
+[WARNING] 
+[WARNING] Some problems were encountered while building the effective model 
for org.apache.ambari:ambari-server:jar:2.0.0.0-SNAPSHOT
+[WARNING] 'build.plugins.plugin.version' for 
org.codehaus.mojo:properties-maven-plugin is missing. @ line 334, column 15
+[WARNING] 
+[WARNING] It is highly recommended to fix these problems because they threaten 
the stability of your build.
+[WARNING] 
+[WARNING] For this reason, future Maven versions might no longer support 
building such malformed projects.
+[WARNING] 
+[INFO] 
+[INFO] 
+[INFO] Building Ambari Server 2.0.0.0-SNAPSHOT
+[INFO] 
+[WARNING] The POM for org.glassfish:javax.el:jar:3.0.1-b06-SNAPSHOT is 
missing, no dependency information available
+[WARNING] The POM for org.glassfish:javax.el:jar:3.0.1-b07-SNAPSHOT is 
missing, no dependency information available
+[WARNING] The POM for org.glassfish:javax.el:jar:3.0.1-b08-SNAPSHOT is 
missing, no dependency information available
+Downloading: 
https://oss.sonatype.org/content/groups/staging/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.pom
+
Downloading: 
http://repo.spring.io/milestone/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.pom
+
Downloading: 
https://repository.apache.org/content/groups/staging/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.pom
+4/11 KB   
8/11 KB   
8/11 KB   
11/11 KB   
   
Downloaded: 
https://repository.apache.org/content/groups/staging/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.pom
 (11 KB at 3.5 KB/sec)
+Downloading: 
https://oss.sonatype.org/content/groups/staging/org/apache/commons/commons-parent/37/commons-parent-37.pom
+   
Downloading: 
http://repo.spring.io/milestone/org/apache/commons/commons-parent/37/commons-parent-37.pom
+   
Downloading: 
https://repository.apache.org/content/groups/staging/org/apache/commons/commons-parent/37/commons-parent-37.pom
+4/62 KB
8/62 KB   
8/62 KB   
12/62 KB   
14/62 KB   
16/62 KB   
20/62 KB   
22/62 KB   
24/62 KB   
28/62 KB   
30/62 KB   
32/62 KB   
36/62 KB   
38/62 KB   
40/62 KB   
44/62 KB   
45/62 KB   
48/62 KB   
52/62 KB   
53/62 KB   
56/62 KB   
60/62 KB   
61/62 KB   
62/62 KB   
   
Downloaded: 
https://repository.apache.org/content/groups/staging/org/apache/commons/commons-parent/37/commons-parent-37.pom
 (62 KB at 26.5 KB/sec)
+Downloading: 
https://oss.sonatype.org/content/groups/staging/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.jar
+   
Downloading: 
http://repo.spring.io/milestone/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.jar
+   
Downloading: 
https://repository.apache.org/content/groups/staging/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.jar
+4/52 KB
8/52 KB   
8/52 KB   
12/52 KB   
14/52 KB   
16/52 KB   
20/52 KB   
22/52 KB   
24/52 KB   
28/52 KB   
30/52 KB   
32/52 KB   
36/52 KB   
38/52 KB   
40/52 KB   
44/52 KB   
45/52 KB   
48/52 KB   
52/52 KB   
   
Downloaded: 
https://repository.apache.org/content/groups/staging/commons-cli/commons-cli/1.3.1/commons-cli-1.3.1.jar
 (52 KB at 9.7 KB/sec)
+[INFO] 
+[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ ambari-server ---
+[INFO] Deleting 
/Users/stoader/Projects/Hortonworks/apache/ambari-commits/ambari/ambari-server/target
+[INFO] Deleting 
/Users/stoader/Projects/Hortonworks/apache/ambari-commits/ambari/ambari-server 
(includes = [**/*.pyc], excludes = [])
+[INFO] 
+[INFO] --- build-helper-maven-plugin:1.8:regex-property 
(parse-package-version) @ ambari-server ---
+[INFO] 
+[INFO] --- build-helper-maven-plugin:1.8:regex-property 
(parse-package-release) @ ambari-server ---
+[INFO] 
+[INFO] --- build-helper-maven-plugin:1.8:parse-version (parse-version) @ 
ambari-server ---
+[INFO] 
+[INFO] --- build-helper-maven-plugin:1.8:regex-property (regex-property) @ 
ambari-server ---
+[INFO] 
+[INFO] --- build-helper-maven-plugin:1.8:regex-property (regex-schema-version) 
@ ambari-server ---
+[INFO] 
+[INFO] --- buildnumber-maven-plugin:1.2:create (default) @ ambari-server ---
+[INFO] Checking for local modifications: skipped.
+[INFO] Updating project files from SCM: skipped.
+[INFO] Executing: /bin/sh -c cd 
/Users/stoader/Projects/Hortonworks/apache/ambari-commits/ambari/ambari-server 
&& git rev-parse --verify HEAD
+[INFO] Working directory: 
/Users/stoader/Projects/Hortonworks/apache/ambari-c

ambari git commit: AMBARI-15239 Combo Search: Search tags need to be preserved after drill in/out single host detail (rzang)

2016-03-01 Thread rzang
Repository: ambari
Updated Branches:
  refs/heads/trunk c871f286d -> e6fde445c


AMBARI-15239 Combo Search: Search tags need to be preserved after drill in/out 
single host detail (rzang)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e6fde445
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e6fde445
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e6fde445

Branch: refs/heads/trunk
Commit: e6fde445c07c552156dbadf409ccf964a2ae5b70
Parents: c871f28
Author: Richard Zang 
Authored: Tue Mar 1 14:10:50 2016 -0800
Committer: Richard Zang 
Committed: Tue Mar 1 14:10:50 2016 -0800

--
 ambari-web/app/config.js|   2 +-
 .../mixins/common/table_server_view_mixin.js|   1 -
 ambari-web/app/styles/application.less  |   4 +
 ambari-web/app/templates/main/host.hbs  |  55 +---
 ambari-web/app/utils/db.js  |   8 +
 ambari-web/app/views/common/table_view.js   |   5 +
 ambari-web/app/views/main/host.js   | 326 ---
 .../app/views/main/host/combo_search_box.js |   9 +
 8 files changed, 29 insertions(+), 381 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e6fde445/ambari-web/app/config.js
--
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index bdca3ad..cba09d7 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -79,7 +79,7 @@ App.supports = {
   skipComponentStartAfterInstall: false,
   storeKDCCredentials: true,
   preInstallChecks: false,
-  hostComboSearchBox: false,
+  hostComboSearchBox: true,
   serviceAutoStart: false,
   logSearch: false,
   redhatSatellite: false

http://git-wip-us.apache.org/repos/asf/ambari/blob/e6fde445/ambari-web/app/mixins/common/table_server_view_mixin.js
--
diff --git a/ambari-web/app/mixins/common/table_server_view_mixin.js 
b/ambari-web/app/mixins/common/table_server_view_mixin.js
index cb26367..eca17d6 100644
--- a/ambari-web/app/mixins/common/table_server_view_mixin.js
+++ b/ambari-web/app/mixins/common/table_server_view_mixin.js
@@ -93,7 +93,6 @@ App.TableServerViewMixin = Em.Mixin.create({
 clearTimeout(this.get('timeOut'));
 this.set('controller.resetStartIndex', true);
 this.set('filterConditions', []);
-this.clearFilterConditionsFromLocalStorage();
 searchCollection.models.forEach(function (model) {
   var tag = model.attributes;
   var isComponentState = 
comboController.isComponentStateFacet(tag.category);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e6fde445/ambari-web/app/styles/application.less
--
diff --git a/ambari-web/app/styles/application.less 
b/ambari-web/app/styles/application.less
index 9a871dd..755dff2 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -3121,6 +3121,10 @@ table.graphs {
 .set-rack-id {
   text-decoration: none;
 }
+
+.host-select-all {
+  margin-bottom: -1px ;
+}
   }
 
   .status-dot-position {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e6fde445/ambari-web/app/templates/main/host.hbs
--
diff --git a/ambari-web/app/templates/main/host.hbs 
b/ambari-web/app/templates/main/host.hbs
index 508448c..233ff07 100644
--- a/ambari-web/app/templates/main/host.hbs
+++ b/ambari-web/app/templates/main/host.hbs
@@ -24,41 +24,12 @@
 {{view App.HostTableMenuView}}
   {{/isAuthorized}}
 
-
-  {{#view view.statusFilter categoriesBinding="view.categories"}}
-
-  
-{{t common.filter}}: 
-
-  
-  {{view.comboBoxLabel}}
-  
-
-  
-  
-
-  {{t 
common.all}} ({{view.parentView.totalCount}})
-
-{{#each category in view.categories}}
-  {{#if category.isVisible}}
-
-  
-  
-{{category.label}}
-  
-   
- {{/if}}
-   {{/each}}
- 
-   
-  {{/view}}
-
   
   {{outlet}}
   
 
-  {{#view view.sortView classNames="label-row" 
contentBinding="view.filteredContent"}}
- 
+{{#view view.sortView classNames="label-row" 
contentBinding="view.filteredContent"}}
+{{view 
Ember.Checkbox class="host-select-all" 
checkedBinding="view.parentView.selectAllHosts"}}
  
 {{view view.parentView.nameSort}}
  
@@ -74,23 +45,6 @@
 
 {{t common.components}}
   

ambari git commit: AMBARI-15133. Functionality to purge operational logs from the ambari database. (Laszlo Puskas via stoader)

2016-03-01 Thread stoader
Repository: ambari
Updated Branches:
  refs/heads/trunk b07ef5851 -> c871f286d


AMBARI-15133. Functionality to purge operational logs from the ambari database. 
(Laszlo Puskas via stoader)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c871f286
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c871f286
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c871f286

Branch: refs/heads/trunk
Commit: c871f286d90119b2b606b266204ba3e7eae08f8a
Parents: b07ef58
Author: Toader, Sebastian 
Authored: Tue Mar 1 21:01:10 2016 +0100
Committer: Toader, Sebastian 
Committed: Tue Mar 1 22:44:05 2016 +0100

--
 ambari-server/pom.xml   |   5 +
 ambari-server/sbin/ambari-server|  10 +-
 .../server/cleanup/ClasspathScannerUtils.java   | 129 +++
 .../ambari/server/cleanup/CleanupDriver.java| 117 ++
 .../ambari/server/cleanup/CleanupModule.java|  76 +
 .../ambari/server/cleanup/CleanupService.java   |  33 
 .../server/cleanup/CleanupServiceImpl.java  |  67 
 .../ambari/server/cleanup/PurgePolicy.java  |  33 
 .../server/cleanup/TimeBasedCleanupPolicy.java  |  62 +++
 .../apache/ambari/server/orm/dao/AlertsDAO.java |  91 ++-
 .../apache/ambari/server/orm/dao/Cleanable.java |  39 +
 .../server/orm/entities/AlertCurrentEntity.java |   4 +-
 .../server/orm/entities/AlertHistoryEntity.java |   4 +-
 .../server/orm/entities/AlertNoticeEntity.java  |   4 +-
 ambari-server/src/main/python/ambari-server.py  |   8 +-
 .../src/main/python/ambari_server/dbCleanup.py  | 117 ++
 .../main/python/ambari_server/setupActions.py   |   3 +-
 .../cleanup/CleanupServiceFunctionalTest.java   | 161 +++
 .../server/cleanup/CleanupServiceImplTest.java  |  82 ++
 .../ddl-func-test/ddl-cleanup-test-data.sql |   6 +
 20 files changed, 1041 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c871f286/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index e3409b9..f691fad 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -1262,6 +1262,11 @@
   jetty-util-ajax
   ${jetty.version}
 
+
+  commons-cli
+  commons-cli
+  1.3.1
+
   
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/c871f286/ambari-server/sbin/ambari-server
--
diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server
index 5b31d73..c77b2e9 100755
--- a/ambari-server/sbin/ambari-server
+++ b/ambari-server/sbin/ambari-server
@@ -155,11 +155,15 @@ case "$1" in
 ;;
   setup-sso)
 echo -e "Setting up SSO authentication properties..."
-$PYTHON /usr/sbin/ambari-server.py $@
-;;
+$PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
+;;
+  db-cleanup)
+echo -e "Cleanup database..."
+$PYTHON "$AMBARI_PYTHON_EXECUTABLE" $@
+;;
   *)
 echo "Usage: $AMBARI_PYTHON_EXECUTABLE
-
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|setup-sso|refresh-stack-hash|backup|restore|update-host-names|enable-stack|check-database}
 [options]
+
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|setup-sso|refresh-stack-hash|backup|restore|update-host-names|enable-stack|check-database|db-cleanup}
 [options]
 Use $AMBARI_PYTHON_EXECUTABLE  --help to get details on 
options available.
 Or, simply invoke ambari-server.py --help to print the options."
 exit 1

http://git-wip-us.apache.org/repos/asf/ambari/blob/c871f286/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
new file mode 100644
index 000..4c12a62
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java
@@ -0,0 +1,129 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a cop

ambari git commit: AMBARI-15251. Ambari - Managed KDC Credentials is not saving the Admin Principal and Admin Password when Adding Services. (alexantonenko)

2016-03-01 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 97f3089ba -> b07ef5851


AMBARI-15251. Ambari - Managed KDC Credentials is not saving the Admin 
Principal and Admin Password when Adding Services. (alexantonenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b07ef585
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b07ef585
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b07ef585

Branch: refs/heads/trunk
Commit: b07ef5851f9ef3bf7a406432e202172134777d80
Parents: 97f3089
Author: Alex Antonenko 
Authored: Tue Mar 1 22:02:05 2016 +0200
Committer: Alex Antonenko 
Committed: Tue Mar 1 23:29:41 2016 +0200

--
 .../main/admin/kerberos/step4_controller.js | 62 
 ambari-web/app/routes/add_service_routes.js |  2 -
 .../admin/kerberos/step4_controller_test.js | 21 +--
 3 files changed, 15 insertions(+), 70 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b07ef585/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
--
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js 
b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
index 1eb52f1..914e19e 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
@@ -23,8 +23,6 @@ App.KerberosWizardStep4Controller = 
App.WizardStep7Controller.extend(App.AddSecu
   name: 'kerberosWizardStep4Controller',
   isWithinAddService: Em.computed.equal('wizardController.name', 
'addServiceController'),
 
-  adminPropertyNames: [{name: 'admin_principal', displayName: 'Admin 
principal'}, {name: 'admin_password', displayName: 'Admin password'}],
-
   clearStep: function() {
 this.set('isRecommendedLoaded', false);
 this.set('selectedService', null);
@@ -116,8 +114,6 @@ App.KerberosWizardStep4Controller = 
App.WizardStep7Controller.extend(App.AddSecu
 if (this.get('wizardController.name') == 'addServiceController') {
   // config properties for installed services should be disabled on Add 
Service Wizard
   configProperties.forEach(function(item) {
-if 
(this.get('adminPropertyNames').mapProperty('name').contains(item.get('name'))
-|| item.get('name') === 'persist_credentials') return;
 if 
(this.get('installedServiceNames').contains(item.get('serviceName')) || 
item.get('serviceName') == 'Cluster') {
   item.set('isEditable', false);
 } else if (stackConfigs) {
@@ -161,7 +157,6 @@ App.KerberosWizardStep4Controller = 
App.WizardStep7Controller.extend(App.AddSecu
 // stored configs from previous steps (Configure Kerberos or Customize 
Services for ASW)
 var storedServiceConfigs = 
this.get('wizardController').getDBProperty('serviceConfigProperties');
 var installedServiceNames = 
['Cluster'].concat(App.Service.find().mapProperty('serviceName'));
-var adminProps = [];
 var configProperties = configs.slice(0);
 var siteProperties = App.configsCollection.getAll();
 // override stored values
@@ -170,9 +165,7 @@ App.KerberosWizardStep4Controller = 
App.WizardStep7Controller.extend(App.AddSecu
 // show admin properties in add service wizard
 if (this.get('isWithinAddService')) {
   installedServiceNames = 
installedServiceNames.concat(this.get('selectedServiceNames'));
-  adminProps = this.createAdminCredentialsProperties(configProperties);
 }
-configProperties = adminProps.concat(configProperties);
 configProperties = configProperties.filter(function(item) {
   return installedServiceNames.contains(item.get('serviceName'));
 });
@@ -271,60 +264,5 @@ App.KerberosWizardStep4Controller = 
App.WizardStep7Controller.extend(App.AddSecu
 });
 this.updateKerberosDescriptor(kerberosDescriptor, configs);
 
App.get('router.kerberosWizardController').saveKerberosDescriptorConfigs(kerberosDescriptor);
-  },
-
-  /**
-   * Generate App.ServiceConfigProperty instances for 'admin_principal' and 
'admin_password' properties
-   * Used for Add Service Wizard only on Configure Identities step.
-   *
-   * @param {object[]} loadedProperties list of already loaded config 
properties
-   * @returns {App.ServiceConfigProperty[]}
-   */
-  createAdminCredentialsProperties: function(loadedProperties) {
-if (App.router.get('mainAdminKerberosController.isManualKerberos')) {
-  return [];
-}
-var fileName = 'krb5-conf.xml';
-var krbProperties = loadedProperties.filterProperty('filename', fileName);
-var siteProperties = App.config.get('preDefinedSiteProperties');
-var credentialProperties = 
this.get('adminPropertyNames').map(function(prop, index) {
- 

ambari git commit: AMBARI-15251. Ambari - Managed KDC Credentials is not saving the Admin Principal and Admin Password when Adding Services. (alexantonenko)

2016-03-01 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 beac3462d -> 479f21327


AMBARI-15251. Ambari - Managed KDC Credentials is not saving the Admin 
Principal and Admin Password when Adding Services. (alexantonenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/479f2132
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/479f2132
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/479f2132

Branch: refs/heads/branch-2.2
Commit: 479f21327a327cfad90e21f96270317f0926f56e
Parents: beac346
Author: Alex Antonenko 
Authored: Tue Mar 1 22:03:47 2016 +0200
Committer: Alex Antonenko 
Committed: Tue Mar 1 23:29:20 2016 +0200

--
 .../main/admin/kerberos/step4_controller.js | 61 
 ambari-web/app/routes/add_service_routes.js |  2 -
 .../admin/kerberos/step4_controller_test.js | 10 +---
 3 files changed, 1 insertion(+), 72 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/479f2132/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
--
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js 
b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
index d4b025c..339afbf 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
@@ -25,8 +25,6 @@ App.KerberosWizardStep4Controller = 
App.WizardStep7Controller.extend(App.AddSecu
 return this.get('wizardController.name') == 'addServiceController';
   }.property('wizardController.name'),
 
-  adminPropertyNames: [{name: 'admin_principal', displayName: 'Admin 
principal'}, {name: 'admin_password', displayName: 'Admin password'}],
-
   clearStep: function() {
 this.set('isRecommendedLoaded', false);
 this.set('selectedService', null);
@@ -118,8 +116,6 @@ App.KerberosWizardStep4Controller = 
App.WizardStep7Controller.extend(App.AddSecu
 if (this.get('wizardController.name') == 'addServiceController') {
   // config properties for installed services should be disabled on Add 
Service Wizard
   configProperties.forEach(function(item) {
-if 
(this.get('adminPropertyNames').mapProperty('name').contains(item.get('name'))
-|| item.get('name') === 'persist_credentials') return;
 if 
(this.get('installedServiceNames').contains(item.get('serviceName')) || 
item.get('serviceName') == 'Cluster') {
   item.set('isEditable', false);
 } else if (stackConfigs) {
@@ -164,7 +160,6 @@ App.KerberosWizardStep4Controller = 
App.WizardStep7Controller.extend(App.AddSecu
 // stored configs from previous steps (Configure Kerberos or Customize 
Services for ASW)
 var storedServiceConfigs = 
this.get('wizardController').getDBProperty('serviceConfigProperties');
 var installedServiceNames = 
['Cluster'].concat(App.Service.find().mapProperty('serviceName'));
-var adminProps = [];
 var configProperties = configs.slice(0);
 var siteProperties = App.config.get('preDefinedSiteProperties');
 // override stored values
@@ -173,9 +168,7 @@ App.KerberosWizardStep4Controller = 
App.WizardStep7Controller.extend(App.AddSecu
 // show admin properties in add service wizard
 if (this.get('isWithinAddService')) {
   installedServiceNames = 
installedServiceNames.concat(this.get('selectedServiceNames'));
-  adminProps = this.createAdminCredentialsProperties(configProperties);
 }
-configProperties = adminProps.concat(configProperties);
 configProperties = configProperties.filter(function(item) {
   return installedServiceNames.contains(item.get('serviceName'));
 });
@@ -274,59 +267,5 @@ App.KerberosWizardStep4Controller = 
App.WizardStep7Controller.extend(App.AddSecu
 });
 this.updateKerberosDescriptor(kerberosDescriptor, configs);
 
App.get('router.kerberosWizardController').saveKerberosDescriptorConfigs(kerberosDescriptor);
-  },
-
-  /**
-   * Generate App.ServiceConfigProperty instances for 'admin_principal' and 
'admin_password' properties
-   * Used for Add Service Wizard only on Configure Identities step.
-   *
-   * @param {object[]} loadedProperties list of already loaded config 
properties
-   * @returns {App.ServiceConfigProperty[]}
-   */
-  createAdminCredentialsProperties: function(loadedProperties) {
-if (App.router.get('mainAdminKerberosController.isManualKerberos')) {
-  return [];
-}
-var fileName = 'krb5-conf.xml';
-var krbProperties = loadedProperties.filterProperty('filename', fileName);
-var siteProperties = App.config.get('preDefinedSiteProperties');
-var credentialProperties = 
this.get('adminPropertyNames').map(function(prop, index) {
-  var

ambari git commit: AMBARI-15252. Server python unit-test failing on branch-2.2(Lav Jain via odiachenko).

2016-03-01 Thread odiachenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 bc2004e50 -> beac3462d


AMBARI-15252. Server python unit-test failing on branch-2.2(Lav Jain via 
odiachenko).


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/beac3462
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/beac3462
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/beac3462

Branch: refs/heads/branch-2.2
Commit: beac3462dba54000a4a93a7cc5d9aa78e5f9706a
Parents: bc2004e
Author: Oleksandr Diachenko 
Authored: Tue Mar 1 11:26:35 2016 -0800
Committer: Oleksandr Diachenko 
Committed: Tue Mar 1 11:26:35 2016 -0800

--
 .../src/test/python/stacks/2.3/common/test_stack_advisor.py  | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/beac3462/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py 
b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
index 316d172..9638054 100644
--- a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
@@ -584,23 +584,23 @@ class TestHDP23StackAdvisor(TestCase):
 
self.assertEquals(configurations['hdfs-site']['properties']['dfs.namenode.inode.attributes.provider.class'],
 'org.apache.ranger.authorization.hadoop.RangerHdfsAuthorizer', "Test with 
Ranger HDFS plugin is enabled")
 
 # Test 1 for dfs.allow.truncate with no HAWQ and dfs.allow.truncate not set
-self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, hosts)
+self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, None)
 self.assertTrue('dfs.allow.truncate' not in 
configurations['hdfs-site']['properties'])
 
 # Test 2 for dfs.allow.truncate with HAWQ and dfs.allow.truncate not set
 services["services"].append({"StackServices" : {"service_name" : "HAWQ"}, 
"components":[]})
-self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, hosts)
+self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, None)
 
self.assertEquals(configurations['hdfs-site']['properties']['dfs.allow.truncate'],
 'true')
 
 # Test 3 for dfs.allow.truncate with no HAWQ and dfs.allow.truncate set to 
false
 services["services"].remove({"StackServices" : {"service_name" : "HAWQ"}, 
"components":[]})
 configurations['hdfs-site']['properties']['dfs.allow.truncate'] = 'false'
-self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, hosts)
+self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, None)
 
self.assertEquals(configurations['hdfs-site']['properties']['dfs.allow.truncate'],
 'false')
 
 # Test 4 for dfs.allow.truncate with HAWQ and dfs.allow.truncate set to 
false
 services["services"].append({"StackServices" : {"service_name" : "HAWQ"}, 
"components":[]})
-self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, hosts)
+self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, None)
 
self.assertEquals(configurations['hdfs-site']['properties']['dfs.allow.truncate'],
 'true')
 
   def test_recommendYARNConfigurations(self):



ambari git commit: AMBARI-15173 - Express Upgrade Stuck At Manual Prompt Due To HRC Status Calculation Cache Problem (part5) (jonathanhurley)

2016-03-01 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 b94d8259f -> bc2004e50


AMBARI-15173 - Express Upgrade Stuck At Manual Prompt Due To HRC Status 
Calculation Cache Problem (part5) (jonathanhurley)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bc2004e5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bc2004e5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bc2004e5

Branch: refs/heads/branch-2.2
Commit: bc2004e50d4ceb1e0c4d70ef1c8b638c0fee676e
Parents: b94d825
Author: Jonathan Hurley 
Authored: Tue Mar 1 12:38:30 2016 -0500
Committer: Jonathan Hurley 
Committed: Tue Mar 1 13:30:51 2016 -0500

--
 .../server/orm/dao/HostRoleCommandDAO.java  | 63 
 1 file changed, 37 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/bc2004e5/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
index d462090..5c8b7f3 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
@@ -60,8 +60,8 @@ import org.apache.ambari.server.orm.entities.StageEntity;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.cache.Cache;
 import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
 import com.google.common.cache.LoadingCache;
 import com.google.common.collect.Lists;
 import com.google.inject.Inject;
@@ -120,8 +120,15 @@ public class HostRoleCommandDAO {
* being read during a transaction which has updated a
* {@link HostRoleCommandEntity}'s {@link HostRoleStatus} but has not
* committed yet.
+   * 
+   * This cache cannot be a {@link LoadingCache} since there is an inherent
+   * problem with concurrency of reloads. Namely, if the entry has been read
+   * during a load, but not yet put into the cache and another invalidation is
+   * registered. The old value would eventually make it into the cache and the
+   * last invalidation would not invalidate anything since the cache was empty
+   * at the time.
*/
-  private final LoadingCache> 
hrcStatusSummaryCache;
+  private final Cache> 
hrcStatusSummaryCache;
 
   /**
* Specifies whether caching for {@link HostRoleCommandStatusSummaryDTO} 
grouped by stage id for requests
@@ -252,24 +259,7 @@ public class HostRoleCommandDAO {
 hrcStatusSummaryCache = CacheBuilder.newBuilder()
   .maximumSize(hostRoleCommandStatusSummaryCacheLimit)
   .expireAfterWrite(hostRoleCommandStatusSummaryCacheExpiryDurationMins, 
TimeUnit.MINUTES)
-  .build(new CacheLoader>() {
-@Override
-public Map load(Long requestId) 
throws Exception {
-  LOG.debug("Cache miss for host role command status summary object 
for request {}, fetching from JPA", requestId);
-
-  // ensure that we wait for any running transactions working on this 
cache to
-  // complete
-  ReadWriteLock lock = 
transactionLocks.getLock(LockArea.HRC_STATUS_CACHE);
-  lock.readLock().lock();
-
-  try{
-Map 
hrcCommandStatusByStageId = loadAggregateCounts(requestId);
-return hrcCommandStatusByStageId;
-  } finally {
-lock.readLock().unlock();
-  }
-}
-  });
+  .build();
   }
 
   @RequiresSession
@@ -665,16 +655,37 @@ public class HostRoleCommandDAO {
 
 
   /**
-   * Finds the counts of tasks for a request and groups them by stage id.
-   * @param requestId the request id
+   * Finds the counts of tasks for a request and groups them by stage id. If
+   * caching is enabled, this will first consult the cache. Cache misses will
+   * then defer to loading the data from the database and then caching the
+   * result.
+   *
+   * @param requestId
+   *  the request id
* @return the map of stage-to-summary objects
*/
   public Map findAggregateCounts(Long 
requestId) {
-if (hostRoleCommandStatusSummaryCacheEnabled) {
-  return hrcStatusSummaryCache.getUnchecked(requestId);
+if (!hostRoleCommandStatusSummaryCacheEnabled) {
+  return loadAggregateCounts(requestId);
 }
-else {
-  return loadAggregateCounts(requestId); // if caching not enabled fall 
back to fetching through JPA
+
+Map map = 
hrcStatusSummaryCache.getIfPresent(requestId);
+if (null != map) {
+  return map;
+}
+
+// ensure that we wait for any running transactions working on this cache 

ambari git commit: AMBARI-15173 - Express Upgrade Stuck At Manual Prompt Due To HRC Status Calculation Cache Problem (part5) (jonathanhurley)

2016-03-01 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/trunk 940b2ffe4 -> 97f3089ba


AMBARI-15173 - Express Upgrade Stuck At Manual Prompt Due To HRC Status 
Calculation Cache Problem (part5) (jonathanhurley)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/97f3089b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/97f3089b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/97f3089b

Branch: refs/heads/trunk
Commit: 97f3089badbf4f16f828d92b317bb623605ee66b
Parents: 940b2ff
Author: Jonathan Hurley 
Authored: Tue Mar 1 12:38:30 2016 -0500
Committer: Jonathan Hurley 
Committed: Tue Mar 1 13:30:21 2016 -0500

--
 .../server/orm/dao/HostRoleCommandDAO.java  | 63 
 1 file changed, 37 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/97f3089b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
index 14dac79..b48ffa8 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
@@ -60,8 +60,8 @@ import org.apache.ambari.server.orm.entities.StageEntity;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.cache.Cache;
 import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
 import com.google.common.cache.LoadingCache;
 import com.google.common.collect.Lists;
 import com.google.inject.Inject;
@@ -120,8 +120,15 @@ public class HostRoleCommandDAO {
* being read during a transaction which has updated a
* {@link HostRoleCommandEntity}'s {@link HostRoleStatus} but has not
* committed yet.
+   * 
+   * This cache cannot be a {@link LoadingCache} since there is an inherent
+   * problem with concurrency of reloads. Namely, if the entry has been read
+   * during a load, but not yet put into the cache and another invalidation is
+   * registered. The old value would eventually make it into the cache and the
+   * last invalidation would not invalidate anything since the cache was empty
+   * at the time.
*/
-  private final LoadingCache> 
hrcStatusSummaryCache;
+  private final Cache> 
hrcStatusSummaryCache;
 
   /**
* Specifies whether caching for {@link HostRoleCommandStatusSummaryDTO} 
grouped by stage id for requests
@@ -252,24 +259,7 @@ public class HostRoleCommandDAO {
 hrcStatusSummaryCache = CacheBuilder.newBuilder()
   .maximumSize(hostRoleCommandStatusSummaryCacheLimit)
   .expireAfterWrite(hostRoleCommandStatusSummaryCacheExpiryDurationMins, 
TimeUnit.MINUTES)
-  .build(new CacheLoader>() {
-@Override
-public Map load(Long requestId) 
throws Exception {
-  LOG.debug("Cache miss for host role command status summary object 
for request {}, fetching from JPA", requestId);
-
-  // ensure that we wait for any running transactions working on this 
cache to
-  // complete
-  ReadWriteLock lock = 
transactionLocks.getLock(LockArea.HRC_STATUS_CACHE);
-  lock.readLock().lock();
-
-  try{
-Map 
hrcCommandStatusByStageId = loadAggregateCounts(requestId);
-return hrcCommandStatusByStageId;
-  } finally {
-lock.readLock().unlock();
-  }
-}
-  });
+  .build();
   }
 
   @RequiresSession
@@ -665,16 +655,37 @@ public class HostRoleCommandDAO {
 
 
   /**
-   * Finds the counts of tasks for a request and groups them by stage id.
-   * @param requestId the request id
+   * Finds the counts of tasks for a request and groups them by stage id. If
+   * caching is enabled, this will first consult the cache. Cache misses will
+   * then defer to loading the data from the database and then caching the
+   * result.
+   *
+   * @param requestId
+   *  the request id
* @return the map of stage-to-summary objects
*/
   public Map findAggregateCounts(Long 
requestId) {
-if (hostRoleCommandStatusSummaryCacheEnabled) {
-  return hrcStatusSummaryCache.getUnchecked(requestId);
+if (!hostRoleCommandStatusSummaryCacheEnabled) {
+  return loadAggregateCounts(requestId);
 }
-else {
-  return loadAggregateCounts(requestId); // if caching not enabled fall 
back to fetching through JPA
+
+Map map = 
hrcStatusSummaryCache.getIfPresent(requestId);
+if (null != map) {
+  return map;
+}
+
+// ensure that we wait for any running transactions working on this cache 
to
+//

ambari git commit: AMBARI-15205. Registering 700 hosts gets stuck without timeout on 8 hosts (aonishuk)

2016-03-01 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 3ac4950b1 -> b94d8259f


AMBARI-15205. Registering 700 hosts gets stuck without timeout on 8 hosts 
(aonishuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b94d8259
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b94d8259
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b94d8259

Branch: refs/heads/branch-2.2
Commit: b94d8259f3a57f71f142caed6c4771e874577dd8
Parents: 3ac4950
Author: Andrew Onishuk 
Authored: Tue Mar 1 19:05:52 2016 +0200
Committer: Andrew Onishuk 
Committed: Tue Mar 1 19:05:52 2016 +0200

--
 .../ambari/server/bootstrap/BSRunner.java   | 101 ---
 1 file changed, 67 insertions(+), 34 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b94d8259/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSRunner.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSRunner.java 
b/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSRunner.java
index bf43bc9..190ad03 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSRunner.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSRunner.java
@@ -29,7 +29,6 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.ambari.server.bootstrap.BootStrapStatus.BSStat;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -145,6 +144,35 @@ class BSRunner extends Thread {
 FileUtils.writeStringToFile(passwordFile, data);
   }
 
+  /**
+   * Waits until the process has terminated or waiting time elapses.
+   * @param timeout time to wait in miliseconds
+   * @return true if process has exited, false otherwise
+   */
+  private boolean waitForProcessTermination(Process process, long timeout) 
throws InterruptedException {
+long startTime = System.currentTimeMillis();
+do {
+  try {
+process.exitValue();
+return true;
+  } catch (IllegalThreadStateException e) {}
+  // Check if process has terminated once per second
+  Thread.sleep(1000);
+} while (System.currentTimeMillis() - startTime < timeout);
+return false;
+  }
+
+  /**
+   * Calculates bootstrap timeout as a function of number of hosts.
+   * @return timeout in milliseconds
+   */
+  private long calculateBSTimeout(int hostCount) {
+final int PARALLEL_BS_COUNT = 20; // bootstrap.py bootstraps 20 hosts in 
parallel
+final long HOST_BS_TIMEOUT = 30L; // 5 minutes timeout for a host 
(average). Same as in bootstrap.py
+
+return Math.max(HOST_BS_TIMEOUT, HOST_BS_TIMEOUT * hostCount / 
PARALLEL_BS_COUNT);
+  }
+
   public synchronized void finished() {
 this.finished = true;
   }
@@ -152,6 +180,7 @@ class BSRunner extends Thread {
   @Override
   public void run() {
 String hostString = createHostString(sshHostInfo.getHosts());
+long bootstrapTimeout = calculateBSTimeout(sshHostInfo.getHosts().size());
 // Startup a scheduled executor service to look through the logs
 ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
 BSStatusCollector statusCollector = new BSStatusCollector();
@@ -220,19 +249,13 @@ class BSRunner extends Thread {
   LOG.info("Host= " + hostString + " bs=" + this.bsScript + " requestDir=" 
+
   requestIdDir + " user=" + user + " keyfile=" + this.sshKeyFile +
   " passwordFile " + this.passwordFile + " server=" + 
this.ambariHostname +
-  " version=" + projectVersion + " serverPort=" + this.serverPort + " 
userRunAs=" + userRunAs);
+  " version=" + projectVersion + " serverPort=" + this.serverPort + " 
userRunAs=" + userRunAs +
+  " timeout=" + bootstrapTimeout / 1000);
 
   envVariables.put("AMBARI_PASSPHRASE", agentSetupPassword);
   if (this.verbose)
 envVariables.put("BS_VERBOSE", "\"-vvv\"");
 
-  String[] env = new String[envVariables.size()];
-  int iVar = 0;
-  for(Map.Entry pair : envVariables.entrySet())
-  {
-env[iVar++] = pair.getKey() + "=" + pair.getValue();
-  }
-
   if (LOG.isDebugEnabled()) {
 LOG.debug(Arrays.toString(command));
   }
@@ -240,29 +263,29 @@ class BSRunner extends Thread {
   String bootStrapOutputFilePath = requestIdDir + File.separator + 
"bootstrap.out";
   String bootStrapErrorFilePath = requestIdDir + File.separator + 
"bootstrap.err";
 
-  Process process = Runtime.getRuntime().exec(command, env);
-  
-  PrintWriter stdOutWriter = null;
-  PrintWriter stdErrWriter = null;
-  
-  try {
-stdOut

ambari git commit: AMBARI-15205. Registering 700 hosts gets stuck without timeout on 8 hosts (aonishuk)

2016-03-01 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk 4c5e03b84 -> 940b2ffe4


AMBARI-15205. Registering 700 hosts gets stuck without timeout on 8 hosts 
(aonishuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/940b2ffe
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/940b2ffe
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/940b2ffe

Branch: refs/heads/trunk
Commit: 940b2ffe498ef7e26080671e30e30e3c42e35248
Parents: 4c5e03b
Author: Andrew Onishuk 
Authored: Tue Mar 1 19:04:22 2016 +0200
Committer: Andrew Onishuk 
Committed: Tue Mar 1 19:04:56 2016 +0200

--
 .../ambari/server/bootstrap/BSRunner.java   | 101 ---
 .../ambari_server/dbConfiguration_linux.py  |  41 
 .../python/ambari_server/serverConfiguration.py |   4 +-
 .../src/main/python/ambari_server/setupHttps.py |   6 +-
 .../main/python/ambari_server/setupSecurity.py  |   6 +-
 5 files changed, 96 insertions(+), 62 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/940b2ffe/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSRunner.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSRunner.java 
b/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSRunner.java
index 81f95fb..46b9e81 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSRunner.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSRunner.java
@@ -29,7 +29,6 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.ambari.server.bootstrap.BootStrapStatus.BSStat;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -146,6 +145,35 @@ class BSRunner extends Thread {
 FileUtils.writeStringToFile(passwordFile, data);
   }
 
+  /**
+   * Waits until the process has terminated or waiting time elapses.
+   * @param timeout time to wait in miliseconds
+   * @return true if process has exited, false otherwise
+   */
+  private boolean waitForProcessTermination(Process process, long timeout) 
throws InterruptedException {
+long startTime = System.currentTimeMillis();
+do {
+  try {
+process.exitValue();
+return true;
+  } catch (IllegalThreadStateException e) {}
+  // Check if process has terminated once per second
+  Thread.sleep(1000);
+} while (System.currentTimeMillis() - startTime < timeout);
+return false;
+  }
+
+  /**
+   * Calculates bootstrap timeout as a function of number of hosts.
+   * @return timeout in milliseconds
+   */
+  private long calculateBSTimeout(int hostCount) {
+final int PARALLEL_BS_COUNT = 20; // bootstrap.py bootstraps 20 hosts in 
parallel
+final long HOST_BS_TIMEOUT = 30L; // 5 minutes timeout for a host 
(average). Same as in bootstrap.py
+
+return Math.max(HOST_BS_TIMEOUT, HOST_BS_TIMEOUT * hostCount / 
PARALLEL_BS_COUNT);
+  }
+
   public synchronized void finished() {
 this.finished = true;
   }
@@ -153,6 +181,7 @@ class BSRunner extends Thread {
   @Override
   public void run() {
 String hostString = createHostString(sshHostInfo.getHosts());
+long bootstrapTimeout = calculateBSTimeout(sshHostInfo.getHosts().size());
 // Startup a scheduled executor service to look through the logs
 ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
 BSStatusCollector statusCollector = new BSStatusCollector();
@@ -228,19 +257,13 @@ class BSRunner extends Thread {
   LOG.info("Host= " + hostString + " bs=" + this.bsScript + " requestDir=" 
+
   requestIdDir + " user=" + user + " sshPort=" + sshPort + " keyfile=" 
+ this.sshKeyFile +
   " passwordFile " + this.passwordFile + " server=" + 
this.ambariHostname +
-  " version=" + projectVersion + " serverPort=" + this.serverPort + " 
userRunAs=" + userRunAs);
+  " version=" + projectVersion + " serverPort=" + this.serverPort + " 
userRunAs=" + userRunAs +
+  " timeout=" + bootstrapTimeout / 1000);
 
   envVariables.put("AMBARI_PASSPHRASE", agentSetupPassword);
   if (this.verbose)
 envVariables.put("BS_VERBOSE", "\"-vvv\"");
 
-  String[] env = new String[envVariables.size()];
-  int iVar = 0;
-  for(Map.Entry pair : envVariables.entrySet())
-  {
-env[iVar++] = pair.getKey() + "=" + pair.getValue();
-  }
-
   if (LOG.isDebugEnabled()) {
 LOG.debug(Arrays.toString(command));
   }
@@ -248,29 +271,29 @@ class BSRunner extends Thread {
   String bootStrapOutputFilePath = requestIdDir + File.separator + 
"bootstrap.out";
   String bootStrapErro

[3/4] ambari git commit: Initial LogSearch Stack Definition for Ambari (Ali Bajwa via rnettleton)

2016-03-01 Thread rnettleton
http://git-wip-us.apache.org/repos/asf/ambari/blob/cb25daa3/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-audit_logs-solrconfig.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-audit_logs-solrconfig.xml
 
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-audit_logs-solrconfig.xml
new file mode 100644
index 000..b7fd43f
--- /dev/null
+++ 
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-audit_logs-solrconfig.xml
@@ -0,0 +1,1922 @@
+
+
+
+
+
+
+
+  
+
+  
+content
+This is the jinja template for solrconfig.xml file for 
service logs
+
+
+
+
+
+  
+
+  
+  5.0.0
+
+  
+
+  
+  
+
+  
+  
+
+  
+  
+
+  
+  
+
+  
+  
+
+  
+  
+
+
+
+  
+
+