ambari git commit: AMBARI-10892. Oozie tar extraction and folder set up should be skipped for sys-prepped hosts

2015-05-01 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/trunk 0670e953a - a851dffba


AMBARI-10892. Oozie tar extraction and folder set up should be skipped for 
sys-prepped hosts


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

Branch: refs/heads/trunk
Commit: a851dffba329380374c427d8919ec9b595706242
Parents: 0670e95
Author: Sumit Mohanty smoha...@hortonworks.com
Authored: Fri May 1 15:39:56 2015 -0700
Committer: Sumit Mohanty smoha...@hortonworks.com
Committed: Fri May 1 15:39:56 2015 -0700

--
 .../OOZIE/4.0.0.2.0/package/scripts/oozie.py| 23 ++--
 1 file changed, 12 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a851dffb/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
index 21ba06b..77b3cdc 100644
--- 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
+++ 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
@@ -192,18 +192,19 @@ def oozie_server_specific():
   Directory(params.oozie_libext_dir,
 recursive=True,
   )
-  
-  configure_cmds = []  
-  
configure_cmds.append(('tar','-xvf',format('{oozie_home}/oozie-sharelib.tar.gz'),'-C',params.oozie_home))
-  configure_cmds.append(('cp', params.ext_js_path, params.oozie_libext_dir))
-  configure_cmds.append(('chown', format('{oozie_user}:{user_group}'), 
format('{oozie_libext_dir}/{ext_js_file}')))
-  configure_cmds.append(('chown', '-RL', format('{oozie_user}:{user_group}'), 
params.oozie_webapps_conf_dir))
-  
+
   no_op_test = format(ls {pid_file} /dev/null 21  ps -p `cat {pid_file}` 
/dev/null 21)
-  Execute( configure_cmds,
-not_if  = no_op_test,
-sudo = True,
-  )
+  if not params.host_sys_prepped:
+configure_cmds = []
+
configure_cmds.append(('tar','-xvf',format('{oozie_home}/oozie-sharelib.tar.gz'),'-C',params.oozie_home))
+configure_cmds.append(('cp', params.ext_js_path, params.oozie_libext_dir))
+configure_cmds.append(('chown', format('{oozie_user}:{user_group}'), 
format('{oozie_libext_dir}/{ext_js_file}')))
+configure_cmds.append(('chown', '-RL', 
format('{oozie_user}:{user_group}'), params.oozie_webapps_conf_dir))
+
+Execute( configure_cmds,
+  not_if  = no_op_test,
+  sudo = True,
+)
 
   if params.jdbc_driver_name==com.mysql.jdbc.Driver or \
  params.jdbc_driver_name == com.microsoft.sqlserver.jdbc.SQLServerDriver 
or \



ambari git commit: AMBARI-10256. Unable to delete HBase Master (alexantonenko)

2015-05-01 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/branch-2.0.maint 84a7c5d27 - c33342c80


AMBARI-10256. Unable to delete HBase Master (alexantonenko)


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

