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_r236689469
 
 

 ##########
 File path: 
ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/MetadataManager.java
 ##########
 @@ -119,36 +119,36 @@ public void deleteMetadata(String id) {
   }
 
   @SuppressWarnings("unchecked")
-  public LogSearchMetaDataListResponse getMetadata(EventHistoryRequest 
request) {
+  public LogSearchMetaDataListResponse getMetadata(MetadataRequest request) {
     LogSearchMetaDataListResponse response = new 
LogSearchMetaDataListResponse();
     String rowType = request.getRowType();
     if (StringUtils.isBlank(rowType)) {
       throw new MalformedInputException("Row type was not specified");
     }
 
-    SolrQuery evemtHistoryQuery = conversionService.convert(request, 
SolrQuery.class);
-    evemtHistoryQuery.addFilterQuery(String.format("%s:%s OR %s:%s", 
USER_NAME, LogSearchContext.getCurrentUsername(),
+    SolrQuery metadataQueryQuery = conversionService.convert(request, 
SolrQuery.class);
+    metadataQueryQuery.addFilterQuery(String.format("%s:%s OR %s:%s", 
USER_NAME, LogSearchContext.getCurrentUsername(),
         SHARE_NAME_LIST, LogSearchContext.getCurrentUsername()));
-    SolrDocumentList solrList = 
metadataSolrDao.process(evemtHistoryQuery).getResults();
+    SolrDocumentList solrList = 
metadataSolrDao.process(metadataQueryQuery).getResults();
 
     Collection<LogsearchMetaData> configList = new ArrayList<>();
 
     for (SolrDocument solrDoc : solrList) {
-      LogsearchMetaData eventHistoryData = new LogsearchMetaData();
-      eventHistoryData.setFiltername("" + solrDoc.get(FILTER_NAME));
-      eventHistoryData.setId("" + solrDoc.get(ID));
-      eventHistoryData.setValues("" + solrDoc.get(VALUES));
-      eventHistoryData.setRowType("" + solrDoc.get(ROW_TYPE));
+      LogsearchMetaData metadata = new LogsearchMetaData();
+      metadata.setFiltername("" + solrDoc.get(FILTER_NAME));
 
 Review comment:
   same as above. also note that part will be the next to rewrite as Tobi will 
start to use metadata collections for storing user settings.

----------------------------------------------------------------
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