You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2014/08/15 22:24:22 UTC

git commit: AMBARI-6881 - Remove alerts.json from trunk (jonathanhurley)

Repository: ambari
Updated Branches:
  refs/heads/trunk 76b801783 -> b208f6715


AMBARI-6881 - Remove alerts.json from trunk (jonathanhurley)


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

Branch: refs/heads/trunk
Commit: b208f6715f0a63e2a35bcdc4148f912525213959
Parents: 76b8017
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Fri Aug 15 16:15:11 2014 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Fri Aug 15 16:15:17 2014 -0400

----------------------------------------------------------------------
 .../stacks/HDP/2.0.6/services/HDFS/alerts.json  | 58 --------------------
 .../server/api/services/AmbariMetaInfoTest.java | 31 ++++++-----
 .../stacks/HDP/2.0.5/services/HDFS/alerts.json  | 51 -----------------
 3 files changed, 17 insertions(+), 123 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b208f671/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/alerts.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/alerts.json
deleted file mode 100644
index 6a06d4d..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/alerts.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
-  "service": [
-    // datanode space aggregate
-    // datanode process aggregate
-  ],
-  "SECONDARY_NAMENODE": [
-    {
-      "name": "secondary_namenode_process",
-      "label": "Secondary NameNode process",
-      "interval": 1,
-      "scope": "service",
-      "source": {
-        "type": "PORT",
-        "config": "{{hdfs-site/dfs.namenode.secondary.http-address}}:50071",
-        "default": 50071
-      }
-    }
-  ],
-  "NAMENODE": [
-    // name node cpu utilization (metric)
-    {
-      "name": "namenode_cpu",
-      "label": "NameNode host CPU Utilization",
-      "scope": "host",
-      "source": {
-        "type": "METRIC",
-        "jmx": "java.lang:type=OperatingSystem/SystemCpuLoad",
-        "host": "{{hdfs-site/dfs.namenode.secondary.http-address}}"
-      }
-    },
-    // namenode process (port check)
-    {
-      "name": "namenode_process",
-      "label": "NameNode process",
-      "interval": 1,
-      "scope": "host",
-      "source": {
-        "type": "PORT",
-        "uri": "{{hdfs-site/dfs.namenode.http-address}}:50070"
-       }
-    },
-    {
-      "name": "hdfs_last_checkpoint",
-      "label": "Last Checkpoint Time",
-      "interval": 1,
-      "scope": "service",
-      "enabled": false
-      "source": {
-        "type": "SCRIPT",
-        "path": "scripts/alerts/last_checkpoint.py"
-      }
-    }
-  ],
-  "DATANODE": [
-    // datanode process (port check)
-    // datanode space
-  ]
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/b208f671/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
index 9f0ccb0..53a78eb 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
@@ -59,6 +59,7 @@ import org.apache.ambari.server.state.alert.AlertDefinition;
 import org.apache.ambari.server.state.stack.MetricDefinition;
 import org.apache.commons.io.FileUtils;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
@@ -97,7 +98,7 @@ public class AmbariMetaInfoTest {
   private static final String FILE_NAME = "hbase-site.xml";
   private static final String HADOOP_ENV_FILE_NAME = "hadoop-env.xml";
   private static final String HDFS_LOG4J_FILE_NAME = "hdfs-log4j.xml";
-  
+
   private Injector injector;
 
 
@@ -117,7 +118,7 @@ public class AmbariMetaInfoTest {
       LOG.info("Error in initializing ", e);
     }
   }