Branch: refs/heads/branch-2.0.maint
Commit: c33342c8021a38d0b8d30a1a4b9e55730530d425
Parents: 84a7c5d
Author: Alex Antonenko hiv...@gmail.com
Authored: Fri Mar 27 22:43:17 2015 +0200
Committer: Yusaku Sako yus...@hortonworks.com
Committed: Fri May 1 17:31:37 2015 -0700

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/c33342c8/ambari-web/app/models/stack_service_component.js
--
diff --git a/ambari-web/app/models/stack_service_component.js 
b/ambari-web/app/models/stack_service_component.js
index 1867cc1..e47787a 100644
--- a/ambari-web/app/models/stack_service_component.js
+++ b/ambari-web/app/models/stack_service_component.js
@@ -102,7 +102,7 @@ App.StackServiceComponent = DS.Model.extend({
 
   /** @property {Boolean} isDeletable - component supports delete action **/
   isDeletable: function() {
-var ignored = ['HBASE_MASTER'];
+var ignored = [];
 return this.get('isAddableToHost')  
!ignored.contains(this.get('componentName'));
   }.property('componentName'),
 



ambari git commit: AMBARI-10829. YARN heapsize does not take effect (dlysnichenko)

2015-05-01 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/branch-2.0.maint fa96df533 - 80207df77


AMBARI-10829. YARN heapsize does not take effect (dlysnichenko)


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

Branch: refs/heads/branch-2.0.maint
Commit: 80207df779da2857fbd6ba971aea9ce8671f0d76
Parents: fa96df5
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Apr 29 14:31:25 2015 +0300
Committer: Yusaku Sako yus...@hortonworks.com
Committed: Fri May 1 17:27:07 2015 -0700

--
 .../services/YARN/configuration/yarn-env.xml| 119 +++
 .../catalog/UpgradeCatalog_1.3_to_2.2.json  |   2 +-
 2 files changed, 120 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/80207df7/ambari-server/src/main/resources/stacks/HDP/2.1/services/YARN/configuration/yarn-env.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/YARN/configuration/yarn-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/YARN/configuration/yarn-env.xml
index dd3e3ef..4c99823 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/YARN/configuration/yarn-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/YARN/configuration/yarn-env.xml
@@ -26,4 +26,123 @@
 value1024/value
 descriptionMax heapsize for AppTimelineServer using a numerical value in 
the scale of MB/description
   /property
+  
+  !-- yarn-env.sh --
+  property
+namecontent/name
+descriptionThis is the jinja template for yarn-env.sh file/description
+value
+export HADOOP_YARN_HOME={{hadoop_yarn_home}}
+export YARN_LOG_DIR={{yarn_log_dir_prefix}}/$USER
+export YARN_PID_DIR={{yarn_pid_dir_prefix}}/$USER
+export HADOOP_LIBEXEC_DIR={{hadoop_libexec_dir}}
+export JAVA_HOME={{java64_home}}
+
+# User for YARN daemons
+export HADOOP_YARN_USER=${HADOOP_YARN_USER:-yarn}
+
+# resolve links - $0 may be a softlink
+export YARN_CONF_DIR=${YARN_CONF_DIR:-$HADOOP_YARN_HOME/conf}
+
+# some Java parameters
+# export JAVA_HOME=/home/y/libexec/jdk1.6.0/
+if [ $JAVA_HOME !=  ]; then
+  #echo run java in $JAVA_HOME
+  JAVA_HOME=$JAVA_HOME
+fi
+
+if [ $JAVA_HOME =  ]; then
+  echo Error: JAVA_HOME is not set.
+  exit 1
+fi
+
+JAVA=$JAVA_HOME/bin/java
+JAVA_HEAP_MAX=-Xmx1000m
+
+# For setting YARN specific HEAP sizes please use this
+# Parameter and set appropriately
+YARN_HEAPSIZE={{yarn_heapsize}}
+
+# check envvars which might override default args
+if [ $YARN_HEAPSIZE !=  ]; then
+  JAVA_HEAP_MAX=-Xmx$YARN_HEAPSIZEm
+fi
+
+# Resource Manager specific parameters
+
+# Specify the max Heapsize for the ResourceManager using a numerical value
+# in the scale of MB. For example, to specify an jvm option of -Xmx1000m, set
+# the value to 1000.
+# This value will be overridden by an Xmx setting specified in either YARN_OPTS
+# and/or YARN_RESOURCEMANAGER_OPTS.
+# If not specified, the default value will be picked from either YARN_HEAPMAX
+# or JAVA_HEAP_MAX with YARN_HEAPMAX as the preferred option of the two.
+export YARN_RESOURCEMANAGER_HEAPSIZE={{resourcemanager_heapsize}}
+
+# Specify the JVM options to be used when starting the ResourceManager.
+# These options will be appended to the options specified as YARN_OPTS
+# and therefore may override any similar flags set in YARN_OPTS
+#export YARN_RESOURCEMANAGER_OPTS=
+
+# Node Manager specific parameters
+
+# Specify the max Heapsize for the NodeManager using a numerical value
+# in the scale of MB. For example, to specify an jvm option of -Xmx1000m, set
+# the value to 1000.
+# This value will be overridden by an Xmx setting specified in either YARN_OPTS
+# and/or YARN_NODEMANAGER_OPTS.
+# If not specified, the default value will be picked from either YARN_HEAPMAX
+# or JAVA_HEAP_MAX with YARN_HEAPMAX as the preferred option of the two.
+export YARN_NODEMANAGER_HEAPSIZE={{nodemanager_heapsize}}
+
+# Specify the max Heapsize for the timeline server using a numerical value
+# in the scale of MB. For example, to specify an jvm option of -Xmx1000m, set
+# the value to 1024.
+# This value will be overridden by an Xmx setting specified in either YARN_OPTS
+# and/or YARN_TIMELINESERVER_OPTS.
+# If not specified, the default value will be picked from either YARN_HEAPMAX
+# or JAVA_HEAP_MAX with YARN_HEAPMAX as the preferred option of the two.
+export YARN_TIMELINESERVER_HEAPSIZE={{apptimelineserver_heapsize}}
+
+# Specify the JVM options to be used when starting the NodeManager.
+# These options will be appended to the options specified as YARN_OPTS
+# and therefore may override any similar flags 

ambari git commit: AMBARI-10451. Stack Validator skips hbase-env, fails when when HBase properties hbase_master_heapsize or hbase_regionserver_heapsize are added to both hbase-env and hbase-site - ret

2015-05-01 Thread alejandro
Repository: ambari
Updated Branches:
  refs/heads/trunk a851dffba - 48ed0


AMBARI-10451. Stack Validator skips hbase-env, fails when when HBase properties 
hbase_master_heapsize or hbase_regionserver_heapsize are added to both 
hbase-env and hbase-site - returns 500 error (alejandro)


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

Branch: refs/heads/trunk
Commit: 48ed0383e48d5164fbee4e10ee0a7a376e71
Parents: a851dff
Author: Alejandro Fernandez afernan...@hortonworks.com
Authored: Fri Apr 10 19:00:36 2015 -0700
Committer: Alejandro Fernandez afernan...@hortonworks.com
Committed: Fri May 1 18:42:48 2015 -0700

--
 .../api/services/stackadvisor/StackAdvisorRunner.java  |  4 +++-
 .../stacks/HDP/2.0.6/services/stack_advisor.py | 13 +++--
 .../resources/stacks/HDP/2.2/services/stack_advisor.py |  1 -
 3 files changed, 14 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/48ed/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorRunner.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorRunner.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorRunner.java
index 191aeed..f3b61bd 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorRunner.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorRunner.java
@@ -83,10 +83,12 @@ public class StackAdvisorRunner {
 if (index  -1) {
   errMessage = errMessage.substring(index + 1).trim();
 }
-errorMessage = errMessage;
+errorMessage = Stack Advisor reported an error:  + errMessage;
   } else {
 errorMessage = Error occurred during stack advisor execution;
   }
+  errorMessage += \nStdOut file:  + outputFile + \n;
+  errorMessage += \nStdErr file:  + errorFile;
   switch (exitCode) {
 case 1:
   throw new StackAdvisorRequestException(errorMessage);

http://git-wip-us.apache.org/repos/asf/ambari/blob/48ed/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index 32678a8..d56b201 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -326,12 +326,16 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
 for service in services[services]:
   serviceName = service[StackServices][service_name]
   validator = self.validateServiceConfigurations(serviceName)
-  if validator is not  None:
+  if validator is not None:
 for siteName, method in validator.items():
   if siteName in recommendedDefaults:
 siteProperties = getSiteProperties(configurations, siteName)
 if siteProperties is not None:
-  resultItems = method(siteProperties, 
recommendedDefaults[siteName][properties], configurations, services, hosts)
+  siteRecommendations = recommendedDefaults[siteName][properties]
+  print(SiteName: %s, method: %s\n % (siteName, method.__name__))
+  print(Site properties: %s\n % str(siteProperties))
+  print(Recommendations: %s\n\n % 
str(siteRecommendations))
+  resultItems = method(siteProperties, siteRecommendations, 
configurations, services, hosts)
   items.extend(resultItems)
 self.validateMinMax(items, recommendedDefaults, configurations)
 return items
@@ -541,6 +545,11 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
 return None
 
   def validatorLessThenDefaultValue(self, properties, recommendedDefaults, 
propertyName):
+if propertyName not in recommendedDefaults:
+  # If a property name exists in say hbase-env and hbase-site (which is 
allowed), then it will exist in the
+  # properties dictionary, but not necessarily in the 
recommendedDefaults dictionary. In this case, ignore it.
+  return None
+
 if not propertyName in properties:
   return self.getErrorItem(Value should be set)
 value = to_number(properties[propertyName])


ambari git commit: AMBARI-10405 Some service components are missing from API response and causes problems (dsen)

2015-05-01 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/branch-2.0.maint 80207df77 - 84a7c5d27


AMBARI-10405 Some service components are missing from API response and causes 
problems (dsen)


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

Branch: refs/heads/branch-2.0.maint
Commit: 84a7c5d27fde9da0fc99cf8d13c65e4ec32e1041
Parents: 80207df
Author: Dmytro Sen d...@apache.org
Authored: Tue Apr 14 12:32:33 2015 +0300
Committer: Yusaku Sako yus...@hortonworks.com
Committed: Fri May 1 17:29:07 2015 -0700

--
 .../ambari/server/controller/AmbariServer.java  |  28 +--
 .../server/controller/ControllerModule.java |   4 +-
 .../controller/utilities/DatabaseChecker.java   | 182 +++
 .../server/state/ServiceComponentImpl.java  |  16 +-
 .../server/controller/AmbariServerTest.java |  47 -
 .../utilities/DatabaseCheckerTest.java  |  91 ++
 6 files changed, 291 insertions(+), 77 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/84a7c5d2/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
index 4e684d3..24dc23d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
@@ -57,6 +57,7 @@ import 
org.apache.ambari.server.controller.internal.StackDefinedPropertyProvider
 import 
org.apache.ambari.server.controller.internal.StackDependencyResourceProvider;
 import 
org.apache.ambari.server.controller.internal.UserPrivilegeResourceProvider;
 import 
org.apache.ambari.server.controller.internal.ViewPermissionResourceProvider;
+import org.apache.ambari.server.controller.utilities.DatabaseChecker;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.PersistenceType;
 import org.apache.ambari.server.orm.dao.BlueprintDAO;
@@ -87,7 +88,6 @@ import 
org.apache.ambari.server.security.unsecured.rest.ConnectionInfo;
 import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.utils.StageUtils;
-import org.apache.ambari.server.utils.VersionUtils;
 import org.apache.ambari.server.view.ViewRegistry;
 import org.apache.velocity.app.Velocity;
 import org.eclipse.jetty.server.Connector;
@@ -213,7 +213,8 @@ public class AmbariServer {
 server.setSessionIdManager(sessionIdManager);
 Server serverForAgent = new Server();
 
-checkDBVersion();
+DatabaseChecker.checkDBVersion();
+DatabaseChecker.checkDBConsistency();
 
 try {
   ClassPathXmlApplicationContext parentSpringAppContext =
@@ -572,29 +573,6 @@ public class AmbariServer {
 }
   }
 
-  protected void checkDBVersion() throws AmbariException {
-LOG.info(Checking DB store version);
-MetainfoEntity schemaVersionEntity = 
metainfoDAO.findByKey(Configuration.SERVER_VERSION_KEY);
-String schemaVersion = null;
-String serverVersion = null;
-
-if (schemaVersionEntity != null) {
-  schemaVersion = schemaVersionEntity.getMetainfoValue();
-  serverVersion = ambariMetaInfo.getServerVersion();
-}
-
-if (schemaVersionEntity==null || 
VersionUtils.compareVersions(schemaVersion, serverVersion, 3) != 0) {
-  String error = Current database store version is not compatible with  +
-  current server version
-  + , serverVersion= + serverVersion
-  + , schemaVersion= + schemaVersion;
-  LOG.warn(error);
-  throw new AmbariException(error);
-}
-
-LOG.info(DB store version is compatible);
-  }
-
   public void stop() throws Exception {
 try {
   server.stop();

http://git-wip-us.apache.org/repos/asf/ambari/blob/84a7c5d2/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
index 9c8bcd7..8afa0bb 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
@@ -65,6 +65,7 @@ import 
org.apache.ambari.server.controller.internal.MemberResourceProvider;
 import 

ambari git commit: AMBARI-10893. Update widgets.json and metrics.json files. (jaimin)

2015-05-01 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/trunk 48ed0 - bb4633918


AMBARI-10893. Update widgets.json and metrics.json files. (jaimin)


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

Branch: refs/heads/trunk
Commit: bb4633918eb4ee18359b870ff681a619bd6839f3
Parents: 48edfff
Author: Jaimin Jetly jai...@hortonworks.com
Authored: Fri May 1 18:49:30 2015 -0700
Committer: Jaimin Jetly jai...@hortonworks.com
Committed: Fri May 1 18:49:40 2015 -0700

--
 .../HBASE/0.96.0.2.0/widgets.json   | 173 ++-
 .../common-services/HDFS/2.1.0.2.0/metrics.json |  40 ++
 .../common-services/HDFS/2.1.0.2.0/widgets.json | 187 ++-
 .../common-services/YARN/2.1.0.2.0/metrics.json | 230 ++---
 .../common-services/YARN/2.1.0.2.0/widgets.json | 513 ---
 .../stacks/HDP/2.3/services/HBASE/widgets.json  | 199 +++
 ambari-web/app/config.js|   2 +-
 .../views/common/widget/graph_widget_view.js|   3 +-
 8 files changed, 915 insertions(+), 432 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/bb463391/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/widgets.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/widgets.json
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/widgets.json
index 949f273..42087b4 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/widgets.json
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/widgets.json
@@ -65,18 +65,6 @@
   is_visible: true,
   metrics: [
 {
-  name: regionserver.Server.Get_95th_percentile._min,
-  metric_path: 
metrics/hbase/regionserver/Server/Get_95th_percentile._min,
-  service_name: HBASE,
-  component_name: HBASE_REGIONSERVER
-},
-{
-  name: regionserver.Server.Get_95th_percentile._avg,
-  metric_path: 
metrics/hbase/regionserver/Server/Get_95th_percentile._avg,
-  service_name: HBASE,
-  component_name: HBASE_REGIONSERVER
-},
-{
   name: regionserver.Server.Get_95th_percentile._max,
   metric_path: 
metrics/hbase/regionserver/Server/Get_95th_percentile._max,
   service_name: HBASE,
@@ -85,15 +73,7 @@
   ],
   values: [
 {
-  name: Cluster wide minimum of 95% Read Latency,
-  value: ${regionserver.Server.Get_95th_percentile._min}
-},
-{
-  name: Weighted average of 95% read Latency,
-  value: ${regionserver.Server.Get_95th_percentile._avg}
-},
-{
-  name: Cluster wide maximum of 95% read Latency,
+  name: Cluster wide maximum of 95% Get Latency,
   value: ${regionserver.Server.Get_95th_percentile._max}
 }
   ],
@@ -110,54 +90,6 @@
   is_visible: true,
   metrics: [
 {
-  name: regionserver.Server.Mutate_95th_percentile._min,
-  metric_path: 
metrics/hbase/regionserver/Server/Mutate_95th_percentile._min,
-  service_name: HBASE,
-  component_name: HBASE_REGIONSERVER
-},
-{
-  name: regionserver.Server.Increment_95th_percentile._min,
-  metric_path: 
metrics/hbase/regionserver/Server/Increment_95th_percentile._min,
-  service_name: HBASE,
-  component_name: HBASE_REGIONSERVER
-},
-{
-  name: regionserver.Server.Append_95th_percentile._min,
-  metric_path: 
metrics/hbase/regionserver/Server/Append_95th_percentile._min,
-  service_name: HBASE,
-  component_name: HBASE_REGIONSERVER
-},
-{
-  name: regionserver.Server.Delete_95th_percentile._min,
-  metric_path: 
metrics/hbase/regionserver/Server/Delete_95th_percentile._min,
-  service_name: HBASE,
-  component_name: HBASE_REGIONSERVER
-},
-{
-  name: regionserver.Server.Mutate_95th_percentile._avg,
-  metric_path: 
metrics/hbase/regionserver/Server/Mutate_95th_percentile._avg,
-  service_name: HBASE,
-  component_name: HBASE_REGIONSERVER
-},
-{
-  name: regionserver.Server.Increment_95th_percentile._avg,
-  metric_path: 

ambari git commit: AMBARI-10891. Widget Browser should be restrictive to logged in user with non admin privelege.(xiwang)

2015-05-01 Thread xiwang
Repository: ambari
Updated Branches:
  refs/heads/trunk bb4633918 - 727f550f8


AMBARI-10891. Widget Browser should be restrictive to logged in user with non 
admin privelege.(xiwang)


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

Branch: refs/heads/trunk
Commit: 727f550f828aff8832123bd941e1d1ca4f5ed423
Parents: bb46339
Author: Xi Wang xiw...@apache.org
Authored: Fri May 1 14:30:13 2015 -0700
Committer: Xi Wang xiw...@apache.org
Committed: Fri May 1 19:10:17 2015 -0700

--
 .../modal_popups/widget_browser_popup.hbs   | 50 ++--
 .../templates/common/widget/gauge_widget.hbs| 14 +++---
 .../templates/common/widget/graph_widget.hbs| 14 +++---
 .../templates/common/widget/number_widget.hbs   | 14 +++---
 .../templates/common/widget/template_widget.hbs | 14 +++---
 5 files changed, 57 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/727f550f/ambari-web/app/templates/common/modal_popups/widget_browser_popup.hbs
--
diff --git 
a/ambari-web/app/templates/common/modal_popups/widget_browser_popup.hbs 
b/ambari-web/app/templates/common/modal_popups/widget_browser_popup.hbs
index 5628cf0..aa26488 100644
--- a/ambari-web/app/templates/common/modal_popups/widget_browser_popup.hbs
+++ b/ambari-web/app/templates/common/modal_popups/widget_browser_popup.hbs
@@ -20,11 +20,13 @@
   {{#if view.isLoaded}}
 div class=widget-browser-content
   !--Create new widget button--
-  div class=btn-group pull-right
-button type=button class=btn btn-primary {{action createWidget 
target=view}} 
-  i class=icon-plus/i nbsp; {{t dashboard.widgets.create}}
-/button
-  /div
+  {{#isAccessible ADMIN}}
+div class=btn-group pull-right
+  button type=button class=btn btn-primary {{action 
createWidget target=view}} 
+i class=icon-plus/i nbsp; {{t dashboard.widgets.create}}
+  /button
+/div
+  {{/isAccessible}}
 
   !--Filters bar: service name filter, status filter here--
   ul id=services-filter-bar class=nav nav-tabs
@@ -62,27 +64,25 @@
 i class=icon-ok/i nbsp; {{t 
dashboard.widgets.browser.action.added}}
 /button
   {{else}}
-button class=btn btn-default dropdown-toggle 
data-toggle=dropdown
-  {{t common.more}}span class=caret/span
-/button
-ul class=dropdown-menu
-  li
-a href=# {{action deleteWidget widget 
target=controller}}
-  {{t dashboard.widgets.browser.action.delete}}
-/a
-  /li
-  li
-{{#if widget.isShared}}
-  a href=# {{action unshareWidget widget 
target=controller}}
-{{t dashboard.widgets.browser.action.unshare}}
-  /a
-{{else}}
-  a href=# {{action shareWidget widget 
target=controller}}
-{{t dashboard.widgets.browser.action.share}}
+{{#isAccessible ADMIN}}
+  button class=btn btn-default dropdown-toggle 
data-toggle=dropdown
+{{t common.more}}span class=caret/span
+  /button
+  ul class=dropdown-menu
+li
+  a href=# {{action deleteWidget widget 
target=controller}}
+{{t dashboard.widgets.browser.action.delete}}
   /a
-{{/if}}
-  /li
-/ul
+/li
+li
+  {{#unless widget.isShared}}
+a href=# {{action shareWidget widget 
target=controller}}
+  {{t dashboard.widgets.browser.action.share}}
+/a
+  {{/unless}}
+/li
+  /ul
+{{/isAccessible}}
 button type=button class=btn btn-default {{action 
addWidget widget target=controller}} 
   {{t dashboard.widgets.browser.action.add}}
 /button

http://git-wip-us.apache.org/repos/asf/ambari/blob/727f550f/ambari-web/app/templates/common/widget/gauge_widget.hbs

[1/2] ambari git commit: AMBARI-10871. Ambari Views. CapSch View, config elements for ordering policies (alexantonenko)

2015-05-01 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 2c7e0340c - 968ff91d9


http://git-wip-us.apache.org/repos/asf/ambari/blob/968ff91d/contrib/views/capacity-scheduler/src/main/resources/ui/app/serializers.js
--
diff --git 
a/contrib/views/capacity-scheduler/src/main/resources/ui/app/serializers.js 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/serializers.js
index a746eb8..4dfb5e5 100644
--- a/contrib/views/capacity-scheduler/src/main/resources/ui/app/serializers.js
+++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/serializers.js
@@ -82,36 +82,32 @@ App.SerializerMixin = Em.Mixin.create({
 return this.extractSave(store, type, payload);
   },
   extractQueue: function(data, props) {
-var q = { name: data.name, parentPath: data.parentPath, depth: data.depth 
};
-var prefix = this.PREFIX;
-
-if (q.parentPath == null || q.parentPath.length == 0){
-q.path = q.name;
-  } else {
-q.path = q.parentPath + '.' + q.name;
-  }
-q.id = q.path.dasherize();
-
-var base_path = prefix + . + q.path;
-
-var labelsPath =base_path + .accessible-node-labels;
-var qLabels;
-
-q.unfunded_capacity =   props[base_path + .unfunded.capacity] || 
null;
-
-q.state =   props[base_path + .state] || null;
-q.acl_administer_queue =props[base_path + .acl_administer_queue] 
|| null;
-q.acl_submit_applications = props[base_path + 
.acl_submit_applications] || null;
-
-q.capacity =(props[base_path + 
.capacity])?+props[base_path + .capacity]:null;
-q.maximum_capacity =(props[base_path + 
.maximum-capacity])?+props[base_path + .maximum-capacity]:null;
-
-q.user_limit_factor =   (props[base_path + 
.user-limit-factor])?+props[base_path + .user-limit-factor]:null;
-q.minimum_user_limit_percent =  (props[base_path + 
.minimum-user-limit-percent])?+props[base_path + 
.minimum-user-limit-percent]:null;
-q.maximum_applications =(props[base_path + 
.maximum-applications])?+props[base_path + .maximum-applications]:null;
-q.maximum_am_resource_percent = (props[base_path + 
.maximum-am-resource-percent])?+props[base_path + 
.maximum-am-resource-percent]:null;
-
-//TODO what if didn't set??
+var path = (data.parentPath == null || data.parentPath.length == 
0)?data.name:[data.parentPath, data.name].join('.'),
+base_path = this.PREFIX + . + path,
+labelsPath = base_path + .accessible-node-labels,
+q = {
+  id: path.toLowerCase(),
+  name: data.name,
+  path: path,
+  parentPath: data.parentPath,
+  depth: data.depth,
+  //sort queue list to avoid of parsing different sorting as changed 
value
+  queues:(props[base_path + .queues] || 
'').split(',').sort().join(',') || null,
+  unfunded_capacity: props[base_path + 
.unfunded.capacity] || null,
+  state: props[base_path + .state] || null,
+  acl_administer_queue:  props[base_path + 
.acl_administer_queue] || null,
+  acl_submit_applications:   props[base_path + 
.acl_submit_applications] || null,
+  capacity:  (props[base_path + 
.capacity])?+props[base_path + .capacity]:null,
+  maximum_capacity:  (props[base_path + 
.maximum-capacity])?+props[base_path + .maximum-capacity]:null,
+  user_limit_factor: (props[base_path + 
.user-limit-factor])?+props[base_path + .user-limit-factor]:null,
+  minimum_user_limit_percent:(props[base_path + 
.minimum-user-limit-percent])?+props[base_path + 
.minimum-user-limit-percent]:null,
+  maximum_applications:  (props[base_path + 
.maximum-applications])?+props[base_path + .maximum-applications]:null,
+  maximum_am_resource_percent:   (props[base_path + 
.maximum-am-resource-percent])?+props[base_path + 
.maximum-am-resource-percent]*100:null, // convert to percent
+  ordering_policy:   props[base_path + .ordering-policy] 
|| null,
+  enable_size_based_weight:  props[base_path + 
.ordering-policy.fair.enable-size-based-weight] || null,
+  default_node_label_expression: props[base_path + 
.default-node-label-expression] || null,
+  labelsEnabled: props.hasOwnProperty(labelsPath)
+};
 
 switch ((props.hasOwnProperty(labelsPath))?props[labelsPath]:'') {
   case '*':
@@ -133,28 +129,22 @@ App.SerializerMixin = Em.Mixin.create({
   return [q.id,labelName].join('.');
 }.bind(this)).compact();
 break;
-
 }
 
-if (q.maximum_am_resource_percent)
-  q.maximum_am_resource_percent = q.maximum_am_resource_percent*100; // 
convert to percent
-
-q.queues = props[prefix + . + q.path + .queues] || 

ambari git commit: AMBARI-10875. Kerberos Identity data is empty when Cluster.security_type != KERBEROS (rlevas)

2015-05-01 Thread rlevas
Repository: ambari
Updated Branches:
  refs/heads/trunk fea608d05 - c7d6fcbc5


AMBARI-10875. Kerberos Identity data is empty when Cluster.security_type != 
KERBEROS (rlevas)


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

Branch: refs/heads/trunk
Commit: c7d6fcbc5311301b9478e4305e612f5e72df20c4
Parents: fea608d
Author: Robert Levas rle...@hortonworks.com
Authored: Fri May 1 12:37:32 2015 -0400
Committer: Robert Levas rle...@hortonworks.com
Committed: Fri May 1 12:37:32 2015 -0400

--
 .../server/controller/KerberosHelper.java   | 118 +
 .../server/controller/KerberosHelperTest.java   | 251 ++-
 2 files changed, 191 insertions(+), 178 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c7d6fcbc/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
index b131c4c..5da61c1 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
@@ -2039,83 +2039,81 @@ public class KerberosHelper {
 
 MapString, CollectionKerberosIdentityDescriptor activeIdentities = new 
HashMapString, CollectionKerberosIdentityDescriptor();
 
-if (isClusterKerberosEnabled(cluster)) {
-  CollectionString hosts;
+CollectionString hosts;
 
-  if (hostName == null) {
-MapString, Host hostMap = clusters.getHostsForCluster(clusterName);
-if (hostMap == null) {
-  hosts = null;
-} else {
-  hosts = hostMap.keySet();
-}
+if (hostName == null) {
+  MapString, Host hostMap = clusters.getHostsForCluster(clusterName);
+  if (hostMap == null) {
+hosts = null;
   } else {
-hosts = Collections.singleton(hostName);
+hosts = hostMap.keySet();
   }
+} else {
+  hosts = Collections.singleton(hostName);
+}
 
-  if ((hosts != null)  !hosts.isEmpty()) {
-KerberosDescriptor kerberosDescriptor = getKerberosDescriptor(cluster);
+if ((hosts != null)  !hosts.isEmpty()) {
+  KerberosDescriptor kerberosDescriptor = getKerberosDescriptor(cluster);
 
-if (kerberosDescriptor != null) {
-  MapString, String kerberosDescriptorProperties = 
kerberosDescriptor.getProperties();
+  if (kerberosDescriptor != null) {
+MapString, String kerberosDescriptorProperties = 
kerberosDescriptor.getProperties();
 
-  for (String hostname : hosts) {
-MapString, KerberosIdentityDescriptor hostActiveIdentities = new 
HashMapString, KerberosIdentityDescriptor();
-ListKerberosIdentityDescriptor identities = 
getActiveIdentities(cluster, hostname, serviceName, componentName, 
kerberosDescriptor);
+for (String hostname : hosts) {
+  MapString, KerberosIdentityDescriptor hostActiveIdentities = new 
HashMapString, KerberosIdentityDescriptor();
+  ListKerberosIdentityDescriptor identities = 
getActiveIdentities(cluster, hostname, serviceName, componentName, 
kerberosDescriptor);
 
-if (!identities.isEmpty()) {
-  // Calculate the current host-specific configurations. These 
will be used to replace
-  // variables within the Kerberos descriptor data
-  MapString, MapString, String configurations = 
calculateConfigurations(cluster, hostname, kerberosDescriptorProperties);
+  if (!identities.isEmpty()) {
+// Calculate the current host-specific configurations. These will 
be used to replace
+// variables within the Kerberos descriptor data
+MapString, MapString, String configurations = 
calculateConfigurations(cluster, hostname, kerberosDescriptorProperties);
 
-  for (KerberosIdentityDescriptor identity : identities) {
-KerberosPrincipalDescriptor principalDescriptor = 
identity.getPrincipalDescriptor();
-String principal = null;
+for (KerberosIdentityDescriptor identity : identities) {
+  KerberosPrincipalDescriptor principalDescriptor = 
identity.getPrincipalDescriptor();
+  String principal = null;
 
-if (principalDescriptor != null) {
-  principal = 
KerberosDescriptor.replaceVariables(principalDescriptor.getValue(), 
configurations);
+  if (principalDescriptor 

ambari git commit: AMBARI-10747 [WinTP2] Ambari server: HDPWIN stack - Ensure the specific hadoop users can be domain users

2015-05-01 Thread fbarca
Repository: ambari
Updated Branches:
  refs/heads/trunk 99d96d15c - 77e4d50c8


AMBARI-10747 [WinTP2] Ambari server: HDPWIN stack - Ensure the specific hadoop 
users can be domain users

Taking corrective action to switch the hadoop user to domain\hadoop for each 
active service after installation.


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

Branch: refs/heads/trunk
Commit: 77e4d50c8c4c73ee446f01b05ea1d1d17567197b
Parents: 99d96d1
Author: Florian Barca fba...@hortonworks.com
Authored: Fri May 1 10:37:04 2015 -0700
Committer: Florian Barca fba...@hortonworks.com
Committed: Fri May 1 10:37:04 2015 -0700

--
 .../core/providers/__init__.py  |   2 +
 .../core/providers/service.py   |   3 +
 .../core/providers/windows/service.py   | 211 ---
 .../core/resources/service.py   |  15 +-
 .../libraries/functions/install_hdp_msi.py  |  16 +-
 .../functions/windows_service_utils.py  |  38 ++--
 .../libraries/script/script.py  |   3 +-
 .../ambari_server/dbConfiguration_windows.py|   3 -
 .../main/python/ambari_server/serverSetup.py|   4 +-
 .../Ambari-DDL-SQLServer-CREATELOCAL.sql|   1 +
 .../AMBARI_METRICS/0.1.0/package/scripts/ams.py |  17 +-
 .../0.1.0/package/scripts/params_windows.py |   4 +
 .../FALCON/0.5.0.2.1/package/scripts/falcon.py  |   4 +
 .../0.5.0.2.1/package/scripts/status_params.py  |   2 +
 .../FLUME/1.4.0.2.0/package/scripts/flume.py|   7 +
 .../1.4.0.2.0/package/scripts/params_windows.py |   6 +-
 .../HBASE/0.96.0.2.0/package/scripts/hbase.py   |   8 +
 .../package/scripts/params_windows.py   |  10 +-
 .../HDFS/2.1.0.2.0/package/scripts/hdfs.py  |   7 +
 .../2.1.0.2.0/package/scripts/journalnode.py|   2 +-
 .../HDFS/2.1.0.2.0/package/scripts/namenode.py  |   6 +-
 .../2.1.0.2.0/package/scripts/params_windows.py |  11 +-
 .../2.1.0.2.0/package/scripts/status_params.py  |   1 +
 .../2.1.0.2.0/package/scripts/zkfc_slave.py |   2 +-
 .../HIVE/0.12.0.2.0/package/scripts/hive.py |   8 +
 .../package/scripts/params_windows.py   |  15 +-
 .../HIVE/0.12.0.2.0/package/scripts/webhcat.py  |   5 +
 .../KNOX/0.5.0.2.2/package/scripts/knox.py  |   9 +-
 .../KNOX/0.5.0.2.2/package/scripts/knox_ldap.py |  21 +-
 .../0.5.0.2.2/package/scripts/params_windows.py |   5 +-
 .../OOZIE/4.0.0.2.0/package/scripts/oozie.py|  22 +-
 .../4.0.0.2.0/package/scripts/params_windows.py |   3 +-
 .../package/scripts/params_windows.py   |   5 +-
 .../package/scripts/params_windows.py   |   5 +-
 .../STORM/0.9.1.2.1/package/scripts/nimbus.py   |   3 +-
 .../0.9.1.2.1/package/scripts/params_windows.py |   9 +-
 .../STORM/0.9.1.2.1/package/scripts/storm.py|  20 +-
 .../0.9.1.2.1/package/scripts/supervisor.py |   2 +-
 .../0.9.1.2.1/package/scripts/ui_server.py  |   2 +-
 .../0.4.0.2.1/package/scripts/params_windows.py |   3 +-
 .../2.1.0.2.0/package/scripts/params_windows.py |   9 +-
 .../YARN/2.1.0.2.0/package/scripts/service.py   |   3 +-
 .../2.1.0.2.0/package/scripts/status_params.py  |  12 +-
 .../YARN/2.1.0.2.0/package/scripts/yarn.py  |   8 +
 .../3.4.5.2.0/package/scripts/params_windows.py |   3 +-
 .../3.4.5.2.0/package/scripts/zookeeper.py  |   6 +
 .../2.1/hooks/after-INSTALL/scripts/params.py   |   3 +-
 .../2.1/hooks/before-START/scripts/params.py|   2 +-
 .../ambari/server/upgrade/UpgradeTest.java  |  12 +-
 .../hooks/before-START/test_before_start.py |   1 +
 50 files changed, 463 insertions(+), 116 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/77e4d50c/ambari-common/src/main/python/resource_management/core/providers/__init__.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/core/providers/__init__.py 
b/ambari-common/src/main/python/resource_management/core/providers/__init__.py
index b7f94e5..0cefd12 100644
--- 
a/ambari-common/src/main/python/resource_management/core/providers/__init__.py
+++ 
b/ambari-common/src/main/python/resource_management/core/providers/__init__.py
@@ -55,6 +55,7 @@ PROVIDERS = dict(
   ),
   winsrv=dict(
 
Service=resource_management.core.providers.windows.service.ServiceProvider,
+
ServiceConfig=resource_management.core.providers.windows.service.ServiceConfigProvider,
 
Execute=resource_management.core.providers.windows.system.ExecuteProvider,
 File=resource_management.core.providers.windows.system.FileProvider,
 
Directory=resource_management.core.providers.windows.system.DirectoryProvider
@@ -69,6 +70,7 

ambari git commit: AMBARI-10853. Initial service definition for Atlas (Jon Maron via smohanty)

2015-05-01 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/trunk c7d6fcbc5 - 91b782011


AMBARI-10853. Initial service definition for Atlas (Jon Maron via smohanty)


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

Branch: refs/heads/trunk
Commit: 91b78201181af4c2e316f49ac6a806b76c77d46e
Parents: c7d6fcb
Author: Sumit Mohanty smoha...@hortonworks.com
Authored: Fri May 1 09:51:13 2015 -0700
Committer: Sumit Mohanty smoha...@hortonworks.com
Committed: Fri May 1 09:51:19 2015 -0700

--
 .../ATLAS/0.1.0.2.3.0.0/alerts.json |  60 ++
 .../configuration/application-properties.xml| 190 +++
 .../configuration/metadata-env.xml  |  94 +
 .../ATLAS/0.1.0.2.3.0.0/kerberos.json   |  59 ++
 .../ATLAS/0.1.0.2.3.0.0/metainfo.xml|  79 
 .../ATLAS/0.1.0.2.3.0.0/package/files/log4j.xml |  85 +
 .../0.1.0.2.3.0.0/package/scripts/metadata.py   |  96 ++
 .../package/scripts/metadata_server.py  |  69 +++
 .../0.1.0.2.3.0.0/package/scripts/params.py |  80 
 .../package/scripts/properties_config.py|  33 
 .../package/scripts/service_check.py|  57 ++
 .../package/scripts/status_params.py|  36 
 .../stacks/HDP/2.3/role_command_order.json  |   3 +-
 .../stacks/HDP/2.3/services/ATLAS/metainfo.xml  |  45 +
 .../stacks/2.3/ATLAS/test_metadata_server.py| 124 
 .../test/python/stacks/2.3/configs/default.json |  39 +++-
 16 files changed, 1147 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/91b78201/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3.0.0/alerts.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3.0.0/alerts.json
 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3.0.0/alerts.json
new file mode 100644
index 000..7202950
--- /dev/null
+++ 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3.0.0/alerts.json
@@ -0,0 +1,60 @@
+{
+  ATLAS: {
+service: [],
+ATLAS_SERVER: [
+  {
+name: metadata_server_process,
+label: Atlas Metadata Server Process,
+description: This host-level alert is triggered if the individual 
Metadata server process cannot be established to be up and listening on the 
network.,
+interval: 1,
+scope: ANY,
+source: {
+  type: PORT,
+  uri: {{metadata-env/metadata_port}},
+  default_port: 21000,
+  reporting: {
+ok: {
+  text: TCP OK - {0:.3f}s response on port {1}
+},
+warning: {
+  text: TCP OK - {0:.3f}s response on port {1},
+  value: 1.5
+},
+critical: {
+  text: Connection failed: {0} to {1}:{2},
+  value: 5.0
+}
+  }
+}
+  },
+  {
+name: metadata_server_webui,
+label: Metadata Server Web UI,
+description: This host-level alert is triggered if the Metadata 
Server Web UI is unreachable.,
+interval: 1,
+scope: ANY,
+enabled: true,
+source: {
+  type: WEB,
+  uri: {
+http: {{metadata-env/metadata_port}},
+default_port: 21000,
+kerberos_keytab: 
{{metadata-runtime.properties/*.metadata.http.authentication.keytab}},
+kerberos_principal: 
{{metadata-runtime.properties/*.metadata.http.authentication.principal}}
+  },
+  reporting: {
+ok: {
+  text: HTTP {0} response in {2:.3f}s
+},
+warning:{
+  text: HTTP {0} response from {1} in {2:.3f}s ({3})
+},
+critical: {
+  text: Connection failed to {1} ({3})
+}
+  }
+}
+  }
+]
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/91b78201/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3.0.0/configuration/application-properties.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3.0.0/configuration/application-properties.xml
 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3.0.0/configuration/application-properties.xml
new file mode 100644
index 000..e774f3b
--- /dev/null
+++ 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3.0.0/configuration/application-properties.xml
@@ -0,0 +1,190 @@

ambari git commit: AMBARI-10170. Full Delete of Host : Fix UpgradeCatalogs to handle host-related changes in 1.6.1, 1.7.0, and 2.0.0 after refactoring Entity models (alejandro)

2015-05-01 Thread alejandro
Repository: ambari
Updated Branches:
  refs/heads/trunk 91b782011 - 99d96d15c


AMBARI-10170. Full Delete of Host : Fix UpgradeCatalogs to handle host-related 
changes in 1.6.1, 1.7.0, and 2.0.0 after refactoring Entity models (alejandro)


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

Branch: refs/heads/trunk
Commit: 99d96d15c90ff11f1483d63c48194e31c54bf83e
Parents: 91b7820
Author: Alejandro Fernandez afernan...@hortonworks.com
Authored: Thu Apr 30 15:00:31 2015 -0700
Committer: Alejandro Fernandez afernan...@hortonworks.com
Committed: Fri May 1 10:18:43 2015 -0700

--
 .../server/upgrade/AbstractUpgradeCatalog.java  | 19 +---
 .../server/upgrade/SchemaUpgradeHelper.java | 46 +++---
 .../ambari/server/upgrade/UpgradeCatalog.java   | 13 ++---
 .../server/upgrade/UpgradeCatalog150.java   | 16 +++---
 .../server/upgrade/UpgradeCatalog151.java   | 15 +++---
 .../server/upgrade/UpgradeCatalog160.java   | 15 +++---
 .../server/upgrade/UpgradeCatalog161.java   | 15 +++---
 .../server/upgrade/UpgradeCatalog170.java   | 15 +++---
 .../server/upgrade/UpgradeCatalog200.java   | 15 +++---
 .../server/upgrade/UpgradeCatalog210.java   | 28 ++-
 .../server/upgrade/UpgradeCatalog210Test.java   | 25 +++---
 .../server/upgrade/UpgradeCatalogTest.java  | 51 ++--
 .../ambari/server/upgrade/UpgradeTest.java  |  2 +
 13 files changed, 121 insertions(+), 154 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/99d96d15/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
index 940be93..ec63512 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
@@ -91,11 +91,6 @@ public abstract class AbstractUpgradeCatalog implements 
UpgradeCatalog {
 return null;
   }
 
-  @Override
-  public String[] getCompatibleVersions() {
-return null;
-  }
-
   protected static UpgradeCatalog getUpgradeCatalog(String version) {
 return upgradeCatalogMap.get(version);
   }
@@ -229,7 +224,7 @@ public abstract class AbstractUpgradeCatalog implements 
UpgradeCatalog {
* If xml owner service is not in the cluster, the configuration won't be 
added.
*
* @param configType Configuration type. (hdfs-site, etc.)
-   * @param properties Set property names.
+   * @param propertyNames Set property names.
*/
   protected void updateConfigurationPropertiesWithValuesFromXml(String 
configType,
   SetString propertyNames, boolean updateIfExists, boolean 
createNewConfigType) throws AmbariException {
@@ -377,6 +372,11 @@ public abstract class AbstractUpgradeCatalog implements 
UpgradeCatalog {
   }
 
   @Override
+  public void preUpgradeData() throws AmbariException, SQLException {
+executePreDMLUpdates();
+  }
+
+  @Override
   public void upgradeData() throws AmbariException, SQLException {
 executeDMLUpdates();
 updateMetaInfoVersion(getTargetVersion());
@@ -384,6 +384,13 @@ public abstract class AbstractUpgradeCatalog implements 
UpgradeCatalog {
 
   protected abstract void executeDDLUpdates() throws AmbariException, 
SQLException;
 
+  /**
+   * Perform data insertion before running normal upgrade of data, requires 
started persist service
+   * @throws AmbariException
+   * @throws SQLException
+   */
+  protected abstract void executePreDMLUpdates() throws AmbariException, 
SQLException;
+
   protected abstract void executeDMLUpdates() throws AmbariException, 
SQLException;
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/99d96d15/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
index 1d6095b..a8f719a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
@@ -151,33 +151,6 @@ public class SchemaUpgradeHelper {
   }
 
   /**
-   * Determine if the class definitions in the target version 

[2/2] ambari git commit: AMBARI-10889. Create data access layer for new Ambari Topology Manager state. (swagle)

2015-05-01 Thread swagle
AMBARI-10889. Create data access layer for new Ambari Topology Manager state. 
(swagle)


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

Branch: refs/heads/trunk
Commit: 89711d74312553a8f6f16f745d7542b40081c5d1
Parents: 77e4d50
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri May 1 12:59:13 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri May 1 13:00:57 2015 -0700

--
 .../server/orm/dao/TopologyHostGroupDAO.java|  62 +++
 .../server/orm/dao/TopologyHostRequestDAO.java  |  62 +++
 .../orm/dao/TopologyLogicalRequestDAO.java  |  61 +++
 .../server/orm/dao/TopologyRequestDAO.java  |  76 +
 .../orm/entities/HostRoleCommandEntity.java |  11 ++
 .../orm/entities/TopologyHostGroupEntity.java   | 128 ++
 .../orm/entities/TopologyHostInfoEntity.java| 114 +
 .../orm/entities/TopologyHostRequestEntity.java | 133 +++
 .../orm/entities/TopologyHostTaskEntity.java| 107 
 .../entities/TopologyLogicalRequestEntity.java  | 114 +
 .../orm/entities/TopologyLogicalTaskEntity.java | 109 
 .../orm/entities/TopologyRequestEntity.java | 167 +++
 .../server/upgrade/UpgradeCatalog210.java   |  98 ++-
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |  76 +
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |  76 +
 .../resources/Ambari-DDL-Postgres-CREATE.sql|  84 +-
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql |  91 +-
 .../src/main/resources/META-INF/persistence.xml |   7 +
 .../apache/ambari/server/orm/OrmTestHelper.java |   4 +-
 .../orm/dao/TopologyLogicalRequestDAOTest.java  | 155 +
 .../server/orm/dao/TopologyRequestDAOTest.java  | 119 +
 21 files changed, 1847 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/89711d74/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/TopologyHostGroupDAO.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/TopologyHostGroupDAO.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/TopologyHostGroupDAO.java
new file mode 100644
index 000..a11ec33
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/TopologyHostGroupDAO.java
@@ -0,0 +1,62 @@
+/**
+ * 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.
+ */
+package org.apache.ambari.server.orm.dao;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+import com.google.inject.Singleton;
+import com.google.inject.persist.Transactional;
+import org.apache.ambari.server.orm.RequiresSession;
+import org.apache.ambari.server.orm.entities.TopologyHostGroupEntity;
+
+import javax.persistence.EntityManager;
+import java.util.List;
+
+@Singleton
+public class TopologyHostGroupDAO {
+  @Inject
+  ProviderEntityManager entityManagerProvider;
+
+  @Inject
+  DaoUtils daoUtils;
+
+  @RequiresSession
+  public TopologyHostGroupEntity findById(Long id) {
+return entityManagerProvider.get().find(TopologyHostGroupEntity.class, id);
+  }
+
+  @RequiresSession
+  public ListTopologyHostGroupEntity findAll() {
+return daoUtils.selectAll(entityManagerProvider.get(), 
TopologyHostGroupEntity.class);
+  }
+
+  @Transactional
+  public void create(TopologyHostGroupEntity hostGroupEntity) {
+entityManagerProvider.get().persist(hostGroupEntity);
+  }
+
+  @Transactional
+  public TopologyHostGroupEntity merge(TopologyHostGroupEntity 
hostGroupEntity) {
+return entityManagerProvider.get().merge(hostGroupEntity);
+  }
+
+  @Transactional
+  public void remove(TopologyHostGroupEntity hostGroupEntity) {
+entityManagerProvider.get().remove(hostGroupEntity);
+  }
+}


[1/2] ambari git commit: AMBARI-10889. Create data access layer for new Ambari Topology Manager state. (swagle)

2015-05-01 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 77e4d50c8 - 89711d743


http://git-wip-us.apache.org/repos/asf/ambari/blob/89711d74/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/TopologyRequestDAOTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/TopologyRequestDAOTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/TopologyRequestDAOTest.java
new file mode 100644
index 000..b426c3f
--- /dev/null
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/TopologyRequestDAOTest.java
@@ -0,0 +1,119 @@
+/**
+ * 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.
+ */
+package org.apache.ambari.server.orm.dao;
+
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.persist.PersistService;
+import junit.framework.Assert;
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.orm.GuiceJpaInitializer;
+import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
+import org.apache.ambari.server.orm.OrmTestHelper;
+import org.apache.ambari.server.orm.entities.TopologyHostGroupEntity;
+import org.apache.ambari.server.orm.entities.TopologyHostInfoEntity;
+import org.apache.ambari.server.orm.entities.TopologyRequestEntity;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import static org.apache.ambari.server.orm.OrmTestHelper.CLUSTER_NAME;
+
+public class TopologyRequestDAOTest {
+  private Injector injector;
+  private TopologyRequestDAO requestDAO;
+  OrmTestHelper helper;
+  Long clusterId;
+
+  @Before
+  public void setup() throws Exception {
+injector = Guice.createInjector(new InMemoryDefaultTestModule());
+injector.getInstance(GuiceJpaInitializer.class);
+requestDAO = injector.getInstance(TopologyRequestDAO.class);
+helper = injector.getInstance(OrmTestHelper.class);
+clusterId = helper.createCluster();
+  }
+
+  @After
+  public void teardown() throws AmbariException {
+injector.getInstance(PersistService.class).stop();
+  }
+
+  private void create() {
+TopologyRequestEntity requestEntity = new TopologyRequestEntity();
+requestEntity.setAction(a1);
+requestEntity.setBlueprintName(bp1);
+requestEntity.setClusterAttributes(attributes);
+requestEntity.setClusterProperties(properties);
+requestEntity.setClusterName(CLUSTER_NAME);
+requestEntity.setDescription(description);
+TopologyHostGroupEntity hostGroupEntity = new TopologyHostGroupEntity();
+hostGroupEntity.setName(hg1);
+hostGroupEntity.setGroupAttributes(hg-attributes);
+hostGroupEntity.setGroupProperties(hg-properties);
+hostGroupEntity.setTopologyRequestEntity(requestEntity);
+
requestEntity.setTopologyHostGroupEntities(Collections.singletonList(hostGroupEntity));
+TopologyHostInfoEntity hostInfoEntity = new TopologyHostInfoEntity();
+hostInfoEntity.setTopologyHostGroupEntity(hostGroupEntity);
+
hostGroupEntity.setTopologyHostInfoEntities(Collections.singletonList(hostInfoEntity));
+hostInfoEntity.setFqdn(fqdn);
+hostInfoEntity.setHostCount(12);
+hostInfoEntity.setPredicate(predicate);
+
+requestDAO.create(requestEntity);
+  }
+
+  private void testRequestEntity(ListTopologyRequestEntity requestEntities) {
+Assert.assertEquals(1, requestEntities.size());
+TopologyRequestEntity requestEntity = requestEntities.iterator().next();
+Assert.assertEquals(a1, requestEntity.getAction());
+Assert.assertEquals(bp1, requestEntity.getBlueprintName());
+Assert.assertEquals(attributes, requestEntity.getClusterAttributes());
+Assert.assertEquals(properties, requestEntity.getClusterProperties());
+Assert.assertEquals(description, requestEntity.getDescription());
+CollectionTopologyHostGroupEntity hostGroupEntities = 
requestEntity.getTopologyHostGroupEntities();
+Assert.assertEquals(1, hostGroupEntities.size());
+TopologyHostGroupEntity hostGroupEntity = 
hostGroupEntities.iterator().next();
+Assert.assertEquals(hg1, 

ambari git commit: AMBARI-10879: If hostname used by agents is upper-case or mixed-case then upgrading to Ambari-2.0 may create issues (jluniya)

2015-05-01 Thread jluniya
Repository: ambari
Updated Branches:
  refs/heads/trunk 968ff91d9 - 53c5b621a


AMBARI-10879: If hostname used by agents is upper-case or mixed-case then 
upgrading to Ambari-2.0 may create issues (jluniya)


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

Branch: refs/heads/trunk
Commit: 53c5b621a80fcd1ff6450948875071938f063419
Parents: 968ff91
Author: Jayush Luniya jlun...@hortonworks.com
Authored: Fri May 1 01:22:46 2015 -0700
Committer: Jayush Luniya jlun...@hortonworks.com
Committed: Fri May 1 01:22:46 2015 -0700

--
 .../src/main/python/ambari_agent/hostname.py| 18 ++--
 .../server/upgrade/UpgradeCatalog210.java   | 86 +---
 2 files changed, 80 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/53c5b621/ambari-agent/src/main/python/ambari_agent/hostname.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/hostname.py 
b/ambari-agent/src/main/python/ambari_agent/hostname.py
index e33b739..9c03d98 100644
--- a/ambari-agent/src/main/python/ambari_agent/hostname.py
+++ b/ambari-agent/src/main/python/ambari_agent/hostname.py
@@ -45,11 +45,12 @@ def hostname(config):
   if (0 == osStat.returncode and 0 != len(out.strip())):
 cached_hostname = out.strip()
   else:
-cached_hostname = socket.getfqdn().lower()
+cached_hostname = socket.getfqdn()
 except:
-  cached_hostname = socket.getfqdn().lower()
+  cached_hostname = socket.getfqdn()
   except:
-cached_hostname = socket.getfqdn().lower()
+cached_hostname = socket.getfqdn()
+  cached_hostname = cached_hostname.lower()
   return cached_hostname
 
 
@@ -66,7 +67,7 @@ def public_hostname(config):
   output = subprocess.Popen(scriptname, stdout=subprocess.PIPE, 
stderr=subprocess.PIPE, shell=True)
   out, err = output.communicate()
   if (0 == output.returncode and 0 != len(out.strip())):
-cached_public_hostname = out.strip()
+cached_public_hostname = out.strip().lower()
 logger.info(Read public hostname ' + cached_public_hostname + ' 
using agent:public_hostname_script)
 return cached_public_hostname
   except:
@@ -76,14 +77,7 @@ def public_hostname(config):
 +  :out  + out +  :err  + err)
 logger.info(Defaulting to fqdn.)
 
-  # future - do an agent entry for this too
-  try:
-handle = 
urllib2.urlopen('http://169.254.169.254/latest/meta-data/public-hostname', '', 
2)
-str = handle.read()
-handle.close()
-cached_public_hostname = str
-  except Exception, e:
-cached_public_hostname = socket.getfqdn().lower()
+  cached_public_hostname = socket.getfqdn().lower()
   return cached_public_hostname
 
 def server_hostname(config):

http://git-wip-us.apache.org/repos/asf/ambari/blob/53c5b621/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
index c7866db..d376cd6 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java
@@ -74,8 +74,11 @@ public class UpgradeCatalog210 extends 
AbstractUpgradeCatalog {
   private static final String VIEW_PARAMETER_TABLE = viewparameter;
   private static final String STACK_TABLE = stack;
   private static final String REPO_VERSION_TABLE = repo_version;
+  private static final String ALERT_HISTORY_TABLE = alert_history;
 
   private static final String HOST_ID_COL = host_id;
+  private static final String HOST_NAME_COL = host_name;
+  private static final String PUBLIC_HOST_NAME_COL = public_host_name;
 
   // constants for stack table changes
   private static final String STACK_ID_COLUMN_NAME = stack_id;
@@ -371,16 +374,16 @@ public class UpgradeCatalog210 extends 
AbstractUpgradeCatalog {
  ADD CONSTRAINT serviceconfighosts_pkey PRIMARY KEY 
(service_config_id, host_id));
 
 // Finish by deleting the unnecessary host_name columns.
-dbAccessor.dropColumn(CONFIG_GROUP_HOST_MAPPING_TABLE, host_name);
-dbAccessor.dropColumn(CLUSTER_HOST_MAPPING_TABLE, host_name);
-dbAccessor.dropColumn(HOST_CONFIG_MAPPING_TABLE, host_name);
-dbAccessor.dropColumn(HOST_COMPONENT_STATE_TABLE, host_name);
-dbAccessor.dropColumn(HOST_COMPONENT_DESIRED_STATE_TABLE, host_name);
-

ambari git commit: AMBARI-10890. Report cpu_steal percent with cpu metrics. (swagle)

2015-05-01 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 89711d743 - 7fc85761a


AMBARI-10890. Report cpu_steal percent with cpu metrics. (swagle)


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

Branch: refs/heads/trunk
Commit: 7fc85761a203f3279e87209f62348a8a0505f551
Parents: 89711d7
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri May 1 14:27:54 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri May 1 14:27:54 2015 -0700

--
 .../src/main/python/core/host_info.py   | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7fc85761/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
--
diff --git 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
index 057b5b6..e102c11 100644
--- 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
+++ 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
@@ -65,6 +65,7 @@ class HostInfo():
   'cpu_wio': number2percents(cpu_times.iowait) if hasattr(cpu_times, 
'iowait') else 0,
   'cpu_intr': number2percents(cpu_times.irq) if hasattr(cpu_times, 'irq') 
else 0,
   'cpu_sintr': number2percents(cpu_times.softirq) if hasattr(cpu_times, 
'softirq') else 0
+  'cpu_steal': number2percents(cpu_times.steal) if hasattr(cpu_times, 
'steal') else 0
 }
 if platform.system() != Windows:
   load_avg = os.getloadavg()



ambari git commit: AMBARI-10890. Report cpu_steal percent with cpu metrics. Typo fix. (swagle)

2015-05-01 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 7fc85761a - 0670e953a


AMBARI-10890. Report cpu_steal percent with cpu metrics. Typo fix. (swagle)


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

Branch: refs/heads/trunk
Commit: 0670e953a8b820163e546b21ce5cb40248986966
Parents: 7fc8576
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri May 1 14:29:39 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri May 1 14:29:39 2015 -0700

--
 .../src/main/python/core/host_info.py  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0670e953/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
--
diff --git 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
index e102c11..41f6a0a 100644
--- 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
+++ 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
@@ -64,7 +64,7 @@ class HostInfo():
   'cpu_nice': number2percents(cpu_times.nice) if hasattr(cpu_times, 
'nice') else 0,
   'cpu_wio': number2percents(cpu_times.iowait) if hasattr(cpu_times, 
'iowait') else 0,
   'cpu_intr': number2percents(cpu_times.irq) if hasattr(cpu_times, 'irq') 
else 0,
-  'cpu_sintr': number2percents(cpu_times.softirq) if hasattr(cpu_times, 
'softirq') else 0
+  'cpu_sintr': number2percents(cpu_times.softirq) if hasattr(cpu_times, 
'softirq') else 0,
   'cpu_steal': number2percents(cpu_times.steal) if hasattr(cpu_times, 
'steal') else 0
 }
 if platform.system() != Windows:



ambari git commit: AMBARI-10874 - Pre-Upgrade Checks Should Know Which Stack They Are Valid (jonathanhurley)

2015-05-01 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/trunk 53c5b621a - fea608d05


AMBARI-10874 - Pre-Upgrade Checks Should Know Which Stack They Are Valid 
(jonathanhurley)


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

Branch: refs/heads/trunk
Commit: fea608d052a0538b3f7900ca785aa9d378a36dab
Parents: 53c5b62
Author: Jonathan Hurley jhur...@hortonworks.com
Authored: Fri May 1 09:33:22 2015 -0400
Committer: Jonathan Hurley jhur...@hortonworks.com
Committed: Fri May 1 09:33:37 2015 -0400

--
 .../server/checks/AbstractCheckDescriptor.java  |  68 +++-
 .../server/checks/ConfigurationMergeCheck.java  |   4 +
 .../checks/HostsMasterMaintenanceCheck.java |   4 +
 .../checks/HostsRepositoryVersionCheck.java |   4 +
 .../checks/SecondaryNamenodeDeletedCheck.java   |   4 +
 .../ServicesMapReduceDistributedCacheCheck.java |   5 +
 .../ServicesNamenodeHighAvailabilityCheck.java  |   4 +
 .../ServicesTezDistributedCacheCheck.java   |   7 +-
 .../checks/ServicesYarnWorkPreservingCheck.java |   4 +
 .../server/controller/PrereqCheckRequest.java   |  42 +
 .../PreUpgradeCheckResourceProvider.java|  41 -
 .../org/apache/ambari/server/state/StackId.java |  26 ++-
 .../server/checks/HostsHeartbeatCheckTest.java  |   9 +-
 .../checks/ServicesDecommissionCheckTest.java   |   9 +-
 .../ServicesMaintenanceModeCheckTest.java   |   9 +-
 .../server/checks/ServicesUpCheckTest.java  |   9 +-
 .../checks/UpgradeCheckStackVersionTest.java| 170 +++
 17 files changed, 401 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fea608d0/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
index 0666df7..1816ce8 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
@@ -29,6 +29,7 @@ import org.apache.ambari.server.orm.dao.RepositoryVersionDAO;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.ServiceInfo;
+import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.stack.PrereqCheckType;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
 import org.apache.ambari.server.state.stack.upgrade.RepositoryVersionHelper;
@@ -45,6 +46,8 @@ import com.google.inject.Provider;
 public abstract class AbstractCheckDescriptor {
 
   private static final Logger LOG = 
LoggerFactory.getLogger(AbstractCheckDescriptor.class);
+  private static final StackId STACK_HDP_22 = new StackId(HDP, 2.2);
+  private static final StackId STACK_HDP_23 = new StackId(HDP, 2.3);
 
   protected static final String DEFAULT = default;
 
@@ -75,18 +78,67 @@ public abstract class AbstractCheckDescriptor {
   }
 
   /**
-   * Tests if the prerequisite check is applicable to given cluster. By 
default returns true.
+   * Tests if the prerequisite check is applicable to given cluster. This
+   * method's defautl logic is to ensure that the cluster stack source and
+   * target are compatible with the prerequisite check. When overridding this
+   * method, call {@code super#isApplicable(PrereqCheckRequest)}.
*
-   * @param request prerequisite check request
+   * @param request
+   *  prerequisite check request
* @return true if check should be performed
*
-   * @throws org.apache.ambari.server.AmbariException if server error happens
+   * @throws org.apache.ambari.server.AmbariException
+   *   if server error happens
*/
   public boolean isApplicable(PrereqCheckRequest request) throws 
AmbariException {
+StackId sourceStackId = getSourceStack();
+StackId targetStackId = getTargetStack();
+
+if( null == sourceStackId  null == targetStackId ) {
+  return true;
+}
+
+StackId requestSourceStack = request.getSourceStackId();
+if (null != sourceStackId  null != requestSourceStack
+ sourceStackId.compareTo(requestSourceStack)  0) {
+  return false;
+}
+
+StackId requestTargetStack = request.getTargetStackId();
+if (null != targetStackId  null != requestTargetStack
+ targetStackId.compareTo(requestTargetStack)  0) {
+  return false;
+}
+
 return true;
   }
 
   /**
+   * Gets the