浏览代码

AMBARI-10309. entries, entry_labels and entry_descriptions should not be defined as a flat list (mpapyrkovskyy via srimanth)

Srimanth Gunturi 10 年之前
父节点
当前提交
19ce4a6ca8

+ 11 - 1
ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationResponse.java

@@ -60,7 +60,7 @@ public class StackConfigurationResponse {
    * @param dependedByProperties depended by properties set
    * @param dependedByProperties depended by properties set
    */
    */
   public StackConfigurationResponse(String propertyName, String propertyValue,
   public StackConfigurationResponse(String propertyName, String propertyValue,
-                                    String propertyDescription, String type,
+                                    String propertyDescription, String propertyDisplayName, String type,
                                     Boolean isRequired,
                                     Boolean isRequired,
                                     Set<PropertyType> propertyTypes,
                                     Set<PropertyType> propertyTypes,
                                     Map<String, String> propertyAttributes,
                                     Map<String, String> propertyAttributes,
@@ -70,6 +70,7 @@ public class StackConfigurationResponse {
     setPropertyName(propertyName);
     setPropertyName(propertyName);
     setPropertyValue(propertyValue);
     setPropertyValue(propertyValue);
     setPropertyDescription(propertyDescription);
     setPropertyDescription(propertyDescription);
+    setPropertyDisplayName(propertyDisplayName);
     setType(type);
     setType(type);
     setRequired(isRequired);
     setRequired(isRequired);
     setPropertyType(propertyTypes);
     setPropertyType(propertyTypes);
@@ -85,6 +86,7 @@ public class StackConfigurationResponse {
   private String propertyName;
   private String propertyName;
   private String propertyValue;
   private String propertyValue;
   private String propertyDescription;
   private String propertyDescription;
+  private String propertyDisplayName;
   private String type;
   private String type;
   private Map<String, String> propertyAttributes;
   private Map<String, String> propertyAttributes;
   private ValueAttributesInfo propertyValueAttributes;
   private ValueAttributesInfo propertyValueAttributes;
@@ -141,6 +143,14 @@ public class StackConfigurationResponse {
     this.propertyDescription = propertyDescription;
     this.propertyDescription = propertyDescription;
   }
   }
 
 
+  public String getPropertyDisplayName() {
+    return propertyDisplayName;
+  }
+
+  public void setPropertyDisplayName(String propertyDisplayName) {
+    this.propertyDisplayName = propertyDisplayName;
+  }
+
   /**
   /**
    * Configuration type
    * Configuration type
    * @return Configuration type (*-site.xml)
    * @return Configuration type (*-site.xml)

+ 2 - 2
ambari-server/src/main/java/org/apache/ambari/server/controller/StackLevelConfigurationResponse.java

@@ -29,13 +29,13 @@ import org.apache.ambari.server.state.ValueAttributesInfo;
 
 
 public class StackLevelConfigurationResponse extends StackConfigurationResponse {
 public class StackLevelConfigurationResponse extends StackConfigurationResponse {
   public StackLevelConfigurationResponse(String propertyName,
   public StackLevelConfigurationResponse(String propertyName,
-      String propertyValue, String propertyDescription, String type,
+      String propertyValue, String propertyDescription, String propertyDisplayName, String type,
       Boolean isRequired, Set<PropertyType> propertyTypes,
       Boolean isRequired, Set<PropertyType> propertyTypes,
       Map<String, String> propertyAttributes,
       Map<String, String> propertyAttributes,
       ValueAttributesInfo propertyValueAttributes,
       ValueAttributesInfo propertyValueAttributes,
       Set<PropertyDependencyInfo> dependsOnProperties,
       Set<PropertyDependencyInfo> dependsOnProperties,
       Set<PropertyDependencyInfo> dependedByProperties) {
       Set<PropertyDependencyInfo> dependedByProperties) {
-    super(propertyName, propertyValue, propertyDescription, type, isRequired,
+    super(propertyName, propertyValue, propertyDescription, propertyDisplayName, type, isRequired,
         propertyTypes, propertyAttributes, propertyValueAttributes,
         propertyTypes, propertyAttributes, propertyValueAttributes,
         dependsOnProperties, dependedByProperties);
         dependsOnProperties, dependedByProperties);
   }
   }

+ 7 - 1
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationResourceProvider.java

@@ -68,7 +68,10 @@ public class StackConfigurationResourceProvider extends
 
 
   public static final String PROPERTY_DESCRIPTION_PROPERTY_ID = PropertyHelper
   public static final String PROPERTY_DESCRIPTION_PROPERTY_ID = PropertyHelper
       .getPropertyId("StackConfigurations", "property_description");
       .getPropertyId("StackConfigurations", "property_description");
-  
+
+  public static final String PROPERTY_DISPLAY_NAME_PROPERTY_ID = PropertyHelper
+      .getPropertyId("StackConfigurations", "property_display_name");
+
   public static final String PROPERTY_PROPERTY_TYPE_PROPERTY_ID = PropertyHelper
   public static final String PROPERTY_PROPERTY_TYPE_PROPERTY_ID = PropertyHelper
       .getPropertyId("StackConfigurations", "property_type");
       .getPropertyId("StackConfigurations", "property_type");
 
 
@@ -145,6 +148,9 @@ public class StackConfigurationResourceProvider extends
 
 
       setResourceProperty(resource, PROPERTY_DESCRIPTION_PROPERTY_ID,
       setResourceProperty(resource, PROPERTY_DESCRIPTION_PROPERTY_ID,
           response.getPropertyDescription(), requestedIds);
           response.getPropertyDescription(), requestedIds);
+
+      setResourceProperty(resource, PROPERTY_DISPLAY_NAME_PROPERTY_ID,
+          response.getPropertyDisplayName(), requestedIds);
       
       
       setResourceProperty(resource, PROPERTY_PROPERTY_TYPE_PROPERTY_ID, 
       setResourceProperty(resource, PROPERTY_PROPERTY_TYPE_PROPERTY_ID, 
           response.getPropertyType(), requestedIds);
           response.getPropertyType(), requestedIds);

+ 21 - 5
ambari-server/src/main/java/org/apache/ambari/server/state/PropertyInfo.java

@@ -22,6 +22,8 @@ package org.apache.ambari.server.state;
 import org.apache.ambari.server.controller.StackConfigurationResponse;
 import org.apache.ambari.server.controller.StackConfigurationResponse;
 import org.w3c.dom.Element;
 import org.w3c.dom.Element;
 
 
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAnyElement;
 import javax.xml.bind.annotation.XmlAnyElement;
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlElement;
@@ -35,14 +37,23 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map;
 import java.util.Set;
 import java.util.Set;
 
 
+@XmlAccessorType(XmlAccessType.FIELD)
 public class PropertyInfo {
 public class PropertyInfo {
   private String name;
   private String name;
   private String value;
   private String value;
   private String description;
   private String description;
+
+  @XmlElement(name = "display-name")
+  private String displayName;
+
   private String filename;
   private String filename;
   private boolean deleted;
   private boolean deleted;
+
+  @XmlAttribute(name = "require-input")
   private boolean requireInput;
   private boolean requireInput;
-  
+
+  @XmlElement(name = "property-type")
+  @XmlList
   private Set<PropertyType> propertyTypes = new HashSet<PropertyType>();
   private Set<PropertyType> propertyTypes = new HashSet<PropertyType>();
 
 
   @XmlAnyElement
   @XmlAnyElement
@@ -89,6 +100,14 @@ public class PropertyInfo {
     this.description = description;
     this.description = description;
   }
   }
 
 
+  public String getDisplayName() {
+    return displayName;
+  }
+
+  public void setDisplayName(String displayName) {
+    this.displayName = displayName;
+  }
+
   public String getFilename() {
   public String getFilename() {
     return filename;
     return filename;
   }
   }
@@ -97,8 +116,6 @@ public class PropertyInfo {
     this.filename = filename;
     this.filename = filename;
   }
   }
   
   
-  @XmlElement(name = "property-type")
-  @XmlList
   public Set<PropertyType> getPropertyTypes() {
   public Set<PropertyType> getPropertyTypes() {
     return propertyTypes;
     return propertyTypes;
   }
   }
@@ -109,7 +126,7 @@ public class PropertyInfo {
   
   
   public StackConfigurationResponse convertToResponse() {
   public StackConfigurationResponse convertToResponse() {
     return new StackConfigurationResponse(getName(), getValue(),
     return new StackConfigurationResponse(getName(), getValue(),
-      getDescription() , getFilename(), isRequireInput(), getPropertyTypes(),
+      getDescription(), getDisplayName() , getFilename(), isRequireInput(), getPropertyTypes(),
       getAttributesMap(), getPropertyValueAttributes(),
       getAttributesMap(), getPropertyValueAttributes(),
       getDependsOnProperties(), getDependedByProperties());
       getDependsOnProperties(), getDependedByProperties());
   }
   }
@@ -142,7 +159,6 @@ public class PropertyInfo {
     return dependedByProperties;
     return dependedByProperties;
   }
   }
 
 
-  @XmlAttribute(name = "require-input")
   public boolean isRequireInput() {
   public boolean isRequireInput() {
     return requireInput;
     return requireInput;
   }
   }

+ 26 - 50
ambari-server/src/main/java/org/apache/ambari/server/state/ValueAttributesInfo.java

@@ -18,12 +18,17 @@
 
 
 package org.apache.ambari.server.state;
 package org.apache.ambari.server.state;
 
 
+import org.codehaus.jackson.annotate.JsonProperty;
 import org.codehaus.jackson.map.annotate.JsonSerialize;
 import org.codehaus.jackson.map.annotate.JsonSerialize;
 
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlElements;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Arrays;
+import java.util.Collection;
 
 
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlAccessorType(XmlAccessType.FIELD)
 @JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
 @JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
@@ -32,18 +37,16 @@ public class ValueAttributesInfo {
   private String maximum;
   private String maximum;
   private String minimum;
   private String minimum;
   private String unit;
   private String unit;
-  private String[] entries;
 
 
-  @XmlElement(name = "entry_labels")
-  private String[] entryLabels;
-
-  @XmlElement(name = "entry_descriptions")
-  private String[] entryDescriptions;
+  @XmlElementWrapper(name = "entries")
+  @XmlElements(@XmlElement(name = "entry"))
+  private Collection<ValueEntryInfo> entries = new ArrayList<ValueEntryInfo>();
 
 
   @XmlElement(name = "entries_editable")
   @XmlElement(name = "entries_editable")
   private Boolean entriesEditable;
   private Boolean entriesEditable;
 
 
-  @XmlElement(name = "selection_cardinality")
+  @XmlElement(name = "selection-cardinality")
+  @JsonProperty("selection_cardinality")
   private String selectionCardinality;
   private String selectionCardinality;
 
 
   public ValueAttributesInfo() {
   public ValueAttributesInfo() {
@@ -82,30 +85,14 @@ public class ValueAttributesInfo {
     this.unit = unit;
     this.unit = unit;
   }
   }
 
 
-  public String[] getEntries() {
+  public Collection<ValueEntryInfo> getEntries() {
     return entries;
     return entries;
   }
   }
 
 
-  public void setEntries(String[] entries) {
+  public void setEntries(Collection<ValueEntryInfo> entries) {
     this.entries = entries;
     this.entries = entries;
   }
   }
 
 
-  public String[] getEntryLabels() {
-    return entryLabels;
-  }
-
-  public void setEntryLabels(String[] entryLabels) {
-    this.entryLabels = entryLabels;
-  }
-
-  public String[] getEntryDescriptions() {
-    return entryDescriptions;
-  }
-
-  public void setEntryDescriptions(String[] entryDescriptions) {
-    this.entryDescriptions = entryDescriptions;
-  }
-
   public Boolean getEntriesEditable() {
   public Boolean getEntriesEditable() {
     return entriesEditable;
     return entriesEditable;
   }
   }
@@ -129,22 +116,15 @@ public class ValueAttributesInfo {
 
 
     ValueAttributesInfo that = (ValueAttributesInfo) o;
     ValueAttributesInfo that = (ValueAttributesInfo) o;
 
 
-    if (!Arrays.equals(entries, that.entries)) return false;
+    if (entries != null ? !entries.equals(that.entries) : that.entries != null) return false;
     if (entriesEditable != null ? !entriesEditable.equals(that.entriesEditable) : that.entriesEditable != null)
     if (entriesEditable != null ? !entriesEditable.equals(that.entriesEditable) : that.entriesEditable != null)
       return false;
       return false;
-    if (!Arrays.equals(entryDescriptions, that.entryDescriptions))
-      return false;
-    if (!Arrays.equals(entryLabels, that.entryLabels)) return false;
-    if (maximum != null ? !maximum.equals(that.maximum) : that.maximum != null)
-      return false;
-    if (minimum != null ? !minimum.equals(that.minimum) : that.minimum != null)
-      return false;
+    if (maximum != null ? !maximum.equals(that.maximum) : that.maximum != null) return false;
+    if (minimum != null ? !minimum.equals(that.minimum) : that.minimum != null) return false;
     if (selectionCardinality != null ? !selectionCardinality.equals(that.selectionCardinality) : that.selectionCardinality != null)
     if (selectionCardinality != null ? !selectionCardinality.equals(that.selectionCardinality) : that.selectionCardinality != null)
       return false;
       return false;
-    if (type != null ? !type.equals(that.type) : that.type != null)
-      return false;
-    if (unit != null ? !unit.equals(that.unit) : that.unit != null)
-      return false;
+    if (type != null ? !type.equals(that.type) : that.type != null) return false;
+    if (unit != null ? !unit.equals(that.unit) : that.unit != null) return false;
 
 
     return true;
     return true;
   }
   }
@@ -155,9 +135,7 @@ public class ValueAttributesInfo {
     result = 31 * result + (maximum != null ? maximum.hashCode() : 0);
     result = 31 * result + (maximum != null ? maximum.hashCode() : 0);
     result = 31 * result + (minimum != null ? minimum.hashCode() : 0);
     result = 31 * result + (minimum != null ? minimum.hashCode() : 0);
     result = 31 * result + (unit != null ? unit.hashCode() : 0);
     result = 31 * result + (unit != null ? unit.hashCode() : 0);
-    result = 31 * result + (entries != null ? Arrays.hashCode(entries) : 0);
-    result = 31 * result + (entryLabels != null ? Arrays.hashCode(entryLabels) : 0);
-    result = 31 * result + (entryDescriptions != null ? Arrays.hashCode(entryDescriptions) : 0);
+    result = 31 * result + (entries != null ? entries.hashCode() : 0);
     result = 31 * result + (entriesEditable != null ? entriesEditable.hashCode() : 0);
     result = 31 * result + (entriesEditable != null ? entriesEditable.hashCode() : 0);
     result = 31 * result + (selectionCardinality != null ? selectionCardinality.hashCode() : 0);
     result = 31 * result + (selectionCardinality != null ? selectionCardinality.hashCode() : 0);
     return result;
     return result;
@@ -166,16 +144,14 @@ public class ValueAttributesInfo {
   @Override
   @Override
   public String toString() {
   public String toString() {
     return "ValueAttributesInfo{" +
     return "ValueAttributesInfo{" +
-        "type='" + type + '\'' +
-        ", maximum=" + maximum +
-        ", minimum=" + minimum +
-        ", unit='" + unit + '\'' +
-        ", entries=" + Arrays.toString(entries) +
-        ", entryLabels=" + Arrays.toString(entryLabels) +
-        ", entryDescriptions=" + Arrays.toString(entryDescriptions) +
-        ", entriesEditable=" + entriesEditable +
-        ", selectionCardinality='" + selectionCardinality + '\'' +
-        '}';
+      "entries=" + entries +
+      ", type='" + type + '\'' +
+      ", maximum='" + maximum + '\'' +
+      ", minimum='" + minimum + '\'' +
+      ", unit='" + unit + '\'' +
+      ", entriesEditable=" + entriesEditable +
+      ", selectionCardinality='" + selectionCardinality + '\'' +
+      '}';
   }
   }
 }
 }
 
 

+ 57 - 0
ambari-server/src/main/java/org/apache/ambari/server/state/ValueEntryInfo.java

@@ -0,0 +1,57 @@
+/*
+ * 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.server.state;
+
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+
+@XmlAccessorType(XmlAccessType.FIELD)
+@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
+public class ValueEntryInfo {
+
+  private String value;
+  private String label;
+  private String description;
+
+  public String getValue() {
+    return value;
+  }
+
+  public void setValue(String value) {
+    this.value = value;
+  }
+
+  public String getLabel() {
+    return label;
+  }
+
+  public void setLabel(String label) {
+    this.label = label;
+  }
+
+  public String getDescription() {
+    return description;
+  }
+
+  public void setDescription(String description) {
+    this.description = description;
+  }
+}

+ 10 - 4
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/hdfs-site.xml

@@ -171,10 +171,16 @@
     <display-name>Minimum replicated blocks %ge</display-name>
     <display-name>Minimum replicated blocks %ge</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>0.99</entries>
-      <entries>1.0</entries>
-      <entry_labels>NN HA</entry_labels>
-      <entry_labels>No NN HA</entry_labels>
+      <entries>
+        <entry>
+          <value>0.99</value>
+          <label>NN HA</label>
+        </entry>
+        <entry>
+          <value>1.0</value>
+          <label>No NN HA</label>
+        </entry>
+      </entries>
       <selection_cardinality>1</selection_cardinality>
       <selection_cardinality>1</selection_cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>

+ 0 - 58
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml

@@ -115,15 +115,6 @@ limitations under the License.
     <name>hive.security.authorization.enabled</name>
     <name>hive.security.authorization.enabled</name>
     <value>false</value>
     <value>false</value>
     <description>enable or disable the hive client authorization</description>
     <description>enable or disable the hive client authorization</description>
-    <display-name>Enable Authorization</display-name>
-    <value-attributes>
-      <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>True</entry_labels>
-      <entry_labels>False</entry_labels>
-      <selection-cardinality>1</selection-cardinality>
-    </value-attributes>
   </property>
   </property>
 
 
   <property>
   <property>
@@ -156,15 +147,6 @@ limitations under the License.
       submitted the query. But if the parameter is set to false, the query will run as the user that the hiveserver2
       submitted the query. But if the parameter is set to false, the query will run as the user that the hiveserver2
       process runs as.
       process runs as.
     </description>
     </description>
-    <display-name>Run as end user instead of Hive user</display-name>
-    <value-attributes>
-      <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>True</entry_labels>
-      <entry_labels>False</entry_labels>
-      <selection-cardinality>1</selection-cardinality>
-    </value-attributes>
   </property>
   </property>
 
 
   <property>
   <property>
@@ -177,19 +159,6 @@ limitations under the License.
     <name>hive.server2.authentication</name>
     <name>hive.server2.authentication</name>
     <description>Authentication mode, default NONE. Options are NONE, NOSASL, KERBEROS, LDAP, PAM and CUSTOM</description>
     <description>Authentication mode, default NONE. Options are NONE, NOSASL, KERBEROS, LDAP, PAM and CUSTOM</description>
     <value>NONE</value>
     <value>NONE</value>
-    <display-name>HiveServer2 Authentication</display-name>
-    <value-attributes>
-      <type>value-list</type>
-      <entries>NONE</entries>
-      <entries>LDAP</entries>
-      <entries>KERBEROS</entries>
-      <entries>PAM</entries>
-      <entry_labels>None</entry_labels>
-      <entry_labels>Lightweight Directory Access Protocol</entry_labels>
-      <entry_labels>Kerberos</entry_labels>
-      <entry_labels>Pluggable Authentication Modules</entry_labels>
-      <selection-cardinality>1</selection-cardinality>
-    </value-attributes>
   </property>
   </property>
 
 
   <property>
   <property>
@@ -208,15 +177,6 @@ limitations under the License.
     <name>hive.enforce.bucketing</name>
     <name>hive.enforce.bucketing</name>
     <value>true</value>
     <value>true</value>
     <description>Whether bucketing is enforced. If true, while inserting into the table, bucketing is enforced.</description>
     <description>Whether bucketing is enforced. If true, while inserting into the table, bucketing is enforced.</description>
-    <display-name>Enforce bucketing</display-name>
-    <value-attributes>
-      <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>True</entry_labels>
-      <entry_labels>False</entry_labels>
-      <selection-cardinality>1</selection-cardinality>
-    </value-attributes>
   </property>
   </property>
 
 
   <property>
   <property>
@@ -334,15 +294,6 @@ limitations under the License.
     <value>true</value>
     <value>true</value>
     <description>This flag controls the vectorized mode of query execution as documented in HIVE-4160 (as of Hive 0.13.0)
     <description>This flag controls the vectorized mode of query execution as documented in HIVE-4160 (as of Hive 0.13.0)
     </description>
     </description>
-    <display-name>Enable Vectorization and Map Vectorization</display-name>
-    <value-attributes>
-      <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>True</entry_labels>
-      <entry_labels>False</entry_labels>
-      <selection-cardinality>1</selection-cardinality>
-    </value-attributes>
   </property>
   </property>
 
 
   <property>
   <property>
@@ -358,15 +309,6 @@ limitations under the License.
     <description>
     <description>
     Whether to enable automatic use of indexes
     Whether to enable automatic use of indexes
     </description>
     </description>
-    <display-name>Push Filters to Storage</display-name>
-    <value-attributes>
-      <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>True</entry_labels>
-      <entry_labels>False</entry_labels>
-      <selection-cardinality>1</selection-cardinality>
-    </value-attributes>
   </property>
   </property>
 
 
   <property>
   <property>

+ 1 - 0
ambari-server/src/main/resources/properties.json

@@ -236,6 +236,7 @@
         "StackConfigurations/property_depends_on",
         "StackConfigurations/property_depends_on",
         "StackConfigurations/property_depended_by",
         "StackConfigurations/property_depended_by",
         "StackConfigurations/property_description",
         "StackConfigurations/property_description",
+        "StackConfigurations/property_display_name",
         "StackConfigurations/type",
         "StackConfigurations/type",
         "StackConfigurations/final",
         "StackConfigurations/final",
         "StackConfigurations/adding_forbidden",
         "StackConfigurations/adding_forbidden",

+ 10 - 13
ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/configuration/hive-site.xml

@@ -391,15 +391,6 @@ limitations under the License.
       stored in metastore. For basic stats collection turn on the config hive.stats.autogather to true.
       stored in metastore. For basic stats collection turn on the config hive.stats.autogather to true.
       For more advanced stats collection need to run analyze table queries.
       For more advanced stats collection need to run analyze table queries.
     </description>
     </description>
-    <display-name>Compute simple queries using stats only</display-name>
-    <value-attributes>
-      <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>True</entry_labels>
-      <entry_labels>False</entry_labels>
-      <selection-cardinality>1</selection-cardinality>
-    </value-attributes>
   </property>
   </property>
 
 
   <property>
   <property>
@@ -466,10 +457,16 @@ limitations under the License.
     <display-name>Run Compactor</display-name>
     <display-name>Run Compactor</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>True</entry_labels>
-      <entry_labels>False</entry_labels>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>True</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>False</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>

+ 278 - 72
ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml

@@ -26,10 +26,16 @@ limitations under the License.
     <display-name>Enable Cost Based Optimizer</display-name>
     <display-name>Enable Cost Based Optimizer</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>On</entry_labels>
-      <entry_labels>Off</entry_labels>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>On</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>Off</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -245,10 +251,16 @@ limitations under the License.
     <display-name>Allow all partitions to be Dynamic</display-name>
     <display-name>Allow all partitions to be Dynamic</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>True</entry_labels>
-      <entry_labels>False</entry_labels>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>True</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>False</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -481,10 +493,16 @@ limitations under the License.
     <display-name>ORC Compression Algorithm</display-name>
     <display-name>ORC Compression Algorithm</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>ZLIB</entries>
-      <entries>SNAPPY</entries>
-      <entry_labels>zlib Compression Library</entry_labels>
-      <entry_labels>Snappy Compression Library</entry_labels>
+      <entries>
+        <entry>
+          <value>ZLIB</value>
+          <label>zlib Compression Library</label>
+        </entry>
+        <entry>
+          <value>SNAPPY</value>
+          <label>Snappy Compression Library</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -553,6 +571,21 @@ limitations under the License.
     <name>hive.enforce.bucketing</name>
     <name>hive.enforce.bucketing</name>
     <value>true</value>
     <value>true</value>
     <description>Whether bucketing is enforced. If true, while inserting into the table, bucketing is enforced.</description>
     <description>Whether bucketing is enforced. If true, while inserting into the table, bucketing is enforced.</description>
+    <display-name>Enforce bucketing</display-name>
+    <value-attributes>
+      <type>value-list</type>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>True</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>False</label>
+        </entry>
+      </entries>
+      <selection-cardinality>1</selection-cardinality>
+    </value-attributes>
   </property>
   </property>
   <property>
   <property>
     <name>hive.enforce.sorting</name>
     <name>hive.enforce.sorting</name>
@@ -639,10 +672,16 @@ limitations under the License.
     <display-name>Sort Partitions Dynamically</display-name>
     <display-name>Sort Partitions Dynamically</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>True</entry_labels>
-      <entry_labels>False</entry_labels>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>True</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>False</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -674,10 +713,16 @@ limitations under the License.
     <display-name>Fetch partition stats at compiler</display-name>
     <display-name>Fetch partition stats at compiler</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>On</entry_labels>
-      <entry_labels>Off</entry_labels>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>On</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>Off</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -693,10 +738,16 @@ limitations under the License.
     <display-name>Fetch column stats at compiler</display-name>
     <display-name>Fetch column stats at compiler</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>On</entry_labels>
-      <entry_labels>Off</entry_labels>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>On</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>Off</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -720,10 +771,16 @@ limitations under the License.
     <display-name>Transaction Manager</display-name>
     <display-name>Transaction Manager</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>org.apache.hadoop.hive.ql.lockmgr.DummyTxnManager</entries>
-      <entries>org.apache.hadoop.hive.ql.lockmgr.DbTxnManager</entries>
-      <entry_labels>org.apache.hadoop.hive.ql.lockmgr.DummyTxnManager (off)</entry_labels>
-      <entry_labels>org.apache.hadoop.hive.ql.lockmgr.DbTxnManager (on)</entry_labels>
+      <entries>
+        <entry>
+          <value>org.apache.hadoop.hive.ql.lockmgr.DummyTxnManager</value>
+          <label>org.apache.hadoop.hive.ql.lockmgr.DummyTxnManager (off)</label>
+        </entry>
+        <entry>
+          <value>org.apache.hadoop.hive.ql.lockmgr.DbTxnManager</value>
+          <label>org.apache.hadoop.hive.ql.lockmgr.DbTxnManager (on)</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -748,10 +805,16 @@ limitations under the License.
     <display-name>Use Locking</display-name>
     <display-name>Use Locking</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>True</entry_labels>
-      <entry_labels>False</entry_labels>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>True</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>False</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -824,6 +887,21 @@ limitations under the License.
     <name>hive.security.authorization.enabled</name>
     <name>hive.security.authorization.enabled</name>
     <value>false</value>
     <value>false</value>
     <description>enable or disable the Hive client authorization</description>
     <description>enable or disable the Hive client authorization</description>
+    <display-name>Enable Authorization</display-name>
+    <value-attributes>
+      <type>value-list</type>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>True</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>False</label>
+        </entry>
+      </entries>
+      <selection-cardinality>1</selection-cardinality>
+    </value-attributes>
   </property>
   </property>
 
 
   <property>
   <property>
@@ -937,6 +1015,29 @@ limitations under the License.
     <name>hive.server2.authentication</name>
     <name>hive.server2.authentication</name>
     <description>Authentication mode, default NONE. Options are NONE, NOSASL, KERBEROS, LDAP, PAM and CUSTOM</description>
     <description>Authentication mode, default NONE. Options are NONE, NOSASL, KERBEROS, LDAP, PAM and CUSTOM</description>
     <value>NONE</value>
     <value>NONE</value>
+    <display-name>HiveServer2 Authentication</display-name>
+    <value-attributes>
+      <type>value-list</type>
+      <entries>
+        <entry>
+          <value>NONE</value>
+          <label>None</label>
+        </entry>
+        <entry>
+          <value>LDAP</value>
+          <label>Lightweight Directory Access Protocol</label>
+        </entry>
+        <entry>
+          <value>KERBEROS</value>
+          <label>Kerberos</label>
+        </entry>
+        <entry>
+          <value>PAM</value>
+          <label>Pluggable Authentication Modules</label>
+        </entry>
+      </entries>
+      <selection-cardinality>1</selection-cardinality>
+    </value-attributes>
   </property>
   </property>
 
 
   <property>
   <property>
@@ -958,6 +1059,21 @@ limitations under the License.
       Setting this property to true will have HiveServer2 execute
       Setting this property to true will have HiveServer2 execute
       Hive operations as the user making the calls to it.
       Hive operations as the user making the calls to it.
     </description>
     </description>
+    <display-name>Run as end user instead of Hive user</display-name>
+    <value-attributes>
+      <type>value-list</type>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>True</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>False</label>
+        </entry>
+      </entries>
+      <selection-cardinality>1</selection-cardinality>
+    </value-attributes>
   </property>
   </property>
   <property>
   <property>
     <name>hive.server2.table.type.mapping</name>
     <name>hive.server2.table.type.mapping</name>
@@ -978,10 +1094,16 @@ limitations under the License.
     <display-name>Use SSL</display-name>
     <display-name>Use SSL</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>True</entry_labels>
-      <entry_labels>False</entry_labels>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>True</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>False</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -1018,10 +1140,16 @@ limitations under the License.
     <display-name>Hold Containers to Reduce Latency</display-name>
     <display-name>Hold Containers to Reduce Latency</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>True</entry_labels>
-      <entry_labels>False</entry_labels>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>True</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>False</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -1068,10 +1196,16 @@ limitations under the License.
     <display-name>Allow dynamic numbers of reducers</display-name>
     <display-name>Allow dynamic numbers of reducers</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>True</entry_labels>
-      <entry_labels>False</entry_labels>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>True</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>False</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -1095,10 +1229,16 @@ limitations under the License.
     <display-name>Allow dynamic partition pruning</display-name>
     <display-name>Allow dynamic partition pruning</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>True</entry_labels>
-      <entry_labels>False</entry_labels>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>True</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>False</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -1166,6 +1306,21 @@ limitations under the License.
       This flag should be set to true to enable vectorized mode of query execution.
       This flag should be set to true to enable vectorized mode of query execution.
       The default value is false.
       The default value is false.
     </description>
     </description>
+    <display-name>Enable Vectorization and Map Vectorization</display-name>
+    <value-attributes>
+      <type>value-list</type>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>True</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>False</label>
+        </entry>
+      </entries>
+      <selection-cardinality>1</selection-cardinality>
+    </value-attributes>
   </property>
   </property>
 
 
   <property>
   <property>
@@ -1181,6 +1336,21 @@ limitations under the License.
     <name>hive.optimize.index.filter</name>
     <name>hive.optimize.index.filter</name>
     <value>true</value>
     <value>true</value>
     <description>Whether to enable automatic use of indexes</description>
     <description>Whether to enable automatic use of indexes</description>
+    <display-name>Push Filters to Storage</display-name>
+    <value-attributes>
+      <type>value-list</type>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>True</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>False</label>
+        </entry>
+      </entries>
+      <selection-cardinality>1</selection-cardinality>
+    </value-attributes>
   </property>
   </property>
 
 
   <property>
   <property>
@@ -1193,10 +1363,16 @@ limitations under the License.
     <display-name>Exection Engine</display-name>
     <display-name>Exection Engine</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>mr</entries>
-      <entries>tez</entries>
-      <entry_labels>MapReduce</entry_labels>
-      <entry_labels>TEZ</entry_labels>
+      <entries>
+        <entry>
+          <value>mr</value>
+          <label>MapReduce</label>
+        </entry>
+        <entry>
+          <value>tez</value>
+          <label>TEZ</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -1224,10 +1400,16 @@ limitations under the License.
     <display-name>Compute simple queries using stats only</display-name>
     <display-name>Compute simple queries using stats only</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>On</entry_labels>
-      <entry_labels>Off</entry_labels>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>True</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>False</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -1266,10 +1448,16 @@ limitations under the License.
     <display-name>Start Tez session at Initialization</display-name>
     <display-name>Start Tez session at Initialization</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>True</entry_labels>
-      <entry_labels>False</entry_labels>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>True</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>False</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -1286,10 +1474,16 @@ limitations under the License.
     <display-name>ORC Encoding Strategy</display-name>
     <display-name>ORC Encoding Strategy</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>SPEED</entries>
-      <entries>COMPRESSION</entries>
-      <entry_labels>Speed</entry_labels>
-      <entry_labels>Compression</entry_labels>
+      <entries>
+        <entry>
+          <value>SPEED</value>
+          <label>Speed</label>
+        </entry>
+        <entry>
+          <value>COMPRESSION</value>
+          <label>Compression</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -1304,10 +1498,16 @@ limitations under the License.
     <display-name>ORC Compression Strategy</display-name>
     <display-name>ORC Compression Strategy</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>SPEED</entries>
-      <entries>COMPRESSION</entries>
-      <entry_labels>Speed</entry_labels>
-      <entry_labels>Compression</entry_labels>
+      <entries>
+        <entry>
+          <value>SPEED</value>
+          <label>Speed</label>
+        </entry>
+        <entry>
+          <value>COMPRESSION</value>
+          <label>Compression</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>
@@ -1322,10 +1522,16 @@ limitations under the License.
     <display-name>Enable Reduce Vectorization</display-name>
     <display-name>Enable Reduce Vectorization</display-name>
     <value-attributes>
     <value-attributes>
       <type>value-list</type>
       <type>value-list</type>
-      <entries>true</entries>
-      <entries>false</entries>
-      <entry_labels>True</entry_labels>
-      <entry_labels>False</entry_labels>
+      <entries>
+        <entry>
+          <value>true</value>
+          <label>True</label>
+        </entry>
+        <entry>
+          <value>false</value>
+          <label>False</label>
+        </entry>
+      </entries>
       <selection-cardinality>1</selection-cardinality>
       <selection-cardinality>1</selection-cardinality>
     </value-attributes>
     </value-attributes>
   </property>
   </property>

+ 3 - 3
ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java

@@ -813,10 +813,10 @@ public class AmbariMetaInfoTest {
     Assert.assertEquals("int", newEnhancedProperty.getPropertyValueAttributes().getType());
     Assert.assertEquals("int", newEnhancedProperty.getPropertyValueAttributes().getType());
     Assert.assertEquals("512", newEnhancedProperty.getPropertyValueAttributes().getMinimum());
     Assert.assertEquals("512", newEnhancedProperty.getPropertyValueAttributes().getMinimum());
     Assert.assertEquals("15360", newEnhancedProperty.getPropertyValueAttributes().getMaximum());
     Assert.assertEquals("15360", newEnhancedProperty.getPropertyValueAttributes().getMaximum());
-    Assert.assertNull(newEnhancedProperty.getPropertyValueAttributes().getEntries());
+    Assert.assertTrue(newEnhancedProperty.getPropertyValueAttributes().getEntries().isEmpty());
     Assert.assertNull(newEnhancedProperty.getPropertyValueAttributes().getEntriesEditable());
     Assert.assertNull(newEnhancedProperty.getPropertyValueAttributes().getEntriesEditable());
-    Assert.assertNull(newEnhancedProperty.getPropertyValueAttributes().getEntryDescriptions());
-    Assert.assertNull(newEnhancedProperty.getPropertyValueAttributes().getEntryLabels());
+//    Assert.assertNull(newEnhancedProperty.getPropertyValueAttributes().getEntryDescriptions());
+//    Assert.assertNull(newEnhancedProperty.getPropertyValueAttributes().getEntryLabels());
     // Original property
     // Original property
     Assert.assertNotNull(originalProperty);
     Assert.assertNotNull(originalProperty);
     Assert.assertEquals("mapreduce.shuffle", originalProperty.getValue());
     Assert.assertEquals("mapreduce.shuffle", originalProperty.getValue());