[3/3] ambari git commit: AMBARI-11844. HBase service: Open Connections and Request Handlers widgets does not display with HDP 2.2 stack deployment.

2015-06-10 Thread swagle
AMBARI-11844. HBase service: Open Connections and Request Handlers widgets does 
not display with HDP 2.2 stack deployment.


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

Branch: refs/heads/trunk
Commit: 0f71307494d982d6bad1825c2a5295e4e0ce7b64
Parents: 614fd80
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Wed Jun 10 09:53:36 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Wed Jun 10 09:53:36 2015 -0700

--
 .../HBASE/0.96.0.2.0/metrics.json   |6 +-
 .../stacks/HDP/2.3/services/HBASE/metrics.json  | 9410 ++
 2 files changed, 9413 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0f713074/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
index a309ec7..ae15651 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
@@ -372,17 +372,17 @@
   temporal: true
 },
 metrics/hbase/ipc/IPC/numOpenConnections: {
-  metric: regionserver.RegionServer.numOpenConnections,
+  metric: ipc.IPC.numOpenConnections,
   pointInTime: false,
   temporal: true
 },
 metrics/hbase/ipc/IPC/numActiveHandler: {
-  metric: regionserver.RegionServer.numActiveHandler,
+  metric: ipc.IPC.numActiveHandler,
   pointInTime: false,
   temporal: true
 },
 metrics/hbase/ipc/IPC/numCallsInGeneralQueue: {
-  metric: regionserver.RegionServer.numCallsInGeneralQueue,
+  metric: ipc.IPC.numCallsInGeneralQueue,
   pointInTime: false,
   temporal: true
 },



ambari git commit: AMBARI-11820. Deleting a shared widget still available on the dashboard of another user.

2015-06-09 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 1862126a0 - 8b535db8b


AMBARI-11820. Deleting a shared widget still available on the dashboard of 
another user.


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

Branch: refs/heads/trunk
Commit: 8b535db8bd50c05534b765c252d3bc0521640d71
Parents: 1862126
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Tue Jun 9 13:20:19 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Tue Jun 9 13:20:26 2015 -0700

--
 .../controller/internal/WidgetLayoutResourceProvider.java| 7 +++
 .../server/controller/internal/WidgetResourceProvider.java   | 8 
 2 files changed, 15 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8b535db8/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
index 7bee12c..67ccafd 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
@@ -355,6 +355,13 @@ public class WidgetLayoutResourceProvider extends 
AbstractControllerResourceProv
 }
 
 for (WidgetLayoutEntity entity: entitiesToBeRemoved) {
+  if (entity.getListWidgetLayoutUserWidgetEntity() != null) {
+for (WidgetLayoutUserWidgetEntity layoutUserWidgetEntity : 
entity.getListWidgetLayoutUserWidgetEntity()) {
+  if 
(layoutUserWidgetEntity.getWidget().getListWidgetLayoutUserWidgetEntity() != 
null) {
+
layoutUserWidgetEntity.getWidget().getListWidgetLayoutUserWidgetEntity().remove(layoutUserWidgetEntity);
+  }
+}
+  }
   widgetLayoutDAO.remove(entity);
 }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b535db8/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
index 64bb94c..897d7e8 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
@@ -37,6 +37,7 @@ import 
org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.orm.dao.WidgetDAO;
 import org.apache.ambari.server.orm.entities.PermissionEntity;
 import org.apache.ambari.server.orm.entities.WidgetEntity;
+import org.apache.ambari.server.orm.entities.WidgetLayoutUserWidgetEntity;
 import org.apache.ambari.server.security.authorization.AmbariGrantedAuthority;
 import org.apache.commons.lang.ObjectUtils;
 import org.apache.commons.lang.StringUtils;
@@ -346,6 +347,13 @@ public class WidgetResourceProvider extends 
AbstractControllerResourceProvider {
 }
 
 for (WidgetEntity entity: entitiesToBeRemoved) {
+  if (entity.getListWidgetLayoutUserWidgetEntity() != null) {
+for (WidgetLayoutUserWidgetEntity layoutUserWidgetEntity : 
entity.getListWidgetLayoutUserWidgetEntity()) {
+  if 
(layoutUserWidgetEntity.getWidgetLayout().getListWidgetLayoutUserWidgetEntity() 
!= null) {
+
layoutUserWidgetEntity.getWidgetLayout().getListWidgetLayoutUserWidgetEntity().remove(layoutUserWidgetEntity);
+  }
+}
+  }
   widgetDAO.remove(entity);
 }
 



ambari git commit: AMBARI-11820. Deleting a shared widget still available on the dashboard of another user.

2015-06-09 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 b94ba75e1 - ef7bcb686


AMBARI-11820. Deleting a shared widget still available on the dashboard of 
another user.


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

Branch: refs/heads/branch-2.1
Commit: ef7bcb6869be8012aae4999a9b7d159a3b343240
Parents: b94ba75
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Tue Jun 9 13:21:44 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Tue Jun 9 13:21:44 2015 -0700

--
 .../controller/internal/WidgetLayoutResourceProvider.java| 7 +++
 .../server/controller/internal/WidgetResourceProvider.java   | 8 
 2 files changed, 15 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7bcb68/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
index 7bee12c..67ccafd 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
@@ -355,6 +355,13 @@ public class WidgetLayoutResourceProvider extends 
AbstractControllerResourceProv
 }
 
 for (WidgetLayoutEntity entity: entitiesToBeRemoved) {
+  if (entity.getListWidgetLayoutUserWidgetEntity() != null) {
+for (WidgetLayoutUserWidgetEntity layoutUserWidgetEntity : 
entity.getListWidgetLayoutUserWidgetEntity()) {
+  if 
(layoutUserWidgetEntity.getWidget().getListWidgetLayoutUserWidgetEntity() != 
null) {
+
layoutUserWidgetEntity.getWidget().getListWidgetLayoutUserWidgetEntity().remove(layoutUserWidgetEntity);
+  }
+}
+  }
   widgetLayoutDAO.remove(entity);
 }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef7bcb68/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
index 64bb94c..897d7e8 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
@@ -37,6 +37,7 @@ import 
org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.orm.dao.WidgetDAO;
 import org.apache.ambari.server.orm.entities.PermissionEntity;
 import org.apache.ambari.server.orm.entities.WidgetEntity;
+import org.apache.ambari.server.orm.entities.WidgetLayoutUserWidgetEntity;
 import org.apache.ambari.server.security.authorization.AmbariGrantedAuthority;
 import org.apache.commons.lang.ObjectUtils;
 import org.apache.commons.lang.StringUtils;
@@ -346,6 +347,13 @@ public class WidgetResourceProvider extends 
AbstractControllerResourceProvider {
 }
 
 for (WidgetEntity entity: entitiesToBeRemoved) {
+  if (entity.getListWidgetLayoutUserWidgetEntity() != null) {
+for (WidgetLayoutUserWidgetEntity layoutUserWidgetEntity : 
entity.getListWidgetLayoutUserWidgetEntity()) {
+  if 
(layoutUserWidgetEntity.getWidgetLayout().getListWidgetLayoutUserWidgetEntity() 
!= null) {
+
layoutUserWidgetEntity.getWidgetLayout().getListWidgetLayoutUserWidgetEntity().remove(layoutUserWidgetEntity);
+  }
+}
+  }
   widgetDAO.remove(entity);
 }
 



ambari git commit: AMBARI-11744. Ambari Server deadlocks when adding service / adding host. (swagle)

2015-06-06 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/branch-2.0.maint 7c439a268 - d9cffc309


AMBARI-11744. Ambari Server deadlocks when adding service / adding host. 
(swagle)


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

Branch: refs/heads/branch-2.0.maint
Commit: d9cffc309a55861bf6cd70401afed6889dd42ea4
Parents: 7c439a2
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri Jun 5 20:33:33 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri Jun 5 20:33:33 2015 -0700

--
 .../internal/ConfigGroupResourceProvider.java   |   4 +-
 .../state/configgroup/ConfigGroupImpl.java  | 113 ++-
 2 files changed, 61 insertions(+), 56 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d9cffc30/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
index 3fcb84b..f4893cd 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
@@ -523,9 +523,7 @@ public class ConfigGroupResourceProvider extends
 return configGroupResponses;
   }
 
