oleewere commented on a change in pull request #45: Cleanup metadata: 
remove/rename event history references
URL: https://github.com/apache/ambari-logsearch/pull/45#discussion_r236689184
 
 

 ##########
 File path: 
ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/converter/MetadataRequestQueryConverter.java
 ##########
 @@ -0,0 +1,67 @@
+/*
+ * 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.MetadataRequest;
+import org.apache.ambari.logsearch.util.SolrUtil;
+import org.apache.commons.lang.StringUtils;
+import org.apache.solr.client.solrj.SolrQuery;
+
+import javax.inject.Named;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static 
org.apache.ambari.logsearch.solr.SolrConstants.CommonLogConstants.CLUSTER;
+import static 
org.apache.ambari.logsearch.solr.SolrConstants.EventHistoryConstants.FILTER_NAME;
+import static 
org.apache.ambari.logsearch.solr.SolrConstants.EventHistoryConstants.ROW_TYPE;
+
+@Named
+public class MetadataRequestQueryConverter extends 
AbstractConverterAware<MetadataRequest, SolrQuery> {
+
+  @Override
+  public SolrQuery convert(MetadataRequest metadataRequest) {
+    SolrQuery metadataQuery = new SolrQuery();
+    metadataQuery.setQuery("*:*");
+
+    int startIndex = StringUtils.isNotEmpty(metadataRequest.getStartIndex()) 
&& StringUtils.isNumeric(metadataRequest.getStartIndex())
+      ? Integer.parseInt(metadataRequest.getStartIndex()) : 0;
 
 Review comment:
   @kasakrisz it was only a rename on request query converter, but as some 
references are changed here, github show this as a new file. that can be fixed 
in an another PR, i think that is used in other places as well

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to