You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ol...@apache.org on 2016/04/09 12:15:48 UTC

[52/61] [abbrv] ambari git commit: AMBARI-15679. Stack definition for Logsearch (oleewre)

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
index 380fa39..dd82430 100644
--- a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
+++ b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
@@ -252,7 +252,19 @@ class RMFTestCase(TestCase):
       self.assertEquals(resource_type, resource.__class__.__name__)
       self.assertEquals(name, resource.name)
       self.assertEquals(kwargs, resource.arguments)
-    
+
+  def assertResourceCalledRegexp(self, resource_type, name, **kwargs):
+    with patch.object(UnknownConfiguration, '__getattr__', return_value=lambda: "UnknownConfiguration()"):
+      self.assertNotEqual(len(RMFTestCase.env.resource_list), 0, "There were no more resources executed!")
+      resource = RMFTestCase.env.resource_list.pop(0)
+      
+      self.assertRegexpMatches(resource.__class__.__name__, resource_type)
+      self.assertRegexpMatches(resource.name, name)
+      for key in set(resource.arguments.keys()) | set(kwargs.keys()):
+        resource_value = resource.arguments.get(key, '')
+        actual_value = kwargs.get(key, '')
+        self.assertRegexpMatches(resource_value, actual_value, msg="Key " + key + " doesn't match")
+
   def assertNoMoreResources(self):
     self.assertEquals(len(RMFTestCase.env.resource_list), 0, "There were other resources executed!")
     

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml b/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
index fb03cb3..b56b935 100644
--- a/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
+++ b/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
@@ -85,6 +85,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
     

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-web/app/mappers/service_metrics_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/service_metrics_mapper.js b/ambari-web/app/mappers/service_metrics_mapper.js
index 49f984d..2e15973 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -389,7 +389,8 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
       SPARK: [34],
       ACCUMULO: [35],
       ATLAS: [36],
-      AMBARI_METRICS: [37]
+      AMBARI_METRICS: [37],
+      LOGSEARCH: [38]
     };
     if (quickLinks[item.ServiceInfo.service_name])
       finalJson.quick_links = quickLinks[item.ServiceInfo.service_name];

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-web/app/models/quick_links.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/quick_links.js b/ambari-web/app/models/quick_links.js
index d7fbbc6..b7ad1ce 100644
--- a/ambari-web/app/models/quick_links.js
+++ b/ambari-web/app/models/quick_links.js
@@ -355,6 +355,19 @@ App.QuickLinks.FIXTURES = [
     regex: '^(\\d+)$',
     default_http_port: 3000,
     default_https_port: 3000
+  },
+  {
+    id:38,
+    label:'Logsearch UI',
+    url:'%@://%@:%@',
+    service_id: 'LOGSEARCH',
+    template:'%@://%@:%@',
+    http_config: 'logsearch.ui.port',
+    https_config: 'logsearch.ui.port',
+    site: 'logsearch-site',
+    regex: '^(\\d+)$',
+    default_http_port: 61888,
+    default_https_port: 61888
   }
 
 ];

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-web/app/views/common/quick_view_link_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js
index b62b7b8..3a99d7a 100644
--- a/ambari-web/app/views/common/quick_view_link_view.js
+++ b/ambari-web/app/views/common/quick_view_link_view.js
@@ -43,7 +43,8 @@ App.QuickViewLinks = Em.View.extend({
     'ACCUMULO',
     'ATLAS',
     'RANGER',
-    'AMBARI_METRICS'
+    'AMBARI_METRICS',
+    'LOGSEARCH'
   ],
 
   /**
@@ -553,6 +554,9 @@ App.QuickViewLinks = Em.View.extend({
       case "AMBARI_METRICS":
         hosts = this.findHosts('METRICS_GRAFANA', response);
         break;
+      case "LOGSEARCH":
+        hosts = this.findHosts('LOGSEARCH_SERVER', response);
+        break;
       default:
         if (this.getWithDefault('content.hostComponents', []).someProperty('isMaster')) {
           hosts = this.findHosts(this.get('content.hostComponents').findProperty('isMaster').get('componentName'), response);

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-web/test/views/common/quick_link_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/quick_link_view_test.js b/ambari-web/test/views/common/quick_link_view_test.js
index b9050f8..2b1c08f 100644
--- a/ambari-web/test/views/common/quick_link_view_test.js
+++ b/ambari-web/test/views/common/quick_link_view_test.js
@@ -964,6 +964,11 @@ describe('App.QuickViewLinks', function () {
       expect(quickViewLinks.findHosts.calledWith('METRICS_GRAFANA', {})).to.be.true;
     });
 
+    it("LOGSEARCH service", function() {
+      expect(quickViewLinks.getHosts({}, 'LOGSEARCH')).to.eql(['host1']);
+      expect(quickViewLinks.findHosts.calledWith('LOGSEARCH_SERVER', {})).to.be.true;
+    });
+
     it("custom service without master", function() {
       expect(quickViewLinks.getHosts({}, 'S1')).to.be.empty;
     });