-  private synchronized void updateConfigGroups
-(SetConfigGroupRequest requests) throws AmbariException {
-
+  private synchronized void updateConfigGroups (SetConfigGroupRequest 
requests) throws AmbariException {
 if (requests.isEmpty()) {
   LOG.warn(Received an empty requests set);
   return;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d9cffc30/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
index 9ec0370..ea3c406 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
@@ -312,18 +312,23 @@ public class ConfigGroupImpl implements ConfigGroup {
 
   @Override
   public void persist() {
-readWriteLock.writeLock().lock();
+cluster.getClusterGlobalLock().writeLock().lock();
 try {
-  if (!isPersisted) {
-persistEntities();
-refresh();
-cluster.refresh();
-isPersisted = true;
-  } else {
-saveIfPersisted();
+  readWriteLock.writeLock().lock();
+  try {
+if (!isPersisted) {
+  persistEntities();
+  refresh();
+  cluster.refresh();
+  isPersisted = true;
+} else {
+  saveIfPersisted();
+}
+  } finally {
+readWriteLock.writeLock().unlock();
   }
 } finally {
-  readWriteLock.writeLock().unlock();
+  cluster.getClusterGlobalLock().writeLock().unlock();
 }
   }
 
@@ -413,19 +418,11 @@ public class ConfigGroupImpl implements ConfigGroup {
 
clusterConfigEntity.setAttributes(gson.toJson(config.getPropertiesAttributes()));
   }
   clusterConfigEntity.setTimestamp(System.currentTimeMillis());
-
-
-  // TODO: Is locking necessary and functional ?
-  cluster.getClusterGlobalLock().writeLock().lock();
-  try {
-clusterDAO.createConfig(clusterConfigEntity);
-clusterEntity.getClusterConfigEntities().add(clusterConfigEntity);
-cluster.addConfig(config);
-clusterDAO.merge(clusterEntity);
-cluster.refresh();
-  } finally {
-cluster.getClusterGlobalLock().writeLock().unlock();
-  }
+  clusterDAO.createConfig(clusterConfigEntity);
+  clusterEntity.getClusterConfigEntities().add(clusterConfigEntity);
+  cluster.addConfig(config);
+  clusterDAO.merge(clusterEntity);
+  cluster.refresh();
 }
 
 ConfigGroupConfigMappingEntity configMappingEntity =
@@ -460,15 +457,20 @@ public class ConfigGroupImpl implements ConfigGroup {
   @Override
   @Transactional
   public void delete() {
-readWriteLock.writeLock().lock();
+cluster.getClusterGlobalLock

ambari git commit: AMBARI-11744. Ambari Server deadlocks when adding service / adding host. (swagle)

2015-06-06 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/branch-2.0-maint [created] d9cffc309


AMBARI-11744. Ambari Server deadlocks when adding service / adding host. 
(swagle)


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

Branch: refs/heads/branch-2.0-maint
Commit: d9cffc309a55861bf6cd70401afed6889dd42ea4
Parents: 7c439a2
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri Jun 5 20:33:33 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri Jun 5 20:33:33 2015 -0700

--
 .../internal/ConfigGroupResourceProvider.java   |   4 +-
 .../state/configgroup/ConfigGroupImpl.java  | 113 ++-
 2 files changed, 61 insertions(+), 56 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d9cffc30/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
index 3fcb84b..f4893cd 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
@@ -523,9 +523,7 @@ public class ConfigGroupResourceProvider extends
 return configGroupResponses;
   }
 
-  private synchronized void updateConfigGroups
-(SetConfigGroupRequest requests) throws AmbariException {
-
+  private synchronized void updateConfigGroups (SetConfigGroupRequest 
requests) throws AmbariException {
 if (requests.isEmpty()) {
   LOG.warn(Received an empty requests set);
   return;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d9cffc30/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
index 9ec0370..ea3c406 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
@@ -312,18 +312,23 @@ public class ConfigGroupImpl implements ConfigGroup {
 
   @Override
   public void persist() {
-readWriteLock.writeLock().lock();
+cluster.getClusterGlobalLock().writeLock().lock();
 try {
-  if (!isPersisted) {
-persistEntities();
-refresh();
-cluster.refresh();
-isPersisted = true;
-  } else {
-saveIfPersisted();
+  readWriteLock.writeLock().lock();
+  try {
+if (!isPersisted) {
+  persistEntities();
+  refresh();
+  cluster.refresh();
+  isPersisted = true;
+} else {
+  saveIfPersisted();
+}
+  } finally {
+readWriteLock.writeLock().unlock();
   }
 } finally {
-  readWriteLock.writeLock().unlock();
+  cluster.getClusterGlobalLock().writeLock().unlock();
 }
   }
 
@@ -413,19 +418,11 @@ public class ConfigGroupImpl implements ConfigGroup {
 
clusterConfigEntity.setAttributes(gson.toJson(config.getPropertiesAttributes()));
   }
   clusterConfigEntity.setTimestamp(System.currentTimeMillis());
-
-
-  // TODO: Is locking necessary and functional ?
-  cluster.getClusterGlobalLock().writeLock().lock();
-  try {
-clusterDAO.createConfig(clusterConfigEntity);
-clusterEntity.getClusterConfigEntities().add(clusterConfigEntity);
-cluster.addConfig(config);
-clusterDAO.merge(clusterEntity);
-cluster.refresh();
-  } finally {
-cluster.getClusterGlobalLock().writeLock().unlock();
-  }
+  clusterDAO.createConfig(clusterConfigEntity);
+  clusterEntity.getClusterConfigEntities().add(clusterConfigEntity);
+  cluster.addConfig(config);
+  clusterDAO.merge(clusterEntity);
+  cluster.refresh();
 }
 
 ConfigGroupConfigMappingEntity configMappingEntity =
@@ -460,15 +457,20 @@ public class ConfigGroupImpl implements ConfigGroup {
   @Override
   @Transactional
   public void delete() {
-readWriteLock.writeLock().lock();
+cluster.getClusterGlobalLock

Git Push Summary

2015-06-06 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/branch-2.0-maint [deleted] d9cffc309


ambari git commit: AMBARI-11744. Ambari Server deadlocks when adding service / adding host. (swagle)

2015-06-06 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk cf6cb47c3 - f2e12158f


AMBARI-11744. Ambari Server deadlocks when adding service / adding host. 
(swagle)


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

Branch: refs/heads/trunk
Commit: f2e12158f82df38b256ee6b3fcc4989ce6751c5a
Parents: cf6cb47
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Sat Jun 6 15:47:44 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Sat Jun 6 15:47:44 2015 -0700

--
 .../internal/ConfigGroupResourceProvider.java   |   4 +-
 .../state/configgroup/ConfigGroupImpl.java  | 113 ++-
 2 files changed, 61 insertions(+), 56 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f2e12158/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
index 68bad38..2bbb9e7 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
@@ -535,9 +535,7 @@ public class ConfigGroupResourceProvider extends
 return configGroupResponses;
   }
 
-  private synchronized void updateConfigGroups
-(SetConfigGroupRequest requests) throws AmbariException {
-
+  private synchronized void updateConfigGroups (SetConfigGroupRequest 
requests) throws AmbariException {
 if (requests.isEmpty()) {
   LOG.warn(Received an empty requests set);
   return;

http://git-wip-us.apache.org/repos/asf/ambari/blob/f2e12158/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
index 656c452..6bab661 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
@@ -317,18 +317,23 @@ public class ConfigGroupImpl implements ConfigGroup {
 
   @Override
   public void persist() {
-readWriteLock.writeLock().lock();
+cluster.getClusterGlobalLock().writeLock().lock();
 try {
-  if (!isPersisted) {
-persistEntities();
-refresh();
-cluster.refresh();
-isPersisted = true;
-  } else {
-saveIfPersisted();
+  readWriteLock.writeLock().lock();
+  try {
+if (!isPersisted) {
+  persistEntities();
+  refresh();
+  cluster.refresh();
+  isPersisted = true;
+} else {
+  saveIfPersisted();
+}
+  } finally {
+readWriteLock.writeLock().unlock();
   }
 } finally {
-  readWriteLock.writeLock().unlock();
+  cluster.getClusterGlobalLock().writeLock().unlock();
 }
   }
 
@@ -420,19 +425,11 @@ public class ConfigGroupImpl implements ConfigGroup {
 
clusterConfigEntity.setAttributes(gson.toJson(config.getPropertiesAttributes()));
   }
   clusterConfigEntity.setTimestamp(System.currentTimeMillis());
-
-
-  // TODO: Is locking necessary and functional ?
-  cluster.getClusterGlobalLock().writeLock().lock();
-  try {
-clusterDAO.createConfig(clusterConfigEntity);
-clusterEntity.getClusterConfigEntities().add(clusterConfigEntity);
-cluster.addConfig(config);
-clusterDAO.merge(clusterEntity);
-cluster.refresh();
-  } finally {
-cluster.getClusterGlobalLock().writeLock().unlock();
-  }
+  clusterDAO.createConfig(clusterConfigEntity);
+  clusterEntity.getClusterConfigEntities().add(clusterConfigEntity);
+  cluster.addConfig(config);
+  clusterDAO.merge(clusterEntity);
+  cluster.refresh();
 }
 
 ConfigGroupConfigMappingEntity configMappingEntity =
@@ -467,15 +464,20 @@ public class ConfigGroupImpl implements ConfigGroup {
   @Override
   @Transactional
   public void delete() {
-readWriteLock.writeLock().lock();
+cluster.getClusterGlobalLock().writeLock().lock

ambari git commit: AMBARI-11731. Ambari Metrics Service Check fails on SUSE. (swagle)

2015-06-05 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk d1ccd2843 - 975cf26ab


AMBARI-11731. Ambari Metrics Service Check fails on SUSE. (swagle)


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

Branch: refs/heads/trunk
Commit: 975cf26ab2087fd4f5046928fdf68a2a8ffab9cb
Parents: d1ccd28
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri Jun 5 10:38:24 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri Jun 5 10:38:43 2015 -0700

--
 ambari-metrics/pom.xml | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/975cf26a/ambari-metrics/pom.xml
--
diff --git a/ambari-metrics/pom.xml b/ambari-metrics/pom.xml
index e57d2a2..782664a 100644
--- a/ambari-metrics/pom.xml
+++ b/ambari-metrics/pom.xml
@@ -38,9 +38,7 @@
 !--TODO change to HDP URL--
 
hbase.tarhttp://public-repo-1.hortonworks.com/HDP/centos6/2.x/GA/2.2.0.0/tars/hbase-0.98.4.2.2.0.0-2041-hadoop2.tar.gz/hbase.tar
 hbase.folderhbase-0.98.4.2.2.0.0-2041-hadoop2/hbase.folder
-hadoop.tar
-  
http://public-repo-1.hortonworks.com/HDP/centos6/2.x/GA/2.2.0.0/tars/hadoop-2.6.0.2.2.0.0-2041.tar.gz
-/hadoop.tar
+
hadoop.tarhttp://public-repo-1.hortonworks.com/HDP/centos6/2.x/GA/2.2.0.0/tars/hadoop-2.6.0.2.2.0.0-2041.tar.gz/hadoop.tar
 hadoop.folderhadoop-2.6.0.2.2.0.0-2041/hadoop.folder
 
hbase.winpkg.zipfile:///c:/hbase_embedded/hbase-0.98.4.2.2.0.0-2041-hadoop2.winpkg.zip/hbase.winpkg.zip
 
hadoop.winpkg.zipfile:///c:/hbase_embedded/hadoop-2.6.0.2.2.0.0-2041.winpkg.zip/hadoop.winpkg.zip



ambari git commit: AMBARI-11731. Ambari Metrics Service Check fails on SUSE. (swagle)

2015-06-05 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 3004eee05 - 4a825b8bc


AMBARI-11731. Ambari Metrics Service Check fails on SUSE. (swagle)


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

Branch: refs/heads/branch-2.1
Commit: 4a825b8bc5235fa71fabff388d7306df5c984654
Parents: 3004eee
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri Jun 5 11:31:26 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri Jun 5 11:31:26 2015 -0700

--
 ambari-metrics/pom.xml | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4a825b8b/ambari-metrics/pom.xml
--
diff --git a/ambari-metrics/pom.xml b/ambari-metrics/pom.xml
index b7be295..2a26d58 100644
--- a/ambari-metrics/pom.xml
+++ b/ambari-metrics/pom.xml
@@ -38,9 +38,7 @@
 !--TODO change to HDP URL--
 
hbase.tarhttp://public-repo-1.hortonworks.com/HDP/centos6/2.x/GA/2.2.0.0/tars/hbase-0.98.4.2.2.0.0-2041-hadoop2.tar.gz/hbase.tar
 hbase.folderhbase-0.98.4.2.2.0.0-2041-hadoop2/hbase.folder
-hadoop.tar
-  
http://public-repo-1.hortonworks.com/HDP/centos6/2.x/GA/2.2.0.0/tars/hadoop-2.6.0.2.2.0.0-2041.tar.gz
-/hadoop.tar
+
hadoop.tarhttp://public-repo-1.hortonworks.com/HDP/centos6/2.x/GA/2.2.0.0/tars/hadoop-2.6.0.2.2.0.0-2041.tar.gz/hadoop.tar
 hadoop.folderhadoop-2.6.0.2.2.0.0-2041/hadoop.folder
 
hbase.winpkg.zipfile:///c:/hbase_embedded/hbase-0.98.4.2.2.0.0-2041-hadoop2.winpkg.zip/hbase.winpkg.zip
 
hadoop.winpkg.zipfile:///c:/hbase_embedded/hadoop-2.6.0.2.2.0.0-2041.winpkg.zip/hadoop.winpkg.zip



ambari git commit: AMBARI-11702. Enhanced Dashboard: Server Error on toggling add widget.

2015-06-04 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 6a0d1e0a2 - 98640c636


AMBARI-11702. Enhanced Dashboard: Server Error on toggling add widget.


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

Branch: refs/heads/trunk
Commit: 98640c63692960188d54a981665a2468769751e2
Parents: 6a0d1e0
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu Jun 4 13:54:39 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu Jun 4 13:54:44 2015 -0700

--
 .../internal/WidgetLayoutResourceProvider.java  | 96 +++-
 .../ambari/server/orm/dao/WidgetLayoutDAO.java  | 11 +++
 2 files changed, 63 insertions(+), 44 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/98640c63/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
index 174a106..7bee12c 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
@@ -50,6 +50,8 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 /**
  * Resource provider for widget layout resources.
@@ -80,6 +82,9 @@ public class WidgetLayoutResourceProvider extends 
AbstractControllerResourceProv
   };
 
   @SuppressWarnings(serial)
+  private static ReadWriteLock lock = new ReentrantReadWriteLock();
+
+  @SuppressWarnings(serial)
   public static SetString propertyIds = new HashSetString() {
 {
   add(WIDGETLAYOUT_ID_PROPERTY_ID);
@@ -267,55 +272,58 @@ public class WidgetLayoutResourceProvider extends 
AbstractControllerResourceProv
   } catch (Exception ex) {
 throw new AmbariException(WidgetLayout should have numerical id);
   }
-  final WidgetLayoutEntity entity = widgetLayoutDAO.findById(layoutId);
-  if (entity == null) {
-throw new ObjectNotFoundException(There is no widget layout with 
id  + layoutId);
-  }
-  if 
(StringUtils.isNotBlank(ObjectUtils.toString(propertyMap.get(WIDGETLAYOUT_LAYOUT_NAME_PROPERTY_ID
 {
-
entity.setLayoutName(propertyMap.get(WIDGETLAYOUT_LAYOUT_NAME_PROPERTY_ID).toString());
-  }
-  if 
(StringUtils.isNotBlank(ObjectUtils.toString(propertyMap.get(WIDGETLAYOUT_SECTION_NAME_PROPERTY_ID
 {
-
entity.setSectionName(propertyMap.get(WIDGETLAYOUT_SECTION_NAME_PROPERTY_ID).toString());
-  }
-  if 
(StringUtils.isNotBlank(ObjectUtils.toString(propertyMap.get(WIDGETLAYOUT_DISPLAY_NAME_PROPERTY_ID
 {
-
entity.setDisplayName(propertyMap.get(WIDGETLAYOUT_DISPLAY_NAME_PROPERTY_ID).toString());
-  }
-  if 
(StringUtils.isNotBlank(ObjectUtils.toString(propertyMap.get(WIDGETLAYOUT_SCOPE_PROPERTY_ID
 {
-
entity.setScope(propertyMap.get(WIDGETLAYOUT_SCOPE_PROPERTY_ID).toString());
-  }
-
-  Set widgetsSet = (LinkedHashSet) 
propertyMap.get(WIDGETLAYOUT_WIDGETS_PROPERTY_ID);
+  lock.writeLock().lock();
+  try {
+final WidgetLayoutEntity entity = 
widgetLayoutDAO.findById(layoutId);
+if (entity == null) {
+  throw new ObjectNotFoundException(There is no widget layout 
with id  + layoutId);
+}
+if 
(StringUtils.isNotBlank(ObjectUtils.toString(propertyMap.get(WIDGETLAYOUT_LAYOUT_NAME_PROPERTY_ID
 {
+  
entity.setLayoutName(propertyMap.get(WIDGETLAYOUT_LAYOUT_NAME_PROPERTY_ID).toString());
+}
+if 
(StringUtils.isNotBlank(ObjectUtils.toString(propertyMap.get(WIDGETLAYOUT_SECTION_NAME_PROPERTY_ID
 {
+  
entity.setSectionName(propertyMap.get(WIDGETLAYOUT_SECTION_NAME_PROPERTY_ID).toString());
+}
+if 
(StringUtils.isNotBlank(ObjectUtils.toString(propertyMap.get(WIDGETLAYOUT_DISPLAY_NAME_PROPERTY_ID
 {
+  
entity.setDisplayName(propertyMap.get(WIDGETLAYOUT_DISPLAY_NAME_PROPERTY_ID).toString());
+}
+if 
(StringUtils.isNotBlank(ObjectUtils.toString(propertyMap.get(WIDGETLAYOUT_SCOPE_PROPERTY_ID
 {
+   

ambari git commit: AMBARI-11672. Ambari 2.0.1 server doesn't start after upgrade from HDP 2.1.7 to 2.2.4. Fixed broken unit test. (swagle)

2015-06-04 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk e7982e319 - c01865ade


AMBARI-11672. Ambari 2.0.1 server doesn't start after upgrade from HDP 2.1.7 to 
2.2.4. Fixed broken unit test. (swagle)


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

Branch: refs/heads/trunk
Commit: c01865ade6bf8819a23c951ac2fcf87d60a1a0ef
Parents: e7982e3
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu Jun 4 10:41:17 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu Jun 4 10:41:17 2015 -0700

--
 .../server/upgrade/UpgradeCatalog210.java   | 72 +++
 .../server/upgrade/UpgradeCatalog210Test.java   | 92 +++-
 2 files changed, 161 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c01865ad/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 2cd4811..d83940e 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
@@ -31,14 +31,20 @@ import 
org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.orm.DBAccessor.DBColumnInfo;
 import org.apache.ambari.server.orm.dao.AlertDefinitionDAO;
 import org.apache.ambari.server.orm.dao.DaoUtils;
+import org.apache.ambari.server.orm.dao.ServiceComponentDesiredStateDAO;
 import org.apache.ambari.server.orm.dao.StackDAO;
 import org.apache.ambari.server.orm.entities.AlertDefinitionEntity;
+import org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity;
+import org.apache.ambari.server.orm.entities.HostComponentStateEntity;
+import 
org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntity;
+import 
org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntityPK;
 import org.apache.ambari.server.orm.entities.StackEntity;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.stack.OsFamily;
+import org.apache.ambari.server.utils.VersionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition;
 import org.slf4j.Logger;
@@ -46,6 +52,9 @@ import org.slf4j.LoggerFactory;
 
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaDelete;
+import javax.persistence.criteria.Root;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.text.MessageFormat;
@@ -884,6 +893,69 @@ public class UpgradeCatalog210 extends 
AbstractUpgradeCatalog {
 
 addMissingConfigs();
 updateAlertDefinitions();
+removeStormRestApiServiceComponent();
+  }
+
+  /**
+   * Delete STORM_REST_API component if HDP is upgraded past 2.2 and the
+   * Component still exists.
+   */
+  protected void removeStormRestApiServiceComponent() {
+AmbariManagementController ambariManagementController = 
injector.getInstance(AmbariManagementController.class);
+Clusters clusters = ambariManagementController.getClusters();
+
+if (clusters != null) {
+  MapString, Cluster clusterMap = clusters.getClusters();
+  for (final Cluster cluster : clusterMap.values()) {
+StackId stackId = cluster.getCurrentStackVersion();
+if (stackId != null  stackId.getStackName().equals(HDP) 
+  VersionUtils.compareVersions(stackId.getStackVersion(), 2.2) = 0) 
{
+
+  executeInTransaction(new Runnable() {
+@Override
+public void run() {
+  ServiceComponentDesiredStateDAO dao = 
injector.getInstance(ServiceComponentDesiredStateDAO.class);
+  ServiceComponentDesiredStateEntityPK entityPK = new 
ServiceComponentDesiredStateEntityPK();
+  entityPK.setClusterId(cluster.getClusterId());
+  entityPK.setServiceName(STORM);
+  entityPK.setComponentName(STORM_REST_API);
+  ServiceComponentDesiredStateEntity entity = 
dao.findByPK(entityPK);
+  if (entity != null) {
+EntityManager em = getEntityManagerProvider().get();
+CriteriaBuilder cb

ambari git commit: AMBARI-11665. AMS : IllegalArgumentException populating metrics for host with no cluster association. (swagle)

2015-06-03 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 42ac63163 - 2ef578f3c


AMBARI-11665. AMS : IllegalArgumentException populating metrics for host with 
no cluster association. (swagle)


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

Branch: refs/heads/trunk
Commit: 2ef578f3c67041ca51b89a71461a830427efead8
Parents: 42ac631
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Wed Jun 3 12:25:12 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Wed Jun 3 12:43:07 2015 -0700

--
 .../controller/metrics/timeline/AMSPropertyProvider.java   | 6 ++
 1 file changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2ef578f3/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
index d7d4c0a..43cf858 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
@@ -503,6 +503,12 @@ public abstract class AMSPropertyProvider extends 
MetricsPropertyProvider {
 
 for (Resource resource : resources) {
   String clusterName = (String) 
resource.getPropertyValue(clusterNamePropertyId);
+  // If a resource is not part of a cluster, do not return metrics since
+  // we cannot decide which collector to reach
+  if (StringUtils.isEmpty(clusterName)) {
+continue;
+  }
+
   MapTemporalInfo, MetricsRequest requests = requestMap.get(clusterName);
   if (requests == null) {
 requests = new HashMapTemporalInfo, MetricsRequest();



ambari git commit: AMBARI-11665. AMS : IllegalArgumentException populating metrics for host with no cluster association. Unit test fixed. (swagle)

2015-06-03 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 414dbe008 - 01f702976


AMBARI-11665. AMS : IllegalArgumentException populating metrics for host with 
no cluster association. Unit test fixed. (swagle)


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

Branch: refs/heads/trunk
Commit: 01f70297665b92c031c774fbc438f700fb2507cf
Parents: 414dbe0
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Wed Jun 3 14:53:06 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Wed Jun 3 14:53:27 2015 -0700

--
 .../metrics/timeline/AMSPropertyProviderTest.java   | 9 +
 1 file changed, 9 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/01f70297/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProviderTest.java
index 923f2f7..e7146d1 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProviderTest.java
@@ -97,6 +97,7 @@ public class AMSPropertyProviderTest {
 );
 
 Resource resource = new ResourceImpl(Resource.Type.Host);
+resource.setProperty(CLUSTER_NAME_PROPERTY_ID, c1);
 resource.setProperty(HOST_NAME_PROPERTY_ID, h1);
 MapString, TemporalInfo temporalInfoMap = new HashMapString, 
TemporalInfo();
 temporalInfoMap.put(PROPERTY_ID1, new TemporalInfoImpl(1416445244701L, 
1416445244901L, 1L));
@@ -137,6 +138,7 @@ public class AMSPropertyProviderTest {
 );
 
 Resource resource = new ResourceImpl(Resource.Type.Host);
+resource.setProperty(CLUSTER_NAME_PROPERTY_ID, c1);
 resource.setProperty(HOST_NAME_PROPERTY_ID, h1);
 MapString, TemporalInfo temporalInfoMap = Collections.emptyMap();
 Request request = PropertyHelper.getReadRequest(Collections.singleton
@@ -179,6 +181,7 @@ public class AMSPropertyProviderTest {
 );
 
 Resource resource = new ResourceImpl(Resource.Type.Host);
+resource.setProperty(CLUSTER_NAME_PROPERTY_ID, c1);
 resource.setProperty(HOST_NAME_PROPERTY_ID, h1);
 MapString, TemporalInfo temporalInfoMap = Collections.emptyMap();
 Request request = PropertyHelper.getReadRequest(
@@ -224,6 +227,7 @@ public class AMSPropertyProviderTest {
 );
 
 Resource resource = new ResourceImpl(Resource.Type.Host);
+resource.setProperty(CLUSTER_NAME_PROPERTY_ID, c1);
 resource.setProperty(HOST_NAME_PROPERTY_ID, h1);
 MapString, TemporalInfo temporalInfoMap = new HashMapString, 
TemporalInfo();
 temporalInfoMap.put(PROPERTY_ID1, new TemporalInfoImpl(1416445244701L, 
1416445244901L, 1L));
@@ -284,6 +288,7 @@ public class AMSPropertyProviderTest {
 
 String propertyId1 = metrics/yarn/Queue/root/AvailableMB;
 Resource resource = new ResourceImpl(Resource.Type.Component);
+resource.setProperty(CLUSTER_NAME_PROPERTY_ID, c1);
 resource.setProperty(HOST_NAME_PROPERTY_ID, h1);
 resource.setProperty(COMPONENT_NAME_PROPERTY_ID, RESOURCEMANAGER);
 MapString, TemporalInfo temporalInfoMap = new HashMapString, 
TemporalInfo();
@@ -327,6 +332,7 @@ public class AMSPropertyProviderTest {
 
 String propertyId = PropertyHelper.getPropertyId(metrics/rpc, 
RpcQueueTime_avg_time);
 Resource resource = new ResourceImpl(Resource.Type.Component);
+resource.setProperty(CLUSTER_NAME_PROPERTY_ID, c1);
 resource.setProperty(HOST_NAME_PROPERTY_ID, h1);
 resource.setProperty(COMPONENT_NAME_PROPERTY_ID, NAMENODE);
 MapString, TemporalInfo temporalInfoMap = new HashMapString, 
TemporalInfo();
@@ -392,6 +398,7 @@ public class AMSPropertyProviderTest {
 
 String propertyId = 
PropertyHelper.getPropertyId(metrics/hbase/regionserver, requests);
 Resource resource = new ResourceImpl(Resource.Type.Component);
+resource.setProperty(CLUSTER_NAME_PROPERTY_ID, c1);
 resource.setProperty(HOST_NAME_PROPERTY_ID, h1);
 resource.setProperty(COMPONENT_NAME_PROPERTY_ID, METRICS_COLLECTOR);
 MapString, TemporalInfo temporalInfoMap = new HashMapString, 
TemporalInfo();
@@ -458,6 +465,7 @@ public class AMSPropertyProviderTest {
 
 String propertyId = PropertyHelper.getPropertyId(metrics/rpc, 
NumOpenConnections._sum);
 Resource resource = new ResourceImpl(Resource.Type.Component

ambari git commit: AMBARI-11501. AMS HBase does not start after Kerberization in distributed mode. Syntax error fixed. (swagle)

2015-06-03 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 377693013 - 8661bdf06


AMBARI-11501. AMS HBase does not start after Kerberization in distributed mode. 
Syntax error fixed. (swagle)


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

Branch: refs/heads/trunk
Commit: 8661bdf06919f60cfd3df76ee7dba56d9636265d
Parents: 3776930
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Tue Jun 2 23:03:38 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Tue Jun 2 23:04:32 2015 -0700

--
 .../AMBARI_METRICS/0.1.0/package/scripts/hbase_master.py   | 2 +-
 .../AMBARI_METRICS/0.1.0/package/scripts/hbase_regionserver.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8661bdf0/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_master.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_master.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_master.py
index e6fe8eb..b769a0d 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_master.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_master.py
@@ -34,7 +34,7 @@ class HbaseMaster(Script):
 import params
 env.set_params(params)
 
-hbase(name='master', action)
+hbase('master', action)
 
   def start(self, env):
 import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/8661bdf0/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_regionserver.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_regionserver.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_regionserver.py
index e733f49..cf0efef 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_regionserver.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase_regionserver.py
@@ -33,7 +33,7 @@ class HbaseRegionServer(Script):
 import params
 env.set_params(params)
 
-hbase(name='regionserver')
+hbase('regionserver', action)
   
   def start(self, env):
 import params



ambari git commit: AMBARI-11672. Ambari 2.0.1 server doesn't start after upgrade from HDP 2.1.7 to 2.2.4. (swagle)

2015-06-03 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk d658e6fd7 - 33f24d575


AMBARI-11672. Ambari 2.0.1 server doesn't start after upgrade from HDP 2.1.7 to 
2.2.4. (swagle)


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

Branch: refs/heads/trunk
Commit: 33f24d57537c5055b896d5b011e535be96d31c8f
Parents: d658e6f
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Wed Jun 3 18:30:50 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Wed Jun 3 19:40:19 2015 -0700

--
 .../server/upgrade/UpgradeCatalog210.java   | 94 +---
 .../server/upgrade/UpgradeCatalog210Test.java   | 81 +
 2 files changed, 164 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/33f24d57/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 e331475..2e40461 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
@@ -31,14 +31,20 @@ import 
org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.orm.DBAccessor.DBColumnInfo;
 import org.apache.ambari.server.orm.dao.AlertDefinitionDAO;
 import org.apache.ambari.server.orm.dao.DaoUtils;
+import org.apache.ambari.server.orm.dao.ServiceComponentDesiredStateDAO;
 import org.apache.ambari.server.orm.dao.StackDAO;
 import org.apache.ambari.server.orm.entities.AlertDefinitionEntity;
+import org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity;
+import org.apache.ambari.server.orm.entities.HostComponentStateEntity;
+import 
org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntity;
+import 
org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntityPK;
 import org.apache.ambari.server.orm.entities.StackEntity;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.stack.OsFamily;
+import org.apache.ambari.server.utils.VersionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition;
 import org.slf4j.Logger;
@@ -46,6 +52,9 @@ import org.slf4j.LoggerFactory;
 
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaDelete;
+import javax.persistence.criteria.Root;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.text.MessageFormat;
@@ -471,21 +480,21 @@ public class UpgradeCatalog210 extends 
AbstractUpgradeCatalog {
   dbAccessor.executeQuery(ALTER TABLE  + SERVICE_CONFIG_HOSTS_TABLE +  
DROP CONSTRAINT serviceconfighosts_pkey);
 }
 dbAccessor.executeQuery(ALTER TABLE  + CONFIG_GROUP_HOST_MAPPING_TABLE +
- ADD CONSTRAINT configgrouphostmapping_pkey PRIMARY KEY 
(config_group_id, host_id));
+   ADD CONSTRAINT configgrouphostmapping_pkey PRIMARY KEY 
(config_group_id, host_id));
 dbAccessor.executeQuery(ALTER TABLE  + CLUSTER_HOST_MAPPING_TABLE +
- ADD CONSTRAINT clusterhostmapping_pkey PRIMARY KEY (cluster_id, 
host_id));
+   ADD CONSTRAINT clusterhostmapping_pkey PRIMARY KEY (cluster_id, 
host_id));
 dbAccessor.executeQuery(ALTER TABLE  + HOST_CONFIG_MAPPING_TABLE +
- ADD CONSTRAINT hostconfigmapping_pkey PRIMARY KEY (cluster_id, 
host_id, type_name, create_timestamp));
+   ADD CONSTRAINT hostconfigmapping_pkey PRIMARY KEY (cluster_id, 
host_id, type_name, create_timestamp));
 dbAccessor.executeQuery(ALTER TABLE  + HOST_COMPONENT_STATE_TABLE +
- ADD CONSTRAINT hostcomponentstate_pkey PRIMARY KEY (cluster_id, 
component_name, host_id, service_name));
+   ADD CONSTRAINT hostcomponentstate_pkey PRIMARY KEY (cluster_id, 
component_name, host_id, service_name));
 dbAccessor.executeQuery(ALTER TABLE  + 
HOST_COMPONENT_DESIRED_STATE_TABLE +
- ADD CONSTRAINT hostcomponentdesiredstate_pkey PRIMARY KEY 
(cluster_id, component_name, host_id, service_name));
+   ADD CONSTRAINT hostcomponentdesiredstate_pkey PRIMARY KEY (cluster_id, 
component_name, host_id, service_name));
 dbAccessor.executeQuery

ambari git commit: AMBARI-11501. AMS HBase does not start after Kerberization in distributed mode. (swagle)

2015-05-28 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 025ca257a - 2bd0014a6


AMBARI-11501. AMS HBase does not start after Kerberization in distributed mode. 
(swagle)


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

Branch: refs/heads/trunk
Commit: 2bd0014a66082079a703d7ea2b43d97d7cb132a2
Parents: 025ca25
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu May 28 15:10:41 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu May 28 15:28:05 2015 -0700

--
 .../common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2bd0014a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
index 22fb894..47fd2dd 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
@@ -176,8 +176,8 @@ else:
 hbase_env_sh_template = config['configurations']['ams-hbase-env']['content']
 ams_env_sh_template = config['configurations']['ams-env']['content']
 
+hbase_staging_dir = 
default(/configurations/ams-hbase-site/hbase.bulkload.staging.dir, 
/amshbase/staging)
 
-hbase_staging_dir = /apps/hbase/staging
 #for create_hdfs_directory
 hostname = config[hostname]
 hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab']



ambari git commit: AMBARI-11467. API to fetch CPU metrics with average aggregation across all hosts returns value higher than the valid max bound. (swagle)

2015-05-27 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk f00daf006 - 39b56b482


AMBARI-11467. API to fetch CPU metrics with average aggregation across all 
hosts returns value higher than the valid max bound. (swagle)


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

Branch: refs/heads/trunk
Commit: 39b56b4829b604b103240dfc3c7a3f788a0949db
Parents: f00daf0
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Wed May 27 16:17:32 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Wed May 27 16:20:54 2015 -0700

--
 .../internal/AbstractPropertyProvider.java  | 12 +++-
 .../MetricsDataTransferMethodFactory.java   | 29 ++--
 2 files changed, 25 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/39b56b48/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractPropertyProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractPropertyProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractPropertyProvider.java
index 96fa24b..133c8b5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractPropertyProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractPropertyProvider.java
@@ -18,11 +18,13 @@
 
 package org.apache.ambari.server.controller.internal;
 
+import org.apache.ambari.server.controller.metrics.MetricReportingAdapter;
+import org.apache.ambari.server.controller.spi.PropertyProvider;
+import org.apache.ambari.server.controller.utilities.PropertyHelper;
+import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.text.DecimalFormat;
-import java.util.Date;
-import java.util.EnumMap;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
@@ -31,12 +33,6 @@ import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import org.apache.ambari.server.controller.metrics.MetricReportingAdapter;
-import org.apache.ambari.server.controller.spi.PropertyProvider;
-import org.apache.ambari.server.controller.utilities.PropertyHelper;
-import org.apache.commons.lang.StringUtils;
-import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
-
 /**
  *  Abstract property provider implementation.
  */

http://git-wip-us.apache.org/repos/asf/ambari/blob/39b56b48/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDataTransferMethodFactory.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDataTransferMethodFactory.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDataTransferMethodFactory.java
index 3c683c8..9d70158 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDataTransferMethodFactory.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDataTransferMethodFactory.java
@@ -17,24 +17,37 @@
  */
 package org.apache.ambari.server.controller.metrics;
 
+import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
 
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
+import static 
org.apache.ambari.server.controller.utilities.PropertyHelper.AGGREGATE_FUNCTION_IDENTIFIERS;
+
 public class MetricsDataTransferMethodFactory {
   private static final SetString PERCENTAGE_METRIC;
 
   static {
-SetString temp = new HashSetString();
-temp.add(cpu_wio);
-temp.add(cpu_idle);
-temp.add(cpu_nice);
-temp.add(cpu_aidle);
-temp.add(cpu_system);
-temp.add(cpu_user);
-PERCENTAGE_METRIC = Collections.unmodifiableSet(temp);
+SetString percentMetrics = new HashSetString();
+percentMetrics.add(cpu_wio);
+percentMetrics.add(cpu_idle);
+percentMetrics.add(cpu_nice);
+percentMetrics.add(cpu_aidle);
+percentMetrics.add(cpu_system);
+percentMetrics.add(cpu_user);
+
+SetString metricsWithAggregateFunctionIds = new HashSetString();
+for (String metric : percentMetrics) {
+  for (String aggregateFunctionId : AGGREGATE_FUNCTION_IDENTIFIERS) {
+metricsWithAggregateFunctionIds.add(metric + aggregateFunctionId

ambari git commit: AMBARI-11260. Cluster aggregate metric graphs are showing averages, not sum. Unit test fix. (swagle)

2015-05-22 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 064f841ad - d2ad633a3


AMBARI-11260. Cluster aggregate metric graphs are showing averages, not sum. 
Unit test fix. (swagle)


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

Branch: refs/heads/trunk
Commit: d2ad633a304385d9e09270c5d10933974a29e60e
Parents: 064f841
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri May 22 14:49:35 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri May 22 14:49:35 2015 -0700

--
 .../controller/internal/StackArtifactResourceProviderTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d2ad633a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProviderTest.java
index f4c212c..af2cbc4 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProviderTest.java
@@ -123,7 +123,7 @@ public class StackArtifactResourceProviderTest {
 
 Metric m1 = 
md.getMetrics().get(metrics/dfs/datanode/heartBeats_avg_time);
 Metric m2 = md.getMetrics().get(metrics/rpc/closeRegion_num_ops);
-Assert.assertEquals(326, md.getMetrics().size());
+Assert.assertEquals(1630, md.getMetrics().size());
 Assert.assertTrue(m1.isAmsHostMetric());
 Assert.assertEquals(unitless, m1.getUnit());
 Assert.assertFalse(m2.isAmsHostMetric());



ambari git commit: AMBARI-11317. Avoid Client side merge sort on aggregator queries. (swagle)

2015-05-21 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 86638417e - 9e5647d99


AMBARI-11317. Avoid Client side merge sort on aggregator queries. (swagle)


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

Branch: refs/heads/trunk
Commit: 9e5647d99cbaec20878017cc53e1373e88965c20
Parents: 8663841
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu May 21 13:31:57 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu May 21 13:37:47 2015 -0700

--
 .../aggregators/TimelineMetricClusterAggregatorMinute.java| 3 ++-
 .../timeline/aggregators/TimelineMetricHostAggregator.java| 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9e5647d9/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorMinute.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorMinute.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorMinute.java
index 9b51f98..fdcd720 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorMinute.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorMinute.java
@@ -94,10 +94,11 @@ public class TimelineMetricClusterAggregatorMinute extends 
AbstractTimelineAggre
 condition.setStatement(String.format(GET_METRIC_SQL,
   PhoenixTransactSQL.getNaiveTimeRangeHint(startTime, 
NATIVE_TIME_RANGE_DELTA),
   METRICS_RECORD_TABLE_NAME));
+// Retaining order of the row-key avoids client side merge sort.
 condition.addOrderByColumn(METRIC_NAME);
 condition.addOrderByColumn(HOSTNAME);
-condition.addOrderByColumn(APP_ID);
 condition.addOrderByColumn(SERVER_TIME);
+condition.addOrderByColumn(APP_ID);
 return condition;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/9e5647d9/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricHostAggregator.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricHostAggregator.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricHostAggregator.java
index 796cb72..37ddeb3 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricHostAggregator.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricHostAggregator.java
@@ -68,11 +68,12 @@ public class TimelineMetricHostAggregator extends 
AbstractTimelineAggregator {
 condition.setStatement(String.format(GET_METRIC_AGGREGATE_ONLY_SQL,
   PhoenixTransactSQL.getNaiveTimeRangeHint(startTime, 
nativeTimeRangeDelay),
   tableName));
+// Retaining order of the row-key avoids client side merge sort.
 condition.addOrderByColumn(METRIC_NAME);
 condition.addOrderByColumn(HOSTNAME);
+condition.addOrderByColumn(SERVER_TIME);
 condition.addOrderByColumn(APP_ID);
 condition.addOrderByColumn(INSTANCE_ID);
-condition.addOrderByColumn(SERVER_TIME);
 return condition;
   }
 



ambari git commit: AMBARI-11260. Cluster aggregate metric graphs are showing averages, not sum. (swagle)

2015-05-21 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 97eec61d1 - 9371bb760


AMBARI-11260. Cluster aggregate metric graphs are showing averages, not sum. 
(swagle)


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

Branch: refs/heads/trunk
Commit: 9371bb7601c42b250ec258b85a95a5cc1f55ba61
Parents: 97eec61
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu May 21 10:08:26 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu May 21 10:08:26 2015 -0700

--
 .../server/api/services/AmbariMetaInfo.java |  92 -
 .../internal/AbstractPropertyProvider.java  |   4 +-
 .../metrics/MetricsReportPropertyProvider.java  |   2 +
 .../MetricsReportPropertyProviderProxy.java |  15 +++
 .../timeline/AMSComponentPropertyProvider.java  |  58 +--
 .../metrics/timeline/AMSPropertyProvider.java   |  34 ++-
 .../timeline/AMSReportPropertyProvider.java |  42 +++-
 .../controller/utilities/PropertyHelper.java|  76 ++
 .../timeline/AMSPropertyProviderTest.java   |   2 +
 .../timeline/AMSReportPropertyProviderTest.java |  50 +-
 .../ams/aggregate_cluster_metrics.json  | 100 +++
 11 files changed, 361 insertions(+), 114 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9371bb76/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
index 0761614..f411aaa 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
@@ -18,24 +18,10 @@
 
 package org.apache.ambari.server.api.services;
 
-import java.io.File;
-import java.io.FileReader;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Scanner;
-import java.util.Set;
-
-import javax.xml.bind.JAXBException;
-
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.ParentObjectNotFoundException;
 import org.apache.ambari.server.StackAccessException;
@@ -71,16 +57,32 @@ import 
org.apache.ambari.server.state.kerberos.KerberosDescriptor;
 import org.apache.ambari.server.state.kerberos.KerberosDescriptorFactory;
 import org.apache.ambari.server.state.kerberos.KerberosServiceDescriptor;
 import 
org.apache.ambari.server.state.kerberos.KerberosServiceDescriptorFactory;
+import org.apache.ambari.server.state.stack.Metric;
 import org.apache.ambari.server.state.stack.MetricDefinition;
 import org.apache.ambari.server.state.stack.OsFamily;
 import org.apache.ambari.server.state.stack.UpgradePack;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
+import javax.xml.bind.JAXBException;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Scanner;
+import java.util.Set;
+
+import static 
org.apache.ambari.server.controller.spi.Resource.InternalType.Component;
+import static 
org.apache.ambari.server.controller.utilities.PropertyHelper.AGGREGATE_FUNCTION_IDENTIFIERS;
 
 
 /**
@@ -867,7 +869,7 @@ public class AmbariMetaInfo {
   try {
 map = gson.fromJson(new FileReader(svc.getMetricsFile()), type);
 
-svc.setMetrics(map);
+svc.setMetrics(updateComponentMetricMapWithAggregateFunctionIds(map));
 
   } catch (Exception e) {
 LOG.error (Could not read the metrics file, e);
@@ -879,6 +881,50 @@ public class AmbariMetaInfo {
   }
 
   /**
+   * Add aggregate function support for all stack defined metrics.
+   */
+  private MapString, MapString

ambari git commit: AMBARI-11250. Publishing graphs/widgets for a new service requires ambari server code change.

2015-05-19 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 8a7c54c63 - 824bc8b6a


AMBARI-11250. Publishing graphs/widgets for a new service requires ambari 
server code change.


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

Branch: refs/heads/trunk
Commit: 824bc8b6a45682638147d24197cdf106c4fe96c5
Parents: 8a7c54c
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Tue May 19 12:55:58 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Tue May 19 12:56:06 2015 -0700

--
 .../metrics/timeline/AMSPropertyProvider.java   | 23 -
 .../ambari/server/state/ComponentInfo.java  | 11 +++
 .../AMBARI_METRICS/0.1.0/metainfo.xml   |  1 +
 .../HBASE/0.96.0.2.0/metainfo.xml   |  2 +
 .../timeline/AMSPropertyProviderTest.java   | 96 
 5 files changed, 131 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/824bc8b6/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
index 8bd1b2d..d5af2b7 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
@@ -17,7 +17,10 @@
  */
 package org.apache.ambari.server.controller.metrics.timeline;
 
+import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.configuration.ComponentSSLConfiguration;
+import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.controller.AmbariServer;
 import org.apache.ambari.server.controller.internal.PropertyInfo;
 import org.apache.ambari.server.controller.metrics.MetricHostProvider;
 import org.apache.ambari.server.controller.metrics.MetricsPropertyProvider;
@@ -27,6 +30,7 @@ import 
org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.TemporalInfo;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.controller.utilities.StreamProvider;
+import org.apache.ambari.server.state.StackId;
 import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
 import org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics;
@@ -339,8 +343,23 @@ public abstract class AMSPropertyProvider extends 
MetricsPropertyProvider {
   } else {
 String componentName = getComponentName(resource);
 if (componentName != null  !componentName.isEmpty()) {
-  if (TIMELINE_APPID_MAP.containsKey(componentName)) {
-componentName = TIMELINE_APPID_MAP.get(componentName);
+  String clusterName = (String) 
resource.getPropertyValue(clusterNamePropertyId);
+  StackId stackId;
+  try {
+AmbariManagementController managementController = 
AmbariServer.getController();
+stackId = 
managementController.getClusters().getCluster(clusterName).getCurrentStackVersion();
+if (stackId != null) {
+  String stackName = stackId.getStackName();
+  String version = stackId.getStackVersion();
+  AmbariMetaInfo ambariMetaInfo = 
managementController.getAmbariMetaInfo();
+  String serviceName = 
ambariMetaInfo.getComponentToService(stackName, version, componentName);
+  String timeLineAppId = ambariMetaInfo.getComponent(stackName, 
version, serviceName, componentName).getTimelineAppid();
+  if (timeLineAppId != null){
+componentName = timeLineAppId;
+  }
+}
+  } catch (Exception e) {
+e.printStackTrace();
   }
   uriBuilder.setParameter(appId, componentName);
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/824bc8b6/ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java
index 05c0df7..fd68060 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java
+++ 

ambari git commit: AMBARI-11184. AMS: Incorrect value obtained for a datapoint in the metric data series queried from AMS. (swagle)

2015-05-18 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 2015be59a - 8b0c964a8


AMBARI-11184. AMS: Incorrect value obtained for a datapoint in the metric data 
series queried from AMS. (swagle)


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

Branch: refs/heads/trunk
Commit: 8b0c964a89ffd4d352d0deac0756923242a252e9
Parents: 2015be5
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Mon May 18 13:07:06 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Mon May 18 13:07:06 2015 -0700

--
 .../metrics/timeline/PhoenixHBaseAccessor.java  |   8 +-
 .../timeline/TimelineMetricConfiguration.java   |   3 +
 .../aggregators/AbstractTimelineAggregator.java |   6 +-
 .../TimelineMetricClusterAggregatorMinute.java  | 131 +--
 .../aggregators/TimelineMetricReadHelper.java   |   4 +-
 .../timeline/AbstractMiniHBaseClusterTest.java  |  80 ++-
 .../metrics/timeline/ITClusterAggregator.java   | 130 ++
 .../0.1.0/configuration/ams-site.xml|   2 +-
 8 files changed, 290 insertions(+), 74 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8b0c964a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
index b890171..bf1ae66 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
@@ -313,8 +313,7 @@ public class PhoenixHBaseAccessor {
 }
   }
 
-  public void insertMetricRecords(TimelineMetrics metrics)
-throws SQLException, IOException {
+  public void insertMetricRecords(TimelineMetrics metrics) throws 
SQLException, IOException {
 
 ListTimelineMetric timelineMetrics = metrics.getMetrics();
 if (timelineMetrics == null || timelineMetrics.isEmpty()) {
@@ -351,9 +350,8 @@ public class PhoenixHBaseAccessor {
 metricRecordStmt.setDouble(8, aggregates[0]);
 metricRecordStmt.setDouble(9, aggregates[1]);
 metricRecordStmt.setDouble(10, aggregates[2]);
-metricRecordStmt.setLong(11, (long)aggregates[3]);
-String json =
-  TimelineUtils.dumpTimelineRecordtoJSON(metric.getMetricValues());
+metricRecordStmt.setLong(11, (long) aggregates[3]);
+String json = 
TimelineUtils.dumpTimelineRecordtoJSON(metric.getMetricValues());
 metricRecordStmt.setString(12, json);
 
 try {

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b0c964a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricConfiguration.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricConfiguration.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricConfiguration.java
index 0595c20..0461261 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricConfiguration.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricConfiguration.java
@@ -157,6 +157,9 @@ public class TimelineMetricConfiguration {
   public static final String CLUSTER_AGGREGATOR_APP_IDS =
 timeline.metrics.service.cluster.aggregator.appIds;
 
+  public static final String SERVER_SIDE_TIMESIFT_ADJUSTMENT =
+timeline.metrics.service.cluster.aggregator.timeshift.adjustment;
+
   public static final String HOST_APP_ID = HOST;
 
   private Configuration hbaseConf;

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b0c964a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server

ambari git commit: AMBARI-11143. Upgrade 2.0.0 - 2.0.1 on ubuntu 12 - commands failures. (swagle)

2015-05-14 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 9f93b027c - f32be8ae9


AMBARI-11143. Upgrade 2.0.0 - 2.0.1 on ubuntu 12 - commands failures. (swagle)


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

Branch: refs/heads/trunk
Commit: f32be8ae93609a95b84ac364b8179ee802438de3
Parents: 9f93b02
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu May 14 13:56:58 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu May 14 13:56:58 2015 -0700

--
 .../src/main/package/deb/control/postinst  | 6 +-
 .../src/main/package/rpm/sink/postinstall.sh   | 6 +-
 2 files changed, 2 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f32be8ae/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst
--
diff --git 
a/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst 
b/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst
index e87b9f0..e75d557 100644
--- 
a/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst
+++ 
b/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst
@@ -32,9 +32,5 @@ LINKS=(${HADOOP_LINK_NAME} ${FLUME_LINK_NAME} 
${KAFKA_LINK_NAME})
 
 for index in ${!LINKS[*]}
 do
-  if [ -e ${LINKS[$index]} ]; then
-rm -f ${LINKS[$index]}
-  fi
-
-  ln -s ${JARS[$index]} ${LINKS[$index]}
+  rm -f ${LINKS[$index]} ; ln -s ${JARS[$index]} ${LINKS[$index]}
 done

http://git-wip-us.apache.org/repos/asf/ambari/blob/f32be8ae/ambari-metrics/ambari-metrics-assembly/src/main/package/rpm/sink/postinstall.sh
--
diff --git 
a/ambari-metrics/ambari-metrics-assembly/src/main/package/rpm/sink/postinstall.sh
 
b/ambari-metrics/ambari-metrics-assembly/src/main/package/rpm/sink/postinstall.sh
index e87b9f0..e75d557 100644
--- 
a/ambari-metrics/ambari-metrics-assembly/src/main/package/rpm/sink/postinstall.sh
+++ 
b/ambari-metrics/ambari-metrics-assembly/src/main/package/rpm/sink/postinstall.sh
@@ -32,9 +32,5 @@ LINKS=(${HADOOP_LINK_NAME} ${FLUME_LINK_NAME} 
${KAFKA_LINK_NAME})
 
 for index in ${!LINKS[*]}
 do
-  if [ -e ${LINKS[$index]} ]; then
-rm -f ${LINKS[$index]}
-  fi
-
-  ln -s ${JARS[$index]} ${LINKS[$index]}
+  rm -f ${LINKS[$index]} ; ln -s ${JARS[$index]} ${LINKS[$index]}
 done



ambari git commit: AMBARI-11143. Upgrade 2.0.0 - 2.0.1 on ubuntu 12 - commands failures. (swagle)

2015-05-14 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/branch-2.0.maint ece8e1ab0 - d09bf95e6


AMBARI-11143. Upgrade 2.0.0 - 2.0.1 on ubuntu 12 - commands failures. (swagle)


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

Branch: refs/heads/branch-2.0.maint
Commit: d09bf95e65d757ef38397fb12eebaed156df686a
Parents: ece8e1a
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu May 14 13:53:51 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu May 14 13:53:51 2015 -0700

--
 .../src/main/package/deb/control/postinst  | 6 +-
 .../src/main/package/rpm/sink/postinstall.sh   | 6 +-
 2 files changed, 2 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d09bf95e/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst
--
diff --git 
a/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst 
b/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst
index e87b9f0..e75d557 100644
--- 
a/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst
+++ 
b/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst
@@ -32,9 +32,5 @@ LINKS=(${HADOOP_LINK_NAME} ${FLUME_LINK_NAME} 
${KAFKA_LINK_NAME})
 
 for index in ${!LINKS[*]}
 do
-  if [ -e ${LINKS[$index]} ]; then
-rm -f ${LINKS[$index]}
-  fi
-
-  ln -s ${JARS[$index]} ${LINKS[$index]}
+  rm -f ${LINKS[$index]} ; ln -s ${JARS[$index]} ${LINKS[$index]}
 done

http://git-wip-us.apache.org/repos/asf/ambari/blob/d09bf95e/ambari-metrics/ambari-metrics-assembly/src/main/package/rpm/sink/postinstall.sh
--
diff --git 
a/ambari-metrics/ambari-metrics-assembly/src/main/package/rpm/sink/postinstall.sh
 
b/ambari-metrics/ambari-metrics-assembly/src/main/package/rpm/sink/postinstall.sh
index e87b9f0..e75d557 100644
--- 
a/ambari-metrics/ambari-metrics-assembly/src/main/package/rpm/sink/postinstall.sh
+++ 
b/ambari-metrics/ambari-metrics-assembly/src/main/package/rpm/sink/postinstall.sh
@@ -32,9 +32,5 @@ LINKS=(${HADOOP_LINK_NAME} ${FLUME_LINK_NAME} 
${KAFKA_LINK_NAME})
 
 for index in ${!LINKS[*]}
 do
-  if [ -e ${LINKS[$index]} ]; then
-rm -f ${LINKS[$index]}
-  fi
-
-  ln -s ${JARS[$index]} ${LINKS[$index]}
+  rm -f ${LINKS[$index]} ; ln -s ${JARS[$index]} ${LINKS[$index]}
 done



ambari git commit: AMBARI-11149. Widgets: attempted to move/add/delete a widget causes exception.

2015-05-14 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 3d9072733 - 501afc0f5


AMBARI-11149. Widgets: attempted to move/add/delete a widget causes exception.


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

Branch: refs/heads/trunk
Commit: 501afc0f58c65eaeccf6c388ae6100c2c3d31048
Parents: 3d90727
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu May 14 16:07:19 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu May 14 16:07:19 2015 -0700

--
 .../internal/WidgetLayoutResourceProvider.java  |  9 
 .../entities/WidgetLayoutUserWidgetEntity.java  |  8 +++
 .../WidgetLayoutResourceProviderTest.java   | 23 
 3 files changed, 31 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/501afc0f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
index 8f068d5..174a106 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
@@ -286,6 +286,15 @@ public class WidgetLayoutResourceProvider extends 
AbstractControllerResourceProv
 
   Set widgetsSet = (LinkedHashSet) 
propertyMap.get(WIDGETLAYOUT_WIDGETS_PROPERTY_ID);
 
+  //Remove old relations from widget entities
+  for (WidgetLayoutUserWidgetEntity widgetLayoutUserWidgetEntity : 
entity.getListWidgetLayoutUserWidgetEntity()) {
+
widgetLayoutUserWidgetEntity.getWidget().getListWidgetLayoutUserWidgetEntity()
+.remove(widgetLayoutUserWidgetEntity);
+widgetDAO.merge(widgetLayoutUserWidgetEntity.getWidget());
+  }
+  entity.setListWidgetLayoutUserWidgetEntity(new 
LinkedListWidgetLayoutUserWidgetEntity());
+  widgetLayoutDAO.merge(entity);
+
   ListWidgetLayoutUserWidgetEntity widgetLayoutUserWidgetEntityList 
= new LinkedListWidgetLayoutUserWidgetEntity();
   int order=0;
   for (Object widgetObject : widgetsSet) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/501afc0f/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetLayoutUserWidgetEntity.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetLayoutUserWidgetEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetLayoutUserWidgetEntity.java
index 1d6e1b5..dbae31b 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetLayoutUserWidgetEntity.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetLayoutUserWidgetEntity.java
@@ -17,6 +17,7 @@
  */
 package org.apache.ambari.server.orm.entities;
 
+import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.Id;
@@ -43,7 +44,7 @@ public class WidgetLayoutUserWidgetEntity {
   @JoinColumn(name = widget_layout_id, referencedColumnName = id)
   private WidgetLayoutEntity widgetLayout;
 
-  @ManyToOne
+  @ManyToOne(cascade = {CascadeType.MERGE, CascadeType.PERSIST, 
CascadeType.REFRESH})
   @JoinColumn(name = widget_id, referencedColumnName = id)
   private WidgetEntity widget;
 
@@ -97,10 +98,7 @@ public class WidgetLayoutUserWidgetEntity {
 
 WidgetLayoutUserWidgetEntity that = (WidgetLayoutUserWidgetEntity) o;
 
-if (widgetLayout.getId() != that.widgetLayout.getId()) return false;
-if (widget.getId() != that.widget.getId()) return false;
-
-return true;
+return (widgetLayout.equals(that.widgetLayout)  
widget.equals(that.widget));
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/501afc0f/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProviderTest.java
index 1a9e230..8184d34 100644
--- 

ambari git commit: Revert AMBARI-11149. Widgets: attempted to move/add/delete a widget causes exception. Unit test failure.

2015-05-14 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 9b6223b90 - 94ba7c0f9


Revert AMBARI-11149. Widgets: attempted to move/add/delete a widget causes 
exception. Unit test failure.

This reverts commit 501afc0f58c65eaeccf6c388ae6100c2c3d31048.


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

Branch: refs/heads/trunk
Commit: 94ba7c0f9904e6c6834a36f8b4de982f86cc94c7
Parents: 9b6223b
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu May 14 19:56:31 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu May 14 19:58:10 2015 -0700

--
 .../internal/WidgetLayoutResourceProvider.java  |  9 
 .../entities/WidgetLayoutUserWidgetEntity.java  |  8 ---
 .../WidgetLayoutResourceProviderTest.java   | 23 
 3 files changed, 9 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/94ba7c0f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
index 174a106..8f068d5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
@@ -286,15 +286,6 @@ public class WidgetLayoutResourceProvider extends 
AbstractControllerResourceProv
 
   Set widgetsSet = (LinkedHashSet) 
propertyMap.get(WIDGETLAYOUT_WIDGETS_PROPERTY_ID);
 
-  //Remove old relations from widget entities
-  for (WidgetLayoutUserWidgetEntity widgetLayoutUserWidgetEntity : 
entity.getListWidgetLayoutUserWidgetEntity()) {
-
widgetLayoutUserWidgetEntity.getWidget().getListWidgetLayoutUserWidgetEntity()
-.remove(widgetLayoutUserWidgetEntity);
-widgetDAO.merge(widgetLayoutUserWidgetEntity.getWidget());
-  }
-  entity.setListWidgetLayoutUserWidgetEntity(new 
LinkedListWidgetLayoutUserWidgetEntity());
-  widgetLayoutDAO.merge(entity);
-
   ListWidgetLayoutUserWidgetEntity widgetLayoutUserWidgetEntityList 
= new LinkedListWidgetLayoutUserWidgetEntity();
   int order=0;
   for (Object widgetObject : widgetsSet) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/94ba7c0f/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetLayoutUserWidgetEntity.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetLayoutUserWidgetEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetLayoutUserWidgetEntity.java
index dbae31b..1d6e1b5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetLayoutUserWidgetEntity.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetLayoutUserWidgetEntity.java
@@ -17,7 +17,6 @@
  */
 package org.apache.ambari.server.orm.entities;
 
-import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.Id;
@@ -44,7 +43,7 @@ public class WidgetLayoutUserWidgetEntity {
   @JoinColumn(name = widget_layout_id, referencedColumnName = id)
   private WidgetLayoutEntity widgetLayout;
 
-  @ManyToOne(cascade = {CascadeType.MERGE, CascadeType.PERSIST, 
CascadeType.REFRESH})
+  @ManyToOne
   @JoinColumn(name = widget_id, referencedColumnName = id)
   private WidgetEntity widget;
 
@@ -98,7 +97,10 @@ public class WidgetLayoutUserWidgetEntity {
 
 WidgetLayoutUserWidgetEntity that = (WidgetLayoutUserWidgetEntity) o;
 
-return (widgetLayout.equals(that.widgetLayout)  
widget.equals(that.widget));
+if (widgetLayout.getId() != that.widgetLayout.getId()) return false;
+if (widget.getId() != that.widget.getId()) return false;
+
+return true;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/94ba7c0f/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProviderTest.java
 

ambari git commit: AMBARI-11114. Verify metrics for HDFS, YARN, HBASE are supported.

2015-05-13 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 7266faea1 - a103aaa0b


AMBARI-4. Verify metrics for HDFS, YARN, HBASE are supported.


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

Branch: refs/heads/trunk
Commit: a103aaa0b3813bc2067d3c9e9291acdb5c2494c3
Parents: 7266fae
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Wed May 13 10:50:53 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Wed May 13 10:51:08 2015 -0700

--
 .../HBASE/0.96.0.2.0/metrics.json   | 100 
 .../common-services/HDFS/2.1.0.2.0/metrics.json | 127 +++
 .../YARN/2.1.0.2.0/YARN_metrics.json| 160 +++
 3 files changed, 316 insertions(+), 71 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a103aaa0/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
index 8d08d9b..efaca33 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
@@ -1379,6 +1379,56 @@
   pointInTime: true,
   temporal: false
 },
+metrics/hbase/regionserver/ScanNext_num_ops: {
+  metric: 
Hadoop:service=HBase,name=RegionServer,sub=Server.ScanNext_num_ops,
+  pointInTime: true,
+  temporal: false
+},
+metrics/hbase/regionserver/Increment_num_ops: {
+  metric: 
Hadoop:service=HBase,name=RegionServer,sub=Server.Increment_num_ops,
+  pointInTime: true,
+  temporal: false
+},
+metrics/hbase/regionserver/Append_num_ops: {
+  metric: 
Hadoop:service=HBase,name=RegionServer,sub=Server.Append_num_ops,
+  pointInTime: true,
+  temporal: false
+},
+metrics/hbase/regionserver/ScanNext_95th_percentile: {
+  metric: 
Hadoop:service=HBase,name=RegionServer,sub=Server.ScanNext_95th_percentile,
+  pointInTime: true,
+  temporal: false
+},
+metrics/hbase/regionserver/Append_95th_percentile: {
+  metric: 
Hadoop:service=HBase,name=RegionServer,sub=Server.Append_95th_percentile,
+  pointInTime: true,
+  temporal: false
+},
+metrics/hbase/regionserver/Increment_95th_percentile: {
+  metric: 
Hadoop:service=HBase,name=RegionServer,sub=Server.Increment_95th_percentile,
+  pointInTime: true,
+  temporal: false
+},
+metrics/hbase/regionserver/updatesBlockedTime: {
+  metric: 
Hadoop:service=HBase,name=RegionServer,sub=Server.updatesBlockedTime,
+  pointInTime: true,
+  temporal: false
+},
+metrics/hbase/IPC/numActiveHandler: {
+  metric: 
Hadoop:service=HBase,name=IPC,sub=IPC.numActiveHandler,
+  pointInTime: true,
+  temporal: false
+},
+metrics/hbase/IPC/numCallsInGeneralQueue: {
+  metric: 
Hadoop:service=HBase,name=IPC,sub=IPC.numCallsInGeneralQueue,
+  pointInTime: true,
+  temporal: false
+},
+metrics/hbase/IPC/numOpenConnections: {
+  metric: 
Hadoop:service=HBase,name=IPC,sub=IPC.numOpenConnections,
+  pointInTime: true,
+  temporal: false
+},
 metrics/hbase/regionserver/slowAppendCount: {
   metric: 
Hadoop:service=HBase,name=RegionServer,sub=Server.slowAppendCount,
   pointInTime: true,
@@ -3023,6 +3073,56 @@
   pointInTime: true,
   temporal: false
 },
+metrics/hbase/regionserver/ScanNext_num_ops: {
+  metric: 
Hadoop:service=HBase,name=RegionServer,sub=Server.ScanNext_num_ops,
+  pointInTime: true,
+  temporal: false
+},
+metrics/hbase/regionserver/Increment_num_ops: {
+  metric: 
Hadoop:service=HBase,name=RegionServer,sub=Server.Increment_num_ops,
+  pointInTime: true,
+  temporal: false
+},
+metrics/hbase/regionserver/Append_num_ops: {
+  metric: 

Git Push Summary

2015-05-12 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/origin/branch-2.0.maint [deleted] 11695e4fe


ambari git commit: AMBARI-11083. Upgrade 1.6.1 - 2.0.1 - nagios not removed.

2015-05-12 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk bd1971616 - 017ae9f0e


AMBARI-11083. Upgrade 1.6.1 - 2.0.1 - nagios not removed.


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

Branch: refs/heads/trunk
Commit: 017ae9f0e4a1e4fbe933168ca9a30499b83c5d3a
Parents: bd19716
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Tue May 12 12:41:25 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Tue May 12 12:41:31 2015 -0700

--
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java| 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/017ae9f0/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java
index 9804bca..d2b9610 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java
@@ -467,6 +467,7 @@ public class UpgradeCatalog200 extends 
AbstractUpgradeCatalog {
 desiredStateDao.remove(serviceDesiredState);
 
 // remove service
+cluster.getClusterServiceEntities().remove(nagios);
 ClusterServiceEntityPK primaryKey = new ClusterServiceEntityPK();
 primaryKey.setClusterId(nagios.getClusterId());
 primaryKey.setServiceName(nagios.getServiceName());



ambari git commit: AMBARI-11083. Upgrade 1.6.1 - 2.0.1 - nagios not removed.

2015-05-12 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/origin/branch-2.0.maint [created] 11695e4fe


AMBARI-11083. Upgrade 1.6.1 - 2.0.1 - nagios not removed.


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

Branch: refs/heads/origin/branch-2.0.maint
Commit: 11695e4fe531680bf8fcc00c1598664e549c5728
Parents: a21a69e
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Tue May 12 12:44:57 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Tue May 12 12:44:57 2015 -0700

--
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java| 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/11695e4f/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java
index 4e444b9..1b22c89 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java
@@ -489,6 +489,7 @@ public class UpgradeCatalog200 extends 
AbstractUpgradeCatalog {
 desiredStateDao.remove(serviceDesiredState);
 
 // remove service
+cluster.getClusterServiceEntities().remove(nagios);
 ClusterServiceEntityPK primaryKey = new ClusterServiceEntityPK();
 primaryKey.setClusterId(nagios.getClusterId());
 primaryKey.setServiceName(nagios.getServiceName());



ambari git commit: AMBARI-10707. AMS does not work with NN HA in AMS distrbuted mode. (swagle)

2015-05-12 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 017ae9f0e - 891f668cc


AMBARI-10707. AMS does not work with NN HA in AMS distrbuted mode. (swagle)


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

Branch: refs/heads/trunk
Commit: 891f668cc987165479875fe8db11d0364e873476
Parents: 017ae9f
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Tue May 12 12:55:20 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Tue May 12 12:55:20 2015 -0700

--
 .../AMBARI_METRICS/0.1.0/package/scripts/ams.py | 38 
 1 file changed, 38 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/891f668c/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
index c7de4f3..507336b 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
@@ -89,6 +89,15 @@ def ams(name=None):
 mode=0644
   )
 
+  XmlConfig(hdfs-site.xml,
+conf_dir=params.hbase_conf_dir,
+configurations=params.config['configurations']['hdfs-site'],
+
configuration_attributes=params.config['configuration_attributes']['hdfs-site'],
+owner=params.ams_user,
+group=params.user_group,
+mode=0644
+  )
+
   XmlConfig(core-site.xml,
 conf_dir=params.ams_collector_conf_dir,
 configurations=params.config['configurations']['core-site'],
@@ -97,6 +106,16 @@ def ams(name=None):
 group=params.user_group,
 mode=0644
   )
+
+  XmlConfig(core-site.xml,
+conf_dir=params.hbase_conf_dir,
+configurations=params.config['configurations']['core-site'],
+
configuration_attributes=params.config['configuration_attributes']['core-site'],
+owner=params.ams_user,
+group=params.user_group,
+mode=0644
+  )
+
 else:
   ServiceConfig(params.ams_embedded_hbase_win_service_name,
 action=change_user,
@@ -249,6 +268,15 @@ def ams(name=None):
 mode=0644
   )
 
+  XmlConfig(hdfs-site.xml,
+conf_dir=params.hbase_conf_dir,
+configurations=params.config['configurations']['hdfs-site'],
+
configuration_attributes=params.config['configuration_attributes']['hdfs-site'],
+owner=params.ams_user,
+group=params.user_group,
+mode=0644
+  )
+
   XmlConfig(core-site.xml,
 conf_dir=params.ams_collector_conf_dir,
 configurations=params.config['configurations']['core-site'],
@@ -257,6 +285,16 @@ def ams(name=None):
 group=params.user_group,
 mode=0644
   )
+
+  XmlConfig(core-site.xml,
+conf_dir=params.hbase_conf_dir,
+configurations=params.config['configurations']['core-site'],
+
configuration_attributes=params.config['configuration_attributes']['core-site'],
+owner=params.ams_user,
+group=params.user_group,
+mode=0644
+  )
+
 pass
 
   elif name == 'monitor':



ambari git commit: AMBARI-10987. Error loading deferred resources when making metric API requests with null padding. (swagle)

2015-05-12 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 4ae8d6459 - 5ba9a426e


AMBARI-10987. Error loading deferred resources when making metric API requests 
with null padding. (swagle)


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

Branch: refs/heads/trunk
Commit: 5ba9a426e93273ba3cc0c962804f2ca4894d3224
Parents: 4ae8d64
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Tue May 12 16:14:14 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Tue May 12 16:17:10 2015 -0700

--
 .../MetricsDownsamplingMethodFactory.java   | 38 
 1 file changed, 32 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5ba9a426/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethodFactory.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethodFactory.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethodFactory.java
index 2d22643..f7d3457 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethodFactory.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethodFactory.java
@@ -18,6 +18,7 @@
 package org.apache.ambari.server.controller.metrics;
 
 import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
+
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Map;
@@ -75,30 +76,55 @@ class MetricsAveragePerSecondDownsampling extends 
MetricsDownsamplingMethod {
 ArrayListAccumulo cache = new ArrayListAccumulo();
 
 final IteratorMap.EntryLong, Double ci = 
metricData.getMetricValues().entrySet().iterator();
-if (ci.hasNext()) {
-  Map.EntryLong, Double e0 = ci.next();
+
+// Skip null padding at the beginning of the series.
+Map.EntryLong, Double e0 = null;
+while (ci.hasNext()) {
+  e0 = ci.next();
+  if (e0.getValue() == null) {
+cache.add(new Accumulo(e0.getKey() / 1000, null));
+  } else {
+break;
+  }
+}
+
+if (e0 != null) {
   long t0 = e0.getKey() / 1000;
   Double s0 = e0.getValue();
   int nSamples = 1;
+  boolean lastNonNullEntryAdded = false;
 
   while(ci.hasNext()) {
 e0 = ci.next();
+// Skip null padding at the end of the series.
+if (e0.getValue() == null) {
+  if (!lastNonNullEntryAdded) {
+// Add last non null entry
+cache.add(new Accumulo(t0, dataTransferMethod.getData(s0 / 
nSamples)));
+lastNonNullEntryAdded = true;
+  }
+  // We do not pad below an interval of a second.
+  // Add the null entry
+  cache.add(new Accumulo(e0.getKey() / 1000, null));
+  continue;
+}
 long t = e0.getKey() / 1000;
 
 if (t != t0) {
-  cache.add(new Accumulo(t0, s0 != null ? 
dataTransferMethod.getData(s0 / nSamples) : null));
+  cache.add(new Accumulo(t0, dataTransferMethod.getData(s0 / 
nSamples)));
   t0 = t;
   s0 = e0.getValue();
   nSamples = 1;
 } else {
-  // Zero value contributes to nothing for downsampling method
-  s0 += e0.getValue() != null ? e0.getValue() : 0;
+  s0 += e0.getValue();
   nSamples++;
 }
   }
 
   //Add the last entry into the cache
-  cache.add(new Accumulo(t0, s0 != null ? dataTransferMethod.getData(s0 / 
nSamples) : null));
+  if (!lastNonNullEntryAdded) {
+cache.add(new Accumulo(t0, dataTransferMethod.getData(s0 / nSamples)));
+  }
 }
 
 Number[][] datapointsArray = new Number[cache.size()][2];



ambari git commit: AMBARI-11031. Widgets with same widgetName in different layout are not created.

2015-05-08 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk cf62f66a1 - 5c4e25e2b


AMBARI-11031. Widgets with same widgetName in different layout are not created.


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

Branch: refs/heads/trunk
Commit: 5c4e25e2b109c004bd2e85c038cf4aa04965c1e1
Parents: cf62f66
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri May 8 10:01:28 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri May 8 10:01:28 2015 -0700

--
 .../AmbariManagementControllerImpl.java  | 11 ---
 .../ambari/server/controller/WidgetResponse.java |  2 +-
 .../internal/WidgetResourceProvider.java |  6 --
 .../apache/ambari/server/orm/dao/WidgetDAO.java  |  3 ++-
 .../ambari/server/orm/entities/WidgetEntity.java | 19 ---
 .../server/state/stack/WidgetLayoutInfo.java | 14 +++---
 .../ambari/server/upgrade/UpgradeCatalog210.java |  2 +-
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql   |  2 +-
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql  |  2 +-
 .../resources/Ambari-DDL-Postgres-CREATE.sql |  2 +-
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql  |  2 +-
 .../resources/Ambari-DDL-SQLServer-CREATE.sql|  2 +-
 .../HBASE/0.96.0.2.0/widgets.json| 10 ++
 .../common-services/HDFS/2.1.0.2.0/widgets.json  |  4 ++--
 .../YARN/2.1.0.2.0/YARN_widgets.json |  9 ++---
 .../AmbariManagementControllerTest.java  |  1 +
 .../internal/WidgetResourceProviderTest.java | 13 +++--
 .../ambari/server/orm/dao/WidgetDAOTest.java |  8 +++-
 .../server/orm/dao/WidgetLayoutDAOTest.java  |  2 +-
 .../stacks/OTHER/2.0/services/HBASE/widgets.json |  8 +++-
 20 files changed, 69 insertions(+), 53 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5c4e25e2/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index ccf1705..bb8f088 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -4014,7 +4014,8 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
   private WidgetEntity addIfNotExistsWidgetEntity(WidgetLayoutInfo layoutInfo, 
ClusterEntity clusterEntity,
   String user, long createTime) {
 ListWidgetEntity createdEntities =
-  widgetDAO.findByName(clusterEntity.getClusterId(), 
layoutInfo.getWidgetName(), user);
+  widgetDAO.findByName(clusterEntity.getClusterId(), 
layoutInfo.getWidgetName(),
+  user, layoutInfo.getDefaultSectionName());
 
 if (createdEntities == null || createdEntities.isEmpty()) {
   WidgetEntity widgetEntity = new WidgetEntity();
@@ -4022,7 +4023,7 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
   widgetEntity.setClusterEntity(clusterEntity);
   widgetEntity.setScope(WidgetResourceProvider.SCOPE.CLUSTER.name());
   widgetEntity.setWidgetName(layoutInfo.getWidgetName());
-  widgetEntity.setDisplayName(layoutInfo.getDisplayName());
+  widgetEntity.setDefaultSectionName(layoutInfo.getDefaultSectionName());
   widgetEntity.setAuthor(user);
   widgetEntity.setDescription(layoutInfo.getDescription());
   widgetEntity.setTimeCreated(createTime);
@@ -4035,7 +4036,8 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 cluster =  + clusterEntity.getClusterName());
   widgetDAO.create(widgetEntity);
 
-  createdEntities = widgetDAO.findByName(clusterEntity.getClusterId(), 
layoutInfo.getWidgetName(), user);
+  createdEntities = widgetDAO.findByName(clusterEntity.getClusterId(), 
layoutInfo.getWidgetName(),
+  user, layoutInfo.getDefaultSectionName());
   if (createdEntities != null  !createdEntities.isEmpty()) {
 return createdEntities.iterator().next();
   }
@@ -4076,6 +4078,9 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
   ListWidgetLayoutUserWidgetEntity widgetLayoutUserWidgetEntityList 
= new LinkedListWidgetLayoutUserWidgetEntity();
   int order = 0;
   for (WidgetLayoutInfo 

ambari git commit: AMBARI-11010. Aggregator function does not work for point in time service component metric query. (swagle)

2015-05-08 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 41a41e64b - c0da0a1d9


AMBARI-11010. Aggregator function does not work for point in time service 
component metric query. (swagle)


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

Branch: refs/heads/trunk
Commit: c0da0a1d9b295b2ac7f0ac5638b255852e816feb
Parents: 41a41e6
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri May 8 10:08:16 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri May 8 10:42:26 2015 -0700

--
 .../timeline/SingleValuedTimelineMetric.java| 107 +++
 .../metrics2/sink/timeline/TimelineMetrics.java |  26 +++
 .../timeline/HBaseTimelineMetricStore.java  |   3 +-
 .../metrics/timeline/PhoenixHBaseAccessor.java  | 191 +++
 .../TimelineMetricHostAggregator.java   |   9 +-
 .../aggregators/TimelineMetricReadHelper.java   |  29 ++-
 .../metrics/timeline/ITClusterAggregator.java   |   1 -
 .../metrics/timeline/ITMetricAggregator.java|  20 +-
 .../timeline/ITPhoenixHBaseAccessor.java|  52 -
 9 files changed, 292 insertions(+), 146 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c0da0a1d/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/SingleValuedTimelineMetric.java
--
diff --git 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/SingleValuedTimelineMetric.java
 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/SingleValuedTimelineMetric.java
new file mode 100644
index 000..8ecca54
--- /dev/null
+++ 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/SingleValuedTimelineMetric.java
@@ -0,0 +1,107 @@
+/**
+ * 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.hadoop.metrics2.sink.timeline;
+
+/**
+ * This class prevents creating a TreeMap for every instantiation of a metric
+ * read from the store. The methods are meant to provide interoperability
+ * with @TimelineMetric
+ */
+public class SingleValuedTimelineMetric {
+  private Long timestamp;
+  private Double value;
+  private String metricName;
+  private String appId;
+  private String instanceId;
+  private String hostName;
+  private Long startTime;
+  private String type;
+
+  public void setSingleTimeseriesValue(Long timestamp, Double value) {
+this.timestamp = timestamp;
+this.value = value;
+  }
+
+  public SingleValuedTimelineMetric(String metricName, String appId,
+String instanceId, String hostName,
+long timestamp, long startTime, String 
type) {
+this.metricName = metricName;
+this.appId = appId;
+this.instanceId = instanceId;
+this.hostName = hostName;
+this.timestamp = timestamp;
+this.startTime = startTime;
+this.type = type;
+  }
+
+  public Long getTimestamp() {
+return timestamp;
+  }
+
+  public long getStartTime() {
+return startTime;
+  }
+
+  public String getType() {
+return type;
+  }
+
+  public Double getValue() {
+return value;
+  }
+
+  public String getMetricName() {
+return metricName;
+  }
+
+  public String getAppId() {
+return appId;
+  }
+
+  public String getInstanceId() {
+return instanceId;
+  }
+
+  public String getHostName() {
+return hostName;
+  }
+
+  public boolean equalsExceptTime(TimelineMetric metric) {
+if (!metricName.equals(metric.getMetricName())) return false;
+if (hostName != null ? !hostName.equals(metric.getHostName()) : 
metric.getHostName() != null)
+  return false;
+if (appId != null ? !appId.equals(metric.getAppId()) : metric.getAppId() 
!= null)
+  return false;
+if (instanceId != null

ambari git commit: AMBARI-10987. Error loading deferred resources when making metric API requests with null padding. (swagle)

2015-05-07 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 7b822e42b - 34c1e9b2c


AMBARI-10987. Error loading deferred resources when making metric API requests 
with null padding. (swagle)


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

Branch: refs/heads/trunk
Commit: 34c1e9b2c7726a92d18de68d5b292cb87e564740
Parents: 7b822e4
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu May 7 10:34:33 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu May 7 10:37:50 2015 -0700

--
 .../metrics/timeline/PhoenixHBaseAccessor.java  |  2 +
 .../query/render/MetricsPaddingRenderer.java| 46 +
 .../api/resources/BaseResourceDefinition.java   |  5 ++
 .../MetricsDownsamplingMethodFactory.java   | 14 ++--
 .../metrics/MetricsPropertyProvider.java| 20 --
 .../metrics/MetricsPropertyProviderProxy.java   | 13 
 .../render/MetricsPaddingRendererTest.java  | 69 
 7 files changed, 155 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/34c1e9b2/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
index e27d9a9..7258cad 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
@@ -309,6 +309,8 @@ public class PhoenixHBaseAccessor {
 clusterDailyTtl));
 
   conn.commit();
+
+  LOG.info(Metrics schema initialized.);
 } catch (SQLException sql) {
   if (sql.getErrorCode() ==
 SQLExceptionCode.SET_UNSUPPORTED_PROP_ON_ALTER_TABLE.getErrorCode()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/34c1e9b2/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/MetricsPaddingRenderer.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/MetricsPaddingRenderer.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/MetricsPaddingRenderer.java
new file mode 100644
index 000..ff776c7
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/MetricsPaddingRenderer.java
@@ -0,0 +1,46 @@
+/**
+ * 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.api.query.render;
+
+import org.apache.ambari.server.api.query.QueryInfo;
+import org.apache.ambari.server.api.util.TreeNode;
+import java.util.Set;
+
+import static 
org.apache.ambari.server.controller.metrics.MetricsPaddingMethod.PADDING_STRATEGY;
+
+public class MetricsPaddingRenderer extends DefaultRenderer {
+  PADDING_STRATEGY paddingMethod = PADDING_STRATEGY.ZEROS;
+
+  public MetricsPaddingRenderer(String paddingMethod) {
+if (paddingMethod.equalsIgnoreCase(null_padding)) {
+  this.paddingMethod = PADDING_STRATEGY.NULLS;
+} else if (paddingMethod.equalsIgnoreCase(no_padding)) {
+  this.paddingMethod = PADDING_STRATEGY.NONE;
+}
+  }
+
+  @Override
+  public TreeNodeSetString finalizeProperties(TreeNodeQueryInfo 
queryProperties,
+  boolean isCollection) {
+SetString properties

ambari git commit: AMBARi-10964. Deleting a widget fails.

2015-05-06 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 690dfde82 - 4699a1b75


AMBARi-10964. Deleting a widget fails.


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

Branch: refs/heads/trunk
Commit: 4699a1b75811aace747dc9c87072b29b8b41fbd1
Parents: 690dfde
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Wed May 6 10:30:23 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Wed May 6 10:30:23 2015 -0700

--
 .../internal/WidgetLayoutResourceProvider.java  |  4 ++--
 .../WidgetLayoutResourceProviderTest.java   | 22 ++--
 2 files changed, 22 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4699a1b7/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
index 68dc4e9..8f068d5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
@@ -172,7 +172,7 @@ public class WidgetLayoutResourceProvider extends 
AbstractControllerResourceProv
 widgetLayoutUserWidgetEntity.setWidgetOrder(order++);
 widgetLayoutUserWidgetEntity.setWidgetLayout(entity);
 widgetLayoutUserWidgetEntityList.add(widgetLayoutUserWidgetEntity);
-
+
widgetEntity.getListWidgetLayoutUserWidgetEntity().add(widgetLayoutUserWidgetEntity);
   }
 
   
entity.setListWidgetLayoutUserWidgetEntity(widgetLayoutUserWidgetEntityList);
@@ -301,7 +301,7 @@ public class WidgetLayoutResourceProvider extends 
AbstractControllerResourceProv
 widgetLayoutUserWidgetEntity.setWidgetOrder(order++);
 widgetLayoutUserWidgetEntity.setWidgetLayout(entity);
 widgetLayoutUserWidgetEntityList.add(widgetLayoutUserWidgetEntity);
-
+
widgetEntity.getListWidgetLayoutUserWidgetEntity().add(widgetLayoutUserWidgetEntity);
   }
 
   
entity.setListWidgetLayoutUserWidgetEntity(widgetLayoutUserWidgetEntityList);

http://git-wip-us.apache.org/repos/asf/ambari/blob/4699a1b7/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProviderTest.java
index dda0598..1a9e230 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProviderTest.java
@@ -31,7 +31,9 @@ import 
org.apache.ambari.server.controller.utilities.PredicateBuilder;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.metadata.ActionMetadata;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
+import org.apache.ambari.server.orm.dao.WidgetDAO;
 import org.apache.ambari.server.orm.dao.WidgetLayoutDAO;
+import org.apache.ambari.server.orm.entities.WidgetEntity;
 import org.apache.ambari.server.orm.entities.WidgetLayoutEntity;
 import org.apache.ambari.server.orm.entities.WidgetLayoutUserWidgetEntity;
 import org.apache.ambari.server.state.Cluster;
@@ -42,6 +44,7 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
@@ -51,6 +54,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import static org.easymock.EasyMock.anyLong;
 import static org.easymock.EasyMock.anyObject;
 import static org.easymock.EasyMock.capture;
 import static org.easymock.EasyMock.createMock;
@@ -68,11 +72,13 @@ import static org.junit.Assert.assertEquals;
 public class WidgetLayoutResourceProviderTest {
 
   private WidgetLayoutDAO dao = null;
+  private WidgetDAO widgetDAO = null;
   private Injector m_injector;
 
   @Before
   public void before() {
 dao = createStrictMock(WidgetLayoutDAO.class);
+widgetDAO = 

ambari git commit: AMBARI-10904. Provide a configurable timeout setting on MetricsTimelineSink.emitMetrics. Sink connection problem. (swagle)

2015-05-06 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 8cbe1e106 - 2ca58368e


AMBARI-10904. Provide a configurable timeout setting on 
MetricsTimelineSink.emitMetrics. Sink connection problem. (swagle)


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

Branch: refs/heads/trunk
Commit: 2ca58368e60671580e246199da392167c371338e
Parents: 8cbe1e1
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Wed May 6 18:12:39 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Wed May 6 18:12:39 2015 -0700

--
 .../metrics2/sink/timeline/AbstractTimelineMetricsSink.java   | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2ca58368/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
--
diff --git 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
index 4b93f50..f18f52a 100644
--- 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
+++ 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
@@ -54,6 +54,8 @@ public abstract class AbstractTimelineMetricsSink {
 
   public AbstractTimelineMetricsSink() {
 LOG = LogFactory.getLog(this.getClass());
+httpClient.getParams().setSoTimeout(getTimeoutSeconds() * 1000);
+httpClient.getParams().setConnectionManagerTimeout(getTimeoutSeconds() * 
1000);
   }
 
   protected void emitMetrics(TimelineMetrics metrics) throws IOException {
@@ -65,10 +67,11 @@ public abstract class AbstractTimelineMetricsSink {
 
   PostMethod postMethod = new PostMethod(connectUrl);
   postMethod.setRequestEntity(requestEntity);
-  postMethod.setParameter(HttpMethodParams.SO_TIMEOUT, 
String.valueOf(getTimeoutSeconds() * 1000));
   int statusCode = httpClient.executeMethod(postMethod);
+
   if (statusCode != 200) {
-LOG.info(Unable to POST metrics to collector,  + connectUrl);
+LOG.info(Unable to POST metrics to collector,  + connectUrl + ,  +
+  statusCode =  + statusCode);
   } else {
 LOG.debug(Metrics posted to Collector  + connectUrl);
   }



ambari git commit: AMBARI-10889. Create data access layer for new Ambari Topology Manager state. UT failure. (swagle)

2015-05-05 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 88fa680d0 - c465e9e12


AMBARI-10889. Create data access layer for new Ambari Topology Manager state. 
UT failure. (swagle)


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

Branch: refs/heads/trunk
Commit: c465e9e125c79212c38b737d36afcbf2365ecfbb
Parents: 88fa680
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Tue May 5 11:02:45 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Tue May 5 11:03:02 2015 -0700

--
 .../ambari/server/upgrade/UpgradeCatalog210.java| 16 
 1 file changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c465e9e1/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 0845e4b..46fdbf4 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
@@ -224,12 +224,12 @@ public class UpgradeCatalog210 extends 
AbstractUpgradeCatalog {
 dbAccessor.addFKConstraint(TOPOLOGY_LOGICAL_TASK_TABLE, FK_ltask_hrc_id, 
physical_task_id, host_role_command, task_id, false, false);
 
 // Sequence updates
-dbAccessor.executeQuery(INSERT INTO ambari_sequences(sequence_name, 
sequence_value) values ('topology_host_info_id_seq', 0);, false);
-dbAccessor.executeQuery(INSERT INTO ambari_sequences(sequence_name, 
sequence_value) values ('topology_host_request_id_seq', 0);, false);
-dbAccessor.executeQuery(INSERT INTO ambari_sequences(sequence_name, 
sequence_value) values ('topology_host_task_id_seq', 0);, false);
-dbAccessor.executeQuery(INSERT INTO ambari_sequences(sequence_name, 
sequence_value) values ('topology_logical_request_id_seq', 0);, false);
-dbAccessor.executeQuery(INSERT INTO ambari_sequences(sequence_name, 
sequence_value) values ('topology_logical_task_id_seq', 0);, false);
-dbAccessor.executeQuery(INSERT INTO ambari_sequences(sequence_name, 
sequence_value) values ('topology_request_id_seq', 0);, false);
+dbAccessor.executeQuery(INSERT INTO ambari_sequences(sequence_name, 
sequence_value) values ('topology_host_info_id_seq', 0), false);
+dbAccessor.executeQuery(INSERT INTO ambari_sequences(sequence_name, 
sequence_value) values ('topology_host_request_id_seq', 0), false);
+dbAccessor.executeQuery(INSERT INTO ambari_sequences(sequence_name, 
sequence_value) values ('topology_host_task_id_seq', 0), false);
+dbAccessor.executeQuery(INSERT INTO ambari_sequences(sequence_name, 
sequence_value) values ('topology_logical_request_id_seq', 0), false);
+dbAccessor.executeQuery(INSERT INTO ambari_sequences(sequence_name, 
sequence_value) values ('topology_logical_task_id_seq', 0), false);
+dbAccessor.executeQuery(INSERT INTO ambari_sequences(sequence_name, 
sequence_value) values ('topology_request_id_seq', 0), false);
   }
 
   /**
@@ -532,8 +532,8 @@ public class UpgradeCatalog210 extends 
AbstractUpgradeCatalog {
 dbAccessor.addColumn(users, new DBColumnInfo(active_widget_layouts, 
String.class, 1024, null, true));
 
 // Sequence updates
-dbAccessor.executeQuery(INSERT INTO ambari_sequences(sequence_name, 
sequence_value) values ('widget_id_seq', 0);, false);
-dbAccessor.executeQuery(INSERT INTO ambari_sequences(sequence_name, 
sequence_value) values ('widget_layout_id_seq', 0);, false);
+dbAccessor.executeQuery(INSERT INTO ambari_sequences(sequence_name, 
sequence_value) values ('widget_id_seq', 0), false);
+dbAccessor.executeQuery(INSERT INTO ambari_sequences(sequence_name, 
sequence_value) values ('widget_layout_id_seq', 0), false);
   }
 
   /**



ambari git commit: AMBARI-10903. Ambari metrics build issues due to incorrect order in pom file. (swagle)

2015-05-04 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 64b8e235a - 2a4b6


AMBARI-10903. Ambari metrics build issues due to incorrect order in pom file. 
(swagle)


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

Branch: refs/heads/trunk
Commit: 2a4b6a68b8afa88572be1f73bc5bf6f35759
Parents: 64b8e23
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Mon May 4 12:16:45 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Mon May 4 12:16:45 2015 -0700

--
 pom.xml | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2a4b6444/pom.xml
--
diff --git a/pom.xml b/pom.xml
index eb9b587..3f7b95d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -415,11 +415,11 @@
 moduleambari-views/module
 moduleambari-admin/module
 modulecontrib/views/module
+moduleambari-metrics/ambari-metrics-common/module
 moduleambari-server/module
 moduleambari-agent/module
 moduleambari-client/module
 moduleambari-shell/module
-moduleambari-metrics/ambari-metrics-common/module
   /modules
 /profile
 profile
@@ -428,11 +428,11 @@
 moduleambari-project/module
 moduleambari-views/module
 moduleambari-admin/module
+moduleambari-metrics/ambari-metrics-common/module
 moduleambari-server/module
 moduleambari-agent/module
 moduleambari-client/module
 moduleambari-shell/module
-moduleambari-metrics/ambari-metrics-common/module
   /modules
 /profile
 profile
@@ -447,11 +447,11 @@
 moduleambari-project/module
 moduleambari-views/module
 moduleambari-admin/module
+moduleambari-metrics/ambari-metrics-common/module
 moduleambari-server/module
 moduleambari-agent/module
 moduleambari-client/module
 moduleambari-shell/module
-moduleambari-metrics/ambari-metrics-common/module
   /modules
 /profile
 profile
@@ -473,11 +473,11 @@
 moduleambari-views/module
 moduleambari-admin/module
 modulecontrib/ambari-scom/metrics-sink/module
+moduleambari-metrics/ambari-metrics-common/module
 moduleambari-server/module
 moduleambari-agent/module
 moduleambari-client/module
 moduleambari-shell/module
-moduleambari-metrics/ambari-metrics-common/module
   /modules
 /profile
 profile



[2/2] ambari git commit: AMBARI-10904. Provide a configurable timeout setting on MetricsTimelineSink.emitMetrics. (swagle)

2015-05-04 Thread swagle
AMBARI-10904. Provide a configurable timeout setting on 
MetricsTimelineSink.emitMetrics. (swagle)


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

Branch: refs/heads/trunk
Commit: 5226ae1be4ceafb0ca4544a48d69c85edbc4a410
Parents: 0c39d4e
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Mon May 4 18:06:44 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Mon May 4 18:06:44 2015 -0700

--
 .../timeline/AbstractTimelineMetricsSink.java   | 11 +++-
 .../cache/HandleConnectExceptionTest.java   |  6 ++
 .../sink/flume/FlumeTimelineMetricsSink.java| 13 +++--
 .../timeline/HadoopTimelineMetricsSink.java |  8 +++
 .../kafka/KafkaTimelineMetricsReporter.java | 60 +++-
 .../storm/StormTimelineMetricsReporter.java |  9 +++
 .../sink/storm/StormTimelineMetricsSink.java| 14 -
 7 files changed, 85 insertions(+), 36 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5226ae1b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
--
diff --git 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
index fd4cacd..4b93f50 100644
--- 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
+++ 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
@@ -17,26 +17,28 @@
  */
 package org.apache.hadoop.metrics2.sink.timeline;
 
-import java.io.IOException;
-import java.net.ConnectException;
-
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.methods.PostMethod;
 import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.apache.commons.httpclient.params.HttpMethodParams;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.codehaus.jackson.map.AnnotationIntrospector;
 import org.codehaus.jackson.map.ObjectMapper;
 import org.codehaus.jackson.map.annotate.JsonSerialize;
 import org.codehaus.jackson.xc.JaxbAnnotationIntrospector;
+import java.io.IOException;
+import java.net.ConnectException;
 
 public abstract class AbstractTimelineMetricsSink {
   public static final String TAGS_FOR_PREFIX_PROPERTY_PREFIX = 
tagsForPrefix.;
   public static final String MAX_METRIC_ROW_CACHE_SIZE = maxRowCacheSize;
   public static final String METRICS_SEND_INTERVAL = sendInterval;
+  public static final String METRICS_POST_TIMEOUT_SECONDS = timeout;
   public static final String COLLECTOR_HOST_PROPERTY = collector;
   public static final String COLLECTOR_PORT_PROPERTY = port;
 
+  protected static final int DEFAULT_POST_TIMEOUT_SECONDS = 10;
   protected final Log LOG;
   private HttpClient httpClient = new HttpClient();
 
@@ -63,6 +65,7 @@ public abstract class AbstractTimelineMetricsSink {
 
   PostMethod postMethod = new PostMethod(connectUrl);
   postMethod.setRequestEntity(requestEntity);
+  postMethod.setParameter(HttpMethodParams.SO_TIMEOUT, 
String.valueOf(getTimeoutSeconds() * 1000));
   int statusCode = httpClient.executeMethod(postMethod);
   if (statusCode != 200) {
 LOG.info(Unable to POST metrics to collector,  + connectUrl);
@@ -79,4 +82,6 @@ public abstract class AbstractTimelineMetricsSink {
   }
 
   abstract protected String getCollectorUri();
+
+  abstract protected int getTimeoutSeconds();
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/5226ae1b/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/cache/HandleConnectExceptionTest.java
--
diff --git 
a/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/cache/HandleConnectExceptionTest.java
 
b/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/cache/HandleConnectExceptionTest.java
index 2786e3c..4f9b93e 100644
--- 
a/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/cache/HandleConnectExceptionTest.java
+++ 
b/ambari-metrics/ambari-metrics-common/src/test/java/org/apache/hadoop/metrics2/sink/timeline/cache/HandleConnectExceptionTest.java
@@ -68,6 +68,12 @@ public class HandleConnectExceptionTest

[1/2] ambari git commit: AMBARI-10918. Ambari with DB as oracle is failing to deploy. (swagle)

2015-05-04 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk ce3e14370 - 5226ae1be


AMBARI-10918. Ambari with DB as oracle is failing to deploy. (swagle)


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

Branch: refs/heads/trunk
Commit: 0c39d4ef5343c8fb055cd2581538ae26d9a77fba
Parents: ce3e143
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Mon May 4 17:52:40 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Mon May 4 17:52:40 2015 -0700

--
 .../ambari/server/orm/dao/ServiceConfigDAO.java  |  7 ---
 .../ambari/server/orm/entities/WidgetEntity.java | 15 ---
 .../ambari/server/upgrade/UpgradeCatalog210.java |  6 +++---
 .../src/main/resources/Ambari-DDL-MySQL-CREATE.sql   |  4 ++--
 .../src/main/resources/Ambari-DDL-Oracle-CREATE.sql  |  4 ++--
 .../main/resources/Ambari-DDL-Postgres-CREATE.sql|  4 ++--
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql  |  4 ++--
 7 files changed, 27 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0c39d4ef/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java
index 8f8e196..db0817b 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java
@@ -18,6 +18,7 @@
 
 package org.apache.ambari.server.orm.dao;
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -212,13 +213,13 @@ public class ServiceConfigDAO {
*/
   @RequiresSession
   public Long findNextServiceConfigVersion(long clusterId, String serviceName) 
{
-TypedQueryLong query = entityManagerProvider.get().createNamedQuery(
-ServiceConfigEntity.findNextServiceConfigVersion, Long.class);
+TypedQueryNumber query = entityManagerProvider.get().createNamedQuery(
+ServiceConfigEntity.findNextServiceConfigVersion, Number.class);
 
 query.setParameter(clusterId, clusterId);
 query.setParameter(serviceName, serviceName);
 
-return daoUtils.selectSingle(query);
+return daoUtils.selectSingle(query).longValue();
   }
 
   @Transactional

http://git-wip-us.apache.org/repos/asf/ambari/blob/0c39d4ef/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetEntity.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetEntity.java
index 397d845..b65a87b 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetEntity.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/WidgetEntity.java
@@ -17,13 +17,16 @@
  */
 package org.apache.ambari.server.orm.entities;
 
+import javax.persistence.Basic;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.FetchType;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
 import javax.persistence.ManyToOne;
 import javax.persistence.NamedQueries;
 import javax.persistence.NamedQuery;
@@ -67,7 +70,9 @@ public class WidgetEntity {
   @Column(name = widget_type, nullable = false, length = 255)
   private String widgetType;
 
-  @Column(name = metrics, length = 32672)
+  @Lob
+  @Basic(fetch = FetchType.LAZY)
+  @Column(name = metrics)
   private String metrics;
 
   @Column(name = time_created, nullable = false, length = 255)
@@ -85,10 +90,14 @@ public class WidgetEntity {
   @Column(name = scope, length = 255)
   private String scope;
 
-  @Column(name = widget_values, length = 4000)
+  @Lob
+  @Basic(fetch = FetchType.LAZY)
+  @Column(name = widget_values)
   private String widgetValues;
 
-  @Column(name = properties, length = 4000)
+  @Lob
+  @Basic(fetch = FetchType.LAZY)
+  @Column(name = properties)
   private String properties;
 
   @Column(name = cluster_id, nullable = false)

http://git-wip-us.apache.org/repos/asf/ambari/blob/0c39d4ef/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java

ambari git commit: AMBARI-10903. Ambari metrics build issues due to incorrect order in pom file. Remove specific module dep. (swagle)

2015-05-04 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 2a4b6 - 061d062c4


AMBARI-10903. Ambari metrics build issues due to incorrect order in pom file. 
Remove specific module dep. (swagle)


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

Branch: refs/heads/trunk
Commit: 061d062c41200537a26a7c1d676963017f44d926
Parents: 2a4b644
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Mon May 4 12:57:51 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Mon May 4 12:57:51 2015 -0700

--
 pom.xml | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/061d062c/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 3f7b95d..d9600a5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -415,7 +415,7 @@
 moduleambari-views/module
 moduleambari-admin/module
 modulecontrib/views/module
-moduleambari-metrics/ambari-metrics-common/module
+moduleambari-metrics/module
 moduleambari-server/module
 moduleambari-agent/module
 moduleambari-client/module
@@ -428,7 +428,7 @@
 moduleambari-project/module
 moduleambari-views/module
 moduleambari-admin/module
-moduleambari-metrics/ambari-metrics-common/module
+moduleambari-metrics/module
 moduleambari-server/module
 moduleambari-agent/module
 moduleambari-client/module
@@ -447,7 +447,7 @@
 moduleambari-project/module
 moduleambari-views/module
 moduleambari-admin/module
-moduleambari-metrics/ambari-metrics-common/module
+moduleambari-metrics/module
 moduleambari-server/module
 moduleambari-agent/module
 moduleambari-client/module
@@ -473,7 +473,7 @@
 moduleambari-views/module
 moduleambari-admin/module
 modulecontrib/ambari-scom/metrics-sink/module
-moduleambari-metrics/ambari-metrics-common/module
+moduleambari-metrics/module
 moduleambari-server/module
 moduleambari-agent/module
 moduleambari-client/module



[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);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari

[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-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-10809. AMS: navigating graph time ranges are not correct. (swagle)

2015-04-29 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 6f00dd8a1 - 7f753b444


AMBARI-10809. AMS: navigating graph time ranges are not correct. (swagle)


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

Branch: refs/heads/trunk
Commit: 7f753b4448e4b370c100d663e8a4f4fd1f0ec5b0
Parents: 6f00dd8
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Wed Apr 29 11:34:31 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Wed Apr 29 11:34:31 2015 -0700

--
 .../metrics/MetricsPaddingMethod.java   | 106 ++
 .../metrics/MetricsPropertyProvider.java|  17 +-
 .../metrics/timeline/AMSPropertyProvider.java   |   4 +-
 .../timeline/MetricsPaddingMethodTest.java  | 208 +++
 4 files changed, 332 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7f753b44/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPaddingMethod.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPaddingMethod.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPaddingMethod.java
new file mode 100644
index 000..a78beee
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPaddingMethod.java
@@ -0,0 +1,106 @@
+/**
+ * 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.controller.metrics;
+
+import org.apache.ambari.server.controller.spi.TemporalInfo;
+import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
+import java.util.Iterator;
+import java.util.TreeMap;
+
+public class MetricsPaddingMethod {
+  private final PADDING_STRATEGY strategy;
+  public static final String ZERO_PADDING_PARAM = params/padding;
+  public static enum PADDING_STRATEGY {
+ZEROS,
+NULLS,
+NONE
+  }
+
+  public MetricsPaddingMethod(PADDING_STRATEGY strategy) {
+this.strategy = strategy;
+  }
+
+  /**
+   * Adds zero/null values towards the end of metrics sequence as well as the
+   * beginning to support backward compatibility with Ganglia.
+   * We use step if only a single datapoint is found.
+   * It is assumed that @TimelineMetric.metricsValues are sorted in ascending
+   * order and thee is no padding between the interval.
+   *
+   * @param metric AMS @TimelineMetric
+   * @param temporalInfo @TemporalInfo Requested interval
+   */
+  public void applyPaddingStrategy(TimelineMetric metric, TemporalInfo 
temporalInfo) {
+if (strategy.equals(PADDING_STRATEGY.NONE) || temporalInfo == null) {
+  return;
+}
+
+// TODO: JSON dser returns LinkedHashMap that is not Navigable
+TreeMapLong, Double values = new TreeMapLong, 
Double(metric.getMetricValues());
+
+long dataInterval = getTimelineMetricInterval(values);
+
+if (dataInterval == -1) {
+  dataInterval = temporalInfo.getStep() != null ? temporalInfo.getStep() : 
-1;
+}
+// Unable to determine what interval to use for padding
+if (dataInterval == -1) {
+  return;
+}
+
+long intervalStartTime = longToMillis(temporalInfo.getStartTime());
+long intervalEndTime = longToMillis(temporalInfo.getEndTime());
+long dataStartTime = longToMillis(values.firstKey());
+long dataEndTime = longToMillis(values.lastKey());
+
+Double paddingValue = 0.0d;
+
+if (strategy.equals(PADDING_STRATEGY.NULLS)) {
+  paddingValue = null;
+}
+// Pad before data interval
+for (long counter = intervalStartTime; counter  dataStartTime; counter += 
dataInterval) {
+  // Until counter approaches or goes past dataStartTime : pad
+  values.put(counter, paddingValue);
+}
+// Pad after data interval
+for (long counter = dataEndTime + dataInterval; counter = 
intervalEndTime

ambari git commit: AMBARI-10809. AMS: navigating graph time ranges are not correct. Unit test fix. (swagle)

2015-04-29 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 7f753b444 - 4189dcca8


AMBARI-10809. AMS: navigating graph time ranges are not correct. Unit test fix. 
(swagle)


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

Branch: refs/heads/trunk
Commit: 4189dcca8ea334b099aed550191148fbc2c7395e
Parents: 7f753b4
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Wed Apr 29 13:59:47 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Wed Apr 29 13:59:47 2015 -0700

--
 .../metrics/MetricsPaddingMethod.java   |   3 +-
 .../timeline/AMSPropertyProviderTest.java   |   2 +-
 .../resources/ams/multiple_host_metrics.json| 172 +--
 3 files changed, 89 insertions(+), 88 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4189dcca/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPaddingMethod.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPaddingMethod.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPaddingMethod.java
index a78beee..32d214d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPaddingMethod.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPaddingMethod.java
@@ -25,6 +25,7 @@ import java.util.TreeMap;
 public class MetricsPaddingMethod {
   private final PADDING_STRATEGY strategy;
   public static final String ZERO_PADDING_PARAM = params/padding;
+  private static final long MINIMUM_STEP_INTERVAL = 999l; // ~ 1 second
   public static enum PADDING_STRATEGY {
 ZEROS,
 NULLS,
@@ -55,7 +56,7 @@ public class MetricsPaddingMethod {
 
 long dataInterval = getTimelineMetricInterval(values);
 
-if (dataInterval == -1) {
+if (dataInterval == -1 || dataInterval  MINIMUM_STEP_INTERVAL) {
   dataInterval = temporalInfo.getStep() != null ? temporalInfo.getStep() : 
-1;
 }
 // Unable to determine what interval to use for padding

http://git-wip-us.apache.org/repos/asf/ambari/blob/4189dcca/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProviderTest.java
index 78e1831..b72dcaf 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProviderTest.java
@@ -364,7 +364,7 @@ public class AMSPropertyProviderTest {
 uriBuilder.addParameter(endTime, 1421697600);
 Assert.assertEquals(uriBuilder.toString(), streamProvider.getLastSpec());
 Number[][] val = (Number[][]) res.getPropertyValue(propertyId);
-Assert.assertEquals(188, val.length);
+Assert.assertEquals(189, val.length);
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/ambari/blob/4189dcca/ambari-server/src/test/resources/ams/multiple_host_metrics.json
--
diff --git a/ambari-server/src/test/resources/ams/multiple_host_metrics.json 
b/ambari-server/src/test/resources/ams/multiple_host_metrics.json
index 019dc62..2868573 100644
--- a/ambari-server/src/test/resources/ams/multiple_host_metrics.json
+++ b/ambari-server/src/test/resources/ams/multiple_host_metrics.json
@@ -125,92 +125,92 @@
 appid: HOST,
 starttime: 1416445244801,
 metrics: {
-  1416486250037: 2.46272E8,
-  1416486255040: 2.46145024E8,
-  1416486260042: 2.46280192E8,
-  1416486265047: 2.4641536E8,
-  1416486270053: 2.44318208E8,
-  1416486275058: 2.464768E8,
-  1416486280063: 2.464768E8,
-  1416486285067: 2.464768E8,
-  1416486290072: 2.46898688E8,
-  1416486295077: 2.46898688E8,
-  1416486300083: 2.46898688E8,
-  1416486305088: 2.46898688E8,
-  1416486310093: 2.4676352E8,
-  1416486315097: 2.4676352E8,
-  1416486320102: 2.46898688E8,
-  1416486325105: 2.46898688E8,
-  1416486330107: 2.46898688E8,
-  1416486335113: 2.47025664E8,
-  1416486340118: 2.47025664E8,
-  1416486345123: 2.46898688E8

ambari git commit: AMBARI-10809. AMS: navigating graph time ranges are not correct. (swagle)

2015-04-29 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/branch-2.0.maint 5eab7803f - fa96df533


AMBARI-10809. AMS: navigating graph time ranges are not correct. (swagle)


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

Branch: refs/heads/branch-2.0.maint
Commit: fa96df5332b0da27b51e76a018a9e5400f38b9ec
Parents: 5eab780
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Wed Apr 29 13:50:05 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Wed Apr 29 13:50:05 2015 -0700

--
 .../metrics/MetricsPaddingMethod.java   | 107 ++
 .../metrics/MetricsPropertyProvider.java|  17 +-
 .../metrics/timeline/AMSPropertyProvider.java   |   8 +-
 .../timeline/AMSPropertyProviderTest.java   |   2 +-
 .../timeline/MetricsPaddingMethodTest.java  | 208 +++
 .../resources/ams/multiple_host_metrics.json| 172 +++
 6 files changed, 422 insertions(+), 92 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fa96df53/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPaddingMethod.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPaddingMethod.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPaddingMethod.java
new file mode 100644
index 000..6093aaf
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPaddingMethod.java
@@ -0,0 +1,107 @@
+/**
+ * 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.controller.metrics;
+
+import org.apache.ambari.server.controller.spi.TemporalInfo;
+import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
+import java.util.Iterator;
+import java.util.TreeMap;
+
+public class MetricsPaddingMethod {
+  private final PADDING_STRATEGY strategy;
+  private static final long MINIMUM_STEP_INTERVAL = 999l; // ~ 1 second
+  public static final String ZERO_PADDING_PARAM = params/padding;
+  public static enum PADDING_STRATEGY {
+ZEROS,
+NULLS,
+NONE
+  }
+
+  public MetricsPaddingMethod(PADDING_STRATEGY strategy) {
+this.strategy = strategy;
+  }
+
+  /**
+   * Adds zero/null values towards the end of metrics sequence as well as the
+   * beginning to support backward compatibility with Ganglia.
+   * We use step if only a single datapoint is found.
+   * It is assumed that @TimelineMetric.metricsValues are sorted in ascending
+   * order and thee is no padding between the interval.
+   *
+   * @param metric AMS @TimelineMetric
+   * @param temporalInfo @TemporalInfo Requested interval
+   */
+  public void applyPaddingStrategy(TimelineMetric metric, TemporalInfo 
temporalInfo) {
+if (strategy.equals(PADDING_STRATEGY.NONE) || temporalInfo == null) {
+  return;
+}
+
+// TODO: JSON dser returns LinkedHashMap that is not Navigable
+TreeMapLong, Double values = new TreeMapLong, 
Double(metric.getMetricValues());
+
+long dataInterval = getTimelineMetricInterval(values);
+
+if (dataInterval == -1 || dataInterval  MINIMUM_STEP_INTERVAL) {
+  dataInterval = temporalInfo.getStep() != null ? temporalInfo.getStep() : 
-1;
+}
+// Unable to determine what interval to use for padding
+if (dataInterval == -1) {
+  return;
+}
+
+long intervalStartTime = longToMillis(temporalInfo.getStartTime());
+long intervalEndTime = longToMillis(temporalInfo.getEndTime());
+long dataStartTime = longToMillis(values.firstKey());
+long dataEndTime = longToMillis(values.lastKey());
+
+Double paddingValue = 0.0d;
+
+if (strategy.equals(PADDING_STRATEGY.NULLS)) {
+  paddingValue = null;
+}
+// Pad before data interval
+for (long counter = intervalStartTime; counter  dataStartTime

ambari git commit: AMBARI-10799. Ambari API should support querying metric values with aggregation type (max, min, avg and sum). (swagle)

2015-04-27 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 35a99761e - 6a054b35a


AMBARI-10799. Ambari API should support querying metric values with aggregation 
type (max, min, avg and sum). (swagle)


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

Branch: refs/heads/trunk
Commit: 6a054b35a3a4034788d83455a124d9ece0d72811
Parents: 35a9976
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Mon Apr 27 16:17:21 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Mon Apr 27 16:17:21 2015 -0700

--
 .../metrics/MetricsPropertyProviderProxy.java   |3 -
 .../timeline/AMSComponentPropertyProvider.java  |   52 +-
 .../metrics/timeline/AMSPropertyProvider.java   |   52 +-
 .../timeline/AMSPropertyProviderTest.java   |   44 +-
 .../ams/aggregate_component_metric.json |   42 +
 .../ams/multiple_component_metrics.json | 1274 --
 6 files changed, 177 insertions(+), 1290 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6a054b35/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPropertyProviderProxy.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPropertyProviderProxy.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPropertyProviderProxy.java
index d2cd959..24f1851 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPropertyProviderProxy.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsPropertyProviderProxy.java
@@ -24,12 +24,10 @@ import 
org.apache.ambari.server.controller.metrics.ganglia.GangliaComponentPrope
 import 
org.apache.ambari.server.controller.metrics.ganglia.GangliaHostComponentPropertyProvider;
 import 
org.apache.ambari.server.controller.metrics.ganglia.GangliaHostPropertyProvider;
 import 
org.apache.ambari.server.controller.metrics.ganglia.GangliaPropertyProvider;
-import 
org.apache.ambari.server.controller.metrics.ganglia.GangliaReportPropertyProvider;
 import 
org.apache.ambari.server.controller.metrics.timeline.AMSComponentPropertyProvider;
 import 
org.apache.ambari.server.controller.metrics.timeline.AMSHostComponentPropertyProvider;
 import 
org.apache.ambari.server.controller.metrics.timeline.AMSHostPropertyProvider;
 import 
org.apache.ambari.server.controller.metrics.timeline.AMSPropertyProvider;
-import 
org.apache.ambari.server.controller.metrics.timeline.AMSReportPropertyProvider;
 import org.apache.ambari.server.controller.spi.Predicate;
 import org.apache.ambari.server.controller.spi.Request;
 import org.apache.ambari.server.controller.spi.Resource;
@@ -37,7 +35,6 @@ import 
org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.utilities.StreamProvider;
 import java.util.Map;
 import java.util.Set;
-
 import static 
org.apache.ambari.server.controller.metrics.MetricsServiceProvider.MetricsService;
 import static 
org.apache.ambari.server.controller.metrics.MetricsServiceProvider.MetricsService.GANGLIA;
 import static 
org.apache.ambari.server.controller.metrics.MetricsServiceProvider.MetricsService.TIMELINE_METRICS;

http://git-wip-us.apache.org/repos/asf/ambari/blob/6a054b35/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSComponentPropertyProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSComponentPropertyProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSComponentPropertyProvider.java
index 1fb0869..3e32326 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSComponentPropertyProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSComponentPropertyProvider.java
@@ -20,9 +20,16 @@ package org.apache.ambari.server.controller.metrics.timeline;
 import org.apache.ambari.server.configuration.ComponentSSLConfiguration;
 import org.apache.ambari.server.controller.internal.PropertyInfo;
 import org.apache.ambari.server.controller.metrics.MetricHostProvider;
+import org.apache.ambari.server.controller.spi.Predicate;
+import org.apache.ambari.server.controller.spi.Request;
 import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.utilities.PredicateHelper;
 import

ambari git commit: AMBARI-10707. AMS does not work with NN HA in AMS distrbuted mode. (swagle)

2015-04-23 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 638862c6d - a2c86f2a2


AMBARI-10707. AMS does not work with NN HA in AMS distrbuted mode. (swagle)


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

Branch: refs/heads/trunk
Commit: a2c86f2a20a82fb78f07b4107bbac7ee40d94529
Parents: 638862c
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu Apr 23 11:22:52 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu Apr 23 11:34:34 2015 -0700

--
 .../AMBARI_METRICS/0.1.0/package/scripts/ams.py | 41 
 1 file changed, 41 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a2c86f2a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
index 68ee119..8cbbed2 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
@@ -72,7 +72,27 @@ def ams(name=None):
  owner=params.ams_user,
  content=InlineTemplate(params.ams_env_sh_template)
 )
+pass
+
+if params.is_hbase_distributed:
+  # Configuration needed to support NN HA
+  XmlConfig(hdfs-site.xml,
+conf_dir=params.ams_collector_conf_dir,
+configurations=params.config['configurations']['hdfs-site'],
+
configuration_attributes=params.config['configuration_attributes']['hdfs-site'],
+owner=params.ams_user,
+group=params.user_group,
+mode=0644
+  )
 
+  XmlConfig(core-site.xml,
+conf_dir=params.ams_collector_conf_dir,
+configurations=params.config['configurations']['core-site'],
+
configuration_attributes=params.config['configuration_attributes']['core-site'],
+owner=params.ams_user,
+group=params.user_group,
+mode=0644
+  )
 pass
 
   elif name == 'monitor':
@@ -203,6 +223,27 @@ def ams(name=None):
   )
 pass
 
+if params.is_hbase_distributed:
+  # Configuration needed to support NN HA
+  XmlConfig(hdfs-site.xml,
+conf_dir=params.ams_collector_conf_dir,
+configurations=params.config['configurations']['hdfs-site'],
+
configuration_attributes=params.config['configuration_attributes']['hdfs-site'],
+owner=params.ams_user,
+group=params.user_group,
+mode=0644
+  )
+
+  XmlConfig(core-site.xml,
+conf_dir=params.ams_collector_conf_dir,
+configurations=params.config['configurations']['core-site'],
+
configuration_attributes=params.config['configuration_attributes']['core-site'],
+owner=params.ams_user,
+group=params.user_group,
+mode=0644
+  )
+pass
+
   elif name == 'monitor':
 Directory(params.ams_monitor_conf_dir,
   owner=params.ams_user,



ambari git commit: AMBARI-10710. Storm Rest API server will not start when used in conjunction with Ambari metrics on HDP 2.1. (swagle)

2015-04-23 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk aa3bd6e2b - d951909c1


AMBARI-10710. Storm Rest API server will not start when used in conjunction 
with Ambari metrics on HDP 2.1. (swagle)


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

Branch: refs/heads/trunk
Commit: d951909c1c491a23952ab505cd4812ee3f1f9669
Parents: aa3bd6e
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu Apr 23 13:40:08 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu Apr 23 13:49:17 2015 -0700

--
 .../STORM/0.9.1.2.1/package/templates/config.yaml.j2   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d951909c/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/templates/config.yaml.j2
--
diff --git 
a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/templates/config.yaml.j2
 
b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/templates/config.yaml.j2
index af7d8e3..460e391 100644
--- 
a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/templates/config.yaml.j2
+++ 
b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/templates/config.yaml.j2
@@ -46,7 +46,7 @@ ganglia:
   #spoof: 192.168.1.1:storm
 {% endif %}
 
-{% if has_metric_collector %}
+{% if has_metric_collector and stack_is_hdp22_or_further %}
 enableGanglia: False
 
 ganglia:



[1/2] ambari git commit: AMBARI-10711. Empty graph widgets on HBase service page.

2015-04-23 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk d951909c1 - 0730247ee


http://git-wip-us.apache.org/repos/asf/ambari/blob/0730247e/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
index 84efc2f..290ac73 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
@@ -150,7142 +150,3067 @@
   pointInTime:true,
   temporal:true
 },
-metrics/hbase/regionserver/compactionTime_avg_time: {
-  metric: hbase.regionserver.compactionTime_avg_time,
-  pointInTime: true,
-  temporal: true
-},
-metrics/rpc/closeRegion_num_ops: {
-  metric: rpc.rpc.closeRegion_num_ops,
-  pointInTime: true,
-  temporal: true
-},
 metrics/hbase/regionserver/mutationsWithoutWALSize: {
   metric: regionserver.Server.mutationsWithoutWALSize,
   pointInTime: false,
   temporal: true
 },
-metrics/rpc/unassign_num_ops: {
-  metric: rpc.rpc.unassign_num_ops,
-  pointInTime: true,
+metrics/hbase/regionserver/slowAppendCount: {
+  metric: regionserver.Server.slowAppendCount,
+  pointInTime: false,
   temporal: true
 },
-metrics/rpc/modifyTable_num_ops: {
-  metric: rpc.rpc.modifyTable_num_ops,
+metrics/disk/part_max_used: {
+  metric: part_max_used,
   pointInTime: true,
   temporal: true
 },
-metrics/rpc/getProtocolVersion_avg_time: {
-  metric: rpc.rpc.getProtocolVersion_avg_time,
-  pointInTime: true,
+metrics/hbase/regionserver/blockCacheCount: {
+  metric: regionserver.Server.blockCacheCount,
+  pointInTime: false,
   temporal: true
 },
-metrics/rpc/getZooKeeper/aboveOneSec/_avg_time: {
-  metric: rpc.rpc.getZooKeeper.aboveOneSec._avg_time,
+metrics/ugi/loginSuccess_num_ops: {
+  metric: ugi.UgiMetrics.LoginSuccessNumOps,
   pointInTime: true,
   temporal: true
 },
-metrics/rpc/getClosestRowBefore_num_ops: {
-  metric: rpc.rpc.getClosestRowBefore_num_ops,
+metrics/jvm/memHeapCommittedM: {
+  metric: jvm.JvmMetrics.MemHeapCommittedM,
   pointInTime: true,
   temporal: true
 },
-metrics/hbase/regionserver/slowAppendCount: {
-  metric: regionserver.Server.slowAppendCount,
-  pointInTime: false,
-  temporal: true
-},
-metrics/rpc/getClosestRowBefore/aboveOneSec/_avg_time: {
-  metric: rpc.rpc.getClosestRowBefore.aboveOneSec._avg_time,
+metrics/jvm/threadsRunnable: {
+  metric: jvm.JvmMetrics.ThreadsRunnable,
   pointInTime: true,
   temporal: true
 },
-metrics/rpc/lockRow_num_ops: {
-  metric: rpc.rpc.lockRow_num_ops,
-  pointInTime: true,
+metrics/hbase/regionserver/deleteRequestLatency_min: {
+  metric: regionserver.Server.Delete_min,
+  pointInTime: false,
   temporal: true
 },
-metrics/rpc/flushRegion_avg_time: {
-  metric: rpc.rpc.flushRegion_avg_time,
+metrics/jvm/threadsNew: {
+  metric: jvm.JvmMetrics.ThreadsNew,
   pointInTime: true,
   temporal: true
 },
-metrics/rpc/stopMaster_num_ops: {
-  metric: rpc.rpc.stopMaster_num_ops,
+metrics/rpc/rpcAuthorizationFailures: {
+  metric: regionserver.RegionServer.authorizationFailures,
   pointInTime: true,
   temporal: true
 },
-metrics/rpc/openRegions/aboveOneSec/_num_ops: {
-  metric: rpc.rpc.openRegions.aboveOneSec._num_ops,
+metrics/rpc/RpcQueueTime_avg_time: {
+  metric: regionserver.RegionServer.QueueCallTime_median,
   pointInTime: true,
   temporal: true
 },
-metrics/rpc/balance_avg_time: {
-  metric: rpc.rpc.balance_avg_time,
+metrics/boottime: {
+  metric: boottime,
   pointInTime: true,
   temporal: true
 },
-metrics/disk/part_max_used: {
-  metric: 

[2/2] ambari git commit: AMBARI-10711. Empty graph widgets on HBase service page.

2015-04-23 Thread swagle
AMBARI-10711. Empty graph widgets on HBase service page.


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

Branch: refs/heads/trunk
Commit: 0730247ee4396bce0aa2fbb6bdb9f19287405d7d
Parents: d951909
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu Apr 23 14:19:28 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu Apr 23 14:19:28 2015 -0700

--
 .../HBASE/0.96.0.2.0/metrics.json   | 9107 +-
 1 file changed, 2406 insertions(+), 6701 deletions(-)
--




[2/2] ambari git commit: AMBARI-10622. Add daily aggregation to AMS (useful for reporting over months of data). (swagle)

2015-04-21 Thread swagle
AMBARI-10622. Add daily aggregation to AMS (useful for reporting over months of 
data). (swagle)


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

Branch: refs/heads/trunk
Commit: 67c425acfd22dcd701d05eab16f22d423db045dd
Parents: 2557d9a
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Tue Apr 21 09:51:58 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Tue Apr 21 09:51:58 2015 -0700

--
 .../ambari-metrics-timelineservice/pom.xml  |   1 +
 .../timeline/HBaseTimelineMetricStore.java  |  40 ++--
 .../metrics/timeline/PhoenixHBaseAccessor.java  | 144 ++--
 .../metrics/timeline/Precision.java |   6 +-
 .../timeline/TimelineMetricConfiguration.java   |  29 ++-
 .../aggregators/AbstractTimelineAggregator.java |  58 -
 .../TimelineClusterMetricReader.java|  42 
 .../aggregators/TimelineMetricAggregator.java   | 151 ++--
 .../TimelineMetricAggregatorFactory.java| 188 ++-
 .../TimelineMetricClusterAggregator.java| 235 ++-
 .../TimelineMetricClusterAggregatorHourly.java  | 175 --
 .../TimelineMetricClusterAggregatorMinute.java  | 201 
 .../TimelineMetricHostAggregator.java   | 113 +
 .../aggregators/TimelineMetricReadHelper.java   |  36 +++
 .../timeline/query/PhoenixTransactSQL.java  |  82 ---
 .../timeline/AbstractMiniHBaseClusterTest.java  |   5 +-
 .../metrics/timeline/ITClusterAggregator.java   |  99 ++--
 .../metrics/timeline/ITMetricAggregator.java|  82 ++-
 .../timeline/ITPhoenixHBaseAccessor.java|  34 ++-
 .../metrics/timeline/MetricTestHelper.java  |   7 +-
 .../timeline/TestMetricHostAggregate.java   |   4 +-
 .../0.1.0/configuration/ams-site.xml|  70 +-
 22 files changed, 1065 insertions(+), 737 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/67c425ac/ambari-metrics/ambari-metrics-timelineservice/pom.xml
--
diff --git a/ambari-metrics/ambari-metrics-timelineservice/pom.xml 
b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
index 4ec730e..2485661 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/pom.xml
+++ b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
@@ -249,6 +249,7 @@
 configuration
   redirectTestOutputToFiletrue/redirectTestOutputToFile
   forkModealways/forkMode
+  argLine-XX:-UseSplitVerifier/argLine
 /configuration
   /plugin
 /plugins

http://git-wip-us.apache.org/repos/asf/ambari/blob/67c425ac/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
index 1fac404..447f6f9 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
@@ -28,8 +28,6 @@ import 
org.apache.hadoop.yarn.api.records.timeline.TimelinePutResponse;
 import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators.Function;
 import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators.TimelineMetricAggregator;
 import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators.TimelineMetricAggregatorFactory;
-import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators.TimelineMetricClusterAggregator;
-import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators.TimelineMetricClusterAggregatorHourly;
 import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.Condition;
 import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.DefaultCondition;
 
@@ -69,39 +67,53 @@ public class HBaseTimelineMetricStore extends 
AbstractService
 hBaseAccessor = new PhoenixHBaseAccessor(hbaseConf, metricsConf

[1/2] ambari git commit: AMBARI-10622. Add daily aggregation to AMS (useful for reporting over months of data). (swagle)

2015-04-21 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 2557d9a8f - 67c425acf


http://git-wip-us.apache.org/repos/asf/ambari/blob/67c425ac/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorMinute.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorMinute.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorMinute.java
new file mode 100644
index 000..293608e
--- /dev/null
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorMinute.java
@@ -0,0 +1,201 @@
+/**
+ * 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.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators;
+
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.PhoenixHBaseAccessor;
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.Condition;
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.DefaultCondition;
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.PhoenixTransactSQL;
+import java.io.IOException;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.PhoenixTransactSQL.GET_METRIC_SQL;
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.PhoenixTransactSQL.METRICS_CLUSTER_AGGREGATE_TABLE_NAME;
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.PhoenixTransactSQL.METRICS_RECORD_TABLE_NAME;
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.PhoenixTransactSQL.NATIVE_TIME_RANGE_DELTA;
+
+/**
+ * Aggregates a metric across all hosts in the cluster. Reads metrics from
+ * the precision table and saves into the aggregate.
+ */
+public class TimelineMetricClusterAggregatorMinute extends 
AbstractTimelineAggregator {
+  private static final Log LOG = 
LogFactory.getLog(TimelineMetricClusterAggregatorMinute.class);
+  public Long timeSliceIntervalMillis;
+  private TimelineMetricReadHelper timelineMetricReadHelper = new 
TimelineMetricReadHelper(true);
+  // Aggregator to perform app-level aggregates for host metrics
+  private final TimelineMetricAppAggregator appAggregator;
+
+  public TimelineMetricClusterAggregatorMinute(PhoenixHBaseAccessor 
hBaseAccessor,
+   Configuration metricsConf,
+   String checkpointLocation,
+   Long sleepIntervalMillis,
+   Integer 
checkpointCutOffMultiplier,
+   String aggregatorDisabledParam,
+   String tableName,
+   String outputTableName,
+   Long nativeTimeRangeDelay,
+   Long timeSliceInterval) {
+super(hBaseAccessor, metricsConf, checkpointLocation, sleepIntervalMillis,
+  checkpointCutOffMultiplier, aggregatorDisabledParam, tableName,
+  outputTableName, nativeTimeRangeDelay);
+
+appAggregator = new TimelineMetricAppAggregator(metricsConf);
+

ambari git commit: AMBARI-10543. String matches does not work on metrics property of Widget response.

2015-04-16 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 9dfbf91df - 5bb1faefb


AMBARI-10543. String matches does not work on metrics property of Widget 
response.


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

Branch: refs/heads/trunk
Commit: 5bb1faefb10bce6f2eee5d65d98f4ad9e05d4e8d
Parents: 9dfbf91
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu Apr 16 11:17:49 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu Apr 16 11:17:49 2015 -0700

--
 .../internal/WidgetResourceProvider.java|  6 ++--
 .../internal/WidgetResourceProviderTest.java| 32 +---
 2 files changed, 24 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5bb1faef/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
index 1bd1058..59f0e88 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetResourceProvider.java
@@ -230,14 +230,14 @@ public class WidgetResourceProvider extends 
AbstractControllerResourceProvider {
   resource.setProperty(WIDGET_ID_PROPERTY_ID, entity.getId());
   resource.setProperty(WIDGET_WIDGET_NAME_PROPERTY_ID, 
entity.getWidgetName());
   resource.setProperty(WIDGET_WIDGET_TYPE_PROPERTY_ID, 
entity.getWidgetType());
-  setResourceProperty(resource, WIDGET_METRICS_PROPERTY_ID, 
gson.fromJson(entity.getMetrics(), ArrayList.class), requestedIds);
+  setResourceProperty(resource, WIDGET_METRICS_PROPERTY_ID, 
entity.getMetrics(), requestedIds);
   setResourceProperty(resource, WIDGET_TIME_CREATED_PROPERTY_ID, 
entity.getTimeCreated(), requestedIds);
   resource.setProperty(WIDGET_AUTHOR_PROPERTY_ID, entity.getAuthor());
   setResourceProperty(resource, WIDGET_DESCRIPTION_PROPERTY_ID, 
entity.getDescription(), requestedIds);
   resource.setProperty(WIDGET_DISPLAY_NAME_PROPERTY_ID, 
entity.getDisplayName());
   resource.setProperty(WIDGET_SCOPE_PROPERTY_ID, entity.getScope());
-  setResourceProperty(resource, WIDGET_VALUES_PROPERTY_ID, 
gson.fromJson(entity.getWidgetValues(), ArrayList.class), requestedIds);
-  setResourceProperty(resource, WIDGET_PROPERTIES_PROPERTY_ID, 
gson.fromJson(entity.getProperties(), Map.class), requestedIds);
+  setResourceProperty(resource, WIDGET_VALUES_PROPERTY_ID, 
entity.getWidgetValues(), requestedIds);
+  setResourceProperty(resource, WIDGET_PROPERTIES_PROPERTY_ID, 
entity.getProperties(), requestedIds);
 
   String clusterName = null;
   try {

http://git-wip-us.apache.org/repos/asf/ambari/blob/5bb1faef/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetResourceProviderTest.java
index 568a89c..917f1c2 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetResourceProviderTest.java
@@ -145,11 +145,20 @@ public class WidgetResourceProviderTest {
 Assert.assertEquals(displ_name, 
r.getPropertyValue(WidgetResourceProvider.WIDGET_DISPLAY_NAME_PROPERTY_ID));
 Assert.assertEquals(widget name, 
r.getPropertyValue(WidgetResourceProvider.WIDGET_WIDGET_NAME_PROPERTY_ID));
 Object metrics = 
r.getPropertyValue(WidgetResourceProvider.WIDGET_METRICS_PROPERTY_ID);
-Assert.assertTrue(metrics instanceof List);
-Assert.assertEquals(2, ((List) metrics).size());
-Object values = 
r.getPropertyValue(WidgetResourceProvider.WIDGET_VALUES_PROPERTY_ID);
-Assert.assertTrue(values instanceof List);
-Assert.assertEquals(1, ((List) values).size());
+Assert.assertEquals([{\widget_id\:\metrics/jvm/HeapMemoryUsed\, +
+
\host_component_criteria\:\host_components/metrics/dfs/FSNamesystem/HAState\\u003dactive\,
 +
+\service_name\:\HDFS\,\component_name\:\NAMENODE\, +
+

ambari git commit: AMBARI-10484. Change response structure for widget layout API.

2015-04-15 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 9420d3816 - b92bfc352


AMBARI-10484. Change response structure for widget layout API.


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

Branch: refs/heads/trunk
Commit: b92bfc352d41a84327824fcba34fa44c541db795
Parents: 9420d38
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Wed Apr 15 12:20:45 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Wed Apr 15 12:20:45 2015 -0700

--
 .../WidgetLayoutResourceDefinition.java |  8 +++---
 .../internal/WidgetLayoutResourceProvider.java  | 28 ++--
 .../WidgetLayoutResourceProviderTest.java   | 12 -
 3 files changed, 24 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b92bfc35/ambari-server/src/main/java/org/apache/ambari/server/api/resources/WidgetLayoutResourceDefinition.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/WidgetLayoutResourceDefinition.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/WidgetLayoutResourceDefinition.java
index 2d2ca1e..a9bbd9c 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/WidgetLayoutResourceDefinition.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/WidgetLayoutResourceDefinition.java
@@ -68,13 +68,13 @@ public class WidgetLayoutResourceDefinition extends 
BaseResourceDefinition {
   TreeNodeResource parent = resultNode.getParent();
 
   for (TreeNodeResource node : parent.getChildren()) {
-if (node.getObject().getPropertiesMap().get(WidgetLayouts) != null 
-
node.getObject().getPropertiesMap().get(WidgetLayouts).get(WidgetInfo) != 
null) {
+if (node.getObject().getPropertiesMap().get(WidgetLayoutInfo) != 
null 
+
node.getObject().getPropertiesMap().get(WidgetLayoutInfo).get(widgets) != 
null) {
 
-  ArrayList widgetsList = (ArrayList) 
node.getObject().getPropertiesMap().get(WidgetLayouts).get(WidgetInfo);
+  ArrayList widgetsList = (ArrayList) 
node.getObject().getPropertiesMap().get(WidgetLayoutInfo).get(widgets);
   for (Object widgetObject : widgetsList) {
 HashMapString, Object widgetMap = (HashMap) widgetObject;
-String widgetId = ((WidgetResponse) 
widgetMap.get(Widget)).getId().toString();
+String widgetId = ((WidgetResponse) 
widgetMap.get(WidgetInfo)).getId().toString();
 String widgetHref = href.substring(0, 
href.indexOf(/widget_layouts) + 1) +
 widgets/ + widgetId;
 widgetMap.put(href, widgetHref);

http://git-wip-us.apache.org/repos/asf/ambari/blob/b92bfc35/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
index ba3bce9..8fa5bc6 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProvider.java
@@ -59,14 +59,14 @@ public class WidgetLayoutResourceProvider extends 
AbstractControllerResourceProv
 
   // - Property ID constants -
 
-  public static final String WIDGETLAYOUT_ID_PROPERTY_ID = 
PropertyHelper.getPropertyId(WidgetLayouts, id);
-  public static final String WIDGETLAYOUT_CLUSTER_NAME_PROPERTY_ID 
= PropertyHelper.getPropertyId(WidgetLayouts, cluster_name);
-  public static final String WIDGETLAYOUT_SECTION_NAME_PROPERTY_ID 
= PropertyHelper.getPropertyId(WidgetLayouts, section_name);
-  public static final String WIDGETLAYOUT_LAYOUT_NAME_PROPERTY_ID  
   = PropertyHelper.getPropertyId(WidgetLayouts, layout_name);
-  public static final String WIDGETLAYOUT_SCOPE_PROPERTY_ID  = 
PropertyHelper.getPropertyId(WidgetLayouts, scope);
-  public static final String WIDGETLAYOUT_INFO_PROPERTY_ID   = 
PropertyHelper.getPropertyId(WidgetLayouts, WidgetInfo);
-  public static final String WIDGETLAYOUT_USERNAME_PROPERTY_ID 
  = PropertyHelper.getPropertyId(WidgetLayouts, user_name);
-  public 

ambari git commit: AMBARI-10505. Equals predicate does not work for host component metrics. (swagle)

2015-04-15 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk e9617f7f6 - f05543d39


AMBARI-10505. Equals predicate does not work for host component metrics. 
(swagle)


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

Branch: refs/heads/trunk
Commit: f05543d393aed760f49f799a447366d45b3a128b
Parents: e9617f7
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Wed Apr 15 13:16:17 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Wed Apr 15 13:58:56 2015 -0700

--
 .../ambari/server/api/query/QueryImpl.java  |  2 +-
 .../ambari/server/api/query/QueryImplTest.java  | 73 
 2 files changed, 74 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f05543d3/ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java 
b/ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java
index 0ab9d07..2319683 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java
@@ -445,7 +445,7 @@ public class QueryImpl implements Query, ResourceInstance {
 new QueryResult(request, queryPredicate, subResourcePredicate, 
map, new QueryResponseImpl(resourceSet)));
 }
   }
-  clusterController.populateResources(resourceType, providerResourceSet, 
request, null);
+  clusterController.populateResources(resourceType, providerResourceSet, 
request, subResourcePredicate);
   subResource.queryForSubResources();
 }
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/f05543d3/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java
index 5ac91fd..01361d2 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java
@@ -23,6 +23,7 @@ package org.apache.ambari.server.api.query;
 import static org.easymock.EasyMock.anyBoolean;
 import static org.easymock.EasyMock.anyObject;
 import static org.easymock.EasyMock.capture;
+import static org.easymock.EasyMock.createMock;
 import static org.easymock.EasyMock.createNiceMock;
 import static org.easymock.EasyMock.eq;
 import static org.easymock.EasyMock.expect;
@@ -301,6 +302,78 @@ public class QueryImplTest {
   }
 
   @Test
+  public void testExecute_SubResourcePropertyPredicate() throws Exception {
+ResourceDefinition resourceDefinition = new ClusterResourceDefinition();
+
+MapResource.Type, String mapIds = new HashMapResource.Type, String();
+mapIds.put(Resource.Type.Cluster, c1);
+mapIds.put(Resource.Type.Host, h1);
+
+ClusterController clusterController = 
createNiceMock(ClusterController.class);
+QueryResponse clusterResponse = createNiceMock(QueryResponse.class);
+QueryResponse hostResponse = createNiceMock(QueryResponse.class);
+Schema clusterSchema = createNiceMock(ClusterSchema, Schema.class);
+Schema hostSchema = createNiceMock(HostSchema, Schema.class);
+Renderer renderer = createNiceMock(Renderer.class);
+Resource clusterResource = createMock(ClusterResource, Resource.class);
+Resource hostResource = createMock(HostResource, Resource.class);
+SetResource clusterResources = Collections.singleton(clusterResource);
+SetResource hostResources = Collections.singleton(hostResource);
+IterableResource iterable = createNiceMock(Iterable.class);
+IteratorResource iterator = createNiceMock(Iterator.class);
+
+
expect(clusterController.getSchema(Resource.Type.Cluster)).andReturn(clusterSchema).anyTimes();
+
expect(clusterController.getSchema(Resource.Type.Host)).andReturn(hostSchema).anyTimes();
+
+expect(clusterController.getResources(eq(Resource.Type.Cluster),
+  anyObject(org.apache.ambari.server.controller.spi.Request.class), 
anyObject(Predicate.class))).
+  andReturn(clusterResponse);
+
+// Expect this call with a predicate passed down
+expect(clusterController.getResources(eq(Resource.Type.Host),
+  anyObject(org.apache.ambari.server.controller.spi.Request.class), 
anyObject(Predicate.class))).
+  andReturn(hostResponse

ambari git commit: AMBARI-10445. Populate cluster widgets from stack-defined widgets on cluster/service create. Unit test fix. (swagle)

2015-04-13 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 5a60fa18a - e5efc57ae


AMBARI-10445. Populate cluster widgets from stack-defined widgets on 
cluster/service create. Unit test fix. (swagle)


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

Branch: refs/heads/trunk
Commit: e5efc57ae7828ce379079385454d58142db9b44b
Parents: 5a60fa1
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Mon Apr 13 16:57:46 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Mon Apr 13 16:57:53 2015 -0700

--
 .../server/controller/AmbariManagementControllerImpl.java | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e5efc57a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 07ac1d3..c442349 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -388,7 +388,8 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
   clusters.mapHostsToCluster(request.getHostNames(),
   request.getClusterName());
 }
-
+// Create cluster widgets and layouts
+initializeWidgetsAndLayouts(c, null);
   }
 
   @Override
@@ -3832,7 +3833,7 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
   @SuppressWarnings(unchecked)
   @Override
   public void initializeWidgetsAndLayouts(Cluster cluster, Service service) 
throws AmbariException {
-StackId stackId = cluster.getCurrentStackVersion();
+StackId stackId = cluster.getDesiredStackVersion();
 Type widgetLayoutType = new TypeTokenMapString, 
ListWidgetLayout(){}.getType();
 
 try {
@@ -3868,7 +3869,7 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 }
   }
   if (widgetDescriptor != null) {
-LOG.debug(Loaded widgest descriptor:  + widgetDescriptor);
+LOG.debug(Loaded widget descriptor:  + widgetDescriptor);
 for (Object artifact : widgetDescriptor.values()) {
   ListWidgetLayout widgetLayouts = (ListWidgetLayout) artifact;
   createWidgetsAndLayouts(cluster, widgetLayouts);



[1/2] ambari git commit: AMBARI-10445. Populate cluster widgets from stack-defined widgets on cluster/service create. (swagle)

2015-04-10 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 2f2e37267 - fe702ab2a


AMBARI-10445. Populate cluster widgets from stack-defined widgets on 
cluster/service create. (swagle)


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

Branch: refs/heads/trunk
Commit: c71624a60654b1ed2ef04068fe986a0409fdd648
Parents: 2f2e372
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri Apr 10 15:09:08 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri Apr 10 15:09:08 2015 -0700

--
 .../api/services/WidgetLayoutService.java   |  17 ++-
 .../server/api/services/WidgetService.java  |  17 ++-
 .../controller/AmbariManagementController.java  |   9 ++
 .../AmbariManagementControllerImpl.java | 139 -
 .../internal/ClusterResourceProvider.java   |  33 ++--
 .../internal/ServiceResourceProvider.java   |  12 +-
 .../internal/StackArtifactResourceProvider.java |   4 +-
 .../internal/WidgetLayoutResourceProvider.java  |  19 ++-
 .../internal/WidgetResourceProvider.java|  19 ++-
 .../apache/ambari/server/orm/dao/WidgetDAO.java |  11 ++
 .../ambari/server/orm/dao/WidgetLayoutDAO.java  |  11 ++
 .../server/orm/entities/WidgetEntity.java   |   7 +-
 .../server/orm/entities/WidgetLayoutEntity.java |   3 +-
 .../ambari/server/state/stack/WidgetLayout.java |   7 +
 .../server/state/stack/WidgetLayoutInfo.java|   2 +-
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |   4 +-
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |   4 +-
 .../resources/Ambari-DDL-Postgres-CREATE.sql|   4 +-
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql |   4 +-
 .../AmbariManagementControllerTest.java | 150 +--
 .../OTHER/2.0/services/HBASE/widgets.json   |   2 +-
 21 files changed, 374 insertions(+), 104 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c71624a6/ambari-server/src/main/java/org/apache/ambari/server/api/services/WidgetLayoutService.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/WidgetLayoutService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/WidgetLayoutService.java
index 234b773..fad83cb 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/WidgetLayoutService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/WidgetLayoutService.java
@@ -28,6 +28,7 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
 import java.nio.charset.Charset;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -119,13 +120,15 @@ public class WidgetLayoutService extends BaseService {
   }
 
   private String getUserName(HttpHeaders headers) {
-String authorizationString = 
headers.getRequestHeaders().get(Authorization).get(0);
-if (authorizationString != null  
authorizationString.startsWith(Basic)) {
-  String base64Credentials = 
authorizationString.substring(Basic.length()).trim();
-  String clearCredentials = new 
String(Base64.decode(base64Credentials),Charset.forName(UTF-8));
-  return clearCredentials.split(:, 2)[0];
-} else {
-  return null;
+ListString authorizationHeaders = 
headers.getRequestHeaders().get(Authorization);
+if (authorizationHeaders != null  !authorizationHeaders.isEmpty()){
+  String authorizationString = authorizationHeaders.get(0);
+  if (authorizationString != null  
authorizationString.startsWith(Basic)) {
+String base64Credentials = 
authorizationString.substring(Basic.length()).trim();
+String clearCredentials = new 
String(Base64.decode(base64Credentials),Charset.forName(UTF-8));
+return clearCredentials.split(:, 2)[0];
+  }
 }
+return null;
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c71624a6/ambari-server/src/main/java/org/apache/ambari/server/api/services/WidgetService.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/WidgetService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/WidgetService.java
index ead0985..07dae40 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/WidgetService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/WidgetService.java
@@ -28,6 +28,7 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
 import java.nio.charset.Charset;
 import java.util.HashMap;
+import java.util.List;
 import

[2/2] ambari git commit: AMBARI-10445. Populate cluster widgets from stack-defined widgets on cluster/service create. Dispaly Name not null fix. (swagle)

2015-04-10 Thread swagle
AMBARI-10445. Populate cluster widgets from stack-defined widgets on 
cluster/service create. Dispaly Name not null fix. (swagle)


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

Branch: refs/heads/trunk
Commit: fe702ab2a0e36371d0a311d04e5c58a028ead9c2
Parents: c71624a
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri Apr 10 15:26:32 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri Apr 10 15:26:32 2015 -0700

--
 ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql| 4 ++--
 ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql   | 4 ++--
 ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fe702ab2/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
--
diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 
b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
index 2edb93e..fb2a831 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -542,7 +542,7 @@ CREATE TABLE widget (
   time_created BIGINT NOT NULL,
   author VARCHAR(255),
   description VARCHAR(255),
-  display_name VARCHAR(255) NOT NULL,
+  display_name VARCHAR(255),
   scope VARCHAR(255),
   widget_values VARCHAR(4000),
   properties VARCHAR(4000),
@@ -556,7 +556,7 @@ CREATE TABLE widget_layout (
   section_name VARCHAR(255) NOT NULL,
   scope VARCHAR(255) NOT NULL,
   user_name VARCHAR(255) NOT NULL,
-  display_name VARCHAR(255) NOT NULL,
+  display_name VARCHAR(255),
   cluster_id BIGINT NOT NULL,
   PRIMARY KEY(id)
 );

http://git-wip-us.apache.org/repos/asf/ambari/blob/fe702ab2/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
--
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql 
b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
index 9834933..ae70ed3 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
@@ -530,7 +530,7 @@ CREATE TABLE widget (
   time_created NUMBER(19) NOT NULL,
   author VARCHAR2(255),
   description VARCHAR2(255),
-  display_name VARCHAR2(255) NOT NULL,
+  display_name VARCHAR2(255),
   scope VARCHAR2(255),
   widget_values VARCHAR2(4000),
   properties VARCHAR2(4000),
@@ -544,7 +544,7 @@ CREATE TABLE widget_layout (
   section_name VARCHAR2(255) NOT NULL,
   scope VARCHAR2(255) NOT NULL,
   user_name VARCHAR2(255) NOT NULL,
-  display_name VARCHAR2(255) NOT NULL,
+  display_name VARCHAR2(255),
   cluster_id NUMBER(19) NOT NULL,
   PRIMARY KEY(id)
 );

http://git-wip-us.apache.org/repos/asf/ambari/blob/fe702ab2/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
--
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 
b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
index 1b97c2a..f1f3055 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -535,7 +535,7 @@ CREATE TABLE widget (
   time_created BIGINT NOT NULL,
   author VARCHAR(255),
   description VARCHAR(255),
-  display_name VARCHAR(255) NOT NULL,
+  display_name VARCHAR(255),
   scope VARCHAR(255),
   widget_values VARCHAR(4000),
   properties VARCHAR(4000),
@@ -549,7 +549,7 @@ CREATE TABLE widget_layout (
   section_name VARCHAR(255) NOT NULL,
   scope VARCHAR(255) NOT NULL,
   user_name VARCHAR(255) NOT NULL,
-  display_name VARCHAR(255) NOT NULL,
+  display_name VARCHAR(255),
   cluster_id BIGINT NOT NULL,
   PRIMARY KEY(id)
 );



ambari git commit: AMBARI-10394. JDK-8013062 appeared during adding service. (swagle)

2015-04-10 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk fe702ab2a - 25fe9bd51


AMBARI-10394. JDK-8013062 appeared during adding service. (swagle)


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

Branch: refs/heads/trunk
Commit: 25fe9bd51d6eb03196267d6abf226a0f75a08280
Parents: fe702ab
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri Apr 10 16:01:37 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri Apr 10 16:01:37 2015 -0700

--
 ambari-server/src/main/python/ambari_server_main.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/25fe9bd5/ambari-server/src/main/python/ambari_server_main.py
--
diff --git a/ambari-server/src/main/python/ambari_server_main.py 
b/ambari-server/src/main/python/ambari_server_main.py
index 902b457..1e6b2ec 100644
--- a/ambari-server/src/main/python/ambari_server_main.py
+++ b/ambari-server/src/main/python/ambari_server_main.py
@@ -58,7 +58,8 @@ jvm_args = os.getenv('AMBARI_JVM_ARGS', '-Xms512m -Xmx2048m')
 SERVER_START_CMD = {0}  \
 -server -XX:NewRatio=3  \
 -XX:+UseConcMarkSweepGC  + \
--XX:-UseGCOverheadLimit -XX:CMSInitiatingOccupancyFraction=60  + \
+-XX:-UseGCOverheadLimit -XX:CMSInitiatingOccupancyFraction=60  \
+-Dsun.zip.disableMemoryMapping=true  + \
 {1} {2}  \
 -cp {3} \
 org.apache.ambari.server.controller.AmbariServer  \



ambari git commit: AMBARI-10445. Populate cluster widgets from stack-defined widgets on cluster/service create. Upgrade Catalog changes. (swagle)

2015-04-10 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk d3d73f762 - 5dad81c3d


AMBARI-10445. Populate cluster widgets from stack-defined widgets on 
cluster/service create. Upgrade Catalog changes. (swagle)


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

Branch: refs/heads/trunk
Commit: 5dad81c3df577bc81f588cb61eae6b0f56089b87
Parents: d3d73f7
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri Apr 10 17:24:25 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri Apr 10 17:24:32 2015 -0700

--
 .../org/apache/ambari/server/upgrade/UpgradeCatalog210.java  | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5dad81c3/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 e94d5f4..d72c9d3 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
@@ -309,10 +309,10 @@ public class UpgradeCatalog210 extends 
AbstractUpgradeCatalog {
 columns.add(new DBColumnInfo(time_created, Long.class,  255,   null, 
false));
 columns.add(new DBColumnInfo(author, String.class,  255,   null, true));
 columns.add(new DBColumnInfo(description, String.class,  255,   null, 
true));
-columns.add(new DBColumnInfo(display_name, String.class,  255,   null, 
false));
+columns.add(new DBColumnInfo(display_name, String.class,  255,   null, 
true));
 columns.add(new DBColumnInfo(scope, String.class,  255,   null, true));
-columns.add(new DBColumnInfo(widget_values, String.class,  255,   null, 
true));
-columns.add(new DBColumnInfo(properties, String.class,  255,   null, 
true));
+columns.add(new DBColumnInfo(widget_values, String.class,  4000,   null, 
true));
+columns.add(new DBColumnInfo(properties, String.class,  4000,   null, 
true));
 columns.add(new DBColumnInfo(cluster_id, Long.class,  255,   null, 
false));
 dbAccessor.createTable(WIDGET_TABLE, columns, id);
 
@@ -323,7 +323,7 @@ public class UpgradeCatalog210 extends 
AbstractUpgradeCatalog {
 columns.add(new DBColumnInfo(cluster_id, Long.class,  255,   null, 
false));
 columns.add(new DBColumnInfo(scope, String.class,  255,   null, false));
 columns.add(new DBColumnInfo(user_name, String.class,  255,   null, 
false));
-columns.add(new DBColumnInfo(display_name, String.class,  255,   null, 
false));
+columns.add(new DBColumnInfo(display_name, String.class,  255,   null, 
true));
 
 dbAccessor.createTable(WIDGET_LAYOUT_TABLE, columns, id);
 



ambari git commit: AMBARI-10445. Populate cluster widgets from stack-defined widgets on cluster/service create. Upgrade Catalog changes. (swagle)

2015-04-10 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk f8b83e2f6 - 37717dd4c


AMBARI-10445. Populate cluster widgets from stack-defined widgets on 
cluster/service create. Upgrade Catalog changes. (swagle)


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

Branch: refs/heads/trunk
Commit: 37717dd4cd55ee75f3f218e6fee20af529cc0f87
Parents: f8b83e2
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri Apr 10 18:46:44 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri Apr 10 18:49:57 2015 -0700

--
 .../server/upgrade/UpgradeCatalog210.java   | 36 +
 .../server/upgrade/UpgradeCatalog210Test.java   | 78 
 2 files changed, 114 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/37717dd4/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 d72c9d3..09a8740 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
@@ -22,10 +22,18 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.configuration.Configuration;
+import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.orm.DBAccessor.DBColumnInfo;
+import org.apache.ambari.server.orm.dao.ClusterDAO;
+import org.apache.ambari.server.orm.dao.ClusterServiceDAO;
+import org.apache.ambari.server.orm.entities.ClusterEntity;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Service;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -357,6 +365,32 @@ public class UpgradeCatalog210 extends 
AbstractUpgradeCatalog {
 false);
   }
 
+  /**
+   * Copy cluster  service widgets from stack to DB.
+   */
+  protected void initializeClusterAndServiceWidgets() throws AmbariException {
+AmbariManagementController controller = 
injector.getInstance(AmbariManagementController.class);
+Clusters clusters = controller.getClusters();
+if (clusters == null) {
+  return;
+}
+
+MapString, Cluster clusterMap = clusters.getClusters();
+
+if (clusterMap != null  !clusterMap.isEmpty()) {
+  for (Cluster cluster : clusterMap.values()) {
+controller.initializeWidgetsAndLayouts(cluster, null);
+
+MapString, Service serviceMap = cluster.getServices();
+if (serviceMap != null  !serviceMap.isEmpty()) {
+  for (Service service : serviceMap.values()) {
+controller.initializeWidgetsAndLayouts(cluster, service);
+  }
+}
+  }
+}
+  }
+
   // - UpgradeCatalog 
 
   /**
@@ -425,5 +459,7 @@ public class UpgradeCatalog210 extends 
AbstractUpgradeCatalog {
   @Override
   protected void executeDMLUpdates() throws AmbariException, SQLException {
 addNewConfigurationsFromXml();
+// Initialize all default widgets and widget layouts
+initializeClusterAndServiceWidgets();
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/37717dd4/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java
index af9dcda..6ca7dfd 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java
@@ -18,19 +18,29 @@
 
 package org.apache.ambari.server.upgrade;
 
+import com.google.inject.AbstractModule;
 import com.google.inject.Binder;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.Module;
 import com.google.inject.Provider;
 import com.google.inject.persist.PersistService;
+import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.configuration.Configuration

[2/2] ambari git commit: AMBARI-10372. Create an API endpoint for widget_layouts.

2015-04-06 Thread swagle
AMBARI-10372. Create an API endpoint for widget_layouts.


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

Branch: refs/heads/trunk
Commit: 4b3caee767a2dc2dbd0061021ebafff9156bcbd3
Parents: 75c9df8
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Mon Apr 6 11:25:21 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Mon Apr 6 11:25:21 2015 -0700

--
 .../resources/ResourceInstanceFactoryImpl.java  |   8 +
 .../WidgetLayoutResourceDefinition.java |  86 +
 .../api/resources/WidgetResourceDefinition.java |  46 +++
 .../server/api/services/ClusterService.java |  10 +
 .../api/services/WidgetLayoutService.java   | 114 ++
 .../services/parsers/JsonRequestBodyParser.java |   3 +-
 .../server/controller/WidgetResponse.java   | 181 ++
 .../AbstractControllerResourceProvider.java |   2 +
 .../internal/WidgetLayoutResourceProvider.java  | 343 ++
 .../ambari/server/controller/spi/Resource.java  |   4 +
 .../ambari/server/orm/dao/UserWidgetDAO.java|  99 -
 .../apache/ambari/server/orm/dao/WidgetDAO.java |  97 +
 .../ambari/server/orm/dao/WidgetLayoutDAO.java  |   2 -
 .../server/orm/entities/UserWidgetEntity.java   | 222 
 .../server/orm/entities/WidgetEntity.java   | 231 
 .../server/orm/entities/WidgetLayoutEntity.java |  48 ++-
 .../entities/WidgetLayoutUserWidgetEntity.java  |  19 +-
 .../server/upgrade/UpgradeCatalog210.java   |   5 +-
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |   6 +-
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |   6 +-
 .../resources/Ambari-DDL-Postgres-CREATE.sql|   8 +-
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql |   8 +-
 .../src/main/resources/META-INF/persistence.xml |   2 +-
 .../src/main/resources/properties.json  |  27 ++
 .../parsers/JsonRequestBodyParserTest.java  |   2 +
 .../WidgetLayoutResourceProviderTest.java   | 362 +++
 .../server/orm/dao/UserWidgetDAOTest.java   | 116 --
 .../ambari/server/orm/dao/WidgetDAOTest.java| 121 +++
 .../server/orm/dao/WidgetLayoutDAOTest.java |  36 +-
 .../server/upgrade/UpgradeCatalog210Test.java   |  10 +-
 30 files changed, 1748 insertions(+), 476 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4b3caee7/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
index 7183fa7..07e70ab 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
@@ -362,6 +362,14 @@ public class ResourceInstanceFactoryImpl implements 
ResourceInstanceFactory {
 resourceDefinition = new SimpleResourceDefinition(Resource.Type.Theme, 
theme, themes);
 break;
 
+  case Widget:
+resourceDefinition = new WidgetResourceDefinition();
+break;
+
+  case WidgetLayout:
+resourceDefinition = new WidgetLayoutResourceDefinition();
+break;
+
   default:
 throw new IllegalArgumentException(Unsupported resource type:  + 
type);
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b3caee7/ambari-server/src/main/java/org/apache/ambari/server/api/resources/WidgetLayoutResourceDefinition.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/WidgetLayoutResourceDefinition.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/WidgetLayoutResourceDefinition.java
new file mode 100644
index 000..2d2ca1e
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/WidgetLayoutResourceDefinition.java
@@ -0,0 +1,86 @@
+/**
+ * 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 

[1/2] ambari git commit: AMBARI-10372. Create an API endpoint for widget_layouts.

2015-04-06 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 75c9df821 - 4b3caee76


http://git-wip-us.apache.org/repos/asf/ambari/blob/4b3caee7/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProviderTest.java
new file mode 100644
index 000..6cb82d9
--- /dev/null
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/WidgetLayoutResourceProviderTest.java
@@ -0,0 +1,362 @@
+/**
+ * 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.controller.internal;
+
+import com.google.inject.Binder;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Module;
+import com.google.inject.util.Modules;
+import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.controller.spi.Predicate;
+import org.apache.ambari.server.controller.spi.Request;
+import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.utilities.PredicateBuilder;
+import org.apache.ambari.server.controller.utilities.PropertyHelper;
+import org.apache.ambari.server.metadata.ActionMetadata;
+import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
+import org.apache.ambari.server.orm.dao.WidgetLayoutDAO;
+import org.apache.ambari.server.orm.entities.WidgetLayoutEntity;
+import org.apache.ambari.server.orm.entities.WidgetLayoutUserWidgetEntity;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.easymock.Capture;
+import org.easymock.EasyMock;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.capture;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.createStrictMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.resetToStrict;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+
+/**
+ * WidgetLayout tests
+ */
+public class WidgetLayoutResourceProviderTest {
+
+  private WidgetLayoutDAO dao = null;
+  private Injector m_injector;
+
+  @Before
+  public void before() {
+dao = createStrictMock(WidgetLayoutDAO.class);
+
+m_injector = Guice.createInjector(Modules.override(
+new InMemoryDefaultTestModule()).with(new MockModule()));
+  }
+
+  /**
+   * @throws Exception
+   */
+  @Test
+  public void testGetResourcesNoPredicate() throws Exception {
+WidgetLayoutResourceProvider provider = createProvider(null);
+
+Request request = PropertyHelper.getReadRequest(WidgetLayouts/id);
+
+SetResource results = provider.getResources(request, null);
+
+assertEquals(0, results.size());
+  }
+
+  /**
+   * @throws Exception
+   */
+  @Test
+  public void testGetSingleResource() throws Exception {
+Request request = PropertyHelper.getReadRequest(
+WidgetLayoutResourceProvider.WIDGETLAYOUT_CLUSTER_NAME_PROPERTY_ID,
+WidgetLayoutResourceProvider.WIDGETLAYOUT_ID_PROPERTY_ID,
+WidgetLayoutResourceProvider.WIDGETLAYOUT_DISPLAY_NAME_PROPERTY_ID,
+WidgetLayoutResourceProvider.WIDGETLAYOUT_LAYOUT_NAME_PROPERTY_ID,
+WidgetLayoutResourceProvider.WIDGETLAYOUT_SECTION_NAME_PROPERTY_ID,
+WidgetLayoutResourceProvider.WIDGETLAYOUT_USERNAME_PROPERTY_ID,
+WidgetLayoutResourceProvider.WIDGETLAYOUT_SCOPE_PROPERTY_ID,
+WidgetLayoutResourceProvider.WIDGETLAYOUT_INFO_PROPERTY_ID);
+
+AmbariManagementController amc = 

ambari git commit: AMBARI-10372. Create an API endpoint for widget_layouts. Missing license header.

2015-04-06 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 4b3caee76 - 5c030d431


AMBARI-10372. Create an API endpoint for widget_layouts. Missing license header.


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

Branch: refs/heads/trunk
Commit: 5c030d43149a1012a8d74e75fc52edd3928e58d3
Parents: 4b3caee
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Mon Apr 6 11:35:57 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Mon Apr 6 11:35:57 2015 -0700

--
 .../server/api/services/WidgetLayoutService.java   | 17 +
 1 file changed, 17 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5c030d43/ambari-server/src/main/java/org/apache/ambari/server/api/services/WidgetLayoutService.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/WidgetLayoutService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/WidgetLayoutService.java
index b4985ca..234b773 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/WidgetLayoutService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/WidgetLayoutService.java
@@ -1,3 +1,20 @@
+/**
+ * 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.api.services;
 
 import com.sun.jersey.core.util.Base64;



[7/7] ambari git commit: AMBARI-10290. Expose avaialble host metrics across hostcomponents. (swagle)

2015-04-02 Thread swagle
AMBARI-10290. Expose avaialble host metrics across hostcomponents. (swagle)


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

Branch: refs/heads/trunk
Commit: b93452edab3d93a7217751192145eab3944876c1
Parents: 81f311b
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Tue Mar 31 16:07:12 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu Apr 2 14:55:29 2015 -0700

--
 .../timeline/AbstractTimelineAggregator.java| 271 --
 .../metrics/timeline/AggregatorUtils.java   |  59 --
 .../metrics/timeline/ConnectionProvider.java|  29 -
 .../timeline/DefaultPhoenixDataSource.java  |  77 --
 .../metrics/timeline/Function.java  | 169 
 .../timeline/HBaseTimelineMetricStore.java  |  10 +-
 .../metrics/timeline/MetricAggregate.java   | 110 ---
 .../timeline/MetricClusterAggregate.java|  74 --
 .../metrics/timeline/MetricHostAggregate.java   |  81 --
 .../metrics/timeline/PhoenixHBaseAccessor.java  |  61 +-
 .../metrics/timeline/PhoenixTransactSQL.java| 970 ---
 .../metrics/timeline/TimelineClusterMetric.java |  97 --
 .../timeline/TimelineClusterMetricReader.java   |  42 -
 .../timeline/TimelineMetricAggregator.java  | 145 ---
 .../TimelineMetricAggregatorFactory.java|  99 --
 .../TimelineMetricClusterAggregator.java| 223 -
 .../TimelineMetricClusterAggregatorHourly.java  | 177 
 .../timeline/TimelineMetricConfiguration.java   |   6 +
 .../metrics/timeline/TimelineMetricReader.java  |  65 --
 .../aggregators/AbstractTimelineAggregator.java | 270 ++
 .../timeline/aggregators/AggregatorUtils.java   |  59 ++
 .../metrics/timeline/aggregators/Function.java  | 169 
 .../timeline/aggregators/MetricAggregate.java   | 110 +++
 .../aggregators/MetricClusterAggregate.java |  73 ++
 .../aggregators/MetricHostAggregate.java|  81 ++
 .../aggregators/TimelineClusterMetric.java  |  97 ++
 .../TimelineClusterMetricReader.java|  42 +
 .../aggregators/TimelineMetricAggregator.java   | 147 +++
 .../TimelineMetricAggregatorFactory.java|  98 ++
 .../TimelineMetricAppAggregator.java| 169 
 .../TimelineMetricClusterAggregator.java| 235 +
 .../TimelineMetricClusterAggregatorHourly.java  | 175 
 .../aggregators/TimelineMetricReadHelper.java   |  66 ++
 .../metrics/timeline/query/Condition.java   |  46 +
 .../timeline/query/ConnectionProvider.java  |  29 +
 .../timeline/query/DefaultCondition.java| 258 +
 .../query/DefaultPhoenixDataSource.java |  77 ++
 .../timeline/query/PhoenixTransactSQL.java  | 573 +++
 .../query/SplitByMetricNamesCondition.java  | 165 
 .../TestApplicationHistoryServer.java   |   3 +-
 .../timeline/AbstractMiniHBaseClusterTest.java  |   3 +-
 .../AbstractTimelineAggregatorTest.java |   9 +-
 .../metrics/timeline/FunctionTest.java  |   7 +-
 .../timeline/HBaseTimelineMetricStoreTest.java  |   5 +-
 .../metrics/timeline/ITClusterAggregator.java   |  78 +-
 .../metrics/timeline/ITMetricAggregator.java|  18 +-
 .../timeline/ITPhoenixHBaseAccessor.java|  23 +-
 .../metrics/timeline/MetricTestHelper.java  |  20 +-
 .../timeline/TestMetricHostAggregate.java   |   1 +
 .../timeline/TestPhoenixTransactSQL.java|  11 +-
 .../0.1.0/configuration/ams-site.xml|   8 +
 51 files changed, 3130 insertions(+), 2760 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b93452ed/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/AbstractTimelineAggregator.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/AbstractTimelineAggregator.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/AbstractTimelineAggregator.java
deleted file mode 100644
index 4af3db7..000
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/AbstractTimelineAggregator.java
+++ /dev/null
@@ -1,271 +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

[6/7] ambari git commit: AMBARI-10290. Expose avaialble host metrics across hostcomponents. (swagle)

2015-04-02 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/b93452ed/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineClusterMetricReader.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineClusterMetricReader.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineClusterMetricReader.java
deleted file mode 100644
index ea0913e..000
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineClusterMetricReader.java
+++ /dev/null
@@ -1,42 +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/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.hadoop.yarn.server.applicationhistoryservice.metrics.timeline;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-public class TimelineClusterMetricReader {
-
-  private boolean ignoreInstance;
-
-  public TimelineClusterMetricReader(boolean ignoreInstance) {
-this.ignoreInstance = ignoreInstance;
-  }
-
-  public TimelineClusterMetric fromResultSet(ResultSet rs)
-throws SQLException {
-
-return new TimelineClusterMetric(
-  rs.getString(METRIC_NAME),
-  rs.getString(APP_ID),
-  ignoreInstance ? null : rs.getString(INSTANCE_ID),
-  rs.getLong(SERVER_TIME),
-  rs.getString(UNITS));
-  }
-}
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/b93452ed/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricAggregator.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricAggregator.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricAggregator.java
deleted file mode 100644
index 459e612..000
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TimelineMetricAggregator.java
+++ /dev/null
@@ -1,145 +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/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.hadoop.yarn.server.applicationhistoryservice.metrics.timeline;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
-import java.io.IOException;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.Map;
-import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.PhoenixTransactSQL.Condition;
-import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.PhoenixTransactSQL.DefaultCondition;
-import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.PhoenixTransactSQL.GET_METRIC_AGGREGATE_ONLY_SQL;
-
-public class TimelineMetricAggregator extends AbstractTimelineAggregator {
-  private static 

[3/7] ambari git commit: AMBARI-10290. Expose avaialble host metrics across hostcomponents. Support HostComponent host metrics. (swagle)

2015-04-02 Thread swagle
AMBARI-10290. Expose avaialble host metrics across hostcomponents. Support 
HostComponent host metrics. (swagle)


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

Branch: refs/heads/trunk
Commit: 23faabc4a9bcb6908314a4c5679b1d4045de8f53
Parents: b93452e
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Thu Apr 2 14:33:29 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Thu Apr 2 14:55:29 2015 -0700

--
 .../aggregators/AbstractTimelineAggregator.java |4 +
 .../metrics/timeline/aggregators/Function.java  |3 +-
 .../metrics/timeline/ITClusterAggregator.java   |2 +-
 ambari-server/pom.xml   |5 +
 .../internal/AbstractPropertyProvider.java  |   13 +-
 .../controller/internal/PropertyInfo.java   |9 +
 .../internal/StackDefinedPropertyProvider.java  |6 +-
 .../ganglia/GangliaPropertyProvider.java|2 +-
 .../metrics/timeline/AMSPropertyProvider.java   |  161 +-
 .../controller/utilities/PropertyHelper.java|   10 +
 .../ambari/server/state/stack/Metric.java   |   11 +-
 .../0.1.0/configuration/ams-site.xml|2 +-
 .../HBASE/0.96.0.2.0/metrics.json   |  429 +++--
 .../common-services/HDFS/2.1.0.2.0/metrics.json |  429 +++--
 .../STORM/0.9.1.2.1/metrics.json| 1510 +-
 .../common-services/YARN/2.1.0.2.0/metrics.json |  361 -
 .../src/main/resources/ganglia_properties.json  |  268 ++--
 .../StackArtifactResourceProviderTest.java  |6 +
 .../RestMetricsPropertyProviderTest.java|   16 +-
 .../metrics/ganglia/TestStreamProvider.java |4 +-
 .../timeline/AMSPropertyProviderTest.java   |  106 +-
 .../ams/single_host_component_metrics.json  |   21 +
 .../test/resources/ams/single_host_metric.json  |  242 +--
 .../stacks/OTHER/1.0/services/HDFS/metrics.json |3 +-
 24 files changed, 2327 insertions(+), 1296 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/23faabc4/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/AbstractTimelineAggregator.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/AbstractTimelineAggregator.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/AbstractTimelineAggregator.java
index 8dea46e..07717a8 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/AbstractTimelineAggregator.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/AbstractTimelineAggregator.java
@@ -37,6 +37,10 @@ import static java.util.concurrent.TimeUnit.SECONDS;
 import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.AGGREGATOR_CHECKPOINT_DELAY;
 import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.RESULTSET_FETCH_SIZE;
 
+/**
+ * Base class for all runnable aggregators. Provides common functions like
+ * check pointing and scheduling.
+ */
 public abstract class AbstractTimelineAggregator implements Runnable {
   protected final PhoenixHBaseAccessor hBaseAccessor;
   private final Log LOG;

http://git-wip-us.apache.org/repos/asf/ambari/blob/23faabc4/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/Function.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/Function.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/Function.java
index 9d17fca..8292657 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/Function.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/Function.java
@@ -31,8

[5/7] ambari git commit: AMBARI-10290. Expose avaialble host metrics across hostcomponents. (swagle)

2015-04-02 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/b93452ed/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricAggregatorFactory.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricAggregatorFactory.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricAggregatorFactory.java
new file mode 100644
index 000..a0e4e32
--- /dev/null
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricAggregatorFactory.java
@@ -0,0 +1,98 @@
+/**
+ * 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.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators;
+
+import org.apache.commons.io.FilenameUtils;
+import org.apache.hadoop.conf.Configuration;
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.PhoenixHBaseAccessor;
+
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.PhoenixTransactSQL.METRICS_AGGREGATE_HOURLY_TABLE_NAME;
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.PhoenixTransactSQL.METRICS_AGGREGATE_MINUTE_TABLE_NAME;
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.PhoenixTransactSQL.METRICS_RECORD_TABLE_NAME;
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.DEFAULT_CHECKPOINT_LOCATION;
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.HOST_AGGREGATOR_HOUR_CHECKPOINT_CUTOFF_MULTIPLIER;
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.HOST_AGGREGATOR_HOUR_DISABLED;
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.HOST_AGGREGATOR_HOUR_SLEEP_INTERVAL;
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.HOST_AGGREGATOR_MINUTE_CHECKPOINT_CUTOFF_MULTIPLIER;
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.HOST_AGGREGATOR_MINUTE_DISABLED;
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.HOST_AGGREGATOR_MINUTE_SLEEP_INTERVAL;
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.TIMELINE_METRICS_AGGREGATOR_CHECKPOINT_DIR;
+
+public class TimelineMetricAggregatorFactory {
+  private static final String MINUTE_AGGREGATE_CHECKPOINT_FILE =
+timeline-metrics-host-aggregator-checkpoint;
+  private static final String MINUTE_AGGREGATE_HOURLY_CHECKPOINT_FILE =
+timeline-metrics-host-aggregator-hourly-checkpoint;
+
+  public static TimelineMetricAggregator createTimelineMetricAggregatorMinute
+(PhoenixHBaseAccessor hBaseAccessor, Configuration metricsConf) {
+
+String checkpointDir = metricsConf.get(
+  TIMELINE_METRICS_AGGREGATOR_CHECKPOINT_DIR, DEFAULT_CHECKPOINT_LOCATION);
+String checkpointLocation = FilenameUtils.concat(checkpointDir,
+  MINUTE_AGGREGATE_CHECKPOINT_FILE);
+long sleepIntervalMillis = SECONDS.toMillis(metricsConf.getLong
+  (HOST_AGGREGATOR_MINUTE_SLEEP_INTERVAL, 300l));  // 5 mins
+
+int checkpointCutOffMultiplier = metricsConf.getInt
+  (HOST_AGGREGATOR_MINUTE_CHECKPOINT_CUTOFF_MULTIPLIER, 3);
+String hostAggregatorDisabledParam = HOST_AGGREGATOR_MINUTE_DISABLED;
+
+String inputTableName = METRICS_RECORD_TABLE_NAME;
+String outputTableName = METRICS_AGGREGATE_MINUTE_TABLE_NAME;
+
+return new 

[4/7] ambari git commit: AMBARI-10290. Expose avaialble host metrics across hostcomponents. (swagle)

2015-04-02 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/b93452ed/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStoreTest.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStoreTest.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStoreTest.java
index e610403..8233b3f 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStoreTest.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStoreTest.java
@@ -17,14 +17,15 @@
  */
 package 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline;
 
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators.Function;
 import org.junit.Test;
 
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 
-import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.Function.ReadFunction.AVG;
-import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.Function.PostProcessingFunction.RATE;
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators.Function.ReadFunction.AVG;
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators.Function.PostProcessingFunction.RATE;
 import static org.assertj.core.api.Assertions.*;
 
 public class HBaseTimelineMetricStoreTest {

http://git-wip-us.apache.org/repos/asf/ambari/blob/b93452ed/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/ITClusterAggregator.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/ITClusterAggregator.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/ITClusterAggregator.java
index f9dda46..da3d703b 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/ITClusterAggregator.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/ITClusterAggregator.java
@@ -19,27 +19,35 @@ package 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline
 
 
 import org.apache.hadoop.conf.Configuration;
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators.MetricClusterAggregate;
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators.TimelineClusterMetric;
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators.TimelineClusterMetricReader;
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators.TimelineMetricClusterAggregator;
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators.TimelineMetricClusterAggregatorHourly;
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.Condition;
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.DefaultCondition;
+import 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.PhoenixTransactSQL;
 import org.junit.After;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
-
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
-
 import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNotNull;
 import static junit.framework.Assert.fail;
-import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.PhoenixTransactSQL.Condition;
-import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.PhoenixTransactSQL.DefaultCondition;
-import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.PhoenixTransactSQL.GET_CLUSTER_AGGREGATE_SQL;
-import static 

[1/7] ambari git commit: AMBARI-10290. Expose avaialble host metrics across hostcomponents. Support HostComponent host metrics. (swagle)

2015-04-02 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 81f311baf - 23faabc4a


http://git-wip-us.apache.org/repos/asf/ambari/blob/23faabc4/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProviderTest.java
index c50ccba..b6af863 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProviderTest.java
@@ -72,14 +72,14 @@ public class RestMetricsPropertyProviderTest {
 metricsProperties.put(port_config_type, storm-site);
 metricsProperties.put(port_property_name, storm.port);
 metricsProperties.put(protocol, http);
-componentMetrics.put(metrics/api/cluster/summary/tasks.total, new 
Metric(/api/cluster/summary##tasks.total, false, false));
-componentMetrics.put(metrics/api/cluster/summary/slots.total, new 
Metric(/api/cluster/summary##slots.total, false, false));
-componentMetrics.put(metrics/api/cluster/summary/slots.free, new 
Metric(/api/cluster/summary##slots.free, false, false));
-componentMetrics.put(metrics/api/cluster/summary/supervisors, new 
Metric(/api/cluster/summary##supervisors, false, false));
-componentMetrics.put(metrics/api/cluster/summary/executors.total, new 
Metric(/api/cluster/summary##executors.total, false, false));
-componentMetrics.put(metrics/api/cluster/summary/slots.used, new 
Metric(/api/cluster/summary##slots.used, false, false));
-componentMetrics.put(metrics/api/cluster/summary/topologies, new 
Metric(/api/cluster/summary##topologies, false, false));
-componentMetrics.put(metrics/api/cluster/summary/nimbus.uptime, new 
Metric(/api/cluster/summary##nimbus.uptime, false, false));
+componentMetrics.put(metrics/api/cluster/summary/tasks.total, new 
Metric(/api/cluster/summary##tasks.total, false, false, false));
+componentMetrics.put(metrics/api/cluster/summary/slots.total, new 
Metric(/api/cluster/summary##slots.total, false, false, false));
+componentMetrics.put(metrics/api/cluster/summary/slots.free, new 
Metric(/api/cluster/summary##slots.free, false, false, false));
+componentMetrics.put(metrics/api/cluster/summary/supervisors, new 
Metric(/api/cluster/summary##supervisors, false, false, false));
+componentMetrics.put(metrics/api/cluster/summary/executors.total, new 
Metric(/api/cluster/summary##executors.total, false, false, false));
+componentMetrics.put(metrics/api/cluster/summary/slots.used, new 
Metric(/api/cluster/summary##slots.used, false, false, false));
+componentMetrics.put(metrics/api/cluster/summary/topologies, new 
Metric(/api/cluster/summary##topologies, false, false, false));
+componentMetrics.put(metrics/api/cluster/summary/nimbus.uptime, new 
Metric(/api/cluster/summary##nimbus.uptime, false, false, false));
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/23faabc4/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/ganglia/TestStreamProvider.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/ganglia/TestStreamProvider.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/ganglia/TestStreamProvider.java
index f6ac02b..07fa7c7 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/ganglia/TestStreamProvider.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/ganglia/TestStreamProvider.java
@@ -24,8 +24,8 @@ import java.io.IOException;
 import java.io.InputStream;
 
 public class TestStreamProvider implements StreamProvider {
-
-  private final String fileName;
+  // Allow for filename to be set at runtime
+  protected String fileName;
   private String lastSpec;
   private boolean isLastSpecUpdated;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/23faabc4/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProviderTest.java
index 4e2ed98..052f86c 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProviderTest.java
@@ -33,6 +33,8 @@ 

ambari git commit: AMBARI-10259. Expose the widget artifact on stack version and stack service resource. (swagle)

2015-03-27 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 592609bb0 - a982836df


AMBARI-10259. Expose the widget artifact on stack version and stack service 
resource. (swagle)


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

Branch: refs/heads/trunk
Commit: a982836df6fad9a8d648c6bcc5b1852b2be4d7de
Parents: 592609b
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Fri Mar 27 15:09:09 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Fri Mar 27 16:49:49 2015 -0700

--
 .../server/api/services/AmbariMetaInfo.java |  10 +
 .../internal/StackArtifactResourceProvider.java |  77 +++-
 .../ambari/server/stack/ServiceDirectory.java   |  20 ++
 .../ambari/server/stack/ServiceModule.java  |   4 +
 .../ambari/server/stack/StackDirectory.java |  18 ++
 .../apache/ambari/server/stack/StackModule.java |   5 +
 .../apache/ambari/server/state/ServiceInfo.java |  14 ++
 .../apache/ambari/server/state/StackInfo.java   |  11 ++
 .../ambari/server/state/stack/WidgetLayout.java |  69 +++
 .../server/state/stack/WidgetLayoutInfo.java| 115 +++
 .../HBASE/0.96.0.2.0/metrics.json   |  70 +++
 .../HBASE/0.96.0.2.0/widgets.json   | 192 +++
 .../StackArtifactResourceProviderTest.java  |  44 +
 .../OTHER/2.0/services/HBASE/widgets.json   | 192 +++
 14 files changed, 834 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a982836d/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
index 8952153..143022e 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
@@ -102,6 +102,16 @@ public class AmbariMetaInfo {
   public static final String KERBEROS_DESCRIPTOR_FILE_NAME = kerberos.json;
 
   /**
+   * The filename name for a Widgets descriptor file at either the stack or 
service level
+   */
+  public static final String WIDGETS_DESCRIPTOR_FILE_NAME = widgets.json;
+
+  /**
+   * Filename for theme file at service layer
+   */
+  public static final String SERVICE_THEME_FILE_NAME = theme.json;
+
+  /**
* This string is used in placeholder in places that are common for
* all operating systems or in situations where os type is not important.
*/

http://git-wip-us.apache.org/repos/asf/ambari/blob/a982836d/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java
index b7530a0..53734aa 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java
@@ -18,6 +18,8 @@
 
 package org.apache.ambari.server.controller.internal;
 
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
 import com.google.inject.Inject;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.StackAccessException;
@@ -42,9 +44,13 @@ import 
org.apache.ambari.server.state.kerberos.KerberosDescriptorFactory;
 import org.apache.ambari.server.state.kerberos.KerberosServiceDescriptor;
 import 
org.apache.ambari.server.state.kerberos.KerberosServiceDescriptorFactory;
 import org.apache.ambari.server.state.stack.MetricDefinition;
+import org.apache.ambari.server.state.stack.WidgetLayout;
+import org.apache.commons.lang.StringUtils;
 
 import java.io.File;
+import java.io.FileReader;
 import java.io.IOException;
+import java.lang.reflect.Type;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -144,6 +150,9 @@ public class StackArtifactResourceProvider extends 
AbstractControllerResourcePro
   @Inject
   private static KerberosServiceDescriptorFactory 
kerberosServiceDescriptorFactory;
 
+  Type widgetLayoutType = new TypeTokenMapString, 
ListWidgetLayout(){}.getType();
+  Gson gson = new Gson();
+
   /**
* set resource

ambari git commit: AMBARI-10212. Widgets: Add schema tables for PostgreSQL, MySQL and Oracle.

2015-03-25 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 6e67329b8 - 308a618f4


AMBARI-10212. Widgets: Add schema tables for PostgreSQL, MySQL and Oracle.


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

Branch: refs/heads/trunk
Commit: 308a618f40f3c724dbbd33c178ebbab2c38b2ea4
Parents: 6e67329
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Wed Mar 25 17:22:58 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Wed Mar 25 17:22:58 2015 -0700

--
 .../ambari/server/orm/dao/UserWidgetDAO.java|  99 +
 .../ambari/server/orm/dao/WidgetLayoutDAO.java  |  99 +
 .../server/orm/entities/UserWidgetEntity.java   | 222 +++
 .../server/orm/entities/WidgetLayoutEntity.java | 130 +++
 .../entities/WidgetLayoutUserWidgetEntity.java  | 114 ++
 .../WidgetLayoutUserWidgetEntityPK.java |  71 ++
 .../server/upgrade/UpgradeCatalog210.java   |  40 
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |  34 +++
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |  34 +++
 .../resources/Ambari-DDL-Postgres-CREATE.sql|  34 +++
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql |  37 
 .../src/main/resources/META-INF/persistence.xml |   3 +
 .../server/orm/dao/UserWidgetDAOTest.java   | 116 ++
 .../server/orm/dao/WidgetLayoutDAOTest.java | 128 +++
 .../server/upgrade/UpgradeCatalog210Test.java   |  36 ++-
 15 files changed, 1196 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/308a618f/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UserWidgetDAO.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UserWidgetDAO.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UserWidgetDAO.java
new file mode 100644
index 000..834da26
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UserWidgetDAO.java
@@ -0,0 +1,99 @@
+/**
+ * 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.UserWidgetEntity;
+import org.apache.ambari.server.orm.entities.WidgetLayoutEntity;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+@Singleton
+public class UserWidgetDAO {
+  @Inject
+  ProviderEntityManager entityManagerProvider;
+
+  /**
+   * DAO utilities for dealing mostly with {@link TypedQuery} results.
+   */
+  @Inject
+  private DaoUtils daoUtils;
+
+  @RequiresSession
+  public UserWidgetEntity findById(Long id) {
+return entityManagerProvider.get().find(UserWidgetEntity.class, id);
+  }
+
+  @RequiresSession
+  public ListUserWidgetEntity findByCluster(long clusterId) {
+TypedQueryUserWidgetEntity query = entityManagerProvider.get()
+.createNamedQuery(UserWidgetEntity.findByCluster, 
UserWidgetEntity.class);
+query.setParameter(clusterId, clusterId);
+
+return daoUtils.selectList(query);
+  }
+
+  @RequiresSession
+  public ListUserWidgetEntity findBySectionName(String sectionName) {
+TypedQueryUserWidgetEntity query = entityManagerProvider.get()
+.createNamedQuery(UserWidgetEntity.findBySectionName, 
UserWidgetEntity.class);
+query.setParameter(sectionName, sectionName);
+
+return daoUtils.selectList(query);
+  }
+
+  @RequiresSession
+  public ListUserWidgetEntity findAll() {
+TypedQueryUserWidgetEntity query = entityManagerProvider.get()
+.createNamedQuery(UserWidgetEntity.findAll, 

[29/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metrics.json
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metrics.json
index 9b8e1f4..6131606 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metrics.json
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metrics.json
@@ -4,251 +4,1233 @@
   {
 type: ganglia,
 metrics: {
-  metrics/hbase/ipc/ProcessCallTime_75th_percentile: {metric: 
ipc.IPC.ProcessCallTime_75th_percentile, pointInTime: true, temporal: 
true},
-  metrics/hbase/ipc/ProcessCallTime_95th_percentile: {metric: 
ipc.IPC.ProcessCallTime_95th_percentile, pointInTime: true, temporal: 
true},
-  metrics/hbase/ipc/ProcessCallTime_99th_percentile: {metric: 
ipc.IPC.ProcessCallTime_99th_percentile, pointInTime: true, temporal: 
true},
-  metrics/hbase/ipc/ProcessCallTime_max: {metric: 
ipc.IPC.ProcessCallTime_max, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/ProcessCallTime_mean: {metric: 
ipc.IPC.ProcessCallTime_mean, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/ProcessCallTime_median: {metric: 
ipc.IPC.ProcessCallTime_median, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/ProcessCallTime_min: {metric: 
ipc.IPC.ProcessCallTime_min, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/ProcessCallTime_num_ops: {metric: 
ipc.IPC.ProcessCallTime_num_ops, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/QueueCallTime_75th_percentile: {metric: 
ipc.IPC.QueueCallTime_75th_percentile, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/QueueCallTime_95th_percentile: {metric: 
ipc.IPC.QueueCallTime_95th_percentile, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/QueueCallTime_99th_percentile: {metric: 
ipc.IPC.QueueCallTime_99th_percentile, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/QueueCallTime_max: {metric: 
ipc.IPC.QueueCallTime_max, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/QueueCallTime_mean: {metric: 
ipc.IPC.QueueCallTime_mean, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/QueueCallTime_median: {metric: 
ipc.IPC.QueueCallTime_median, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/QueueCallTime_min: {metric: 
ipc.IPC.QueueCallTime_min, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/QueueCallTime_num_ops: {metric: 
ipc.IPC.QueueCallTime_num_ops, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/authenticationFailures: {metric: 
ipc.IPC.authenticationFailures, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/authenticationSuccesses: {metric: 
ipc.IPC.authenticationSuccesses, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/authorizationFailures: {metric: 
ipc.IPC.authorizationFailures, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/authorizationSuccesses: {metric: 
ipc.IPC.authorizationSuccesses, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/numActiveHandler: {metric: 
ipc.IPC.numActiveHandler, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/numCallsInGeneralQueue: {metric: 
ipc.IPC.numCallsInGeneralQueue, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/numCallsInPriorityQueue: {metric: 
ipc.IPC.numCallsInPriorityQueue, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/numCallsInReplicationQueue: {metric: 
ipc.IPC.numCallsInReplicationQueue, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/numOpenConnections: {metric: 
ipc.IPC.numOpenConnections, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/queueSize: {metric: ipc.IPC.queueSize, 
pointInTime: true, temporal: true},
-  metrics/hbase/ipc/receivedBytes: {metric: 
ipc.IPC.receivedBytes, pointInTime: true, temporal: true},
-  metrics/hbase/ipc/sentBytes: {metric: ipc.IPC.sentBytes, 
pointInTime: true, temporal: true},
-  metrics/hbase/jvm/GcCount: {metric: jvm.JvmMetrics.GcCount, 
pointInTime: true, temporal: true},
-  metrics/hbase/jvm/GcCountConcurrentMarkSweep: {metric: 
jvm.JvmMetrics.GcCountConcurrentMarkSweep, pointInTime: true, temporal: 
true},
-  metrics/hbase/jvm/GcCountParNew: {metric: 
jvm.JvmMetrics.GcCountParNew, pointInTime: true, temporal: true},
-  metrics/hbase/jvm/GcTimeMillis: {metric: 
jvm.JvmMetrics.GcTimeMillis, pointInTime: true, temporal: true},
-  metrics/hbase/jvm/GcTimeMillisConcurrentMarkSweep: {metric: 
jvm.JvmMetrics.GcTimeMillisConcurrentMarkSweep, pointInTime: true, 
temporal: true},
-  

[21/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/metrics.json 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/metrics.json
index 088626a..ca02f99 100644
--- 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/metrics.json
+++ 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/metrics.json
@@ -4,1415 +4,1419 @@
   {
 type: ganglia,
 metrics: {
-  metrics/dfs/FSNamesystem/TotalLoad: {
-metric: dfs.FSNamesystem.TotalLoad,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityTotal: {
-metric: dfs.FSNamesystem.CapacityTotal,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityUsed: {
-metric: dfs.FSNamesystem.CapacityUsed,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityRemaining: {
-metric: dfs.FSNamesystem.CapacityRemaining,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityNonDFSUsed: {
-metric: dfs.FSNamesystem.CapacityUsedNonDFS,
-pointInTime: false,
-temporal: true
-  },  
-  metrics/dfs/FSNamesystem/BlockCapacity: {
-metric: dfs.FSNamesystem.BlockCapacity,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/namenode/GetListingOps: {
-metric: dfs.namenode.GetListingOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/namenode/FilesAppended: {
-metric: dfs.namenode.FilesAppended,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/getProtocolVersion_num_ops: {
-metric: rpcdetailed.rpcdetailed.getProtocolVersion_num_ops,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/fsync_avg_time: {
-metric: rpcdetailed.rpcdetailed.FsyncAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/ugi/loginSuccess_avg_time: {
-metric: ugi.UgiMetrics.LoginSuccessAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/load/load_one: {
-metric: load_one,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/renewLease_num_ops: {
-metric: rpcdetailed.rpcdetailed.RenewLeaseNumOps,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/getFileInfo_avg_time: {
-metric: rpcdetailed.rpcdetailed.GetFileInfoAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/memNonHeapUsedM: {
-metric: jvm.JvmMetrics.MemNonHeapUsedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/complete_avg_time: {
-metric: rpcdetailed.rpcdetailed.CompleteAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/setPermission_num_ops: {
-metric: rpcdetailed.rpcdetailed.SetPermissionNumOps,
-pointInTime: true,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityTotalGB: {
-metric: dfs.FSNamesystem.CapacityTotalGB,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/setOwner_num_ops: {
-metric: rpcdetailed.rpcdetailed.SetOwnerNumOps,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/getBlockLocations_num_ops: {
-metric: rpcdetailed.rpcdetailed.GetBlockLocationsNumOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/process/proc_run: {
-metric: proc_run,
-pointInTime: true,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityUsedGB: {
-metric: dfs.FSNamesystem.CapacityUsedGB,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/namenode/AddBlockOps: {
-metric: dfs.namenode.AddBlockOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/memory/swap_total: {
-metric: swap_total,
-pointInTime: true,
-temporal: true
-  },
-  

[28/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/metrics.json 
b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/metrics.json
index c841438..b0990ba 100644
--- 
a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/metrics.json
+++ 
b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/metrics.json
@@ -1,213 +1,215 @@
 {
   FLUME_HANDLER: {
 Component: [
-{
+  {
 type: ganglia,
 metrics: {
-  metrics/flume/flume/CHANNEL/ChannelCapacity:{
-metric:ChannelCapacity,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/CHANNEL/StartTime:{
-metric:StartTime,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/CHANNEL/EventTakeAttemptCount:{
-metric:EventTakeAttemptCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/CHANNEL/EventTakeSuccessCount:{
-metric:EventTakeSuccessCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/CHANNEL/EventPutAttemptCount:{
-metric:EventPutAttemptCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/CHANNEL/StopTime:{
-metric:StopTime,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/CHANNEL/ChannelFillPercentage:{
-metric:ChannelFillPercentage,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/CHANNEL/ChannelSize:{
-metric:ChannelSize,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/CHANNEL/EventPutSuccessCount:{
-metric:EventPutSuccessCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/SINK/ConnectionCreatedCount:{
-metric:ConnectionCreatedCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/SINK/BatchCompleteCount:{
-metric:BatchCompleteCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/SINK/EventDrainSuccessCount:{
-metric:EventDrainSuccessCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/SINK/StartTime:{
-metric:StartTime,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/SINK/EventDrainAttemptCount:{
-metric:EventDrainAttemptCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/SINK/ConnectionFailedCount:{
-metric:ConnectionFailedCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/SINK/BatchUnderflowCount:{
-metric:BatchUnderflowCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/SINK/ConnectionClosedCount:{
-metric:ConnectionClosedCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/SINK/StopTime:{
-metric:StopTime,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/SINK/BatchEmptyCount:{
-metric:BatchEmptyCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/SOURCE/AppendBatchReceivedCount:{
-metric:AppendBatchReceivedCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/SOURCE/AppendAcceptedCount:{
-metric:AppendAcceptedCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/SOURCE/StartTime:{
-metric:StartTime,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/SOURCE/OpenConnectionCount:{
-metric:OpenConnectionCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/SOURCE/AppendBatchAcceptedCount:{
-metric:AppendBatchAcceptedCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/flume/flume/SOURCE/AppendReceivedCount:{
-metric:AppendReceivedCount,
-pointInTime:true,
-temporal:true
-  },
-  

[26/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metrics.json 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metrics.json
index 0ed53c8..702bda1 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metrics.json
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metrics.json
@@ -4,1345 +4,1349 @@
   {
 type: ganglia,
 metrics: {
-  metrics/dfs/FSNamesystem/TotalLoad: {
-metric: dfs.FSNamesystem.TotalLoad,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityTotal: {
-metric: dfs.FSNamesystem.CapacityTotal,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityUsed: {
-metric: dfs.FSNamesystem.CapacityUsed,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityRemaining: {
-metric: dfs.FSNamesystem.CapacityRemaining,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityNonDFSUsed: {
-metric: dfs.FSNamesystem.CapacityUsedNonDFS,
-pointInTime: false,
-temporal: true
-  },  
-  metrics/dfs/FSNamesystem/BlockCapacity: {
-metric: dfs.FSNamesystem.BlockCapacity,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/namenode/GetListingOps: {
-metric: dfs.namenode.GetListingOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/namenode/FilesAppended: {
-metric: dfs.namenode.FilesAppended,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/getProtocolVersion_num_ops: {
-metric: rpcdetailed.rpcdetailed.getProtocolVersion_num_ops,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/fsync_avg_time: {
-metric: rpcdetailed.rpcdetailed.FsyncAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/ugi/loginSuccess_avg_time: {
-metric: ugi.UgiMetrics.LoginSuccessAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/load/load_one: {
-metric: load_one,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/renewLease_num_ops: {
-metric: rpcdetailed.rpcdetailed.RenewLeaseNumOps,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/getFileInfo_avg_time: {
-metric: rpcdetailed.rpcdetailed.GetFileInfoAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/memNonHeapUsedM: {
-metric: jvm.JvmMetrics.MemNonHeapUsedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/complete_avg_time: {
-metric: rpcdetailed.rpcdetailed.CompleteAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/setPermission_num_ops: {
-metric: rpcdetailed.rpcdetailed.SetPermissionNumOps,
-pointInTime: true,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityTotalGB: {
-metric: dfs.FSNamesystem.CapacityTotalGB,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/setOwner_num_ops: {
-metric: rpcdetailed.rpcdetailed.SetOwnerNumOps,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/getBlockLocations_num_ops: {
-metric: rpcdetailed.rpcdetailed.GetBlockLocationsNumOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/process/proc_run: {
-metric: proc_run,
-pointInTime: true,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityUsedGB: {
-metric: dfs.FSNamesystem.CapacityUsedGB,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/namenode/AddBlockOps: {
-metric: dfs.namenode.AddBlockOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/memory/swap_total: {
-metric: swap_total,
-pointInTime: true,
-temporal: true
-  },
-  

[30/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
AMBARI-10196. Expose metadata for the metrics via API. (swagle)


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

Branch: refs/heads/trunk
Commit: d83c14c401d90e6355283a23d17b41b5d778fd28
Parents: d95dfe3
Author: Siddharth Wagle swa...@hortonworks.com
Authored: Tue Mar 24 19:20:55 2015 -0700
Committer: Siddharth Wagle swa...@hortonworks.com
Committed: Tue Mar 24 19:20:55 2015 -0700

--
 .../server/api/services/AmbariMetaInfo.java |26 +-
 .../internal/StackArtifactResourceProvider.java |   139 +-
 .../server/state/stack/MetricDefinition.java|26 +-
 .../AMBARI_METRICS/0.1.0/metrics.json   |  2946 +-
 .../FLUME/1.4.0.2.0/metrics.json|   810 +-
 .../HBASE/0.96.0.2.0/metrics.json   | 26360 
 .../common-services/HDFS/2.1.0.2.0/metrics.json | 14720 -
 .../KAFKA/0.8.1.2.2/metrics.json|   466 +-
 .../STORM/0.9.1.2.1/metrics.json|16 +-
 .../common-services/YARN/2.1.0.2.0/metrics.json |  9558 +++---
 .../src/main/resources/ganglia_properties.json  | 4 +-
 .../BIGTOP/0.8/services/FLUME/metrics.json  |  1390 +-
 .../BIGTOP/0.8/services/HBASE/metrics.json  | 27130 +
 .../BIGTOP/0.8/services/HDFS/metrics.json   | 15540 +-
 .../BIGTOP/0.8/services/YARN/metrics.json   | 10398 ---
 .../2.0.6.GlusterFS/services/YARN/metrics.json  |  4970 +--
 .../2.1.GlusterFS/services/STORM/metrics.json   |  2014 +-
 .../2.1.GlusterFS/services/YARN/metrics.json|  4970 +--
 .../2.2.GlusterFS/services/KAFKA/metrics.json   |   466 +-
 .../2.2.GlusterFS/services/YARN/metrics.json|  4970 +--
 .../stacks/HDP/2.2/services/STORM/metrics.json  |  2022 +-
 .../PHD/3.0.0.0/services/FLUME/metrics.json |  1390 +-
 .../PHD/3.0.0.0/services/HBASE/metrics.json | 27130 +
 .../PHD/3.0.0.0/services/HDFS/metrics.json  | 15540 +-
 .../PHD/3.0.0.0/services/YARN/metrics.json  | 10398 ---
 .../StackArtifactResourceProviderTest.java  |   123 +
 .../HDP/2.0.5/services/HBASE/metrics.json   |  6340 ++--
 .../stacks/HDP/2.0.5/services/HDFS/metrics.json |  5742 ++--
 .../stacks/HDP/2.0.5/services/YARN/metrics.json |  3250 +-
 .../stacks/HDP/2.0.8/services/HDFS/metrics.json | 15540 +-
 .../HDP/2.1.1/services/STORM/metrics.json   |   166 +-
 .../stacks/OTHER/1.0/services/HDFS/metrics.json | 15540 +-
 .../OTHER/1.0/services/STORM/metrics.json   |   192 +-
 .../OTHER/1.0/services/HDFS/metrics.json| 15540 +-
 34 files changed, 124182 insertions(+), 121650 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
index 982f10f..3ac2d0d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
@@ -229,7 +229,7 @@ public class AmbariMetaInfo {
 // Need to be initialized before all actions
 ALL_SUPPORTED_OS = new ArrayListString(os_family.os_list());
 readServerVersion();
-stackManager = new StackManager(stackRoot,commonServicesRoot,
+stackManager = new StackManager(stackRoot, commonServicesRoot,
 new StackContext(metaInfoDAO, actionMetadata, os_family));
 getCustomActionDefinitions(customActionRoot);
   }
@@ -800,12 +800,10 @@ public class AmbariMetaInfo {
   }
 
   /**
-   * Gets the metrics for a Role (component).
-   * @return the list of defined metrics.
+   * Return metrics for a stack service.
*/
-  public ListMetricDefinition getMetrics(String stackName, String 
stackVersion,
-  String serviceName, String componentName, String metricType)
-  throws AmbariException {
+  public MapString, MapString, ListMetricDefinition 
getServiceMetrics(String stackName,
+String stackVersion, String serviceName) throws AmbariException {
 
 ServiceInfo svc = getService(stackName, stackVersion, serviceName);
 
@@ -836,7 +834,21 @@ public class AmbariMetaInfo {
   }
 }
 
-if (map.containsKey(componentName)) {
+return map;
+  }
+
+  /**
+   * Gets the metrics for a Role (component).
+   * @return the list of defined metrics.
+   */
+  public ListMetricDefinition getMetrics(String stackName, String 
stackVersion,
+  String

[07/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/metrics.json
--
diff --git 
a/ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/metrics.json 
b/ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/metrics.json
index dd68181..be96f9a 100644
--- 
a/ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/metrics.json
+++ 
b/ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/metrics.json
@@ -1,5 +1,5 @@
 {
-  NAMENODE : {
+  NAMENODE: {
 Component: [
   {
 type: jmx,
@@ -7,665 +7,667 @@
   port: 60010
 },
 metrics: {
-  ServiceComponentInfo/BlocksTotal:{
-metric : 
Hadoop:service=NameNode,name=FSNamesystemMetrics.BlocksTotal,
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/CapacityRemaining:{
-metric : 
Hadoop:service=NameNode,name=FSNamesystemState.CapacityRemaining,
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/CapacityTotal:{
-metric : Hadoop:service=NameNode,name=NameNodeInfo.Total,
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/CapacityUsed:{
-metric : Hadoop:service=NameNode,name=NameNodeInfo.Used,
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/CorruptBlocks:{
-metric : 
Hadoop:service=NameNode,name=FSNamesystemMetrics.CorruptBlocks,
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/DeadNodes:{
-metric : Hadoop:service=NameNode,name=NameNodeInfo.DeadNodes,
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/DecomNodes:{
-metric : Hadoop:service=NameNode,name=NameNodeInfo.DecomNodes,
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/HeapMemoryMax:{
-metric : java.lang:type=Memory.HeapMemoryUsage[max],
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/HeapMemoryUsed:{
-metric : java.lang:type=Memory.HeapMemoryUsage[used],
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/NonHeapMemoryMax:{
-metric : java.lang:type=Memory.NonHeapMemoryUsage[max],
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/NonHeapMemoryUsed:{
-metric : java.lang:type=Memory.NonHeapMemoryUsage[used],
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/LiveNodes:{
-metric : Hadoop:service=NameNode,name=NameNodeInfo.LiveNodes,
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/MissingBlocks:{
-metric : 
Hadoop:service=NameNode,name=FSNamesystemMetrics.MissingBlocks,
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/NonDfsUsedSpace:{
-metric : 
Hadoop:service=NameNode,name=NameNodeInfo.NonDfsUsedSpace,
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/PercentUsed:{
-metric : Hadoop:service=NameNode,name=NameNodeInfo.PercentUsed,
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/PercentRemaining:{
-metric : 
Hadoop:service=NameNode,name=NameNodeInfo.PercentRemaining,
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/Safemode:{
-metric : Hadoop:service=NameNode,name=NameNodeInfo.Safemode,
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/StartTime:{
-metric : java.lang:type=Runtime.StartTime,
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/TotalFiles:{
-metric : Hadoop:service=NameNode,name=NameNodeInfo.TotalFiles,
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/UnderReplicatedBlocks:{
-metric : 
Hadoop:service=NameNode,name=FSNamesystemMetrics.UnderReplicatedBlocks,
-pointInTime : true,
-temporal : false
-  },
-  ServiceComponentInfo/UpgradeFinalized:{
-metric : 
Hadoop:service=NameNode,name=NameNodeInfo.UpgradeFinalized,
-pointInTime : true,
-temporal : false
-  },
-  

[23/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/ganglia_properties.json
--
diff --git a/ambari-server/src/main/resources/ganglia_properties.json 
b/ambari-server/src/main/resources/ganglia_properties.json
index 4ba2f84..5984b73 100644
--- a/ambari-server/src/main/resources/ganglia_properties.json
+++ b/ambari-server/src/main/resources/ganglia_properties.json
@@ -6259,6 +6259,7 @@
 temporal:true
   }
 },
+
 HBASE_MASTER:{
   metrics/boottime:{
 metric:boottime,
@@ -10789,6 +10790,7 @@
 temporal:true
   }
 },
+
 FLUME_HANDLER:{
   metrics/boottime:{
 metric:boottime,
@@ -11077,7 +11079,6 @@
   }
 }
   },
-
   HostComponent:{
 
 NAMENODE:{
@@ -19902,6 +19903,7 @@
 temporal:true
   }
 },
+
 FLUME_HANDLER:{
   metrics/boottime:{
 metric:boottime,

http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/FLUME/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/FLUME/metrics.json
 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/FLUME/metrics.json
index 2114c12..b0eae2e 100644
--- 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/FLUME/metrics.json
+++ 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/FLUME/metrics.json
@@ -1,358 +1,360 @@
 {
   FLUME_HANDLER: {
 Component: [
-{
+  {
 type: ganglia,
 metrics: {
-  metrics/boottime:{
-metric:boottime,
-pointInTime:true,
-temporal:true
-  },
-  metrics/cpu/cpu_aidle:{
-metric:cpu_aidle,
-pointInTime:true,
-temporal:true
-  },
-  metrics/cpu/cpu_idle:{
-metric:cpu_idle,
-pointInTime:true,
-temporal:true
-  },
-  metrics/cpu/cpu_nice:{
-metric:cpu_nice,
-pointInTime:true,
-temporal:true
-  },
-  metrics/cpu/cpu_num:{
-metric:cpu_num,
-pointInTime:true,
-temporal:true
-  },
-  metrics/cpu/cpu_speed:{
-metric:cpu_speed,
-pointInTime:true,
-temporal:true
-  },
-  metrics/cpu/cpu_system:{
-metric:cpu_system,
-pointInTime:true,
-temporal:true
-  },
-  metrics/cpu/cpu_user:{
-metric:cpu_user,
-pointInTime:true,
-temporal:true
-  },
-  metrics/cpu/cpu_wio:{
-metric:cpu_wio,
-pointInTime:true,
-temporal:true
-  },
-  metrics/disk/disk_free:{
-metric:disk_free,
-pointInTime:true,
-temporal:true
-  },
-  metrics/disk/disk_total:{
-metric:disk_total,
-pointInTime:true,
-temporal:true
-  },
-  metrics/disk/part_max_used:{
-metric:part_max_used,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/gcCount:{
-metric:jvm.metrics.gcCount,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/gcTimeMillis:{
-metric:jvm.metrics.gcTimeMillis,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/logError:{
-metric:jvm.metrics.logError,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/logFatal:{
-metric:jvm.metrics.logFatal,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/logInfo:{
-metric:jvm.metrics.logInfo,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/logWarn:{
-metric:jvm.metrics.logWarn,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/maxMemoryM:{
-metric:jvm.metrics.maxMemoryM,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/memHeapCommittedM:{
-metric:jvm.metrics.memHeapCommittedM,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/memHeapUsedM:{
-metric:jvm.metrics.memHeapUsedM,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/memNonHeapCommittedM:{
-metric:jvm.metrics.memNonHeapCommittedM,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/memNonHeapUsedM:{
-metric:jvm.metrics.memNonHeapUsedM,
-pointInTime:true,
-   

[05/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/test/resources/stacks/HDP/2.0.8/services/HDFS/metrics.json
--
diff --git 
a/ambari-server/src/test/resources/stacks/HDP/2.0.8/services/HDFS/metrics.json 
b/ambari-server/src/test/resources/stacks/HDP/2.0.8/services/HDFS/metrics.json
index 2938552..f75044c 100644
--- 
a/ambari-server/src/test/resources/stacks/HDP/2.0.8/services/HDFS/metrics.json
+++ 
b/ambari-server/src/test/resources/stacks/HDP/2.0.8/services/HDFS/metrics.json
@@ -4,1415 +4,1419 @@
   {
 type: ganglia,
 metrics: {
-  metrics/dfs/FSNamesystem/TotalLoad: {
-metric: dfs.FSNamesystem.TotalLoad,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/BlockCapacity: {
-metric: dfs.FSNamesystem.BlockCapacity,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityTotal: {
-metric: dfs.FSNamesystem.CapacityTotal,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityUsed: {
-metric: dfs.FSNamesystem.CapacityUsed,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityRemaining: {
-metric: dfs.FSNamesystem.CapacityRemaining,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityNonDFSUsed: {
-metric: dfs.FSNamesystem.CapacityUsedNonDFS,
-pointInTime: false,
-temporal: true
-  },   
-  metrics/dfs/namenode/GetListingOps: {
-metric: dfs.namenode.GetListingOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/namenode/FilesAppended: {
-metric: dfs.namenode.FilesAppended,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/getProtocolVersion_num_ops: {
-metric: rpcdetailed.rpcdetailed.getProtocolVersion_num_ops,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/fsync_avg_time: {
-metric: rpcdetailed.rpcdetailed.FsyncAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/ugi/loginSuccess_avg_time: {
-metric: ugi.UgiMetrics.LoginSuccessAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/load/load_one: {
-metric: load_one,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/renewLease_num_ops: {
-metric: rpcdetailed.rpcdetailed.RenewLeaseNumOps,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/getFileInfo_avg_time: {
-metric: rpcdetailed.rpcdetailed.GetFileInfoAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/memNonHeapUsedM: {
-metric: jvm.JvmMetrics.MemNonHeapUsedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/complete_avg_time: {
-metric: rpcdetailed.rpcdetailed.CompleteAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/setPermission_num_ops: {
-metric: rpcdetailed.rpcdetailed.SetPermissionNumOps,
-pointInTime: true,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityTotalGB: {
-metric: dfs.FSNamesystem.CapacityTotalGB,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/setOwner_num_ops: {
-metric: rpcdetailed.rpcdetailed.SetOwnerNumOps,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/getBlockLocations_num_ops: {
-metric: rpcdetailed.rpcdetailed.GetBlockLocationsNumOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/process/proc_run: {
-metric: proc_run,
-pointInTime: true,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityUsedGB: {
-metric: dfs.FSNamesystem.CapacityUsedGB,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/namenode/AddBlockOps: {
-metric: dfs.namenode.AddBlockOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/memory/swap_total: {
-metric: swap_total,
-pointInTime: true,
-temporal: true
-  },
-  

[01/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk d95dfe3b4 - d83c14c40


http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/test/resources/stacks_with_cycle/OTHER/1.0/services/HDFS/metrics.json
--
diff --git 
a/ambari-server/src/test/resources/stacks_with_cycle/OTHER/1.0/services/HDFS/metrics.json
 
b/ambari-server/src/test/resources/stacks_with_cycle/OTHER/1.0/services/HDFS/metrics.json
index 2938552..bb9dca9 100644
--- 
a/ambari-server/src/test/resources/stacks_with_cycle/OTHER/1.0/services/HDFS/metrics.json
+++ 
b/ambari-server/src/test/resources/stacks_with_cycle/OTHER/1.0/services/HDFS/metrics.json
@@ -4,1415 +4,1419 @@
   {
 type: ganglia,
 metrics: {
-  metrics/dfs/FSNamesystem/TotalLoad: {
-metric: dfs.FSNamesystem.TotalLoad,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/BlockCapacity: {
-metric: dfs.FSNamesystem.BlockCapacity,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityTotal: {
-metric: dfs.FSNamesystem.CapacityTotal,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityUsed: {
-metric: dfs.FSNamesystem.CapacityUsed,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityRemaining: {
-metric: dfs.FSNamesystem.CapacityRemaining,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityNonDFSUsed: {
-metric: dfs.FSNamesystem.CapacityUsedNonDFS,
-pointInTime: false,
-temporal: true
-  },   
-  metrics/dfs/namenode/GetListingOps: {
-metric: dfs.namenode.GetListingOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/namenode/FilesAppended: {
-metric: dfs.namenode.FilesAppended,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/getProtocolVersion_num_ops: {
-metric: rpcdetailed.rpcdetailed.getProtocolVersion_num_ops,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/fsync_avg_time: {
-metric: rpcdetailed.rpcdetailed.FsyncAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/ugi/loginSuccess_avg_time: {
-metric: ugi.UgiMetrics.LoginSuccessAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/load/load_one: {
-metric: load_one,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/renewLease_num_ops: {
-metric: rpcdetailed.rpcdetailed.RenewLeaseNumOps,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/getFileInfo_avg_time: {
-metric: rpcdetailed.rpcdetailed.GetFileInfoAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/memNonHeapUsedM: {
-metric: jvm.JvmMetrics.MemNonHeapUsedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/complete_avg_time: {
-metric: rpcdetailed.rpcdetailed.CompleteAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/setPermission_num_ops: {
-metric: rpcdetailed.rpcdetailed.SetPermissionNumOps,
-pointInTime: true,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityTotalGB: {
-metric: dfs.FSNamesystem.CapacityTotalGB,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/setOwner_num_ops: {
-metric: rpcdetailed.rpcdetailed.SetOwnerNumOps,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/getBlockLocations_num_ops: {
-metric: rpcdetailed.rpcdetailed.GetBlockLocationsNumOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/process/proc_run: {
-metric: proc_run,
-pointInTime: true,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityUsedGB: {
-metric: dfs.FSNamesystem.CapacityUsedGB,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/namenode/AddBlockOps: {
-metric: dfs.namenode.AddBlockOps,
-pointInTime: false,
-temporal: true
-  },
-  

[08/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HBASE/metrics.json
--
diff --git 
a/ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HBASE/metrics.json 
b/ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HBASE/metrics.json
index 178e4a9..2a46f29 100644
--- 
a/ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HBASE/metrics.json
+++ 
b/ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HBASE/metrics.json
@@ -4,3180 +4,3184 @@
   {
 type: ganglia,
 metrics: {
-  metrics/rpc/deleteTable/aboveOneSec/_num_ops: {
-metric: rpc.rpc.deleteTable.aboveOneSec._num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/closeRegion_num_ops: {
-metric: rpc.rpc.closeRegion_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/regionServerStartup/aboveOneSec/_avg_time: {
-metric: rpc.rpc.regionServerStartup.aboveOneSec._avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/unassign_num_ops: {
-metric: rpc.rpc.unassign_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/getClusterStatus/aboveOneSec/_avg_time: {
-metric: rpc.rpc.getClusterStatus.aboveOneSec._avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/modifyTable_num_ops: {
-metric: rpc.rpc.modifyTable_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/getProtocolVersion_avg_time: {
-metric: rpc.rpc.getProtocolVersion_avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/unassign/aboveOneSec/_num_ops: {
-metric: rpc.rpc.unassign.aboveOneSec._num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/load/load_one: {
-metric: load_one,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/getClosestRowBefore_num_ops: {
-metric: rpc.rpc.getClosestRowBefore_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/memNonHeapUsedM: {
-metric: jvm.JvmMetrics.MemNonHeapUsedM,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/assign/aboveOneSec/_avg_time: {
-metric: rpc.rpc.assign.aboveOneSec._avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/replicateLogEntries_num_ops: {
-metric: rpc.rpc.replicateLogEntries_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/createTable/aboveOneSec/_avg_time: {
-metric: rpc.rpc.createTable.aboveOneSec._avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/lockRow_num_ops: {
-metric: rpc.rpc.lockRow_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/flushRegion_avg_time: {
-metric: rpc.rpc.flushRegion_avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/multi_avg_time: {
-metric: rpc.rpc.multi_avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/memory/swap_total: {
-metric: swap_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/stopMaster_num_ops: {
-metric: rpc.rpc.stopMaster_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/process/proc_total: {
-metric: proc_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/balance_avg_time: {
-metric: rpc.rpc.balance_avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/disk/part_max_used: {
-metric: part_max_used,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/splitRegion_num_ops: {
-metric: rpc.rpc.splitRegion_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/modifyColumn_avg_time: {
-metric: rpc.rpc.modifyColumn_avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/balance_num_ops: {
-metric: rpc.rpc.balance_num_ops,
-pointInTime: true,
-temporal: true
-  

[17/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/metrics.json
 
b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/metrics.json
index 68efe9f..df7e15f 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/metrics.json
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/metrics.json
@@ -4,355 +4,357 @@
   {
 type: ganglia,
 metrics: {
-  metrics/memory/mem_total: {
-metric: mem_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/memHeapCommittedM: {
-metric: jvm.JvmMetrics.MemHeapCommittedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/mapred/ShuffleOutputsFailed: {
-metric: mapred.ShuffleOutputsFailed,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/threadsRunnable: {
-metric: jvm.JvmMetrics.ThreadsRunnable,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/threadsNew: {
-metric: jvm.JvmMetrics.ThreadsNew,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/rpcAuthorizationFailures: {
-metric: rpc.metrics.RpcAuthorizationFailures,
-pointInTime: false,
-temporal: true
-  },
-  metrics/ugi/loginSuccess_avg_time: {
-metric: ugi.ugi.LoginSuccessAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/RpcQueueTime_avg_time: {
-metric: rpc.rpc.RpcQueueTimeAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/yarn/ContainersCompleted: {
-metric: yarn.ContainersCompleted,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/SentBytes: {
-metric: rpc.rpc.SentBytes,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/memNonHeapUsedM: {
-metric: jvm.JvmMetrics.MemNonHeapUsedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/yarn/ContainersKilled: {
-metric: yarn.ContainersKilled,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/logWarn: {
-metric: jvm.JvmMetrics.LogWarn,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/threadsTimedWaiting: {
-metric: jvm.JvmMetrics.ThreadsTimedWaiting,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/gcCount: {
-metric: jvm.JvmMetrics.GcCount,
-pointInTime: false,
-temporal: true
-  },
-  metrics/process/proc_run: {
-metric: proc_run,
-pointInTime: true,
-temporal: true
-  },
-  metrics/memory/swap_total: {
-metric: swap_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/ReceivedBytes: {
-metric: rpc.rpc.ReceivedBytes,
-pointInTime: false,
-temporal: true
-  },
-  metrics/cpu/cpu_nice: {
-metric: cpu_nice,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/threadsBlocked: {
-metric: jvm.JvmMetrics.ThreadsBlocked,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/RpcQueueTime_num_ops: {
-metric: rpc.rpc.RpcQueueTimeNumOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/process/proc_total: {
-metric: proc_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/yarn/AllocatedGB: {
-metric: yarn.AllocatedGB,
-pointInTime: true,
-temporal: true
-  },
-  metrics/disk/part_max_used: {
-metric: part_max_used,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/NumOpenConnections: {
-metric: rpc.rpc.NumOpenConnections,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/memHeapUsedM: {
-metric: jvm.JvmMetrics.MemHeapUsedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/threadsWaiting: {
-metric: jvm.JvmMetrics.ThreadsWaiting,
-  

[12/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HBASE/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HBASE/metrics.json
 
b/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HBASE/metrics.json
index 37f73bf..810f3b5 100644
--- 
a/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HBASE/metrics.json
+++ 
b/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HBASE/metrics.json
@@ -4,2205 +4,2209 @@
   {
 type: ganglia,
 metrics: {
-  metrics/hbase/regionserver/compactionTime_avg_time: {
-metric: hbase.regionserver.compactionTime_avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/closeRegion_num_ops: {
-metric: rpc.rpc.closeRegion_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/hbase/regionserver/mutationsWithoutWALSize: {
-metric: regionserver.Server.mutationsWithoutWALSize,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/unassign_num_ops: {
-metric: rpc.rpc.unassign_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/modifyTable_num_ops: {
-metric: rpc.rpc.modifyTable_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/getProtocolVersion_avg_time: {
-metric: rpc.rpc.getProtocolVersion_avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/getZooKeeper/aboveOneSec/_avg_time: {
-metric: rpc.rpc.getZooKeeper.aboveOneSec._avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/load/load_one: {
-metric: load_one,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/getClosestRowBefore_num_ops: {
-metric: rpc.rpc.getClosestRowBefore_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/hbase/regionserver/slowAppendCount: {
-metric: regionserver.Server.slowAppendCount,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/getClosestRowBefore/aboveOneSec/_avg_time: {
-metric: rpc.rpc.getClosestRowBefore.aboveOneSec._avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/lockRow_num_ops: {
-metric: rpc.rpc.lockRow_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/flushRegion_avg_time: {
-metric: rpc.rpc.flushRegion_avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/memory/swap_total: {
-metric: swap_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/stopMaster_num_ops: {
-metric: rpc.rpc.stopMaster_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/openRegions/aboveOneSec/_num_ops: {
-metric: rpc.rpc.openRegions.aboveOneSec._num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/balance_avg_time: {
-metric: rpc.rpc.balance_avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/process/proc_total: {
-metric: proc_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/disk/part_max_used: {
-metric: part_max_used,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/modifyColumn_avg_time: {
-metric: rpc.rpc.modifyColumn_avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/multi/aboveOneSec/_avg_time: {
-metric: rpc.rpc.multi.aboveOneSec._avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/hbase/regionserver/rootIndexSizeKB: {
-metric: hbase.regionserver.rootIndexSizeKB,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/getZooKeeper_num_ops: {
-metric: rpc.rpc.getZooKeeper_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/hbase/regionserver/blockCacheCount: {
-metric: regionserver.Server.blockCacheCount,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/flushRegion_num_ops: {
-metric: 

[11/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HDFS/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HDFS/metrics.json
 
b/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HDFS/metrics.json
index 088626a..ca02f99 100644
--- 
a/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HDFS/metrics.json
+++ 
b/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HDFS/metrics.json
@@ -4,1415 +4,1419 @@
   {
 type: ganglia,
 metrics: {
-  metrics/dfs/FSNamesystem/TotalLoad: {
-metric: dfs.FSNamesystem.TotalLoad,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityTotal: {
-metric: dfs.FSNamesystem.CapacityTotal,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityUsed: {
-metric: dfs.FSNamesystem.CapacityUsed,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityRemaining: {
-metric: dfs.FSNamesystem.CapacityRemaining,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityNonDFSUsed: {
-metric: dfs.FSNamesystem.CapacityUsedNonDFS,
-pointInTime: false,
-temporal: true
-  },  
-  metrics/dfs/FSNamesystem/BlockCapacity: {
-metric: dfs.FSNamesystem.BlockCapacity,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/namenode/GetListingOps: {
-metric: dfs.namenode.GetListingOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/namenode/FilesAppended: {
-metric: dfs.namenode.FilesAppended,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/getProtocolVersion_num_ops: {
-metric: rpcdetailed.rpcdetailed.getProtocolVersion_num_ops,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/fsync_avg_time: {
-metric: rpcdetailed.rpcdetailed.FsyncAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/ugi/loginSuccess_avg_time: {
-metric: ugi.UgiMetrics.LoginSuccessAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/load/load_one: {
-metric: load_one,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/renewLease_num_ops: {
-metric: rpcdetailed.rpcdetailed.RenewLeaseNumOps,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/getFileInfo_avg_time: {
-metric: rpcdetailed.rpcdetailed.GetFileInfoAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/memNonHeapUsedM: {
-metric: jvm.JvmMetrics.MemNonHeapUsedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/complete_avg_time: {
-metric: rpcdetailed.rpcdetailed.CompleteAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/setPermission_num_ops: {
-metric: rpcdetailed.rpcdetailed.SetPermissionNumOps,
-pointInTime: true,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityTotalGB: {
-metric: dfs.FSNamesystem.CapacityTotalGB,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpcdetailed/setOwner_num_ops: {
-metric: rpcdetailed.rpcdetailed.SetOwnerNumOps,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpcdetailed/getBlockLocations_num_ops: {
-metric: rpcdetailed.rpcdetailed.GetBlockLocationsNumOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/process/proc_run: {
-metric: proc_run,
-pointInTime: true,
-temporal: true
-  },
-  metrics/dfs/FSNamesystem/CapacityUsedGB: {
-metric: dfs.FSNamesystem.CapacityUsedGB,
-pointInTime: false,
-temporal: true
-  },
-  metrics/dfs/namenode/AddBlockOps: {
-metric: dfs.namenode.AddBlockOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/memory/swap_total: {
-metric: swap_total,
-pointInTime: true,
-temporal: true
-  },
-  

[20/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/YARN/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/YARN/metrics.json 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/YARN/metrics.json
index 5d8309d..526a328 100644
--- 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/YARN/metrics.json
+++ 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/YARN/metrics.json
@@ -4,355 +4,357 @@
   {
 type: ganglia,
 metrics: {
-  metrics/memory/mem_total: {
-metric: mem_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/memHeapCommittedM: {
-metric: jvm.JvmMetrics.MemHeapCommittedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/mapred/ShuffleOutputsFailed: {
-metric: mapred.ShuffleOutputsFailed,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/threadsRunnable: {
-metric: jvm.JvmMetrics.ThreadsRunnable,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/threadsNew: {
-metric: jvm.JvmMetrics.ThreadsNew,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/rpcAuthorizationFailures: {
-metric: rpc.metrics.RpcAuthorizationFailures,
-pointInTime: false,
-temporal: true
-  },
-  metrics/ugi/loginSuccess_avg_time: {
-metric: ugi.ugi.LoginSuccessAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/RpcQueueTime_avg_time: {
-metric: rpc.rpc.RpcQueueTimeAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/yarn/ContainersCompleted: {
-metric: yarn.NodeManagerMetrics.ContainersCompleted,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/SentBytes: {
-metric: rpc.rpc.SentBytes,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/memNonHeapUsedM: {
-metric: jvm.JvmMetrics.MemNonHeapUsedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/yarn/ContainersKilled: {
-metric: yarn.NodeManagerMetrics.ContainersKilled,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/logWarn: {
-metric: jvm.JvmMetrics.LogWarn,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/threadsTimedWaiting: {
-metric: jvm.JvmMetrics.ThreadsTimedWaiting,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/gcCount: {
-metric: jvm.JvmMetrics.GcCount,
-pointInTime: false,
-temporal: true
-  },
-  metrics/process/proc_run: {
-metric: proc_run,
-pointInTime: true,
-temporal: true
-  },
-  metrics/memory/swap_total: {
-metric: swap_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/ReceivedBytes: {
-metric: rpc.rpc.ReceivedBytes,
-pointInTime: false,
-temporal: true
-  },
-  metrics/cpu/cpu_nice: {
-metric: cpu_nice,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/threadsBlocked: {
-metric: jvm.JvmMetrics.ThreadsBlocked,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/RpcQueueTime_num_ops: {
-metric: rpc.rpc.RpcQueueTimeNumOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/process/proc_total: {
-metric: proc_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/yarn/AllocatedGB: {
-metric: yarn.NodeManagerMetrics.AllocatedGB,
-pointInTime: true,
-temporal: true
-  },
-  metrics/disk/part_max_used: {
-metric: part_max_used,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/NumOpenConnections: {
-metric: rpc.rpc.NumOpenConnections,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/memHeapUsedM: {
-metric: jvm.JvmMetrics.MemHeapUsedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/threadsWaiting: {
-metric: 

[24/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/metrics.json 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/metrics.json
index 604987f..c719141 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/metrics.json
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/metrics.json
@@ -4,285 +4,287 @@
   {
 type: ganglia,
 metrics: {
-  metrics/jvm/memHeapCommittedM: {
-metric: jvm.JvmMetrics.MemHeapCommittedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/mapred/ShuffleOutputsFailed: {
-metric: mapred.ShuffleOutputsFailed,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/threadsRunnable: {
-metric: jvm.JvmMetrics.ThreadsRunnable,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/threadsNew: {
-metric: jvm.JvmMetrics.ThreadsNew,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/rpcAuthorizationFailures: {
-metric: rpc.metrics.RpcAuthorizationFailures,
-pointInTime: false,
-temporal: true
-  },
-  metrics/ugi/loginSuccess_avg_time: {
-metric: ugi.ugi.LoginSuccessAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/RpcQueueTime_avg_time: {
-metric: rpc.rpc.RpcQueueTimeAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/yarn/ContainersCompleted: {
-metric: yarn.NodeManagerMetrics.ContainersCompleted,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/SentBytes: {
-metric: rpc.rpc.SentBytes,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/memNonHeapUsedM: {
-metric: jvm.JvmMetrics.MemNonHeapUsedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/yarn/ContainersKilled: {
-metric: yarn.NodeManagerMetrics.ContainersKilled,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/logWarn: {
-metric: jvm.JvmMetrics.LogWarn,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/threadsTimedWaiting: {
-metric: jvm.JvmMetrics.ThreadsTimedWaiting,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/gcCount: {
-metric: jvm.JvmMetrics.GcCount,
-pointInTime: false,
-temporal: true
-  },
-  metrics/process/proc_run: {
-metric: proc_run,
-pointInTime: true,
-temporal: true
-  },
-  metrics/memory/swap_total: {
-metric: swap_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/ReceivedBytes: {
-metric: rpc.rpc.ReceivedBytes,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/threadsBlocked: {
-metric: jvm.JvmMetrics.ThreadsBlocked,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/RpcQueueTime_num_ops: {
-metric: rpc.rpc.RpcQueueTimeNumOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/process/proc_total: {
-metric: proc_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/yarn/AllocatedGB: {
-metric: yarn.NodeManagerMetrics.AllocatedGB,
-pointInTime: true,
-temporal: true
-  },
-  metrics/disk/part_max_used: {
-metric: part_max_used,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/NumOpenConnections: {
-metric: rpc.rpc.NumOpenConnections,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/memHeapUsedM: {
-metric: jvm.JvmMetrics.MemHeapUsedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/threadsWaiting: {
-metric: jvm.JvmMetrics.ThreadsWaiting,
-pointInTime: false,
-temporal: true
-  },
-  metrics/mapred/ShuffleOutputsOK: {
-metric: mapred.ShuffleOutputsOK,
-pointInTime: true,
-temporal: true
-  },
-  

[25/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/metrics.json 
b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/metrics.json
index 826c0e8..58e4ecb 100644
--- 
a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/metrics.json
+++ 
b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/metrics.json
@@ -4,256 +4,258 @@
   {
 type: ganglia,
 metrics: {
-  metrics/jvm/uptime:{
-metric:jvm.uptime,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/heap_usage:{
-metric:jvm.heap_usage,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/non_heap_usage:{
-metric:jvm.non_heap_usage,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/thread-states/runnable:{
-metric:jvm.thread-states.runnable,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/thread-states/blocked:{
-metric:jvm.thread-states.blocked,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/thread-states/timed_waiting:{
-metric:jvm.thread-states.timed_waiting,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/thread-states/terminated:{
-metric:jvm.thread-states.terminated,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/thread_count:{
-metric:jvm.thread_count,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/daemon_thread_count:{
-metric:jvm.daemon_thread_count,
-pointInTime:true,
-temporal:true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/1MinuteRate:
 {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsMessagesInPerSec.1MinuteRate,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/5MinuteRate:
 {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsMessagesInPerSec.5MinuteRate,
-pointInTime: false,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/15MinuteRate:
 {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsMessagesInPerSec.15MinuteRate,
-pointInTime: false,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/meanRate: {
-metric: 
kafka.server.BrokerTopicMetrics/AllTopicsMessagesInPerSec/meanRate,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/count: {
-metric: 
kafka.server.BrokerTopicMetrics/AllTopicsMessagesInPerSec.counte,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/1MinuteRate: {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.1MinuteRate,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/5MinuteRate: {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.5MinuteRate,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/15MinuteRate: {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.15MinuteRate,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/meanRate: {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.meanRate,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/count: {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.count,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesOutPerSec/1MinuteRate: {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsBytesOutPerSec.1MinuteRate,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesOutPerSec/5MinuteRate: {
-metric: 

[27/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
index 9ebef8a..4f99b25 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/metrics.json
@@ -4,2145 +4,2149 @@
   {
 type: ganglia,
 metrics: {
-  metrics/hbase/regionserver/compactionTime_avg_time: {
-metric: hbase.regionserver.compactionTime_avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/closeRegion_num_ops: {
-metric: rpc.rpc.closeRegion_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/hbase/regionserver/mutationsWithoutWALSize: {
-metric: regionserver.Server.mutationsWithoutWALSize,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/unassign_num_ops: {
-metric: rpc.rpc.unassign_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/modifyTable_num_ops: {
-metric: rpc.rpc.modifyTable_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/getProtocolVersion_avg_time: {
-metric: rpc.rpc.getProtocolVersion_avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/getZooKeeper/aboveOneSec/_avg_time: {
-metric: rpc.rpc.getZooKeeper.aboveOneSec._avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/load/load_one: {
-metric: load_one,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/getClosestRowBefore_num_ops: {
-metric: rpc.rpc.getClosestRowBefore_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/hbase/regionserver/slowAppendCount: {
-metric: regionserver.Server.slowAppendCount,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/getClosestRowBefore/aboveOneSec/_avg_time: {
-metric: rpc.rpc.getClosestRowBefore.aboveOneSec._avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/lockRow_num_ops: {
-metric: rpc.rpc.lockRow_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/flushRegion_avg_time: {
-metric: rpc.rpc.flushRegion_avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/memory/swap_total: {
-metric: swap_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/stopMaster_num_ops: {
-metric: rpc.rpc.stopMaster_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/openRegions/aboveOneSec/_num_ops: {
-metric: rpc.rpc.openRegions.aboveOneSec._num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/balance_avg_time: {
-metric: rpc.rpc.balance_avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/process/proc_total: {
-metric: proc_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/disk/part_max_used: {
-metric: part_max_used,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/modifyColumn_avg_time: {
-metric: rpc.rpc.modifyColumn_avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/multi/aboveOneSec/_avg_time: {
-metric: rpc.rpc.multi.aboveOneSec._avg_time,
-pointInTime: true,
-temporal: true
-  },
-  metrics/hbase/regionserver/rootIndexSizeKB: {
-metric: hbase.regionserver.rootIndexSizeKB,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/getZooKeeper_num_ops: {
-metric: rpc.rpc.getZooKeeper_num_ops,
-pointInTime: true,
-temporal: true
-  },
-  metrics/hbase/regionserver/blockCacheCount: {
-metric: regionserver.Server.blockCacheCount,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/flushRegion_num_ops: {
-metric: 

[10/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/YARN/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/YARN/metrics.json
 
b/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/YARN/metrics.json
index 5d8309d..526a328 100644
--- 
a/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/YARN/metrics.json
+++ 
b/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/YARN/metrics.json
@@ -4,355 +4,357 @@
   {
 type: ganglia,
 metrics: {
-  metrics/memory/mem_total: {
-metric: mem_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/memHeapCommittedM: {
-metric: jvm.JvmMetrics.MemHeapCommittedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/mapred/ShuffleOutputsFailed: {
-metric: mapred.ShuffleOutputsFailed,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/threadsRunnable: {
-metric: jvm.JvmMetrics.ThreadsRunnable,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/threadsNew: {
-metric: jvm.JvmMetrics.ThreadsNew,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/rpcAuthorizationFailures: {
-metric: rpc.metrics.RpcAuthorizationFailures,
-pointInTime: false,
-temporal: true
-  },
-  metrics/ugi/loginSuccess_avg_time: {
-metric: ugi.ugi.LoginSuccessAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/RpcQueueTime_avg_time: {
-metric: rpc.rpc.RpcQueueTimeAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/yarn/ContainersCompleted: {
-metric: yarn.NodeManagerMetrics.ContainersCompleted,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/SentBytes: {
-metric: rpc.rpc.SentBytes,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/memNonHeapUsedM: {
-metric: jvm.JvmMetrics.MemNonHeapUsedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/yarn/ContainersKilled: {
-metric: yarn.NodeManagerMetrics.ContainersKilled,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/logWarn: {
-metric: jvm.JvmMetrics.LogWarn,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/threadsTimedWaiting: {
-metric: jvm.JvmMetrics.ThreadsTimedWaiting,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/gcCount: {
-metric: jvm.JvmMetrics.GcCount,
-pointInTime: false,
-temporal: true
-  },
-  metrics/process/proc_run: {
-metric: proc_run,
-pointInTime: true,
-temporal: true
-  },
-  metrics/memory/swap_total: {
-metric: swap_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/ReceivedBytes: {
-metric: rpc.rpc.ReceivedBytes,
-pointInTime: false,
-temporal: true
-  },
-  metrics/cpu/cpu_nice: {
-metric: cpu_nice,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/threadsBlocked: {
-metric: jvm.JvmMetrics.ThreadsBlocked,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/RpcQueueTime_num_ops: {
-metric: rpc.rpc.RpcQueueTimeNumOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/process/proc_total: {
-metric: proc_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/yarn/AllocatedGB: {
-metric: yarn.NodeManagerMetrics.AllocatedGB,
-pointInTime: true,
-temporal: true
-  },
-  metrics/disk/part_max_used: {
-metric: part_max_used,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/NumOpenConnections: {
-metric: rpc.rpc.NumOpenConnections,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/memHeapUsedM: {
-metric: jvm.JvmMetrics.MemHeapUsedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/threadsWaiting: {
-metric: 

[04/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/test/resources/stacks/HDP/2.1.1/services/STORM/metrics.json
--
diff --git 
a/ambari-server/src/test/resources/stacks/HDP/2.1.1/services/STORM/metrics.json 
b/ambari-server/src/test/resources/stacks/HDP/2.1.1/services/STORM/metrics.json
index 905bbb9..7c149bb 100644
--- 
a/ambari-server/src/test/resources/stacks/HDP/2.1.1/services/STORM/metrics.json
+++ 
b/ambari-server/src/test/resources/stacks/HDP/2.1.1/services/STORM/metrics.json
@@ -3,53 +3,54 @@
 Component: [
   {
 type: 
org.apache.ambari.server.controller.metrics.RestMetricsPropertyProvider,
-properties : {
+properties: {
   default_port: 8745,
   port_config_type: storm-site,
   port_property_name: storm.port,
   protocol: http
 },
 metrics: {
-  metrics/api/cluster/summary/tasks.total:
-  {
-metric: /api/cluster/summary##tasks.total,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/slots.total: {
-metric: /api/cluster/summary##slots.total,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/slots.free: {
-metric: /api/cluster/summary##slots.free,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/supervisors: {
-metric: /api/cluster/summary##supervisors,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/executors.total: {
-metric: /api/cluster/summary##executors.total,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/slots.used: {
-metric: /api/cluster/summary##slots.used,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/topologies: {
-metric: /api/cluster/summary##topologies,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/nimbus.uptime: {
-metric: /api/cluster/summary##nimbus.uptime,
-pointInTime: true,
-temporal: false
+  default: {
+metrics/api/cluster/summary/tasks.total: {
+  metric: /api/cluster/summary##tasks.total,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/slots.total: {
+  metric: /api/cluster/summary##slots.total,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/slots.free: {
+  metric: /api/cluster/summary##slots.free,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/supervisors: {
+  metric: /api/cluster/summary##supervisors,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/executors.total: {
+  metric: /api/cluster/summary##executors.total,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/slots.used: {
+  metric: /api/cluster/summary##slots.used,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/topologies: {
+  metric: /api/cluster/summary##topologies,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/nimbus.uptime: {
+  metric: /api/cluster/summary##nimbus.uptime,
+  pointInTime: true,
+  temporal: false
+}
   }
 }
   }
@@ -57,53 +58,54 @@
 HostComponent: [
   {
 type: 
org.apache.ambari.server.controller.metrics.RestMetricsPropertyProvider,
-properties : {
+properties: {
   default_port: 8745,
   port_config_type: storm-site,
   port_property_name: storm.port,
   protocol: http
 },
 metrics: {
-  metrics/api/cluster/summary/tasks.total:
-  {
-metric: /api/cluster/summary##tasks.total,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/slots.total: {
-metric: /api/cluster/summary##slots.total,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/slots.free: {
-metric: /api/cluster/summary##slots.free,
-pointInTime: true,
-temporal: false
-  },
-  

[09/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProviderTest.java
new file mode 100644
index 000..b3e7e51
--- /dev/null
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProviderTest.java
@@ -0,0 +1,123 @@
+/**
+ * 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.controller.internal;
+
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.persist.PersistService;
+import org.apache.ambari.server.api.services.AmbariMetaInfo;
+import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.controller.spi.Predicate;
+import org.apache.ambari.server.controller.spi.Request;
+import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.utilities.PredicateBuilder;
+import org.apache.ambari.server.controller.utilities.PropertyHelper;
+import org.apache.ambari.server.orm.GuiceJpaInitializer;
+import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
+import org.apache.ambari.server.state.stack.MetricDefinition;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import static 
org.apache.ambari.server.controller.internal.StackArtifactResourceProvider.ARTIFACT_DATA_PROPERTY_ID;
+import static 
org.apache.ambari.server.controller.internal.StackArtifactResourceProvider.ARTIFACT_NAME_PROPERTY_ID;
+import static 
org.apache.ambari.server.controller.internal.StackArtifactResourceProvider.STACK_NAME_PROPERTY_ID;
+import static 
org.apache.ambari.server.controller.internal.StackArtifactResourceProvider.STACK_SERVICE_NAME_PROPERTY_ID;
+import static 
org.apache.ambari.server.controller.internal.StackArtifactResourceProvider.STACK_VERSION_PROPERTY_ID;
+import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
+public class StackArtifactResourceProviderTest {
+  private AmbariMetaInfo metaInfo;
+  private Injector injector;
+
+  @Before
+  public void setup() throws Exception {
+// Unfortunately metainfo is tied to in-memory db instance through
+// looking for updated repo url in StackContext
+InMemoryDefaultTestModule module = new InMemoryDefaultTestModule();
+injector = Guice.createInjector(module);
+injector.getInstance(GuiceJpaInitializer.class);
+metaInfo = injector.getInstance(AmbariMetaInfo.class);
+metaInfo.init();
+  }
+
+  @After
+  public void tearDown() {
+injector.getInstance(PersistService.class).stop();
+  }
+
+  private StackArtifactResourceProvider getStackArtifactResourceProvider(
+  AmbariManagementController managementController) {
+
+Resource.Type type = Resource.Type.StackArtifact;
+
+return (StackArtifactResourceProvider) 
AbstractControllerResourceProvider.getResourceProvider(
+  type,
+  PropertyHelper.getPropertyIds(type),
+  PropertyHelper.getKeyPropertyIds(type),
+  managementController);
+  }
+
+  @Test
+  public void testGetMetricsDescriptorForService() throws Exception {
+AmbariManagementController managementController = 
createNiceMock(AmbariManagementController.class);
+
+
expect(managementController.getAmbariMetaInfo()).andReturn(metaInfo).anyTimes();
+
+replay(managementController);
+
+StackArtifactResourceProvider resourceProvider = 
getStackArtifactResourceProvider(managementController);
+
+SetString propertyIds = new HashSetString();
+propertyIds.add(ARTIFACT_NAME_PROPERTY_ID);
+propertyIds.add(STACK_NAME_PROPERTY_ID);
+

[18/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/metrics.json
 
b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/metrics.json
index 83e27d1..fdac412 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/metrics.json
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/metrics.json
@@ -4,45 +4,47 @@
   {
 type: jmx,
 metrics: {
-  metrics/api/cluster/summary/tasks.total: {
-metric: tasks.total,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/slots.total: {
-metric: slots.total,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/slots.free: {
-metric: slots.free,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/supervisors: {
-metric: supervisors,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/executors.total: {
-metric: executors.total,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/slots.used: {
-metric: slots.used,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/topologies: {
-metric: topologies,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/nimbus.uptime: {
-metric: nimbus.uptime,
-pointInTime: true,
-temporal: false
+  default: {
+metrics/api/cluster/summary/tasks.total: {
+  metric: tasks.total,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/slots.total: {
+  metric: slots.total,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/slots.free: {
+  metric: slots.free,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/supervisors: {
+  metric: supervisors,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/executors.total: {
+  metric: executors.total,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/slots.used: {
+  metric: slots.used,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/topologies: {
+  metric: topologies,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/nimbus.uptime: {
+  metric: nimbus.uptime,
+  pointInTime: true,
+  temporal: false
+}
   }
 }
   }
@@ -51,45 +53,47 @@
   {
 type: jmx,
 metrics: {
-  metrics/api/cluster/summary/tasks.total: {
-metric: tasks.total,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/slots.total: {
-metric: slots.total,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/slots.free: {
-metric: slots.free,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/supervisors: {
-metric: supervisors,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/executors.total: {
-metric: executors.total,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/slots.used: {
-metric: slots.used,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/topologies: {
-metric: topologies,
-pointInTime: true,
-temporal: false
-  },
-  metrics/api/cluster/summary/nimbus.uptime: {
-metric: nimbus.uptime,
-pointInTime: true,
-temporal: false
+  default: {
+metrics/api/cluster/summary/tasks.total: {
+  metric: tasks.total,
+  pointInTime: true,
+  temporal: false
+},
+

[02/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/test/resources/stacks/OTHER/1.0/services/STORM/metrics.json
--
diff --git 
a/ambari-server/src/test/resources/stacks/OTHER/1.0/services/STORM/metrics.json 
b/ambari-server/src/test/resources/stacks/OTHER/1.0/services/STORM/metrics.json
index 59bec39..bd82446 100644
--- 
a/ambari-server/src/test/resources/stacks/OTHER/1.0/services/STORM/metrics.json
+++ 
b/ambari-server/src/test/resources/stacks/OTHER/1.0/services/STORM/metrics.json
@@ -1,99 +1,103 @@
 {
-STORM_REST_API: {
-Component: [
-{
-type: jmx,
-metrics: {
-metrics/api/cluster/summary/tasks.total: {
-metric: tasks.total,
-pointInTime: true,
-temporal: false
-},
-metrics/api/cluster/summary/slots.total: {
-  metric: slots.total,
-  pointInTime: true,
-  temporal: false
-},
-metrics/api/cluster/summary/slots.free: {
-  metric: slots.free,
-  pointInTime: true,
-  temporal: false
-},
-metrics/api/cluster/summary/supervisors: {
-  metric: supervisors,
-  pointInTime: true,
-  temporal: false
-},
-metrics/api/cluster/summary/executors.total: {
-  metric: executors.total,
-  pointInTime: true,
-  temporal: false
-},
-metrics/api/cluster/summary/slots.used: {
-  metric: slots.used,
-  pointInTime: true,
-  temporal: false
-},
-metrics/api/cluster/summary/topologies: {
-  metric: topologies,
-  pointInTime: true,
-  temporal: false
-},
-metrics/api/cluster/summary/nimbus.uptime: {
-  metric: nimbus.uptime,
-  pointInTime: true,
-  temporal: false
-}
-}
+  STORM_REST_API: {
+Component: [
+  {
+type: jmx,
+metrics: {
+  default: {
+metrics/api/cluster/summary/tasks.total: {
+  metric: tasks.total,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/slots.total: {
+  metric: slots.total,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/slots.free: {
+  metric: slots.free,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/supervisors: {
+  metric: supervisors,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/executors.total: {
+  metric: executors.total,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/slots.used: {
+  metric: slots.used,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/topologies: {
+  metric: topologies,
+  pointInTime: true,
+  temporal: false
+},
+metrics/api/cluster/summary/nimbus.uptime: {
+  metric: nimbus.uptime,
+  pointInTime: true,
+  temporal: false
 }
-],
-HostComponent: [
-{
-type: jmx,
-metrics: {
-metrics/api/cluster/summary/tasks.total: {
-  metric: tasks.total,
-  pointInTime: true,
-  temporal: false
-},
-metrics/api/cluster/summary/slots.total: {
-  metric: slots.total,
-  pointInTime: true,
-  temporal: false
-},
-metrics/api/cluster/summary/slots.free: {
-  metric: slots.free,
-  pointInTime: true,
-  temporal: false
-},
-metrics/api/cluster/summary/supervisors: {
-  metric: supervisors,
-  pointInTime: true,
-  temporal: false
-},
-metrics/api/cluster/summary/executors.total: {
-  

[16/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/stacks/HDP/2.2.GlusterFS/services/KAFKA/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2.GlusterFS/services/KAFKA/metrics.json
 
b/ambari-server/src/main/resources/stacks/HDP/2.2.GlusterFS/services/KAFKA/metrics.json
index 826c0e8..58e4ecb 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2.GlusterFS/services/KAFKA/metrics.json
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2.GlusterFS/services/KAFKA/metrics.json
@@ -4,256 +4,258 @@
   {
 type: ganglia,
 metrics: {
-  metrics/jvm/uptime:{
-metric:jvm.uptime,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/heap_usage:{
-metric:jvm.heap_usage,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/non_heap_usage:{
-metric:jvm.non_heap_usage,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/thread-states/runnable:{
-metric:jvm.thread-states.runnable,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/thread-states/blocked:{
-metric:jvm.thread-states.blocked,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/thread-states/timed_waiting:{
-metric:jvm.thread-states.timed_waiting,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/thread-states/terminated:{
-metric:jvm.thread-states.terminated,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/thread_count:{
-metric:jvm.thread_count,
-pointInTime:true,
-temporal:true
-  },
-  metrics/jvm/daemon_thread_count:{
-metric:jvm.daemon_thread_count,
-pointInTime:true,
-temporal:true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/1MinuteRate:
 {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsMessagesInPerSec.1MinuteRate,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/5MinuteRate:
 {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsMessagesInPerSec.5MinuteRate,
-pointInTime: false,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/15MinuteRate:
 {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsMessagesInPerSec.15MinuteRate,
-pointInTime: false,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/meanRate: {
-metric: 
kafka.server.BrokerTopicMetrics/AllTopicsMessagesInPerSec/meanRate,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/count: {
-metric: 
kafka.server.BrokerTopicMetrics/AllTopicsMessagesInPerSec.counte,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/1MinuteRate: {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.1MinuteRate,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/5MinuteRate: {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.5MinuteRate,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/15MinuteRate: {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.15MinuteRate,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/meanRate: {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.meanRate,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/count: {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsBytesInPerSec.count,
-pointInTime: true,
-temporal: true
-  },
-  
metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesOutPerSec/1MinuteRate: {
-metric: 
kafka.server.BrokerTopicMetrics.AllTopicsBytesOutPerSec.1MinuteRate,
-pointInTime: true,
-temporal: true
-  },
-  

[15/30] ambari git commit: AMBARI-10196. Expose metadata for the metrics via API. (swagle)

2015-03-24 Thread swagle
http://git-wip-us.apache.org/repos/asf/ambari/blob/d83c14c4/ambari-server/src/main/resources/stacks/HDP/2.2.GlusterFS/services/YARN/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2.GlusterFS/services/YARN/metrics.json
 
b/ambari-server/src/main/resources/stacks/HDP/2.2.GlusterFS/services/YARN/metrics.json
index 68efe9f..df7e15f 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2.GlusterFS/services/YARN/metrics.json
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2.GlusterFS/services/YARN/metrics.json
@@ -4,355 +4,357 @@
   {
 type: ganglia,
 metrics: {
-  metrics/memory/mem_total: {
-metric: mem_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/memHeapCommittedM: {
-metric: jvm.JvmMetrics.MemHeapCommittedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/mapred/ShuffleOutputsFailed: {
-metric: mapred.ShuffleOutputsFailed,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/threadsRunnable: {
-metric: jvm.JvmMetrics.ThreadsRunnable,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/threadsNew: {
-metric: jvm.JvmMetrics.ThreadsNew,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/rpcAuthorizationFailures: {
-metric: rpc.metrics.RpcAuthorizationFailures,
-pointInTime: false,
-temporal: true
-  },
-  metrics/ugi/loginSuccess_avg_time: {
-metric: ugi.ugi.LoginSuccessAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/RpcQueueTime_avg_time: {
-metric: rpc.rpc.RpcQueueTimeAvgTime,
-pointInTime: false,
-temporal: true
-  },
-  metrics/yarn/ContainersCompleted: {
-metric: yarn.ContainersCompleted,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/SentBytes: {
-metric: rpc.rpc.SentBytes,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/memNonHeapUsedM: {
-metric: jvm.JvmMetrics.MemNonHeapUsedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/yarn/ContainersKilled: {
-metric: yarn.ContainersKilled,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/logWarn: {
-metric: jvm.JvmMetrics.LogWarn,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/threadsTimedWaiting: {
-metric: jvm.JvmMetrics.ThreadsTimedWaiting,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/gcCount: {
-metric: jvm.JvmMetrics.GcCount,
-pointInTime: false,
-temporal: true
-  },
-  metrics/process/proc_run: {
-metric: proc_run,
-pointInTime: true,
-temporal: true
-  },
-  metrics/memory/swap_total: {
-metric: swap_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/ReceivedBytes: {
-metric: rpc.rpc.ReceivedBytes,
-pointInTime: false,
-temporal: true
-  },
-  metrics/cpu/cpu_nice: {
-metric: cpu_nice,
-pointInTime: true,
-temporal: true
-  },
-  metrics/jvm/threadsBlocked: {
-metric: jvm.JvmMetrics.ThreadsBlocked,
-pointInTime: false,
-temporal: true
-  },
-  metrics/rpc/RpcQueueTime_num_ops: {
-metric: rpc.rpc.RpcQueueTimeNumOps,
-pointInTime: false,
-temporal: true
-  },
-  metrics/process/proc_total: {
-metric: proc_total,
-pointInTime: true,
-temporal: true
-  },
-  metrics/yarn/AllocatedGB: {
-metric: yarn.AllocatedGB,
-pointInTime: true,
-temporal: true
-  },
-  metrics/disk/part_max_used: {
-metric: part_max_used,
-pointInTime: true,
-temporal: true
-  },
-  metrics/rpc/NumOpenConnections: {
-metric: rpc.rpc.NumOpenConnections,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/memHeapUsedM: {
-metric: jvm.JvmMetrics.MemHeapUsedM,
-pointInTime: false,
-temporal: true
-  },
-  metrics/jvm/threadsWaiting: {
-metric: jvm.JvmMetrics.ThreadsWaiting,
-  

<    2   3   4   5   6   7   8   9   10   11   >