AMBARI-18989. Log level filter labels not getting updated with host name filter
 (oleewere)

Change-Id: I8f86056048f85f6a5de5763c59d68a9b023e5abb


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 2591ba11300a25264b5796868c3de2d448bfb380
Parents: 616e97e
Author: oleewere <oleew...@gmail.com>
Authored: Fri Nov 25 16:30:37 2016 +0100
Committer: oleewere <oleew...@gmail.com>
Committed: Tue Nov 29 15:15:41 2016 +0100

----------------------------------------------------------------------
 .../org/apache/ambari/logsearch/LogSearch.java  |  15 +--
 .../logsearch/common/LogSearchConstants.java    |   1 +
 .../AbstractOperationHolderConverter.java       |   9 ++
 ...actServiceLogRequestFacetQueryConverter.java |  44 +++++++
 .../BaseServiceLogRequestQueryConverter.java    |   1 +
 ...ServiceLogAnyGraphRequestQueryConverter.java |  13 +++
 ...eLogComponentLevelRequestQueryConverter.java |  15 +--
 ...eLogComponentRequestFacetQueryConverter.java |  15 +--
 ...rviceLogLevelCountRequestQueryConverter.java |  16 +++
 ...eLogLevelDateRangeRequestQueryConverter.java |  16 ++-
 ...erviceLogTreeRequestFacetQueryConverter.java |  17 +--
 .../ambari/logsearch/doc/DocConstants.java      |   1 +
 .../logsearch/graph/GraphDataGenerator.java     |  26 +++--
 .../logsearch/manager/ServiceLogsManager.java   |   2 +-
 .../request/ServiceLogParamDefinition.java      |   6 +
 .../request/impl/BaseServiceLogRequest.java     |  13 +++
 .../dashboard/BubbleGraphTableLayoutView.js     |   4 +-
 .../views/dashboard/ComponentListView.js        |   2 +-
 .../scripts/views/dashboard/HostListView.js     |  14 +--
 .../main/webapp/scripts/views/tabs/TreeView.js  |  10 +-
 .../webapp/templates/tabs/TreeView_tmpl.html    | 115 ++++++-------------
 ...ComponentLevelRequestQueryConverterTest.java |   7 +-
 ...ComponentRequestFacetQueryConverterTest.java |   4 +-
 23 files changed, 202 insertions(+), 164 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