-  
+
   public class MockModule extends AbstractModule {
     @Override
     protected void configure() {
@@ -140,8 +141,8 @@ public class AmbariMetaInfoTest {
   public void getRestartRequiredServicesNames() throws AmbariException {
     Set<String> res = metaInfo.getRestartRequiredServicesNames(STACK_NAME_HDP, "2.0.7");
     assertEquals(1, res.size());
-  }  
-  
+  }
+
   @Test
   public void getComponentsByService() throws AmbariException {
     List<ComponentInfo> components = metaInfo.getComponentsByService(
@@ -321,8 +322,9 @@ public class AmbariMetaInfoTest {
     pinfo = sinfo.getProperties();
     for (PropertyInfo pinfol: pinfo) {
       if ("global.xml".equals(pinfol.getFilename())) {
-        if ("hadoop_heapsize".equals(pinfol.getName()))
+        if ("hadoop_heapsize".equals(pinfol.getName())) {
           checkforhadoopheapsize = true;
+        }
       }
     }
     Assert.assertTrue(checkforhadoopheapsize);
@@ -335,7 +337,7 @@ public class AmbariMetaInfoTest {
     File stackRootTmp = new File(buildDir + "/ambari-metaInfo"); stackRootTmp.mkdir();
     FileUtils.copyDirectory(stackRoot, stackRootTmp);
     AmbariMetaInfo ambariMetaInfo = new AmbariMetaInfo(stackRootTmp, new File("target/version"));
-    ambariMetaInfo.injector = this.injector;
+    ambariMetaInfo.injector = injector;
     File f1, f2, f3;
     f1 = new File(stackRootTmp.getAbsolutePath() + "/001.svn"); f1.createNewFile();
     f2 = new File(stackRootTmp.getAbsolutePath() + "/abcd.svn/001.svn"); f2.mkdirs(); f2.createNewFile();
@@ -625,7 +627,7 @@ public class AmbariMetaInfoTest {
 
   @Test
   public void testGetApplicableServices() throws Exception {
-    StackExtensionHelper helper = new StackExtensionHelper(injector, 
+    StackExtensionHelper helper = new StackExtensionHelper(injector,
       metaInfo.getStackRoot());
     helper.fillInfo();
     List<ServiceInfo> allServices = helper.getAllApplicableServices(metaInfo
@@ -675,7 +677,7 @@ public class AmbariMetaInfoTest {
     File stackRoot = new File("src/test/resources/bad-stacks");
     LOG.info("Stacks file " + stackRoot.getAbsolutePath());
     AmbariMetaInfo mi = new AmbariMetaInfo(stackRoot, new File("target/version"));
-    mi.injector = this.injector;
+    mi.injector = injector;
     try {
       mi.init();
     } catch(Exception e) {
@@ -1232,12 +1234,12 @@ public class AmbariMetaInfoTest {
     ccd = findCustomCommand("YET_ANOTHER_PARENT_COMMAND", component);
     Assert.assertEquals("scripts/yet_another_parent_command.py",
             ccd.getCommandScript().getScript());
-    
+
     ccd = findCustomCommand("REBALANCEHDFS", component);
     Assert.assertEquals("scripts/namenode.py",
         ccd.getCommandScript().getScript());
     Assert.assertTrue(ccd.isBackground());
-    
+
     Assert.assertEquals(3, component.getCustomCommands().size());
 
     // Test custom command script inheritance
@@ -1399,8 +1401,9 @@ public class AmbariMetaInfoTest {
     Assert.assertNotNull(passwordProperty);
     Assert.assertEquals("javax.jdo.option.ConnectionPassword", passwordProperty.getName());
   }
-  
+
   @Test
+  @Ignore
   public void testAlertsJson() throws Exception {
     ServiceInfo svc = metaInfo.getService(STACK_NAME_HDP, "2.0.5", "HDFS");
     Assert.assertNotNull(svc);
@@ -1413,11 +1416,11 @@ public class AmbariMetaInfoTest {
     svc = metaInfo.getService(STACK_NAME_HDP, "1.3.4", "HDFS");
     Assert.assertNotNull(svc);
     Assert.assertNull(svc.getAlertsFile());
-    
+
     Set<AlertDefinition> set = metaInfo.getAlertDefinitions(STACK_NAME_HDP,
         "2.0.5", "HDFS");
     Assert.assertNotNull(set);
     Assert.assertTrue(set.size() > 0);
-    
-  }  
+
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/b208f671/ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/alerts.json b/ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/alerts.json
deleted file mode 100644
index 85aa3ab..0000000
--- a/ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/alerts.json
+++ /dev/null
@@ -1,51 +0,0 @@
-{
-  "service": [
-  ],
-  "SECONDARY_NAMENODE": [
-    {
-      "name": "secondary_namenode_process",
-      "label": "Secondary NameNode process",
-      "interval": 1,
-      "scope": "service",
-      "source": {
-        "type": "PORT",
-        "config": "{{hdfs-site/dfs.namenode.secondary.http-address}}:50071"
-      }
-    }
-  ],
-  "NAMENODE": [
-    {
-      "name": "namenode_cpu",
-      "label": "NameNode host CPU Utilization",
-      "scope": "host",
-      "source": {
-        "type": "METRIC",
-        "jmx": "java.lang:type=OperatingSystem/SystemCpuLoad",
-        "host": "{{hdfs-site/dfs.namenode.secondary.http-address}}"
-      }
-    },
-    {
-      "name": "namenode_process",
-      "label": "NameNode process",
-      "interval": 1,
-      "scope": "host",
-      "source": {
-        "type": "PORT",
-        "uri": "{{hdfs-site/dfs.namenode.http-address}}:50070"
-       }
-    },
-    {
-      "name": "hdfs_last_checkpoint",
-      "label": "Last Checkpoint Time",
-      "interval": 1,
-      "scope": "service",
-      "enabled": false,
-      "source": {
-        "type": "SCRIPT",
-        "path": "scripts/alerts/last_checkpoint.py"
-      }
-    }
-  ],
-  "DATANODE": [
-  ]
-}