This is an automated email from the ASF dual-hosted git repository.

oleewere pushed a commit to branch branch-feature-AMBARI-22842
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-feature-AMBARI-22842 by 
this push:
     new fb4d183  AMBARI-22842. Add doc annotations for new properties
fb4d183 is described below

commit fb4d183d4d9cba7b9afa51d15bdfecf5f26a9047
Author: Oliver Szabo <[email protected]>
AuthorDate: Wed Jan 24 22:39:04 2018 +0100

    AMBARI-22842. Add doc annotations for new properties
---
 .../ambari/logsearch/conf/UIMappingConfig.java     | 180 +++++++++++++++++++--
 1 file changed, 163 insertions(+), 17 deletions(-)

diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/UIMappingConfig.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/UIMappingConfig.java
index 1b4a9a9..57abe16 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/UIMappingConfig.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/UIMappingConfig.java
@@ -19,6 +19,7 @@
 package org.apache.ambari.logsearch.conf;
 
 import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.config.api.LogSearchPropertyDescription;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Configuration;
 
@@ -29,61 +30,206 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.AUDIT_COMPONENT_LABELS_DEFAULTS;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.AUDIT_FIELD_COMMON_LABELS_DEFAULTS;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.AUDIT_FIELD_EXCLUDES_COMMON_DEFAULTS;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.AUDIT_FIELD_EXCLUDES_DEFAULTS;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.AUDIT_FIELD_FALLBACK_PREFIX_DEFAULTS;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.AUDIT_FIELD_FILTERABLE_EXCLUDES_COMMON_DEFAULTS;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.AUDIT_FIELD_FILTERABLE_EXCLUDES_DEFAULTS;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.AUDIT_FIELD_LABELS_DEFAULTS;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.AUDIT_FIELD_VISIBLE_COMMON_DEFAULTS;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.AUDIT_FIELD_VISIBLE_DEFAULTS;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.LOGSEARCH_PROPERTIES_FILE;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.SERVICE_FIELD_FALLBACK_PREFIX_DEFAULTS;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.SERVICE_FIELD_FILTERABLE_EXLUDE_DEFAULTS;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.SERVICE_GROUP_LABELS_DEFAULTS;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.SERVICE_COMPONENT_LABELS_DEFAULTS;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.SERVICE_FIELD_LABELS_DEFAULTS;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.SERVICE_FIELD_EXCLUDES_DEFAULTS;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.SERVICE_FIELD_VISIBLE_DEFAULTS;
+
 @Configuration
 public class UIMappingConfig {
 
-  
@Value("#{propertiesSplitter.parseMap('${logsearch.web.service_logs.group.labels:"
 + LogSearchConstants.SERVICE_GROUP_LABELS_DEFAULTS + "}')}")
+  
@Value("#{propertiesSplitter.parseMap('${logsearch.web.service_logs.group.labels:"
 + SERVICE_GROUP_LABELS_DEFAULTS + "}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.service_logs.group.labels",
+    description = "Map of serivce group labels",
+    examples = {"ambari:Ambari,yarn:YARN"},
+    defaultValue = SERVICE_GROUP_LABELS_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private Map<String, String> serviceGroupLabels;
 
-  
@Value("#{propertiesSplitter.parseMap('${logsearch.web.service_logs.component.labels:"
 + LogSearchConstants.SERVICE_COMPONENT_LABELS_DEFAULTS + "}')}")
+  
@Value("#{propertiesSplitter.parseMap('${logsearch.web.service_logs.component.labels:"
 + SERVICE_COMPONENT_LABELS_DEFAULTS + "}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.service_logs.component.labels",
+    description = "Map of serivce component labels.",
+    examples = {"ambari_agent:Ambari Agent,ambari_server:Ambari Servcer"},
+    defaultValue = SERVICE_COMPONENT_LABELS_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private Map<String, String> serviceComponentLabels;
 
-  
@Value("#{propertiesSplitter.parseMap('${logsearch.web.service_logs.field.labels:"
 + LogSearchConstants.SERVICE_FIELD_LABELS_DEFAULTS + "}')}")
+  
@Value("#{propertiesSplitter.parseMap('${logsearch.web.service_logs.field.labels:"
 + SERVICE_FIELD_LABELS_DEFAULTS + "}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.service_logs.field.labels",
+    description = "Map of serivce field labels.",
+    examples = {"log_message:Message,ip:IP Address"},
+    defaultValue = SERVICE_FIELD_LABELS_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private Map<String, String> serviceFieldLabels;
 
-  
@Value("#{propertiesSplitter.parseList('${logsearch.web.service_logs.field.excludes:"
 + LogSearchConstants.SERVICE_FIELD_EXCLUDES_DEFAULTS + "}')}")
+  
@Value("#{propertiesSplitter.parseList('${logsearch.web.service_logs.field.excludes:"
 + SERVICE_FIELD_EXCLUDES_DEFAULTS + "}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.service_logs.field.excludes",
+    description = "List of fields that will be excluded from metadata schema 
responses.",
+    examples = {"seq_num,tag"},
+    defaultValue = SERVICE_FIELD_EXCLUDES_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private List<String> serviceFieldExcludeList;
 
-  
@Value("#{propertiesSplitter.parseList('${logsearch.web.service_logs.field.visible:"
 + LogSearchConstants.SERVICE_FIELD_VISIBLE_DEFAULTS + "}')}")
+  
@Value("#{propertiesSplitter.parseList('${logsearch.web.service_logs.field.visible:"
 + SERVICE_FIELD_VISIBLE_DEFAULTS + "}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.service_logs.field.visible",
+    description = "List of fields that will be displayed by default on the 
UI.",
+    examples = {"log_message,path,logtime"},
+    defaultValue = SERVICE_FIELD_VISIBLE_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private List<String> serviceFieldVisibleList;
 
-  
@Value("#{propertiesSplitter.parseList('${logsearch.web.service_logs.field.filterable.excludes:"
 + LogSearchConstants.SERVICE_FIELD_FILTERABLE_EXLUDE_DEFAULTS + "}')}")
+  
@Value("#{propertiesSplitter.parseList('${logsearch.web.service_logs.field.filterable.excludes:"
 + SERVICE_FIELD_FILTERABLE_EXLUDE_DEFAULTS + "}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.service_logs.field.filterable.excludes",
+    description = "List of fields that will be excluded from filter selection 
on the UI.",
+    examples = {"path,method,logger_name"},
+    defaultValue = SERVICE_FIELD_FILTERABLE_EXLUDE_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private List<String> serviceFieldFilterableExcludesList;
 
-  
@Value("#{propertiesSplitter.parseMap('${logsearch.web.audit_logs.component.labels:"
 + LogSearchConstants.AUDIT_COMPONENT_LABELS_DEFAULTS + "}')}")
+  
@Value("#{propertiesSplitter.parseMap('${logsearch.web.audit_logs.component.labels:"
 + AUDIT_COMPONENT_LABELS_DEFAULTS + "}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.audit_logs.component.labels",
+    description = "Map of component component labels.",
+    examples = {"ambari:Ambari,RangerAudit:ranger"},
+    defaultValue = AUDIT_COMPONENT_LABELS_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private Map<String, String> auditComponentLabels;
 
-  
@Value("#{propertiesSplitter.parseMapInMap('${logsearch.web.audit_logs.field.labels:"
 + LogSearchConstants.AUDIT_FIELD_LABELS_DEFAULTS + "}')}")
+  
@Value("#{propertiesSplitter.parseMapInMap('${logsearch.web.audit_logs.field.labels:"
 + AUDIT_FIELD_LABELS_DEFAULTS + "}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.audit_logs.field.labels",
+    description = "Map of fields (key-value pairs) labels for different 
component types.",
+    examples = {"ambari#reqUser:Ambari 
User,ws_response:Response;RangerAudit#reqUser:Req User"},
+    defaultValue = AUDIT_FIELD_LABELS_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private Map<String, Map<String, String>> auditFieldLabels;
 
-  
@Value("#{propertiesSplitter.parseMap('${logsearch.web.audit_logs.field.common.labels:"
 + LogSearchConstants.AUDIT_FIELD_COMMON_LABELS_DEFAULTS + "}')}")
+  
@Value("#{propertiesSplitter.parseMap('${logsearch.web.audit_logs.field.common.labels:"
 + AUDIT_FIELD_COMMON_LABELS_DEFAULTS + "}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.audit_logs.field.common.labels",
+    description = "Map of fields labels for audits (common).",
+    examples = {"reqUser:Req User,resp:Response"},
+    defaultValue = AUDIT_FIELD_COMMON_LABELS_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private Map<String, String> auditFieldCommonLabels;
 
-  
@Value("#{propertiesSplitter.parseListInMap('${logsearch.web.audit_logs.field.visible:"
 + LogSearchConstants.AUDIT_FIELD_VISIBLE_DEFAULTS + "}')}")
+  
@Value("#{propertiesSplitter.parseListInMap('${logsearch.web.audit_logs.field.visible:"
 + AUDIT_FIELD_VISIBLE_DEFAULTS + "}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.audit_logs.field.visible",
+    description = "List of fields that will be displayed by default on the UI 
for different audit components.",
+    examples = {"ambari:reqUser,resp;RangerAudit:reqUser,repo"},
+    defaultValue = AUDIT_FIELD_VISIBLE_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private Map<String, List<String>> auditFieldVisibleleMap;
 
-  
@Value("#{propertiesSplitter.parseList('${logsearch.web.audit_logs.field.common.visible:"
 + LogSearchConstants.AUDIT_FIELD_VISIBLE_COMMON_DEFAULTS + "}')}")
+  
@Value("#{propertiesSplitter.parseList('${logsearch.web.audit_logs.field.common.visible:"
 + AUDIT_FIELD_VISIBLE_COMMON_DEFAULTS + "}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.audit_logs.field.common.visible",
+    description = "List of fields that will be displayed by default on the UI 
for every audit components.",
+    examples = {"reqUser,resp"},
+    defaultValue = AUDIT_FIELD_VISIBLE_COMMON_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private List<String> auditFieldCommonVisibleList;
 
-  
@Value("#{propertiesSplitter.parseListInMap('${logsearch.web.audit_logs.field.excludes:"
 + LogSearchConstants.AUDIT_FIELD_EXCLUDES_DEFAULTS + "}')}")
+  
@Value("#{propertiesSplitter.parseListInMap('${logsearch.web.audit_logs.field.excludes:"
 + AUDIT_FIELD_EXCLUDES_DEFAULTS + "}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.audit_logs.field.excludes",
+    description = "List of fields that will be excluded from metadata schema 
responses for different audit components.",
+    examples = {"ambari:reqUser,resp,hdfs:ws_user,ws_role"},
+    defaultValue = AUDIT_FIELD_EXCLUDES_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private Map<String, List<String>> auditFieldExcludeMap;
 
-  
@Value("#{propertiesSplitter.parseList('${logsearch.web.audit_logs.field.common.excludes:"
 + LogSearchConstants.AUDIT_FIELD_EXCLUDES_COMMON_DEFAULTS + "}')}")
+  
@Value("#{propertiesSplitter.parseList('${logsearch.web.audit_logs.field.common.excludes:"
 + AUDIT_FIELD_EXCLUDES_COMMON_DEFAULTS + "}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.audit_logs.field.common.excludes",
+    description = "List of fields that will be excluded from metadata schema 
responses for every audit components.",
+    examples = {"reqUser,resp,tag_str"},
+    defaultValue = AUDIT_FIELD_EXCLUDES_COMMON_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private List<String> auditFieldCommonExcludeList;
 
-  
@Value("#{propertiesSplitter.parseListInMap('${logsearch.web.audit_logs.field.filterable.excludes:"
 + LogSearchConstants.AUDIT_FIELD_FILTERABLE_EXCLUDES_DEFAULTS + "}')}")
+  
@Value("#{propertiesSplitter.parseListInMap('${logsearch.web.audit_logs.field.filterable.excludes:"
 + AUDIT_FIELD_FILTERABLE_EXCLUDES_DEFAULTS + "}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.audit_logs.field.filterable.excludes",
+    description = "List of fields that will be excluded from filter selection 
on the UI for different audit components.",
+    examples = {"ambari:tag_str,resp,tag_str;RangerAudit:path,ip"},
+    defaultValue = AUDIT_FIELD_FILTERABLE_EXCLUDES_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private Map<String, List<String>> auditFieldFilterableExcludeMap;
 
-  
@Value("#{propertiesSplitter.parseList('${logsearch.web.audit_logs.field.common.filterable.common.excludes:"
 + LogSearchConstants.AUDIT_FIELD_FILTERABLE_EXCLUDES_COMMON_DEFAULTS + "}')}")
+  
@Value("#{propertiesSplitter.parseList('${logsearch.web.audit_logs.field.common.filterable.common.excludes:"
 + AUDIT_FIELD_FILTERABLE_EXCLUDES_COMMON_DEFAULTS + "}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.audit_logs.field.common.filterable.common.excludes",
+    description = "List of fields that will be excluded from filter selection 
on the UI for every audit components.",
+    examples = {"tag_str,resp,tag_str"},
+    defaultValue = AUDIT_FIELD_FILTERABLE_EXCLUDES_COMMON_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private List<String> auditFieldCommonFilterableExcludeList;
 
   @Value("${logsearch.web.labels.fallback.enabled:true}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.audit_logs.field.filterable.excludes",
+    description = "Enable label fallback. (replace _ with spaces and 
capitalize properly)",
+    examples = {"false"},
+    defaultValue = "true",
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private boolean labelFallbackEnabled;
 
-  
@Value("#{propertiesSplitter.parseList('${logsearch.web.labels.service_logs.field.fallback.prefixes:"
 + LogSearchConstants.SERVICE_FIELD_FALLBACK_PREFIX_DEFAULTS +"}')}")
+  
@Value("#{propertiesSplitter.parseList('${logsearch.web.labels.service_logs.field.fallback.prefixes:"
 + SERVICE_FIELD_FALLBACK_PREFIX_DEFAULTS +"}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.labels.service_logs.field.fallback.prefixes",
+    description = "List of prefixes that should be removed during fallback of 
service field labels.",
+    examples = {"ws_,std_,sdi_"},
+    defaultValue = SERVICE_FIELD_FALLBACK_PREFIX_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private List<String> serviceFieldFallbackPrefixes;
 
-  
@Value("#{propertiesSplitter.parseList('${logsearch.web.labels.service_logs.field.fallback.prefixes:"
 + LogSearchConstants.AUDIT_FIELD_FALLBACK_PREFIX_DEFAULTS + "}')}")
+  
@Value("#{propertiesSplitter.parseList('${logsearch.web.labels.service_logs.field.fallback.prefixes:"
 + AUDIT_FIELD_FALLBACK_PREFIX_DEFAULTS + "}')}")
+  @LogSearchPropertyDescription(
+    name = "logsearch.web.labels.service_logs.field.fallback.prefixes",
+    description = "List of prefixes that should be removed during fallback of 
audit field labels.",
+    examples = {"ws_,std_,sdi_"},
+    defaultValue = AUDIT_FIELD_FALLBACK_PREFIX_DEFAULTS,
+    sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
   private List<String> auditFieldFallbackPrefixes;
 
   private final Map<String, Map<String, String>> mergedAuditFieldLabelMap = 
new HashMap<>();

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to