index d4be790..2c3f4f5 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
@@ -63,12 +63,12 @@ public class LogSearch {
   private static final String HTTP_PROTOCOL = "http";
   private static final String HTTPS_PORT = "61889";
   private static final String HTTP_PORT = "61888";
-  
+
   private static final String WEB_RESOURCE_FOLDER = "webapps/app";
   private static final String ROOT_CONTEXT = "/";
   private static final Integer SESSION_TIMEOUT = 30;
 
- 
+
   public static void main(String[] argv) {
     LogSearch logSearch = new LogSearch();
     ManageStartEndTime.manage();
@@ -78,7 +78,7 @@ public class LogSearch {
       logger.error("Error running logsearch server", e);
     }
   }
-  
+
   public void run(String[] argv) throws Exception {
     Server server = buildSever(argv);
     HandlerList handlers = new HandlerList();
@@ -98,9 +98,10 @@ public class LogSearch {
 
   public Server buildSever(String argv[]) {
     Server server = new Server();
-    ServerConnector connector = new ServerConnector(server);
     boolean portSpecified = argv.length > 0;
     String protcolProperty = 
PropertiesHelper.getProperty(LOGSEARCH_PROTOCOL_PROP,HTTP_PROTOCOL);
+    HttpConfiguration httpConfiguration = new HttpConfiguration();
+    httpConfiguration.setRequestHeaderSize(65535);
     if (StringUtils.isEmpty(protcolProperty)) {
       protcolProperty = HTTP_PROTOCOL;
     }
@@ -109,18 +110,18 @@ public class LogSearch {
       logger.info("Building https server...........");
       port = portSpecified ? argv[0] : HTTPS_PORT;
       checkPort(Integer.parseInt(port));
-      HttpConfiguration https = new HttpConfiguration();
-      https.addCustomizer(new SecureRequestCustomizer());
+      httpConfiguration.addCustomizer(new SecureRequestCustomizer());
       SslContextFactory sslContextFactory = SSLUtil.getSslContextFactory();
       ServerConnector sslConnector = new ServerConnector(server,
           new SslConnectionFactory(sslContextFactory, "http/1.1"),
-          new HttpConnectionFactory(https));
+          new HttpConnectionFactory(httpConfiguration));
       sslConnector.setPort(Integer.parseInt(port));
       server.setConnectors(new Connector[] { sslConnector });
     } else {
       logger.info("Building http server...........");
       port = portSpecified ? argv[0] : HTTP_PORT;
       checkPort(Integer.parseInt(port));
+      ServerConnector connector = new ServerConnector(server, new 
HttpConnectionFactory(httpConfiguration));
       connector.setPort(Integer.parseInt(port));
       server.setConnectors(new Connector[] { connector });
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/LogSearchConstants.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/LogSearchConstants.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/LogSearchConstants.java
index fe31e6d..d1fc68d 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/LogSearchConstants.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/LogSearchConstants.java
@@ -102,6 +102,7 @@ public class LogSearchConstants {
   public static final String REQUEST_PARAM_FILTER_NAME = "filterName";
   public static final String REQUEST_PARAM_ROW_TYPE = "rowType";
   public static final String REQUEST_PARAM_UTC_OFFSET = "utcOffset";
+  public static final String REQUEST_PARAM_HOSTS = "hostList";
 
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/AbstractOperationHolderConverter.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/AbstractOperationHolderConverter.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/AbstractOperationHolderConverter.java
index 3c91f51..b4c6943 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/AbstractOperationHolderConverter.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/AbstractOperationHolderConverter.java
@@ -33,6 +33,7 @@ import 
org.springframework.data.solr.core.query.SimpleFilterQuery;
 import org.springframework.data.solr.core.query.SimpleStringCriteria;
 
 import javax.inject.Inject;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -75,6 +76,14 @@ public abstract class AbstractOperationHolderConverter 
<REQUEST_TYPE, QUERY_TYPE
     return this.addInFilterQuery(query, field, values, false);
   }
 
+  public Query addInFiltersIfNotNullAndEnabled(Query query, String value, 
String field, boolean condition) {
+    if (value != null && condition) {
+      List<String> values = value.length() == 0 ? Arrays.asList("-1") : 
splitValueAsList(value, ",");
+      addInFilterQuery(query, field, values);
+    }
+    return query;
+  }
+
   public Query addInFilterQuery(Query query, String field, List<String> 
values, boolean negate) {
     if (CollectionUtils.isNotEmpty(values)) {
       addFilterQuery(query, new Criteria(field).is(values), negate);

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/AbstractServiceLogRequestFacetQueryConverter.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/AbstractServiceLogRequestFacetQueryConverter.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/AbstractServiceLogRequestFacetQueryConverter.java
new file mode 100644
index 0000000..0fc12e8
--- /dev/null
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/AbstractServiceLogRequestFacetQueryConverter.java
@@ -0,0 +1,44 @@
+/*
+ * 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.logsearch.converter;
+
+import org.apache.ambari.logsearch.model.request.impl.BaseServiceLogRequest;
+import org.apache.ambari.logsearch.util.SolrUtil;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.data.solr.core.query.SimpleFacetQuery;
+
+import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.BUNDLE_ID;
+import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.COMPONENT;
+import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.HOST;
+import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.LEVEL;
+import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.PATH;
+
+public abstract class AbstractServiceLogRequestFacetQueryConverter<SOURCE 
extends BaseServiceLogRequest>
+  extends AbstractLogRequestFacetQueryConverter<SOURCE> {
+
+  @Override
+  public void appendFacetQuery(SimpleFacetQuery facetQuery, SOURCE request) {
+    addEqualsFilterQuery(facetQuery, HOST, 
SolrUtil.escapeQueryChars(request.getHostName()));
+    addEqualsFilterQuery(facetQuery, PATH, 
SolrUtil.escapeQueryChars(request.getFileName()));
+    addEqualsFilterQuery(facetQuery, COMPONENT, 
SolrUtil.escapeQueryChars(request.getComponentName()));
+    addEqualsFilterQuery(facetQuery, BUNDLE_ID, request.getBundleId());
+    addInFiltersIfNotNullAndEnabled(facetQuery, request.getLevel(), LEVEL, 
true);
+    addInFiltersIfNotNullAndEnabled(facetQuery, request.getHostList(), HOST, 
StringUtils.isEmpty(request.getHostName()));
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/BaseServiceLogRequestQueryConverter.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/BaseServiceLogRequestQueryConverter.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/BaseServiceLogRequestQueryConverter.java
index 2601f72..a1f6e75 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/BaseServiceLogRequestQueryConverter.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/BaseServiceLogRequestQueryConverter.java
@@ -53,6 +53,7 @@ public class BaseServiceLogRequestQueryConverter extends 
AbstractServiceLogReque
     if (CollectionUtils.isNotEmpty(levels)){
       addInFilterQuery(query, LEVEL, levels);
     }
+    addInFiltersIfNotNullAndEnabled(query, request.getHostList(), HOST, 
org.apache.commons.lang.StringUtils.isEmpty(request.getHostName()));
     addRangeFilter(query, LOGTIME, request.getFrom(), request.getTo());
     return query;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogAnyGraphRequestQueryConverter.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogAnyGraphRequestQueryConverter.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogAnyGraphRequestQueryConverter.java
index 1d2a657..57bac10 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogAnyGraphRequestQueryConverter.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogAnyGraphRequestQueryConverter.java
@@ -20,12 +20,20 @@ package org.apache.ambari.logsearch.converter;
 
 import org.apache.ambari.logsearch.common.LogType;
 import org.apache.ambari.logsearch.model.request.impl.ServiceAnyGraphRequest;
+import 
org.apache.ambari.logsearch.model.request.impl.ServiceLogLevelCountRequest;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.data.solr.core.query.Criteria;
 import org.springframework.data.solr.core.query.FacetOptions;
+import org.springframework.data.solr.core.query.SimpleFacetQuery;
+import org.springframework.data.solr.core.query.SimpleFilterQuery;
 
+import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.HOST;
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.LOGTIME;
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.LEVEL;
 
 import javax.inject.Named;
+import java.util.Arrays;
+import java.util.List;
 
 @Named
 public class ServiceLogAnyGraphRequestQueryConverter extends 
AbstractLogRequestFacetQueryConverter<ServiceAnyGraphRequest>{
@@ -49,4 +57,9 @@ public class ServiceLogAnyGraphRequestQueryConverter extends 
AbstractLogRequestF
   public LogType getLogType() {
     return LogType.SERVICE;
   }
+
+  @Override
+  public void appendFacetQuery(SimpleFacetQuery facetQuery, 
ServiceAnyGraphRequest request) {
+    addInFiltersIfNotNullAndEnabled(facetQuery, request.getHostList(), HOST, 
StringUtils.isEmpty(request.getHostName()));
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogComponentLevelRequestQueryConverter.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogComponentLevelRequestQueryConverter.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogComponentLevelRequestQueryConverter.java
index cefc029..3b4bb78 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogComponentLevelRequestQueryConverter.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogComponentLevelRequestQueryConverter.java
@@ -18,23 +18,18 @@
  */
 package org.apache.ambari.logsearch.converter;
 
-import com.google.common.base.Splitter;
 import org.apache.ambari.logsearch.common.LogType;
 import 
org.apache.ambari.logsearch.model.request.impl.ServiceLogComponentLevelRequest;
-import org.springframework.data.solr.core.query.Criteria;
 import org.springframework.data.solr.core.query.FacetOptions;
-import org.springframework.data.solr.core.query.SimpleFacetQuery;
-import org.springframework.data.solr.core.query.SimpleFilterQuery;
 
 import javax.inject.Named;
-import java.util.List;
 
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.COMPONENT;
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.LEVEL;
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.LOGTIME;
 
 @Named
-public class ServiceLogComponentLevelRequestQueryConverter extends 
AbstractLogRequestFacetQueryConverter<ServiceLogComponentLevelRequest> {
+public class ServiceLogComponentLevelRequestQueryConverter extends 
AbstractServiceLogRequestFacetQueryConverter<ServiceLogComponentLevelRequest> {
 
   @Override
   public FacetOptions.FacetSort getFacetSort() {
@@ -47,14 +42,6 @@ public class ServiceLogComponentLevelRequestQueryConverter 
extends AbstractLogRe
   }
 
   @Override
-  public void appendFacetQuery(SimpleFacetQuery facetQuery, 
ServiceLogComponentLevelRequest request) {
-    List<String> levels = Splitter.on(",").splitToList(request.getLevel()); // 
TODO: add @Valid on request object to make sure not throw exception if levels 
are missing
-    SimpleFilterQuery filterQuery = new SimpleFilterQuery();
-    filterQuery.addCriteria(new Criteria(LEVEL).in(levels));
-    facetQuery.addFilterQuery(filterQuery);
-  }
-
-  @Override
   public void appendFacetOptions(FacetOptions facetOptions, 
ServiceLogComponentLevelRequest request) {
     facetOptions.addFacetOnPivot(COMPONENT, LEVEL);
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogComponentRequestFacetQueryConverter.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogComponentRequestFacetQueryConverter.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogComponentRequestFacetQueryConverter.java
index afdac70..6271ca8 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogComponentRequestFacetQueryConverter.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogComponentRequestFacetQueryConverter.java
@@ -18,16 +18,11 @@
  */
 package org.apache.ambari.logsearch.converter;
 
-import com.google.common.base.Splitter;
 import org.apache.ambari.logsearch.common.LogType;
 import 
org.apache.ambari.logsearch.model.request.impl.ServiceLogComponentHostRequest;
-import org.springframework.data.solr.core.query.Criteria;
 import org.springframework.data.solr.core.query.FacetOptions;
-import org.springframework.data.solr.core.query.SimpleFacetQuery;
-import org.springframework.data.solr.core.query.SimpleFilterQuery;
 
 import javax.inject.Named;
-import java.util.List;
 
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.COMPONENT;
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.HOST;
@@ -35,7 +30,7 @@ import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.LOGTIME;
 
 @Named
-public class ServiceLogComponentRequestFacetQueryConverter extends 
AbstractLogRequestFacetQueryConverter<ServiceLogComponentHostRequest> {
+public class ServiceLogComponentRequestFacetQueryConverter extends 
AbstractServiceLogRequestFacetQueryConverter<ServiceLogComponentHostRequest> {
 
   @Override
   public FacetOptions.FacetSort getFacetSort() {
@@ -53,14 +48,6 @@ public class ServiceLogComponentRequestFacetQueryConverter 
extends AbstractLogRe
   }
 
   @Override
-  public void appendFacetQuery(SimpleFacetQuery facetQuery, 
ServiceLogComponentHostRequest request) {
-    List<String> levels = Splitter.on(",").splitToList(request.getLevel());
-    SimpleFilterQuery filterQuery = new SimpleFilterQuery();
-    filterQuery.addCriteria(new Criteria(LEVEL).in(levels));
-    facetQuery.addFilterQuery(filterQuery);
-  }
-
-  @Override
   public void appendFacetOptions(FacetOptions facetOptions, 
ServiceLogComponentHostRequest request) {
     facetOptions.addFacetOnPivot(COMPONENT, HOST, LEVEL);
     facetOptions.addFacetOnPivot(COMPONENT, LEVEL);

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogLevelCountRequestQueryConverter.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogLevelCountRequestQueryConverter.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogLevelCountRequestQueryConverter.java
index 18fd204..982d2a1 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogLevelCountRequestQueryConverter.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogLevelCountRequestQueryConverter.java
@@ -20,12 +20,19 @@ package org.apache.ambari.logsearch.converter;
 
 import org.apache.ambari.logsearch.common.LogType;
 import 
org.apache.ambari.logsearch.model.request.impl.ServiceLogLevelCountRequest;
+import org.apache.ambari.logsearch.util.SolrUtil;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.data.solr.core.query.FacetOptions;
+import org.springframework.data.solr.core.query.SimpleFacetQuery;
 
 import javax.inject.Named;
 
+import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.BUNDLE_ID;
+import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.COMPONENT;
+import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.HOST;
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.LOGTIME;
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.LEVEL;
+import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.PATH;
 
 @Named
 public class ServiceLogLevelCountRequestQueryConverter extends 
AbstractLogRequestFacetQueryConverter<ServiceLogLevelCountRequest> {
@@ -49,4 +56,13 @@ public class ServiceLogLevelCountRequestQueryConverter 
extends AbstractLogReques
   public LogType getLogType() {
     return LogType.SERVICE;
   }
+
+  @Override
+  public void appendFacetQuery(SimpleFacetQuery facetQuery, 
ServiceLogLevelCountRequest request) {
+    addEqualsFilterQuery(facetQuery, HOST, 
SolrUtil.escapeQueryChars(request.getHostName()));
+    addEqualsFilterQuery(facetQuery, PATH, 
SolrUtil.escapeQueryChars(request.getFileName()));
+    addEqualsFilterQuery(facetQuery, COMPONENT, 
SolrUtil.escapeQueryChars(request.getComponentName()));
+    addEqualsFilterQuery(facetQuery, BUNDLE_ID, request.getBundleId());
+    addInFiltersIfNotNullAndEnabled(facetQuery, request.getHostList(), HOST, 
StringUtils.isEmpty(request.getHostName()));
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogLevelDateRangeRequestQueryConverter.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogLevelDateRangeRequestQueryConverter.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogLevelDateRangeRequestQueryConverter.java
index 2ff528d..b91a67d 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogLevelDateRangeRequestQueryConverter.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogLevelDateRangeRequestQueryConverter.java
@@ -26,8 +26,10 @@ import org.apache.solr.client.solrj.SolrQuery;
 
 import javax.inject.Named;
 
+import java.util.Arrays;
 import java.util.List;
 
+import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.HOST;
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.LEVEL;
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.LOGTIME;
 
@@ -49,7 +51,19 @@ public class ServiceLogLevelDateRangeRequestQueryConverter 
extends AbstractDateR
     SolrQuery solrQuery = super.convert(request);
     if (StringUtils.isNotEmpty(request.getLevel())) {
       List<String> levels = Splitter.on(",").splitToList(request.getLevel());
-      solrQuery.addFilterQuery(String.format("%s:(%s)", LEVEL, 
StringUtils.join(levels, " OR ")));
+      if (levels.size() > 1) {
+        solrQuery.addFilterQuery(String.format("%s:(%s)", LEVEL, 
StringUtils.join(levels, " OR ")));
+      } else {
+        solrQuery.addFilterQuery(String.format("%s:%s", LEVEL, levels.get(0)));
+      }
+    }
+    if (request.getHostList() != null && 
StringUtils.isEmpty(request.getHostName())) {
+      List<String> hosts = request.getHostList().length() == 0 ? 
Arrays.asList("\\-1") : splitValueAsList(request.getHostList(), ",");
+      if (hosts.size() > 1) {
+        solrQuery.addFilterQuery(String.format("%s:(%s)", HOST, 
StringUtils.join(hosts, " OR ")));
+      } else {
+        solrQuery.addFilterQuery(String.format("%s:%s", HOST, hosts.get(0)));
+      }
     }
     return solrQuery;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogTreeRequestFacetQueryConverter.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogTreeRequestFacetQueryConverter.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogTreeRequestFacetQueryConverter.java
index f9cdb0b..7cb8f91 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogTreeRequestFacetQueryConverter.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/ServiceLogTreeRequestFacetQueryConverter.java
@@ -18,25 +18,18 @@
  */
 package org.apache.ambari.logsearch.converter;
 
-import com.google.common.base.Splitter;
 import org.apache.ambari.logsearch.common.LogType;
 import 
org.apache.ambari.logsearch.model.request.impl.ServiceLogHostComponentRequest;
-import org.springframework.data.solr.core.query.Criteria;
 import org.springframework.data.solr.core.query.FacetOptions;
-import org.springframework.data.solr.core.query.SimpleFacetQuery;
-import org.springframework.data.solr.core.query.SimpleFilterQuery;
-
 import javax.inject.Named;
 
-import java.util.List;
-
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.COMPONENT;
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.HOST;
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.LEVEL;
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.LOGTIME;
 
 @Named
-public class ServiceLogTreeRequestFacetQueryConverter extends 
AbstractLogRequestFacetQueryConverter<ServiceLogHostComponentRequest>{
+public class ServiceLogTreeRequestFacetQueryConverter extends 
AbstractServiceLogRequestFacetQueryConverter<ServiceLogHostComponentRequest>{
 
   @Override
   public FacetOptions.FacetSort getFacetSort() {
@@ -54,14 +47,6 @@ public class ServiceLogTreeRequestFacetQueryConverter 
extends AbstractLogRequest
   }
 
   @Override
-  public void appendFacetQuery(SimpleFacetQuery facetQuery, 
ServiceLogHostComponentRequest request) {
-    List<String> levels = Splitter.on(",").splitToList(request.getLevel());
-    SimpleFilterQuery filterQuery = new SimpleFilterQuery();
-    filterQuery.addCriteria(new Criteria(LEVEL).in(levels));
-    facetQuery.addFilterQuery(filterQuery);
-  }
-
-  @Override
   public void appendFacetOptions(FacetOptions facetOptions, 
ServiceLogHostComponentRequest request) {
     facetOptions.addFacetOnPivot(HOST, COMPONENT, LEVEL);
     facetOptions.addFacetOnPivot(HOST, LEVEL);

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/doc/DocConstants.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/doc/DocConstants.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/doc/DocConstants.java
index 3639b88..805c5a0 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/doc/DocConstants.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/doc/DocConstants.java
@@ -71,6 +71,7 @@ public class DocConstants {
     public static final String NUMBER_ROWS_D = "Getting rows after particular 
log entry - used in 'Preview' option";
     public static final String SCROLL_TYPE_D = "Used in 'Preview' feature for 
getting records 'after' or 'before'";
     public static final String UTC_OFFSET_D = "timezone offset";
+    public static final String HOST_PARAMS_D = "filter for hosts";
   }
 
   public class ServiceOperationDescriptions {

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGenerator.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGenerator.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGenerator.java
index 741c523..75ac819 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGenerator.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGenerator.java
@@ -172,16 +172,16 @@ public class GraphDataGenerator {
   public BarGraphDataListResponse getGraphDataWithDefaults(QueryResponse 
queryResponse, String field, String[] defaults) {
     BarGraphDataListResponse response = new BarGraphDataListResponse();
     BarGraphData barGraphData = new BarGraphData();
-    List<NameValueData> nameValues = generateLevelCountData(queryResponse, 
defaults);
+    List<NameValueData> nameValues = generateLevelCountData(queryResponse, 
defaults, true);
     barGraphData.setName(field);
     barGraphData.setDataCount(nameValues);
     response.setGraphData(Lists.newArrayList(barGraphData));
     return response;
   }
 
-  public NameValueDataListResponse 
getNameValueDataListResponseWithDefaults(QueryResponse response, String[] 
defaults) {
+  public NameValueDataListResponse 
getNameValueDataListResponseWithDefaults(QueryResponse response, String[] 
defaults, boolean emptyResponseDisabled) {
     NameValueDataListResponse result = new NameValueDataListResponse();
-    result.setvNameValues(generateLevelCountData(response, defaults));
+    result.setvNameValues(generateLevelCountData(response, defaults, 
emptyResponseDisabled));
     return result;
   }
 
@@ -325,11 +325,11 @@ public class GraphDataGenerator {
     return extensionTree;
   }
 
-  private List<NameValueData> generateLevelCountData(QueryResponse 
queryResponse, String[] defaults) {
+  private List<NameValueData> generateLevelCountData(QueryResponse 
queryResponse, String[] defaults, boolean emptyResponseEnabled) {
     List<NameValueData> nameValues = Lists.newLinkedList();
     Map<String, NameValueData> linkedMap = Maps.newLinkedHashMap();
     List<Count> counts = generateCount(queryResponse);
-    if (!CollectionUtils.isNotEmpty(counts)) {
+    if (!CollectionUtils.isNotEmpty(counts) && emptyResponseEnabled) {
       return nameValues;
     }
     for (String defaultValue : defaults) {
@@ -338,13 +338,15 @@ public class GraphDataGenerator {
       nameValue.setValue("0");
       linkedMap.put(defaultValue, nameValue);
     }
-    for (Count count : counts) {
-      if (!linkedMap.containsKey(count.getName())) {
-        NameValueData nameValue = new NameValueData();
-        String name = count.getName().toUpperCase();
-        nameValue.setName(name);
-        nameValue.setValue(String.valueOf(count.getCount()));
-        linkedMap.put(name, nameValue);
+    if (CollectionUtils.isNotEmpty(counts)) {
+      for (Count count : counts) {
+        if (!linkedMap.containsKey(count.getName())) {
+          NameValueData nameValue = new NameValueData();
+          String name = count.getName().toUpperCase();
+          nameValue.setName(name);
+          nameValue.setValue(String.valueOf(count.getCount()));
+          linkedMap.put(name, nameValue);
+        }
       }
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/ServiceLogsManager.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/ServiceLogsManager.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/ServiceLogsManager.java
index 8986544..fc2f0f7 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/ServiceLogsManager.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/ServiceLogsManager.java
@@ -209,7 +209,7 @@ public class ServiceLogsManager extends 
ManagerBase<SolrServiceLogData, ServiceL
   public NameValueDataListResponse 
getLogsLevelCount(ServiceLogLevelCountRequest request) {
     SimpleFacetQuery facetQuery = conversionService.convert(request, 
SimpleFacetQuery.class);
     QueryResponse response = serviceLogsSolrDao.process(facetQuery, 
"/service/logs/levels/counts");
-    return 
graphDataGenerator.getNameValueDataListResponseWithDefaults(response, 
LogSearchConstants.SUPPORTED_LOG_LEVELS);
+    return 
graphDataGenerator.getNameValueDataListResponseWithDefaults(response, 
LogSearchConstants.SUPPORTED_LOG_LEVELS, false);
   }
 
   public BarGraphDataListResponse getHistogramData(ServiceGraphRequest 
request) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/ServiceLogParamDefinition.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/ServiceLogParamDefinition.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/ServiceLogParamDefinition.java
index 1783a8d..752f786 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/ServiceLogParamDefinition.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/ServiceLogParamDefinition.java
@@ -21,6 +21,7 @@ package org.apache.ambari.logsearch.model.request;
 import io.swagger.annotations.ApiParam;
 import org.apache.ambari.logsearch.common.LogSearchConstants;
 
+import static 
org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.HOST_PARAMS_D;
 import static 
org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.LEVEL_D;
 import static 
org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.HOST_NAME_D;
 import static 
org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.COMPONENT_NAME_D;
@@ -47,4 +48,9 @@ public interface ServiceLogParamDefinition {
 
   @ApiParam(value = FILE_NAME_D, name = 
LogSearchConstants.REQUEST_PARAM_FILE_NAME)
   void setFileName(String fileName);
+
+  String getHostList();
+
+  @ApiParam(value = HOST_PARAMS_D, name = 
LogSearchConstants.REQUEST_PARAM_HOSTS)
+  void setHostList(String hostList);
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseServiceLogRequest.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseServiceLogRequest.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseServiceLogRequest.java
index edd7563..bafca37 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseServiceLogRequest.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseServiceLogRequest.java
@@ -43,6 +43,9 @@ public class BaseServiceLogRequest extends BaseLogRequest
   @QueryParam(LogSearchConstants.REQUEST_PARAM_BUNDLE_ID)
   private String bundleId;
 
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_HOSTS)
+  private String hostList;
+
   @Override
   public String getLevel() {
     return level;
@@ -92,4 +95,14 @@ public class BaseServiceLogRequest extends BaseLogRequest
   public void setBundleId(String bundleId) {
     this.bundleId = bundleId;
   }
+
+  @Override
+  public String getHostList() {
+    return hostList;
+  }
+
+  @Override
+  public void setHostList(String hostList) {
+    this.hostList = hostList;
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/BubbleGraphTableLayoutView.js
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/BubbleGraphTableLayoutView.js
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/BubbleGraphTableLayoutView.js
index 988c593..e144ae9 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/BubbleGraphTableLayoutView.js
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/BubbleGraphTableLayoutView.js
@@ -160,7 +160,7 @@ define(['require',
                                                host_name :  host,
                                                component_name : component,
                                                sourceLogId: id
-                                       },that.graphParams,{treeParams:null}),
+                                       },that.graphParams,{hostList:null}),
                                        globalVent : that.globalVent
                                });
                        }
@@ -619,7 +619,7 @@ define(['require',
 //                                                     iMessage : 
that.collection.queryParams.iMessage,
 //                                                     eMessage : 
that.collection.queryParams.eMessage,
 //                                                     query : 
that.collection.queryParams.query
-                                               
},that.collection.queryParams,{treeParams:null}),
+                                               
},that.collection.queryParams,{hostList:null}),
                                                globalVent : that.globalVent
                                        }/*)*/);
                                } else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/ComponentListView.js
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/ComponentListView.js
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/ComponentListView.js
index 029c25d..f3bf985 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/ComponentListView.js
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/ComponentListView.js
@@ -191,7 +191,7 @@ define(['require',
                                                params:_.extend({},{
                                                        host_name :  host,
                                                        component_name : 
component
-                                               
},that.searchParams,{treeParams:null}),
+            }, that.searchParams, {hostList: null}),
                                                globalVent : that.globalVent
                                        });
                                },

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/HostListView.js
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/HostListView.js
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/HostListView.js
index b8c11d8..4283f02 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/HostListView.js
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/HostListView.js
@@ -109,7 +109,7 @@ define(['require',
                },
                fetchHosts : function(params){
                        var that = this;
-                       
$.extend(this.collection.queryParams,params,{treeParams:null});
+      $.extend(this.collection.queryParams, params, {hostList: null});
                        this.collection.fetch({
                                reset:true,
                                complete : function(){
@@ -250,7 +250,7 @@ define(['require',
                                                params:_.extend({},{
                                                        host_name :  host,
                                                        component_name : 
component
-                                               
},that.searchParams,{treeParams:null}),
+                                               
},that.searchParams,{hostList:null}),
                                                globalVent : that.globalVent
                                        });
                                }
@@ -278,8 +278,8 @@ define(['require',
                                        
mainParent.find("input[data-type='H']").prop("indeterminate",false);
                                
                        }
-                       var data = this.getCheckedHierarchyData();
-                       this.vent.trigger("tree:search",{treeParams : 
JSON.stringify(_.pluck(data,"h"))});
+      var data = this.getCheckedHierarchyData();
+      this.vent.trigger("tree:search", {hostList: (_.pluck(data, 
"h")).toString()});
                },
                getCheckedHierarchyData : function(){
                        var data=[];
@@ -303,8 +303,8 @@ define(['require',
                        }else
                                this.$('.tree  
input[type="checkbox"]').prop({"checked":false,"indeterminate":false});
                        var data = this.getCheckedHierarchyData();
-                       this.params.treeParams = _.extend({},data);
-                       this.vent.trigger("tree:search",{treeParams : 
JSON.stringify(_.pluck(data,"h"))});
+                       this.params.hostList = _.extend({},data);
+                       this.vent.trigger("tree:search",{hostList : 
(_.pluck(data,"h")).toString()});
                        
                },
                onSearchHostClick : function(e){
@@ -329,7 +329,7 @@ define(['require',
                        
this.ui.searcHostBtn.find("i").removeClass().addClass("fa fa-search");
                },
                restoreCheckbox : function(){
-                       var params = (this.params.treeParams) ? 
JSON.parse(this.params.treeParams) : undefined,that=this;
+      var params = (this.params.hostList) ? this.params.hostList.toString() : 
undefined, that = this;
                        if(params){
                                
that.$("input[data-node]").prop("checked",false);
                                _.each(params,function(node){

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/TreeView.js
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/TreeView.js
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/TreeView.js
index c395495..ee12e8b 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/TreeView.js
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/TreeView.js
@@ -151,7 +151,7 @@ define(['require',
                        this.restoreCheckbox();
                },
                restoreCheckbox : function(){
-                       var params = (this.params.treeParams) ? 
JSON.parse(this.params.treeParams) : undefined,that=this;
+                       var params = (this.params.hostList) ? 
JSON.parse(this.params.hostList) : undefined,that=this;
                        if(params){
                                
that.$("input[data-node]").prop("checked",false);
                                _.each(params,function(node){
@@ -274,8 +274,8 @@ define(['require',
                        }else
                                this.$('.tree  
input[type="checkbox"]').prop({"checked":false,"indeterminate":false});
                        var data = this.getCheckedHierarchyData();
-                       this.params.treeParams = _.extend({},data);
-                       this.vent.trigger("tree:search",{treeParams : 
JSON.stringify(data)});
+                       this.params.hostList = _.extend({},data);
+                       this.vent.trigger("tree:search",{hostList : 
data.toString()});
                        
                },
                onChangeNodeCheckbox : function(e){
@@ -300,7 +300,7 @@ define(['require',
                                
                        }
                        var data = this.getCheckedHierarchyData();
-                       this.vent.trigger("tree:search",{treeParams : 
JSON.stringify(data)});
+                       this.vent.trigger("tree:search",{hostList : 
data.toString()});
                },
                onNewTabIconClick : function(e){
                        var $el = $(e.currentTarget),host,component,that=this;
@@ -311,7 +311,7 @@ define(['require',
                                        params:_.extend({},{
                                                host_name :  host,
                                                component_name : component
-                                       },that.searchParams,{treeParams:null}),
+                                       },that.searchParams,{hostList:null}),
                                        globalVent : that.globalVent
                                }/*)*/);
                        }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/templates/tabs/TreeView_tmpl.html
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/templates/tabs/TreeView_tmpl.html
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/templates/tabs/TreeView_tmpl.html
index f9a6343..3420ca2 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/templates/tabs/TreeView_tmpl.html
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/templates/tabs/TreeView_tmpl.html
@@ -15,83 +15,40 @@
   limitations under the License.
 -->
 <div class="row">
-       <div class="col-md-12">
-               <div class="box">
-                       <div class="box-header">
-                               <div class="box-name">
-                                       <span>Tree View</span>
-                               </div>
-                               <div class="box-icons">
-                                       <!-- a class="collapse-link"> <i 
class="fa fa-save"></i>
-                                       </a> <a class="collapse-link"> <i 
class="fa fa-info"></i>
-                                       </a> <a class="expand-link"> <i 
class="fa fa-gear"></i>
-                                       </a--> <a class="collapse-link"> <i 
class="fa fa-chevron-up"></i>
-                                       </a> <!-- a class="close-link"> <i 
class="fa fa-close"></i>
-                                       </a-->
-                               </div>
-                               <div class="no-move"></div>
-                       </div>
-                       <div class="box-content">
-                               <!-- div class="side-panel">
-                                       <!-- button title="Search by name" 
class="panel-trigger"><i class="fa fa-search"></i></button-->
-                                       <div class="clearfix row-margin-bottom">
-                                               <label class="checkbox 
pull-right no-margin small-85"> <input id="mainCheck" checked ="checked"
-                                                       type="checkbox"> Select 
/ Deselect All <i
-                                                       class="fa fa-square-o 
small"></i>
-                                               </label>
-                                       </div>
-                                   <div class="clearfix">
-                                       <div class="input-group">
-                                           <input type="text" id="searchNode" 
class="form-control" placeholder="Search">
-                                           <span class="input-group-btn">
-                                               <button class="btn btn-info 
btn-search" id="prevSrch" type="button"><i class="fa 
fa-chevron-left"></i></button>
-                                               <button class="btn btn-info 
btn-search" id="nextSrch" type="button"><i class="fa 
fa-chevron-right"></i></button>
-                                           </span>
-                                       </div>
-                                   </div>
-                               <!-- /div-->
-                               
-                               <div class="tree smart-form">
-                               <ul></ul>
-                                       <!-- ul>
-                                               <li><span><i class="fa 
fa-minus-circle"></i> Parent</span>
-                                                       <ul>
-                                                               <li><span><i 
class="fa fa-plus-circle"></i>
-                                                                               
Administrators</span>
-                                                                       <ul>
-                                                                               
<li style="display: none"><span>Michael Jackson</span></li>
-                                                                               
<li style="display: none"><span>Eminem</span></li>
-                                                                               
<li style="display: none"><span>Enrique Iglesias</span></li>
-                                                                       
</ul></li>
-                                                               <li><span><i 
class="fa fa-minus-circle"></i> Child</span>
-                                                                       <ul>
-                                                                               
<li><span>Grand Child</span></li>
-                                                                               
<li><span>Grand Child</span></li>
-                                                                               
<li><span><i class="fa fa-plus-circle"></i> Grand
-                                                                               
                Child</span>
-                                                                               
        <ul>
-                                                                               
                <li style="display: none"><span>Great Grand
-                                                                               
                                Child</span>
-                                                                               
                        <ul>
-                                                                               
                                <li style="display: none"><span>Great great
-                                                                               
                                                Grand Child</span></li>
-                                                                               
                                <li style="display: none"><span>Great great
-                                                                               
                                                Grand Child</span></li>
-                                                                               
                        </ul></li>
-                                                                               
                <li style="display: none"><span>Great Grand
-                                                                               
                                Child</span></li>
-                                                                               
                <li style="display: none"><span>Great Grand
-                                                                               
                                Child</span></li>
-                                                                               
        </ul></li>
-                                                                       
</ul></li>
-                                                       </ul></li>
-                                               <li><span><i class="fa 
fa-minus-circle"></i> Parent2</span>
-                                                       <ul>
-                                                               
<li><span>Child</span></li>
-                                                       </ul></li>
-                                       </ul-->
-                               </div>
-                       </div>
-               </div>
-       </div>
+    <div class="col-md-12">
+        <div class="box">
+            <div class="box-header">
+                <div class="box-name">
+                    <span>Tree View</span>
+                </div>
+                <div class="box-icons">
+                    <a class="collapse-link"><i class="fa fa-chevron-up"></i>
+                    </a>
+                </div>
+                <div class="no-move"></div>
+            </div>
+            <div class="box-content">
+                <div class="clearfix row-margin-bottom">
+                    <label class="checkbox pull-right no-margin small-85">
+                        <input id="mainCheck" checked="checked" 
type="checkbox"> Select / Deselect All
+                        <i class="fa fa-square-o small"></i>
+                    </label>
+                </div>
+                <div class="clearfix">
+                    <div class="input-group">
+                        <input type="text" id="searchNode" 
class="form-control" placeholder="Search">
+            <span class="input-group-btn">
+                <button class="btn btn-info btn-search" id="prevSrch" 
type="button"><i class="fa fa-chevron-left"></i>
+                </button>
+               <button class="btn btn-info btn-search" id="nextSrch" 
type="button"><i class="fa fa-chevron-right"></i>
+               </button>
+             </span>
+                    </div>
+                </div>
+                <div class="tree smart-form">
+                    <ul></ul>
+                </div>
+            </div>
+        </div>
+    </div>
 </div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentLevelRequestQueryConverterTest.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentLevelRequestQueryConverterTest.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentLevelRequestQueryConverterTest.java
index b1ae332..4378a64 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentLevelRequestQueryConverterTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentLevelRequestQueryConverterTest.java
@@ -45,9 +45,10 @@ public class 
ServiceLogComponentLevelRequestQueryConverterTest extends AbstractR
     // WHEN
     SolrQuery query = new 
DefaultQueryParser().doConstructSolrQuery(underTest.convert(request));
     // THEN
-    
assertEquals("?q=*%3A*&rows=0&fq=logtime%3A%5B2016-09-13T22%3A00%3A01.000Z+TO+2016-09-14T22%3A00%3A01.000Z%5D&fq=log_message%3Amyincludemessage"
 +
-      
"&fq=-log_message%3Amyexcludemessage&fq=type%3A%28logsearch_app+secure_log%29&fq=-type%3A%28hst_agent+system_message%29"
 +
-      
"&fq=level%3A%28WARN+ERROR+FATAL%29&facet=true&facet.mincount=1&facet.limit=-1&facet.sort=index&facet.pivot=type%2Clevel",
+    
assertEquals("?q=*%3A*&rows=0&fq=logtime%3A%5B2016-09-13T22%3A00%3A01.000Z+TO+2016-09-14T22%3A00%3A01.000Z%5D"
 +
+      
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=type%3A%28logsearch_app+secure_log%29"
 +
+      
"&fq=-type%3A%28hst_agent+system_message%29&fq=type%3Amycomponent&fq=level%3A%28WARN+ERROR+FATAL%29&facet=true"
 +
+      
"&facet.mincount=1&facet.limit=-1&facet.sort=index&facet.pivot=type%2Clevel",
       query.toQueryString());
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentRequestFacetQueryConverterTest.java
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentRequestFacetQueryConverterTest.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentRequestFacetQueryConverterTest.java
index 3c7f242..ce9cdcc 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentRequestFacetQueryConverterTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentRequestFacetQueryConverterTest.java
@@ -47,8 +47,8 @@ public class 
ServiceLogComponentRequestFacetQueryConverterTest extends AbstractR
     // THEN
     
assertEquals("?q=*%3A*&rows=0&fq=logtime%3A%5B2016-09-13T22%3A00%3A01.000Z+TO+2016-09-14T22%3A00%3A01.000Z%5D"
 +
       
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=type%3A%28logsearch_app+secure_log%29"
 +
-      
"&fq=-type%3A%28hst_agent+system_message%29&fq=level%3A%28WARN+ERROR+FATAL%29&facet=true&facet.mincount=1&facet.limit=-1"
 +
-      
"&facet.sort=index&facet.pivot=type%2Chost%2Clevel&facet.pivot=type%2Clevel",
+      
"&fq=-type%3A%28hst_agent+system_message%29&fq=type%3Amycomponent&fq=level%3A%28WARN+ERROR+FATAL%29"
 +
+      
"&facet=true&facet.mincount=1&facet.limit=-1&facet.sort=index&facet.pivot=type%2Chost%2Clevel&facet.pivot=type%2Clevel",
       query.toQueryString());
   }
 

Reply via email to